summaryrefslogtreecommitdiffstats
path: root/core/deco.c
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2021-02-12 17:52:31 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2021-02-17 07:26:55 -0800
commit03a7e65cf02602e95ac58b217cc9364546361d2f (patch)
treedf76bb46756ce14ee8ecd12289921e956e3b9243 /core/deco.c
parent8103e947aa80da275afe692bc19fa7bb88ccd033 (diff)
downloadsubsurface-03a7e65cf02602e95ac58b217cc9364546361d2f.tar.gz
planner: pass in_planner argument to clear_deco()
To remove reliance on global state, pass an "in_planner" argument to clear_deco(). Thus, calls to in_planner() can be removed. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/deco.c')
-rw-r--r--core/deco.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/deco.c b/core/deco.c
index a997668c2..9e58a914e 100644
--- a/core/deco.c
+++ b/core/deco.c
@@ -503,14 +503,14 @@ void clear_vpmb_state(struct deco_state *ds)
ds->max_bottom_ceiling_pressure.mbar = 0;
}
-void clear_deco(struct deco_state *ds, double surface_pressure)
+void clear_deco(struct deco_state *ds, double surface_pressure, bool in_planner)
{
int ci;
memset(ds, 0, sizeof(*ds));
clear_vpmb_state(ds);
for (ci = 0; ci < 16; ci++) {
- ds->tissue_n2_sat[ci] = (surface_pressure - ((in_planner() && (decoMode() == VPMB)) ? WV_PRESSURE_SCHREINER : WV_PRESSURE)) * N2_IN_AIR / 1000;
+ ds->tissue_n2_sat[ci] = (surface_pressure - ((in_planner && (decoMode() == VPMB)) ? WV_PRESSURE_SCHREINER : WV_PRESSURE)) * N2_IN_AIR / 1000;
ds->tissue_he_sat[ci] = 0.0;
ds->max_n2_crushing_pressure[ci] = 0.0;
ds->max_he_crushing_pressure[ci] = 0.0;