diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2018-10-26 17:03:54 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-10-29 00:09:31 +0000 |
commit | 724055f0af4fb7cdb9f1570967fe4b34797f3419 (patch) | |
tree | 6aab8c34e7d0a6df1d6fe84bc5794e8eb5404b7d /core/divesite.c | |
parent | acd44467c1100a1a774cc644921b1dc33dca1266 (diff) | |
download | subsurface-724055f0af4fb7cdb9f1570967fe4b34797f3419.tar.gz |
Dive site: replace dive->dive_site_uuid by dive_site
Replace the UUID reference of struct dive by a pointer to dive_site.
This commit is rather large in lines, but nevertheless quite simple
since most of the UUID->pointer work was done in previous commits.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/divesite.c')
-rw-r--r-- | core/divesite.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/core/divesite.c b/core/divesite.c index 79902d1ef..726dec42d 100644 --- a/core/divesite.c +++ b/core/divesite.c @@ -138,7 +138,7 @@ int nr_of_dives_at_dive_site(struct dive_site *ds, bool select_only) if (!ds) return 0; for_each_dive(j, d) { - if (d->dive_site_uuid == ds->uuid && (!select_only || d->selected)) { + if (d->dive_site == ds && (!select_only || d->selected)) { nr++; } } @@ -153,7 +153,7 @@ bool is_dive_site_used(struct dive_site *ds, bool select_only) if (!ds) return false; for_each_dive(j, d) { - if (d->dive_site_uuid == ds->uuid && (!select_only || d->selected)) { + if (d->dive_site == ds && (!select_only || d->selected)) { found = true; break; } @@ -318,9 +318,9 @@ void merge_dive_sites(struct dive_site *ref, struct dive_site *dive_sites[], int continue; for_each_dive(curr_dive, d) { - if (d->dive_site_uuid != dive_sites[i]->uuid ) + if (d->dive_site != dive_sites[i] ) continue; - d->dive_site_uuid = ref->uuid; + d->dive_site = ref; invalidate_dive_cache(d); } } |