summaryrefslogtreecommitdiffstats
path: root/dive.h
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-06-01 16:27:19 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-06-01 16:27:19 -0700
commitbd142bbee21aa7fdfe6fbea4e3870b84a767586f (patch)
treeb05c8ec974e30df5b26774c04a92e5c8878c7d14 /dive.h
parentfece3f321fb7040da5d34186598db006da7ef7d2 (diff)
downloadsubsurface-bd142bbee21aa7fdfe6fbea4e3870b84a767586f.tar.gz
Switch verify_gas_exists to take gasmix argument
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'dive.h')
-rw-r--r--dive.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/dive.h b/dive.h
index da4cb07e0..2594f548a 100644
--- a/dive.h
+++ b/dive.h
@@ -118,6 +118,14 @@ static inline bool gasmix_is_air(const struct gasmix *gasmix)
return is_air(gasmix->o2.permille, gasmix->he.permille);
}
+/* in the planner we use a null gasmix to indicate that we keep using the gas as before
+ * this is BAD as a null gasmix can also be interpreted as air.
+ * DANGER DANGER DANGER */
+static inline bool gasmix_is_null(const struct gasmix *gasmix)
+{
+ return gasmix->he.permille == 0 && gasmix->o2.permille == 0;
+}
+
/* Linear interpolation between 'a' and 'b', when we are 'part'way into the 'whole' distance from a to b */
static inline int interpolate(int a, int b, int part, int whole)
{