summaryrefslogtreecommitdiffstats
path: root/dive.c
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org>2013-06-04 07:36:38 +0900
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-06-05 10:12:16 +0900
commitc17e15d3152d79febdb369a6887e3420071e57c3 (patch)
tree342095e6a4d909c663d603b8a486d4402119fd85 /dive.c
parent3fa6d981b072f2a14aaf7dc96caa9da2a41bca1c (diff)
downloadsubsurface-c17e15d3152d79febdb369a6887e3420071e57c3.tar.gz
Merge dive tags when merging dives
.. otherwise the dive tags generally end up cleared when you download a duplicate dive from another dive computer. This uses MERGE_NONZERO, which means that if one of the dives has tags set, we'll prefer those tags. If both dives have tags set, we take the tags from the first ("preferred") dive. We could do a "just or all the bits together" too. But this way we at least take a set of tags that are consistent (ie we don't get both "boat" and "shore" set unless one of the original dives already had that inconsistency) Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'dive.c')
-rw-r--r--dive.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/dive.c b/dive.c
index b005e9d34..5194ff18f 100644
--- a/dive.c
+++ b/dive.c
@@ -1801,6 +1801,7 @@ struct dive *merge_dives(struct dive *a, struct dive *b, int offset, gboolean pr
MERGE_MAX(res, a, b, number);
MERGE_NONZERO(res, a, b, cns);
MERGE_NONZERO(res, a, b, visibility);
+ MERGE_NONZERO(res, a, b, dive_tags);
merge_equipment(res, a, b);
merge_airtemps(res, a, b);
if (dl) {