diff options
author | Willem Ferguson <willemferguson@zoology.up.ac.za> | 2018-04-05 14:13:34 +0200 |
---|---|---|
committer | Lubomir I. Ivanov <neolit123@gmail.com> | 2018-05-14 23:47:00 +0300 |
commit | 0e08c0870a1c82ded398e1d2fb830d61ffe6a647 (patch) | |
tree | dd61315c48a16c4f598a4e32dc3ac829a1ce8487 /core/profile.c | |
parent | c1d04ef7dcbbe34eccf4515a59063ed807e8d5e5 (diff) | |
download | subsurface-0e08c0870a1c82ded398e1d2fb830d61ffe6a647.tar.gz |
Simplify the bailout detection functions.
Function peek_next_divemodechange() is redundant if get_next_divemodechange()
has one additional parameter. Calls to get_next_divemodechange() were
updated in divelist.c, plannernotes.c and profile.c.
Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za>
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 b8dd17728..789727635 100644 --- a/core/profile.c +++ b/core/profile.c @@ -1018,7 +1018,7 @@ void calculate_deco_information(struct deco_state *ds, struct deco_state *planne if (decoMode() == VPMB) ds->first_ceiling_pressure.mbar = depth_to_mbar(first_ceiling, dive); struct gasmix *gasmix = NULL; - struct event *ev = NULL, *ev_dmc = dc->events, *ev_dmt = get_next_divemodechange(&ev_dmc); + struct event *ev = NULL, *ev_dmc = dc->events, *ev_dmt = get_next_divemodechange(&ev_dmc, TRUE); for (i = 1; i < pi->nr; i++) { struct plot_data *entry = pi->entry + i; @@ -1211,7 +1211,7 @@ static void calculate_gas_information_new(struct dive *dive, struct divecomputer struct event *nextev, *evg = NULL, *evd = dc->events; current_divemode = dc->divemode; - nextev = get_next_divemodechange(&evd); + nextev = get_next_divemodechange(&evd, TRUE); for (i = 1; i < pi->nr; i++) { int fn2, fhe; @@ -1220,7 +1220,7 @@ static void calculate_gas_information_new(struct dive *dive, struct divecomputer gasmix = get_gasmix(dive, dc, entry->sec, &evg, gasmix); if (nextev && (entry->sec > nextev->time.seconds)) { // If there are divemode changes and sample time current_divemode = nextev->divemode; // has reached that of the current divemode event, then set the - nextev = get_next_divemodechange(&evd); // current divemode and find the next divemode event + nextev = get_next_divemodechange(&evd, TRUE); // current divemode and find the next divemode event } amb_pressure = depth_to_bar(entry->depth, dive); fill_pressures(&entry->pressures, amb_pressure, gasmix, (current_divemode == OC) ? 0.0 : entry->o2pressure.mbar / 1000.0, current_divemode); |