Use duration_t for total_sac_time in struct stats_t
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
This commit is contained in:
parent
95a23cf470
commit
ca4ccadcc4
@ -73,15 +73,15 @@ static void process_dive(struct dive *dp, stats_t *stats)
|
|||||||
stats->total_average_depth_time.seconds);
|
stats->total_average_depth_time.seconds);
|
||||||
}
|
}
|
||||||
if (dp->sac > 100) { /* less than .1 l/min is bogus, even with a pSCR */
|
if (dp->sac > 100) { /* less than .1 l/min is bogus, even with a pSCR */
|
||||||
sac_time = stats->total_sac_time + duration;
|
sac_time = stats->total_sac_time.seconds + duration;
|
||||||
stats->avg_sac.mliter = lrint((1.0 * stats->total_sac_time * stats->avg_sac.mliter +
|
stats->avg_sac.mliter = lrint((1.0 * stats->total_sac_time.seconds * stats->avg_sac.mliter +
|
||||||
duration * dp->sac) /
|
duration * dp->sac) /
|
||||||
sac_time);
|
sac_time);
|
||||||
if (dp->sac > stats->max_sac.mliter)
|
if (dp->sac > stats->max_sac.mliter)
|
||||||
stats->max_sac.mliter = dp->sac;
|
stats->max_sac.mliter = dp->sac;
|
||||||
if (stats->min_sac.mliter == 0 || dp->sac < stats->min_sac.mliter)
|
if (stats->min_sac.mliter == 0 || dp->sac < stats->min_sac.mliter)
|
||||||
stats->min_sac.mliter = dp->sac;
|
stats->min_sac.mliter = dp->sac;
|
||||||
stats->total_sac_time = sac_time;
|
stats->total_sac_time.seconds = sac_time;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -33,7 +33,7 @@ typedef struct
|
|||||||
temperature_sum_t combined_temp;
|
temperature_sum_t combined_temp;
|
||||||
unsigned int combined_count;
|
unsigned int combined_count;
|
||||||
unsigned int selection_size;
|
unsigned int selection_size;
|
||||||
unsigned int total_sac_time;
|
duration_t total_sac_time;
|
||||||
bool is_year;
|
bool is_year;
|
||||||
bool is_trip;
|
bool is_trip;
|
||||||
char *location;
|
char *location;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user