From d3a7c5448fe166444980ed41757c9e03d83ece2f Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Tue, 23 Oct 2018 13:29:04 +0200 Subject: 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 --- core/parse.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'core/parse.c') 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); -- cgit v1.2.3-70-g09d2