mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
c1d04ef7dc
commit
0e08c0870a
5 changed files with 17 additions and 46 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue