aboutsummaryrefslogtreecommitdiffstats
path: root/core/divesite.c
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2018-10-23 18:31:39 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-10-29 00:09:31 +0000
commit14ab95608cc0694caff580825666d2009177e0a2 (patch)
treeb620ffcf6e48e25cc04764fc1fde00ffffc89465 /core/divesite.c
parentd3a7c5448fe166444980ed41757c9e03d83ece2f (diff)
downloadsubsurface-14ab95608cc0694caff580825666d2009177e0a2.tar.gz
Dive site: pass dive-site pointer to nr_of_dives_at_dive_site()
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 f6e96e3c5..437605b71 100644
--- a/core/divesite.c
+++ b/core/divesite.c
@@ -130,13 +130,15 @@ struct dive_site *alloc_or_get_dive_site(uint32_t uuid)
return ds;
}
-int nr_of_dives_at_dive_site(uint32_t uuid, bool select_only)
+int nr_of_dives_at_dive_site(struct dive_site *ds, bool select_only)
{
int j;
int nr = 0;
struct dive *d;
+ if (!ds)
+ return 0;
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)) {
nr++;
}
}