diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/statistics.c | 11 | ||||
-rw-r--r-- | core/statistics.h | 5 |
2 files changed, 7 insertions, 9 deletions
diff --git a/core/statistics.c b/core/statistics.c index b7e4e1f4c..5d9c8049a 100644 --- a/core/statistics.c +++ b/core/statistics.c @@ -4,6 +4,7 @@ * core logic for the Info & Stats page - * char *get_minutes(int seconds); * void calculate_stats_summary(struct stats_summary *out); + * void calculate_stats_selected(stats_t *stats_selection); */ #include "gettext.h" #include <string.h> @@ -14,8 +15,6 @@ #include "divelist.h" #include "statistics.h" -stats_t stats_selection; - static void process_temperatures(struct dive *dp, stats_t *stats) { temperature_t min_temp, mean_temp, max_temp = {.mkelvin = 0}; @@ -224,21 +223,21 @@ void init_stats_summary(struct stats_summary *stats) } /* make sure we skip the selected summary entries */ -void process_selected_dives(void) +void calculate_stats_selected(stats_t *stats_selection) { struct dive *dive; unsigned int i, nr; - memset(&stats_selection, 0, sizeof(stats_selection)); + memset(stats_selection, 0, sizeof(*stats_selection)); nr = 0; for_each_dive(i, dive) { if (dive->selected) { - process_dive(dive, &stats_selection); + process_dive(dive, stats_selection); nr++; } } - stats_selection.selection_size = nr; + stats_selection->selection_size = nr; } #define SOME_GAS 5000 // 5bar drop in cylinder pressure makes cylinder used diff --git a/core/statistics.h b/core/statistics.h index 4639ecf3f..d0cf5ab67 100644 --- a/core/statistics.h +++ b/core/statistics.h @@ -37,7 +37,6 @@ typedef struct bool is_trip; char *location; } stats_t; -extern stats_t stats_selection; struct stats_summary { stats_t *stats_yearly; @@ -54,9 +53,9 @@ extern char *get_minutes(int seconds); 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); +extern void calculate_stats_selected(stats_t *stats_selection); extern void get_gas_used(struct dive *dive, volume_t gases[MAX_CYLINDERS]); -extern void process_selected_dives(void); -void selected_dives_gas_parts(volume_t *o2_tot, volume_t *he_tot); +extern void selected_dives_gas_parts(volume_t *o2_tot, volume_t *he_tot); #ifdef __cplusplus } |