mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-31 22:23:24 +00:00
Oddly, finishing a sample doesn't require a sample
So let's not pass it around Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
854391419f
commit
1d6903c65a
5 changed files with 6 additions and 6 deletions
4
dive.c
4
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;
|
||||
}
|
||||
|
||||
|
|
2
dive.h
2
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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -1104,7 +1104,7 @@ static void sample_end(void)
|
|||
if (!dive)
|
||||
return;
|
||||
|
||||
finish_sample(dive, sample);
|
||||
finish_sample(dive);
|
||||
sample = NULL;
|
||||
}
|
||||
|
||||
|
|
2
uemis.c
2
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++;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue