From 11467fa326896934a299712810b74aef6a373c6f Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Thu, 27 Jun 2019 07:42:09 +0200 Subject: Core: dynamically allocate the result of get_gas_used() get_gas_used() returns the volume of used gases. Currently, an array with MAX_CYLINDERS is passed in. If we want to make the number of cylinders dynamic, the function must use an arbitrarilly sized array. Therefore, return a dynamically allocated array and free it in the caller. Signed-off-by: Berthold Stoeger --- core/statistics.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'core/statistics.h') diff --git a/core/statistics.h b/core/statistics.h index 257303e19..6e125a217 100644 --- a/core/statistics.h +++ b/core/statistics.h @@ -10,7 +10,6 @@ #define STATISTICS_H #include "core/units.h" -#include "core/dive.h" // For MAX_CYLINDERS #define STATS_MAX_DEPTH 300 /* Max depth for stats bucket is 300m */ #define STATS_DEPTH_BUCKET 10 /* Size of buckets for depth range */ @@ -62,7 +61,7 @@ extern void init_stats_summary(struct stats_summary *stats); extern void free_stats_summary(struct stats_summary *stats); extern void calculate_stats_summary(struct stats_summary *stats, bool selected_only); extern void calculate_stats_selected(stats_t *stats_selection); -extern void get_gas_used(struct dive *dive, volume_t gases[MAX_CYLINDERS]); +extern volume_t *get_gas_used(struct dive *dive); extern void selected_dives_gas_parts(volume_t *o2_tot, volume_t *he_tot); #ifdef __cplusplus -- cgit v1.2.3-70-g09d2