summaryrefslogtreecommitdiffstats
path: root/core/parse.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/parse.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/parse.c')
-rw-r--r--core/parse.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/core/parse.c b/core/parse.c
index 8da7322a0..56e2e1b6f 100644
--- a/core/parse.c
+++ b/core/parse.c
@@ -163,7 +163,7 @@ void event_end(struct parser_state *state)
bool is_dive(struct parser_state *state)
{
return state->cur_dive &&
- (state->cur_dive->dive_site_uuid || state->cur_dive->when || state->cur_dive->dc.samples);
+ (state->cur_dive->dive_site || state->cur_dive->when || state->cur_dive->dc.samples);
}
void reset_dc_info(struct divecomputer *dc, struct parser_state *state)
@@ -417,7 +417,7 @@ void add_dive_site(char *ds_name, struct dive *dive, struct parser_state *state)
char *to_free = NULL;
int size = trimspace(buffer);
if(size) {
- struct dive_site *ds = get_dive_site_by_uuid(dive->dive_site_uuid);
+ struct dive_site *ds = dive->dive_site;
if (!ds) {
// if the dive doesn't have a uuid, check if there's already a dive site by this name
ds = get_dive_site_by_name(buffer);
@@ -433,10 +433,10 @@ void add_dive_site(char *ds_name, struct dive *dive, struct parser_state *state)
// way around
struct dive_site *exact_match = get_dive_site_by_gps_and_name(buffer, &ds->location);
if (exact_match) {
- dive->dive_site_uuid = exact_match->uuid;
+ dive->dive_site = exact_match;
} else {
struct dive_site *newds = create_dive_site(buffer, dive->when);
- dive->dive_site_uuid = newds->uuid;
+ dive->dive_site = newds;
if (has_location(&state->cur_location)) {
// we started this uuid with GPS data, so lets use those
newds->location = state->cur_location;
@@ -447,10 +447,10 @@ void add_dive_site(char *ds_name, struct dive *dive, struct parser_state *state)
}
} else {
// add the existing dive site to the current dive
- dive->dive_site_uuid = ds->uuid;
+ dive->dive_site = ds;
}
} else {
- dive->dive_site_uuid = create_dive_site(buffer, dive->when)->uuid;
+ dive->dive_site = create_dive_site(buffer, dive->when);
}
}
free(to_free);