diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-11-11 07:20:05 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2012-11-11 10:48:09 +0100 |
commit | cda1b73bf68d1802c32416bce3be0ef84137002e (patch) | |
tree | 8e3e35aa04876e0971a0f80b7ee18e4e6bb746d7 /main.c | |
parent | 7c09991876ef8b34bda6f5615a37f99e1b476b18 (diff) | |
download | subsurface-cda1b73bf68d1802c32416bce3be0ef84137002e.tar.gz |
Prepare to merge non-overlapping dives
This just re-organizes the dive merging code so that we expose a new
"merge_dives(a, b, offset)" function that merges two dives together into
one with the samples (and events) of 'b' at the specified offset after
'a'.
We'll want to use this if a dive computer has decided that the dive
ended (due to a pause at the surface), but we really want to just turn
the two computer dives into one long one with an extended surface swim.
No functional changes, but some independent cleanups due to the trip
simplifications.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 6 |
1 files changed, 1 insertions, 5 deletions
@@ -126,16 +126,12 @@ void report_dives(gboolean is_imported) struct dive **pp = &dive_table.dives[i-1]; struct dive *prev = pp[0]; struct dive *dive = pp[1]; - struct dive *next; struct dive *merged; if (prev->when + prev->duration.seconds < dive->when) continue; - next = NULL; - if (i < dive_table.nr-1) - next = pp[2]; - merged = try_to_merge(prev, dive, next); + merged = try_to_merge(prev, dive); if (!merged) continue; |