diff options
author | Henrik Brautaset Aronsen <subsurface@henrik.synth.no> | 2011-12-31 17:15:59 +0100 |
---|---|---|
committer | Henrik Brautaset Aronsen <subsurface@henrik.synth.no> | 2011-12-31 17:15:59 +0100 |
commit | 16b6df559f7b5aabbcbec7d7d08f3687b30384dc (patch) | |
tree | 13f662c31843f3b8de4185c9037bf286cc9a2c3b /divelist.c | |
parent | 2175226580a523a9a3abba3723991b003eee5a2a (diff) | |
download | subsurface-16b6df559f7b5aabbcbec7d7d08f3687b30384dc.tar.gz |
Define O2 permille for air in one spot
Having the O2 permille defined once is more readable.
Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Diffstat (limited to 'divelist.c')
-rw-r--r-- | divelist.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/divelist.c b/divelist.c index 32dc92b99..4ab61997c 100644 --- a/divelist.c +++ b/divelist.c @@ -244,7 +244,7 @@ static void get_dive_gas(struct dive *dive, int *o2, int *he, int *o2low) if (cylinder_none(cyl)) continue; if (!o2) - o2 = 209; + o2 = AIR_PERMILLE; if (o2 < mino2) mino2 = o2; if (he > maxhe) @@ -258,7 +258,7 @@ newmax: maxo2 = o2; } /* All air? Show/sort as "air"/zero */ - if (!maxhe && maxo2 == 209 && mino2 == maxo2) + if (!maxhe && maxo2 == AIR_PERMILLE && mino2 == maxo2) maxo2 = mino2 = 0; *o2 = maxo2; *he = maxhe; @@ -394,7 +394,7 @@ static int calculate_otu(struct dive *dive) t = sample->time.seconds - psample->time.seconds; int o2 = dive->cylinder[sample->cylinderindex].gasmix.o2.permille; if (!o2) - o2 = 209; + o2 = AIR_PERMILLE; po2 = o2 / 1000.0 * (sample->depth.mm + 10000) / 10000.0; if (po2 >= 0.5) otu += pow(po2 - 0.5, 0.83) * t / 30.0; |