summaryrefslogtreecommitdiffstats
path: root/planner.c
diff options
context:
space:
mode:
authorGravatar Rick Walsh <rickmwalsh@gmail.com>2015-06-23 23:20:30 +1000
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-06-26 06:10:34 -0700
commitcb1b6a3d302070febf09d8963585ac445d3277f4 (patch)
tree6ebce41162d523462e7d8c9256578297bdc9656a /planner.c
parentea1f75d8d671d919642b13909045d2648dab51c3 (diff)
downloadsubsurface-cb1b6a3d302070febf09d8963585ac445d3277f4.tar.gz
Define gaschange_before and gaschange_after a few lines earlier
This is required so they work in the test for /* do we want to skip this leg as it is devoid of anything useful? */ We were already trying to use gaschange_after (and previously gaschange), but it was duplicating an existing condition (now removed). Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'planner.c')
-rw-r--r--planner.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/planner.c b/planner.c
index fc4275b4b..7ed2cf71c 100644
--- a/planner.c
+++ b/planner.c
@@ -581,21 +581,20 @@ static void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive, bool
nextdp = nextdp->next;
if (nextdp)
newgasmix = nextdp->gasmix;
+ gaschange_after = (nextdp && (gasmix_distance(&gasmix, &newgasmix) || dp->setpoint != nextdp->setpoint));
+ gaschange_before = (gasmix_distance(&lastprintgasmix, &gasmix) || lastprintsetpoint != dp->setpoint);
/* do we want to skip this leg as it is devoid of anything useful? */
if (!dp->entered &&
- gasmix_distance(&gasmix, &newgasmix) == 0 &&
nextdp &&
- dp->setpoint == nextdp->setpoint &&
dp->depth != lastdepth &&
- nextdp->depth != dp->depth
- && !gaschange_after)
+ nextdp->depth != dp->depth &&
+ !gaschange_before &&
+ !gaschange_after)
continue;
if (dp->time - lasttime < 10 && !(gaschange_after && dp->next && dp->depth != dp->next->depth))
continue;
len = strlen(buffer);
- gaschange_after = (nextdp && (gasmix_distance(&gasmix, &newgasmix) || dp->setpoint != nextdp->setpoint));
- gaschange_before = (gasmix_distance(&lastprintgasmix, &gasmix) || lastprintsetpoint != dp->setpoint);
if (plan_verbatim) {
if (dp->depth != lastprintdepth) {
if (plan_display_transitions || dp->entered || !dp->next || (gaschange_after && dp->next && dp->depth != nextdp->depth)) {