From: Dirk Hohndel Date: Thu, 5 Jan 2012 06:01:02 +0000 (-0800) Subject: Oddly, finishing a sample doesn't require a sample X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=1d6903c65a4980ac51a3508db6a388ab07111341;p=ext%2Fsubsurface.git Oddly, finishing a sample doesn't require a sample So let's not pass it around Signed-off-by: Dirk Hohndel --- diff --git a/dive.c b/dive.c index 3774ba8..9f57aed 100644 --- a/dive.c +++ b/dive.c @@ -160,7 +160,7 @@ struct sample *prepare_sample(struct dive **divep) return NULL; } -void finish_sample(struct dive *dive, struct sample *sample) +void finish_sample(struct dive *dive) { dive->samples++; } @@ -490,7 +490,7 @@ static struct dive *add_sample(struct sample *sample, int time, struct dive *div return NULL; *p = *sample; p->time.seconds = time; - finish_sample(dive, p); + finish_sample(dive); return dive; } diff --git a/dive.h b/dive.h index bdf3aa6..52158ad 100644 --- a/dive.h +++ b/dive.h @@ -281,7 +281,7 @@ extern struct dive *alloc_dive(void); extern void record_dive(struct dive *dive); extern struct sample *prepare_sample(struct dive **divep); -extern void finish_sample(struct dive *dive, struct sample *sample); +extern void finish_sample(struct dive *dive); extern void report_dives(gboolean imported); extern struct dive *fixup_dive(struct dive *dive); diff --git a/libdivecomputer.c b/libdivecomputer.c index daf7241..4ff4148 100644 --- a/libdivecomputer.c +++ b/libdivecomputer.c @@ -175,7 +175,7 @@ sample_cb(parser_sample_type_t type, parser_sample_value_t value, void *userdata case SAMPLE_TYPE_TIME: sample = prepare_sample(divep); sample->time.seconds = value.time; - finish_sample(*divep, sample); + finish_sample(*divep); break; case SAMPLE_TYPE_DEPTH: sample->depth.mm = value.depth * 1000 + 0.5; diff --git a/parse-xml.c b/parse-xml.c index 6840610..6af4a93 100644 --- a/parse-xml.c +++ b/parse-xml.c @@ -1104,7 +1104,7 @@ static void sample_end(void) if (!dive) return; - finish_sample(dive, sample); + finish_sample(dive); sample = NULL; } diff --git a/uemis.c b/uemis.c index 28302b1..06ef5b4 100644 --- a/uemis.c +++ b/uemis.c @@ -231,7 +231,7 @@ void uemis_parse_divelog_binary(char *base64, void *datap) { sample->cylinderindex = u_sample->active_tank; sample->cylinderpressure.mbar= u_sample->tank_pressure * 10; uemis_event(dive, sample, u_sample); - finish_sample(dive, sample); + finish_sample(dive); i += 0x25; u_sample++; }