Init every struct sample with default values

Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
This commit is contained in:
Stefan Fuchs 2017-11-05 15:58:24 +01:00 committed by Dirk Hohndel
parent 1f8506ce64
commit adbc71f9da
4 changed files with 9 additions and 4 deletions

View file

@ -1727,7 +1727,7 @@ static void merge_one_sample(struct sample *sample, int time, struct divecompute
{
int last = dc->samples - 1;
if (last >= 0) {
static struct sample surface;
static struct sample surface = { .bearing.degrees = -1, .ndl.seconds = -1 };
struct sample *prev = dc->sample + last;
int last_time = prev->time.seconds;
int last_depth = prev->depth.mm;
@ -1772,7 +1772,7 @@ static void merge_samples(struct divecomputer *res, struct divecomputer *a, stru
for (;;) {
int at, bt;
struct sample sample;
struct sample sample = { .bearing.degrees = -1, .ndl.seconds = -1 };
if (!res)
return;