mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Encapsulate the horrid gas encoding in gas change events
We should never pass permille values around as integers. And we shouldn't have to decode the stupid value in more than one place. This doesn't tackle all the places where we access O2 and He "too early" and should instead keep passing around a gaxmix. But it's a first step. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
fb4d9b34f8
commit
1a04013453
6 changed files with 38 additions and 23 deletions
|
|
@ -160,7 +160,7 @@ static int active_o2(struct dive *dive, struct divecomputer *dc, duration_t time
|
|||
break;
|
||||
if (strcmp(event->name, "gaschange"))
|
||||
continue;
|
||||
o2permille = 10 * (event->value & 0xffff);
|
||||
o2permille = get_o2(get_gasmix_from_event(event));
|
||||
}
|
||||
return o2permille;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue