From fc55620d2d2942f7f8d95b5e73f8b58ec17ffdb9 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Sun, 19 Feb 2017 12:56:54 -0800 Subject: [PATCH] dive merging: merge water temperature too, not just air temperature I have no idea why we only merged air temperatures. But it was very explicit (even the function doing the merging was named "merge_airtemp()"), and water temperatures were left alone. Signed-off-by: Linus Torvalds --- core/dive.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/dive.c b/core/dive.c index 2c699fb9a..72abee41e 100644 --- a/core/dive.c +++ b/core/dive.c @@ -2195,11 +2195,12 @@ static void merge_equipment(struct dive *res, struct dive *a, struct dive *b) merge_weightsystem_info(res->weightsystem + i, a->weightsystem + i, b->weightsystem + i); } -static void merge_airtemps(struct dive *res, struct dive *a, struct dive *b) +static void merge_temperatures(struct dive *res, struct dive *a, struct dive *b) { un_fixup_airtemp(a); un_fixup_airtemp(b); MERGE_NONZERO(res, a, b, airtemp.mkelvin); + MERGE_NONZERO(res, a, b, watertemp.mkelvin); } /* @@ -3158,7 +3159,7 @@ struct dive *merge_dives(struct dive *a, struct dive *b, int offset, bool prefer MERGE_NONZERO(res, a, b, picture_list); taglist_merge(&res->tag_list, a->tag_list, b->tag_list); merge_equipment(res, a, b); - merge_airtemps(res, a, b); + merge_temperatures(res, a, b); if (dl) { /* If we prefer downloaded, do those first, and get rid of "might be same" computers */ join_dive_computers(&res->dc, &dl->dc, &a->dc, 1);