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>
This commit is contained in:
Linus Torvalds 2013-03-28 10:06:43 -07:00 committed by Dirk Hohndel
parent 99070c49e2
commit 1b05d28944
4 changed files with 12 additions and 13 deletions

6
deco.c
View file

@ -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)