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:
Willem Ferguson 2018-04-05 14:13:34 +02:00 committed by Lubomir I. Ivanov
parent c1d04ef7dc
commit 0e08c0870a
5 changed files with 17 additions and 46 deletions

View file

@ -542,7 +542,7 @@ void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive, bool show_d
struct event *nextev, *evd = dive->dc.events;
current_divemode = dive->dc.divemode;
nextev = get_next_divemodechange(&evd);
nextev = get_next_divemodechange(&evd, TRUE);
if (dive->dc.divemode != CCR) {
while (dp) {
@ -552,7 +552,7 @@ void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive, bool show_d
if (nextev && (dp->time >= nextev->time.seconds)) { // If there are divemode changes and divedatapoint 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 = depth_to_atm(dp->depth.mm, dive);