aboutsummaryrefslogtreecommitdiffstats
path: root/core/profile.c
diff options
context:
space:
mode:
authorGravatar Robert C. Helling <helling@atdotde.de>2017-05-26 00:45:53 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-05-26 15:44:36 -0700
commit7b18be2a50e3c94fa1e9ae30c92bbb3eee3593d6 (patch)
treeaf16a82b1302591c3448812280f261b1cc5296e4 /core/profile.c
parent57ee5a5477c92ff4dd7b8975b1866c988556d14e (diff)
downloadsubsurface-7b18be2a50e3c94fa1e9ae30c92bbb3eee3593d6.tar.gz
Adopt planner state caching to new struct
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Diffstat (limited to 'core/profile.c')
-rw-r--r--core/profile.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/profile.c b/core/profile.c
index efe97d4f3..86bc974b8 100644
--- a/core/profile.c
+++ b/core/profile.c
@@ -950,7 +950,7 @@ void calculate_deco_information(struct dive *dive, struct divecomputer *dc, stru
double surface_pressure = (dc->surface_pressure.mbar ? dc->surface_pressure.mbar : get_surface_pressure_in_mbar(dive, true)) / 1000.0;
bool first_iteration = true;
int deco_time = 0, prev_deco_time = 10000000;
- char *cache_data_initial = NULL;
+ struct deco_state *cache_data_initial = NULL;
/* For VPM-B outside the planner, cache the initial deco state for CVA iterations */
if (decoMode() == VPMB && !in_planner())
cache_deco_state(&cache_data_initial);
@@ -1043,13 +1043,13 @@ void calculate_deco_information(struct dive *dive, struct divecomputer *dc, stru
last_ndl_tts_calc_time = entry->sec;
/* We are going to mess up deco state, so store it for later restore */
- char *cache_data = NULL;
+ struct deco_state *cache_data = NULL;
cache_deco_state(&cache_data);
calculate_ndl_tts(entry, dive, surface_pressure);
if (decoMode() == VPMB && !in_planner() && i == pi->nr - 1)
final_tts = entry->tts_calc;
/* Restore "real" deco state for next real time step */
- restore_deco_state(cache_data);
+ restore_deco_state(cache_data, false);
free(cache_data);
}
}
@@ -1066,7 +1066,7 @@ void calculate_deco_information(struct dive *dive, struct divecomputer *dc, stru
first_ceiling = 0;
first_iteration = false;
count_iteration ++;
- restore_deco_state(cache_data_initial);
+ restore_deco_state(cache_data_initial, false);
} else {
// With Buhlmann, or not in planner, iterating isn't needed. This makes the while condition false.
prev_deco_time = deco_time = 0;