VPM-B: move bottom_time into deco_state

Removing ext variable from profile.c should facilitate future performance
gains

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
This commit is contained in:
Rick Walsh 2017-11-02 17:59:20 +11:00 committed by Robert C. Helling
parent 8d0361ff77
commit a06848c237
3 changed files with 20 additions and 21 deletions

View file

@ -31,7 +31,6 @@ static struct plot_data *last_pi_entry_new = NULL;
void populate_pressure_information(struct dive *, struct divecomputer *, struct plot_info *, int);
extern bool in_planner();
extern int bottom_time;
#ifdef DEBUG_PI
/* debugging tool - not normally used */
@ -960,7 +959,7 @@ void calculate_deco_information(struct dive *dive, struct divecomputer *dc, stru
bool first_iteration = true;
int prev_deco_time = 10000000, time_deep_ceiling = 0;
if (in_planner())
deco_time = pi->maxtime - bottom_time;
deco_time = pi->maxtime - deco_state->bottom_time;
else
deco_time = 0;
struct deco_state *cache_data_initial = NULL;