diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2018-10-23 13:29:04 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-10-29 00:09:31 +0000 |
commit | d3a7c5448fe166444980ed41757c9e03d83ece2f (patch) | |
tree | 7a2a4f05b808705cd27845335876184f87243b5c /core/parse.c | |
parent | ae6239bfec75df8a6795c2cc0017fcb0148e01e5 (diff) | |
download | subsurface-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.c | 6 |
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); |