aboutsummaryrefslogtreecommitdiffstats
path: root/core/parse.c
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2018-10-23 13:29:04 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-10-29 00:09:31 +0000
commitd3a7c5448fe166444980ed41757c9e03d83ece2f (patch)
tree7a2a4f05b808705cd27845335876184f87243b5c /core/parse.c
parentae6239bfec75df8a6795c2cc0017fcb0148e01e5 (diff)
downloadsubsurface-d3a7c5448fe166444980ed41757c9e03d83ece2f.tar.gz
Dive site: return pointer to dive_site in create_dive_site_*()
This changes more of the dive-site interface to return pointers instead of UUIDs. Currently, most call sites directly extract UUIDs afterwards. Ultimately, the UUIDs will be generally replaced by pointers, which will then simplify these callers. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/parse.c')
-rw-r--r--core/parse.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/parse.c b/core/parse.c
index c0d127d0b..8da7322a0 100644
--- a/core/parse.c
+++ b/core/parse.c
@@ -435,8 +435,8 @@ void add_dive_site(char *ds_name, struct dive *dive, struct parser_state *state)
if (exact_match) {
dive->dive_site_uuid = exact_match->uuid;
} else {
- dive->dive_site_uuid = create_dive_site(buffer, dive->when);
- struct dive_site *newds = get_dive_site_by_uuid(dive->dive_site_uuid);
+ struct dive_site *newds = create_dive_site(buffer, dive->when);
+ dive->dive_site_uuid = newds->uuid;
if (has_location(&state->cur_location)) {
// we started this uuid with GPS data, so lets use those
newds->location = state->cur_location;
@@ -450,7 +450,7 @@ void add_dive_site(char *ds_name, struct dive *dive, struct parser_state *state)
dive->dive_site_uuid = ds->uuid;
}
} else {
- dive->dive_site_uuid = create_dive_site(buffer, dive->when);
+ dive->dive_site_uuid = create_dive_site(buffer, dive->when)->uuid;
}
}
free(to_free);