summaryrefslogtreecommitdiffstats
path: root/core/statistics.h
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2018-10-06 09:21:27 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-10-07 05:41:48 +0300
commitc32e71e64d97016d201aea26f0623de6cd65d74d (patch)
treed2dbd6a326701aba1e031a5f6508a5d811e2a34f /core/statistics.h
parentcec0b703652ffb4ab53fd792bee0cbf095b38cca (diff)
downloadsubsurface-c32e71e64d97016d201aea26f0623de6cd65d74d.tar.gz
Dive information: fix surface interval calculation
The old surface interval calculation had fundamental issues: 1) process_all_dives(), which calculates the statistics over *all* dives was used to get the pointer to the previous dive. 2) If two dives in the table had the same time, one of those would have been considered the "previous" dive. 3) If the dive, for which the surface interval is calculated is not yet in the table, no previous dive would be determined. Fix all this by creating a get_surface_interval() function and removing the "get previous dive" functionality of process_all_dives(). Remove the process_all_dives() call from TabDiveInformation::updateData(). Reported-by: Jan Mulder <jlmulder@xs4all.nl> Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/statistics.h')
-rw-r--r--core/statistics.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/statistics.h b/core/statistics.h
index 597edfb94..7766d3154 100644
--- a/core/statistics.h
+++ b/core/statistics.h
@@ -48,7 +48,7 @@ extern stats_t *stats_by_trip;
extern stats_t *stats_by_type;
extern char *get_minutes(int seconds);
-extern void process_all_dives(struct dive *dive, struct dive **prev_dive);
+extern void process_all_dives();
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);