summaryrefslogtreecommitdiffstats
path: root/core/divesite.c
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2018-10-23 18:55:42 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-10-29 00:09:31 +0000
commit8de471f90e95a5a75d0fec78d5bbf900eb90f235 (patch)
tree62812fb5aab9f6a8cb17db8969ab4e10eb041de0 /core/divesite.c
parent14ab95608cc0694caff580825666d2009177e0a2 (diff)
downloadsubsurface-8de471f90e95a5a75d0fec78d5bbf900eb90f235.tar.gz
Dive site: pass dive-site pointer to is_dive_site_used()
Instead of passing a uuid, pass a pointer to the dive site. This is small step in an effort to remove uuids. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/divesite.c')
-rw-r--r--core/divesite.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/core/divesite.c b/core/divesite.c
index 437605b71..163ecc892 100644
--- a/core/divesite.c
+++ b/core/divesite.c
@@ -145,13 +145,15 @@ int nr_of_dives_at_dive_site(struct dive_site *ds, bool select_only)
return nr;
}
-bool is_dive_site_used(uint32_t uuid, bool select_only)
+bool is_dive_site_used(struct dive_site *ds, bool select_only)
{
int j;
bool found = false;
struct dive *d;
+ if (!ds)
+ return false;
for_each_dive(j, d) {
- if (d->dive_site_uuid == uuid && (!select_only || d->selected)) {
+ if (d->dive_site_uuid == ds->uuid && (!select_only || d->selected)) {
found = true;
break;
}