diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2021-02-12 17:47:52 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2021-02-17 07:26:55 -0800 |
commit | 8103e947aa80da275afe692bc19fa7bb88ccd033 (patch) | |
tree | 598ddd2116455308c9133561b5e8b2b01fba536d /core/profile.c | |
parent | 93ecad1b0413645ba59ffe2e50c3636d8673ccb5 (diff) | |
download | subsurface-8103e947aa80da275afe692bc19fa7bb88ccd033.tar.gz |
planner: pass in_planner argument to vpmb_next_gradient()
To remove reliance on global state, pass an "in_planner" argument
to vpmb_next_gradient(). Thus, calls to in_planner() can be removed.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/profile.c')
-rw-r--r-- | core/profile.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/core/profile.c b/core/profile.c index 19c38a4c1..6a7ee707f 100644 --- a/core/profile.c +++ b/core/profile.c @@ -1055,7 +1055,7 @@ static void calculate_deco_information(struct deco_state *ds, const struct deco_ vpmb_start_gradient(ds); /* For CVA iterations, calculate next gradient */ if (!first_iteration || !planner_ds) - vpmb_next_gradient(ds, ds->deco_time, surface_pressure / 1000.0); + vpmb_next_gradient(ds, ds->deco_time, surface_pressure / 1000.0, in_planner); } entry->ceiling = deco_allowed_depth(tissue_tolerance_calc(ds, dive, depth_to_bar(entry->depth, dive)), surface_pressure, dive, !prefs.calcceiling3m); if (prefs.calcceiling3m) @@ -1078,7 +1078,7 @@ static void calculate_deco_information(struct deco_state *ds, const struct deco_ converges correctly, so add 30min*/ if (!planner_ds) ds->deco_time = pi->maxtime - t1 + 1800; - vpmb_next_gradient(ds, ds->deco_time, surface_pressure / 1000.0); + vpmb_next_gradient(ds, ds->deco_time, surface_pressure / 1000.0, in_planner); } } // Use the point where the ceiling clears as the end of deco phase for CVA calculations @@ -1161,7 +1161,7 @@ static void calculate_deco_information(struct deco_state *ds, const struct deco_ * comes typically 10-60s after the end of the bottom time, so add 20s to the calculated * deco time. */ ds->deco_time = ROUND_UP(time_clear_ceiling - time_deep_ceiling + 20, 60) + 20; - vpmb_next_gradient(ds, ds->deco_time, surface_pressure / 1000.0); + vpmb_next_gradient(ds, ds->deco_time, surface_pressure / 1000.0, in_planner); final_tts = 0; last_ndl_tts_calc_time = 0; first_ceiling = 0; |