summaryrefslogtreecommitdiffstats
path: root/core/divesite.c
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2018-10-23 19:40:41 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-10-29 00:09:31 +0000
commit64f0902e0d78ecf9a23016f8048c4e21167b527a (patch)
treeebf9a1d6f1d2d7f643344a08ecb55f408eef323f /core/divesite.c
parentf527a70831a37e736431baa5705c9d188fc12f4b (diff)
downloadsubsurface-64f0902e0d78ecf9a23016f8048c4e21167b527a.tar.gz
Dive site: pass dive-site pointers to merge_dive_sites()
Instead of passing uuids, 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.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/core/divesite.c b/core/divesite.c
index d20421de7..79902d1ef 100644
--- a/core/divesite.c
+++ b/core/divesite.c
@@ -309,26 +309,26 @@ void clear_dive_site(struct dive_site *ds)
free_taxonomy(&ds->taxonomy);
}
-void merge_dive_sites(uint32_t ref, uint32_t* uuids, int count)
+void merge_dive_sites(struct dive_site *ref, struct dive_site *dive_sites[], int count)
{
int curr_dive, i;
struct dive *d;
for(i = 0; i < count; i++){
- if (uuids[i] == ref)
+ if (dive_sites[i] == ref)
continue;
for_each_dive(curr_dive, d) {
- if (d->dive_site_uuid != uuids[i] )
+ if (d->dive_site_uuid != dive_sites[i]->uuid )
continue;
- d->dive_site_uuid = ref;
+ d->dive_site_uuid = ref->uuid;
invalidate_dive_cache(d);
}
}
for(i = 0; i < count; i++) {
- if (uuids[i] == ref)
+ if (dive_sites[i] == ref)
continue;
- delete_dive_site(get_dive_site_by_uuid(uuids[i]));
+ delete_dive_site(dive_sites[i]);
}
mark_divelist_changed(true);
}