aboutsummaryrefslogtreecommitdiffstats
path: root/core/dive.h
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2018-07-17 23:05:03 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-07-17 15:20:52 -0700
commit2c6b1a99af103232d420a09023e9e0e6ccee9084 (patch)
tree70f38609c2a7a8e09c986c0bdfbd7d2695072501 /core/dive.h
parent4931b5a8e61ab40d393a13742bec4e26fd4da155 (diff)
downloadsubsurface-2c6b1a99af103232d420a09023e9e0e6ccee9084.tar.gz
Cleanup: simplify dive_getUniqID()
dive_getUniqID() is used to create unique dive ids, which are stable during application lifetime. It was passed a dive, checked that the id was not set (if it was that it is know to the application) and set a new id (in contradiction to its name!) if it hadn't any. There were three callers: alloc_dive(): called the function on a zeroed dive struct. fixup_dive(): called the function only if the dive had a 0 id. MainWindow::setupForAddAndPlan(): called the function on a zeroed dive struct. Thus, in all three callers the id is guaranteed to be zero and the whole keeping-track-of-ids logic is moot. Remove the logic, don't pass a dive struct to dive_getUniqID() and move the function to the C-backend. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/dive.h')
-rw-r--r--core/dive.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/dive.h b/core/dive.h
index 1e694e271..8458a3ae3 100644
--- a/core/dive.h
+++ b/core/dive.h
@@ -757,7 +757,7 @@ extern int legacy_format_o2pressures(struct dive *dive, struct divecomputer *dc)
extern void sort_table(struct dive_table *table);
extern struct dive *fixup_dive(struct dive *dive);
extern void fixup_dc_duration(struct divecomputer *dc);
-extern int dive_getUniqID(struct dive *d);
+extern int dive_getUniqID();
extern unsigned int dc_airtemp(struct divecomputer *dc);
extern unsigned int dc_watertemp(struct divecomputer *dc);
extern int split_dive(struct dive *);