aboutsummaryrefslogtreecommitdiffstats
path: root/core/dive.c
diff options
context:
space:
mode:
authorGravatar Robert C. Helling <helling@atdotde.de>2019-01-01 18:02:04 +0100
committerGravatar Robert C. Helling <helling@atdotde.de>2019-01-08 10:39:06 +0100
commitc349692d984f417bf56f5fecb8f733d8fb007518 (patch)
treed66682b3d0426ad03bc9d53f6190c0023e0fd344 /core/dive.c
parentf1fc89b978c178fcd0f4f3ddb7629dc7df0d939d (diff)
downloadsubsurface-c349692d984f417bf56f5fecb8f733d8fb007518.tar.gz
Helper function to determined planned dives
... to reduce code duplication. Signed-off-by: Robert C. Helling <helling@atdotde.de>
Diffstat (limited to 'core/dive.c')
-rw-r--r--core/dive.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/core/dive.c b/core/dive.c
index 49431bffe..0ec9e381c 100644
--- a/core/dive.c
+++ b/core/dive.c
@@ -3357,6 +3357,10 @@ void dump_taglist(const char *intro, struct tag_entry *tl)
fprintf(stderr, "\n");
}
+bool is_dc_planner(const struct divecomputer *dc) {
+ return same_string(dc->model, "planned dive");
+}
+
/*
* Merging two dives can be subtle, because there's two different ways
* of merging:
@@ -3401,7 +3405,7 @@ struct dive *merge_dives(const struct dive *a, const struct dive *b, int offset,
offset = 0;
}
- if (same_string(a->dc.model, "planned dive")) {
+ if (is_dc_planner(&a->dc)) {
const struct dive *tmp = a;
a = b;
b = tmp;