summaryrefslogtreecommitdiffstats
path: root/deco.c
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org>2013-03-28 10:06:43 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-03-28 13:47:31 -0700
commit1b05d28944ef72a62e788efdac2dcdc2dc4771ef (patch)
treed5370ac643f1087d9d794a43485658dc2f848574 /deco.c
parent99070c49e2ed1834c7371ce7500d78895e85e67c (diff)
downloadsubsurface-1b05d28944ef72a62e788efdac2dcdc2dc4771ef.tar.gz
Use the new get_o2()/get_he() helper functions more widely
They do the "02=0 means air" thing autmatically, and make for less typing. So use them more widely in places that looked up the o2 and he permille values of a gasmix. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'deco.c')
-rw-r--r--deco.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/deco.c b/deco.c
index 87899b5ee..ab3b42893 100644
--- a/deco.c
+++ b/deco.c
@@ -130,9 +130,9 @@ static double tissue_tolerance_calc(const struct dive *dive)
double add_segment(double pressure, const struct gasmix *gasmix, int period_in_seconds, int ccpo2, const struct dive *dive)
{
int ci;
- int fo2 = gasmix->o2.permille ? gasmix->o2.permille : O2_IN_AIR;
- double ppn2 = (pressure - WV_PRESSURE) * (1000 - fo2 - gasmix->he.permille) / 1000.0;
- double pphe = (pressure - WV_PRESSURE) * gasmix->he.permille / 1000.0;
+ int fo2 = get_o2(gasmix), fhe = get_he(gasmix);
+ double ppn2 = (pressure - WV_PRESSURE) * (1000 - fo2 - fhe) / 1000.0;
+ double pphe = (pressure - WV_PRESSURE) * fhe / 1000.0;
#if GF_LOW_AT_MAXDEPTH
if (pressure > gf_low_pressure_this_dive)