diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2021-02-12 17:39:46 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2021-02-17 07:26:55 -0800 |
commit | 93ecad1b0413645ba59ffe2e50c3636d8673ccb5 (patch) | |
tree | c6b7d2aef7fd8aafa2a0570ca1ffa3168d85f736 /core/deco.c | |
parent | 9fb37ea27f757c76324f9a101a54133cedd71922 (diff) | |
download | subsurface-93ecad1b0413645ba59ffe2e50c3636d8673ccb5.tar.gz |
planner: pass in_planner argument to add_segment()
To remove reliance on global state, pass an "in_planner" argument
to add_segment(). 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.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/deco.c b/core/deco.c index 650376c60..5ca8e1a75 100644 --- a/core/deco.c +++ b/core/deco.c @@ -444,13 +444,13 @@ void calc_crushing_pressure(struct deco_state *ds, double pressure) } /* add period_in_seconds at the given pressure and gas to the deco calculation */ -void add_segment(struct deco_state *ds, double pressure, struct gasmix gasmix, int period_in_seconds, int ccpo2, enum divemode_t divemode, int sac) +void add_segment(struct deco_state *ds, double pressure, struct gasmix gasmix, int period_in_seconds, int ccpo2, enum divemode_t divemode, int sac, bool in_planner) { UNUSED(sac); int ci; struct gas_pressures pressures; bool icd = false; - fill_pressures(&pressures, pressure - ((in_planner() && (decoMode() == VPMB)) ? WV_PRESSURE_SCHREINER : WV_PRESSURE), + fill_pressures(&pressures, pressure - ((in_planner && (decoMode() == VPMB)) ? WV_PRESSURE_SCHREINER : WV_PRESSURE), gasmix, (double) ccpo2 / 1000.0, divemode); for (ci = 0; ci < 16; ci++) { |