summaryrefslogtreecommitdiffstats
path: root/dive.c
diff options
context:
space:
mode:
authorGravatar Jan Schubert <Jan.Schubert@GMX.li>2013-01-14 23:53:38 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-01-14 20:12:40 -0800
commit90d3c5614a9c952a50e582e2dff6e21419c64729 (patch)
tree5298138cc67579e4e58f33e493c53a8dae05ad37 /dive.c
parent2e53a415257677fe6e5da7fcce373722269a9082 (diff)
downloadsubsurface-90d3c5614a9c952a50e582e2dff6e21419c64729.tar.gz
Centralising and redefining values as integers
This patch centralizes the definition for surface pressure, oxygen in air, (re)defines all such values as plain integers and adapts calculations. It eliminates 11 (!) occurrences of definitions for surface pressure and also a few for oxygen in air. It also rewrites the calculation for EAD, END and EADD using the new definitons, harmonizing it for OC and CC and fixes a bug for EADD OC calculation. And finally it removes the unneeded variable entry_ead in gtk-gui.c. Jan Signed-off-by: Jan Schubert <Jan.Schubert@GMX.li> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'dive.c')
-rw-r--r--dive.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/dive.c b/dive.c
index 4fc6f7551..b61166569 100644
--- a/dive.c
+++ b/dive.c
@@ -269,8 +269,8 @@ static void sanitize_gasmix(struct gasmix *mix)
if (!he) {
if (!o2)
return;
- /* 20.9% or 21% O2 is just air */
- if (o2 >= 209 && o2 <= 210) {
+ /* 20.8% to 21% O2 is just air */
+ if (o2 >= (O2_IN_AIR - 1) && o2 <= (O2_IN_AIR + 1)) {
mix->o2.permille = 0;
return;
}