]> git.tdb.fi Git - ext/subsurface.git/commitdiff
Oddly, finishing a sample doesn't require a sample
authorDirk Hohndel <dirk@hohndel.org>
Thu, 5 Jan 2012 06:01:02 +0000 (22:01 -0800)
committerDirk Hohndel <dirk@hohndel.org>
Thu, 5 Jan 2012 16:16:50 +0000 (08:16 -0800)
So let's not pass it around

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
dive.c
dive.h
libdivecomputer.c
parse-xml.c
uemis.c

diff --git a/dive.c b/dive.c
index 3774ba80d037d77b9077a48e42fea16077cf50bc..9f57aed58146554969901198ac761fc888904e18 100644 (file)
--- 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 bdf3aa6e1f52fc8c553377592537741dc95381e9..52158ad78fcaf5b5ed6ea4d378dcb8c9d43bea80 100644 (file)
--- 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);
index daf724190d44d7868ff1a753c29a6a9954c06e09..4ff41486db453fda6d76f0e3c9a27a2dd7f15588 100644 (file)
@@ -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;
index 6840610728e0e0f6da0f89d1218e11d7c9a101c5..6af4a93380ee8112fbfa9b33d234a76f75d70308 100644 (file)
@@ -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 28302b1c0c75ae955d9ae29baf91fcf74056d676..06ef5b4231c6f85e6474d182b04a5cf7911d8f2b 100644 (file)
--- 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++;
        }