Start merging dives by keeping the dive computer data from both dives

Also, note that we do *not* do the "find_sample_offset()" any more when
we merge two dives that happen at the same time - since we just keep
both sets of dive computer data around.

But we keep the function to find the best offset around, because we may
well want to use it later when *showing* the dive, and trying to match
up the different sample data from the multiple dive computers associated
with the dive.

Because of that, this causes warnings about the now unused function.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Linus Torvalds 2012-11-24 18:29:14 -10:00 committed by Dirk Hohndel
parent 5a4640cf44
commit 1b861ba20e
2 changed files with 129 additions and 24 deletions

View file

@ -349,23 +349,19 @@ static void save_trip(FILE *f, dive_trip_t *trip)
static void save_dc(FILE *f, struct dive *dive, struct divecomputer *dc)
{
int i;
const char *post = "";
if (dc->when || dc->vendor || dc->product) {
fprintf(f, "<divecomputer");
if (dc->vendor)
show_utf8(f, dc->vendor, " vendor='", "'", 1);
if (dc->product)
show_utf8(f, dc->product, " product='", "'", 1);
if (dc->when && dc->when != dive->when)
show_date(f, dc->when);
fprintf(f, ">\n");
post = "</divecomputer>\n";
}
fprintf(f, " <divecomputer");
if (dc->vendor)
show_utf8(f, dc->vendor, " vendor='", "'", 1);
if (dc->product)
show_utf8(f, dc->product, " product='", "'", 1);
if (dc->when && dc->when != dive->when)
show_date(f, dc->when);
fprintf(f, ">\n");
save_events(f, dc->events);
for (i = 0; i < dc->samples; i++)
save_sample(f, dc->sample+i);
fprintf(f, post);
fprintf(f, " </divecomputer>\n");
}
static void save_dive(FILE *f, struct dive *dive)