X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=dive.c;h=d934d14384f8010a8a9ee22801d06e4f86798a82;hb=d37d7211ca7ab810987e7eae785ec25484c1e34c;hp=a1ef28c8e3d0deb9bceb686215ce5dfbaf0a53a2;hpb=a6f6e8d6ff06d03fc01d8a6e7f50240e405b7ea6;p=ext%2Fsubsurface.git diff --git a/dive.c b/dive.c index a1ef28c..d934d14 100644 --- a/dive.c +++ b/dive.c @@ -222,6 +222,7 @@ struct dive *fixup_dive(struct dive *dive) #define MERGE_MAX(res, a, b, n) res->n = MAX(a->n, b->n) #define MERGE_MIN(res, a, b, n) res->n = (a->n)?(b->n)?MIN(a->n, b->n):(a->n):(b->n) #define MERGE_TXT(res, a, b, n) res->n = merge_text(a->n, b->n) +#define MERGE_NONZERO(res, a, b, n) res->n = a->n ? a->n : b->n static struct dive *add_sample(struct sample *sample, int time, struct dive *dive) { @@ -411,6 +412,8 @@ struct dive *try_to_merge(struct dive *a, struct dive *b) res = alloc_dive(); res->when = a->when; + MERGE_NONZERO(res, a, b, latitude); + MERGE_NONZERO(res, a, b, longitude); MERGE_TXT(res, a, b, location); MERGE_TXT(res, a, b, notes); MERGE_TXT(res, a, b, buddy);