summaryrefslogtreecommitdiffstats
path: root/core/load-git.c
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2018-10-26 17:03:54 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-10-29 00:09:31 +0000
commit724055f0af4fb7cdb9f1570967fe4b34797f3419 (patch)
tree6aab8c34e7d0a6df1d6fe84bc5794e8eb5404b7d /core/load-git.c
parentacd44467c1100a1a774cc644921b1dc33dca1266 (diff)
downloadsubsurface-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/load-git.c')
-rw-r--r--core/load-git.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/core/load-git.c b/core/load-git.c
index b0d94f3cf..8483b9cf0 100644
--- a/core/load-git.c
+++ b/core/load-git.c
@@ -159,9 +159,9 @@ static void parse_dive_gps(char *line, struct membuffer *str, void *_dive)
if (!ds) {
ds = get_dive_site_by_gps(&location);
if (!ds)
- dive->dive_site_uuid = create_dive_site_with_gps("", &location, dive->when)->uuid;
+ dive->dive_site = create_dive_site_with_gps("", &location, dive->when);
else
- dive->dive_site_uuid = ds->uuid;
+ dive->dive_site = ds;
} else {
if (dive_site_has_gps_location(ds) && !same_location(&ds->location, &location)) {
const char *coords = printGPSCoords(&location);
@@ -183,9 +183,9 @@ static void parse_dive_location(char *line, struct membuffer *str, void *_dive)
if (!ds) {
ds = get_dive_site_by_name(name);
if (!ds)
- dive->dive_site_uuid = create_dive_site(name, dive->when)->uuid;
+ dive->dive_site = create_dive_site(name, dive->when);
else
- dive->dive_site_uuid = ds->uuid;
+ dive->dive_site = ds;
} else {
// we already had a dive site linked to the dive
if (empty_string(ds->name)) {
@@ -212,7 +212,7 @@ static void parse_dive_notes(char *line, struct membuffer *str, void *_dive)
{ UNUSED(line); struct dive *dive = _dive; dive->notes = get_utf8(str); }
static void parse_dive_divesiteid(char *line, struct membuffer *str, void *_dive)
-{ UNUSED(str); struct dive *dive = _dive; dive->dive_site_uuid = get_hex(line); }
+{ UNUSED(str); struct dive *dive = _dive; dive->dive_site = get_dive_site_by_uuid(get_hex(line)); }
/*
* We can have multiple tags in the membuffer. They are separated by