From 2e2cb178d78bd584666528f7acc63608461a1504 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Tue, 4 Jun 2013 07:36:38 +0900 Subject: 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 Signed-off-by: Dirk Hohndel --- dive.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dive.c b/dive.c index 34025d68c..0625aa384 100644 --- a/dive.c +++ b/dive.c @@ -1796,6 +1796,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) { -- cgit v1.2.3-70-g09d2