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>
This commit is contained in:
Linus Torvalds 2012-11-11 07:20:05 +01:00 committed by Dirk Hohndel
parent 7c09991876
commit cda1b73bf6
3 changed files with 15 additions and 19 deletions

3
dive.h
View file

@ -413,7 +413,8 @@ extern void finish_sample(struct dive *dive);
extern void report_dives(gboolean imported);
extern struct dive *fixup_dive(struct dive *dive);
extern struct dive *try_to_merge(struct dive *a, struct dive *b, struct dive *next);
extern struct dive *merge_dives(struct dive *a, struct dive *b, int offset);
extern struct dive *try_to_merge(struct dive *a, struct dive *b);
extern void renumber_dives(int nr);