summaryrefslogtreecommitdiffstats
path: root/divelist.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-06-01 12:07:29 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-06-01 12:07:29 -0700
commit1a040134538b7733f3088ea34f101cfedecc2c64 (patch)
tree53eb0fc9dd65f3e75fb886075cc5b952b3800157 /divelist.c
parentfb4d9b34f87f71b072bccb36633d7247b9d9dd9d (diff)
downloadsubsurface-1a040134538b7733f3088ea34f101cfedecc2c64.tar.gz
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>
Diffstat (limited to 'divelist.c')
-rw-r--r--divelist.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/divelist.c b/divelist.c
index ca2e9827f..421ea28c2 100644
--- a/divelist.c
+++ b/divelist.c
@@ -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;
}