summaryrefslogtreecommitdiffstats
path: root/core/dive.c
diff options
context:
space:
mode:
Diffstat (limited to 'core/dive.c')
-rw-r--r--core/dive.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/core/dive.c b/core/dive.c
index fccfe4da9..9e3d42a44 100644
--- a/core/dive.c
+++ b/core/dive.c
@@ -753,6 +753,10 @@ struct sample *prepare_sample(struct divecomputer *dc)
sample->sensor[0] = sample[-1].sensor[0];
sample->sensor[1] = sample[-1].sensor[1];
}
+ // Init some values with -1
+ sample->bearing.degrees = -1;
+ sample->ndl.seconds = -1;
+
return sample;
}
return NULL;
@@ -1261,12 +1265,12 @@ static void fixup_meandepth(struct dive *dive)
static void fixup_duration(struct dive *dive)
{
struct divecomputer *dc;
- unsigned int duration = 0;
+ duration_t duration = { };
for_each_dc (dive, dc)
- duration = MAX(duration, dc->duration.seconds);
+ duration.seconds = MAX(duration.seconds, dc->duration.seconds);
- dive->duration.seconds = duration;
+ dive->duration.seconds = duration.seconds;
}
/*