summaryrefslogtreecommitdiffstats
path: root/parse-xml.c
diff options
context:
space:
mode:
authorGravatar Anton Lundin <glance@acc.umu.se>2013-11-20 20:26:30 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-11-20 11:31:23 -0800
commita31499de88fc341bf2818bb4c6440ce707d99647 (patch)
tree3f72ec885e5d7705ffbe632868625aa3b0b75bd0 /parse-xml.c
parentef06afde143cc6bb9a099b388c8d4855462aa761 (diff)
downloadsubsurface-a31499de88fc341bf2818bb4c6440ce707d99647.tar.gz
Use the get_o2/get_he helpers
We have helpers that take care of O2_IN_AIR and so on. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'parse-xml.c')
-rw-r--r--parse-xml.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/parse-xml.c b/parse-xml.c
index f582a302a..a7a44c5d0 100644
--- a/parse-xml.c
+++ b/parse-xml.c
@@ -889,12 +889,10 @@ static void try_to_fill_dc(struct divecomputer *dc, const char *name, char *buf)
void add_gas_switch_event(struct dive *dive, struct divecomputer *dc, int seconds, int idx)
{
/* The gas switch event format is insane. It will be fixed, I think */
- int o2 = dive->cylinder[idx].gasmix.o2.permille;
- int he = dive->cylinder[idx].gasmix.he.permille;
+ int o2 = get_o2(&dive->cylinder[idx].gasmix);
+ int he = get_he(&dive->cylinder[idx].gasmix);
int value;
- if (!o2)
- o2 = O2_IN_AIR;
o2 = (o2+5) / 10;
he = (he+5) / 10;
value = o2 + (he << 16);