/* Don't pick a zero for MERGE_MIN() */
#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)
static struct dive *add_sample(struct sample *sample, int time, struct dive *dive)
{
res = alloc_dive();
res->when = a->when;
- res->location = merge_text(a->location, b->location);
- res->notes = merge_text(a->notes, b->notes);
+ MERGE_TXT(res, a, b, location);
+ MERGE_TXT(res, a, b, notes);
+ MERGE_TXT(res, a, b, buddy);
+ MERGE_TXT(res, a, b, divemaster);
MERGE_MAX(res, a, b, number);
MERGE_MAX(res, a, b, maxdepth.mm);
res->meandepth.mm = 0;