summaryrefslogtreecommitdiffstats
path: root/core/parse-xml.c
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2020-06-15 23:13:29 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-06-16 08:20:53 -0700
commit14c37ba7337da108f23dd8cba98c2a9d52bd4099 (patch)
tree555418f2ac143ed663fb4f5dec1a2872fba28f39 /core/parse-xml.c
parentb01361170770a1cd263c57e856437e5f22c794df (diff)
downloadsubsurface-14c37ba7337da108f23dd8cba98c2a9d52bd4099.tar.gz
cleanup: remove indirection when passing arguments to parser functions
For unknown reasons, the dive site and trip to be parsed into were passed as pointers to pointers. A simple pointer seems to be enough, since the object is not allocated by the function. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/parse-xml.c')
-rw-r--r--core/parse-xml.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/core/parse-xml.c b/core/parse-xml.c
index 4aad15bb5..0d52eb733 100644
--- a/core/parse-xml.c
+++ b/core/parse-xml.c
@@ -1364,12 +1364,10 @@ static void try_to_fill_dive(struct dive *dive, const char *name, char *buf, str
}
/* We're in the top-level trip xml. Try to convert whatever value to a trip value */
-static void try_to_fill_trip(dive_trip_t **dive_trip_p, const char *name, char *buf, struct parser_state *state)
+static void try_to_fill_trip(dive_trip_t *dive_trip, const char *name, char *buf, struct parser_state *state)
{
start_match("trip", name, buf);
- dive_trip_t *dive_trip = *dive_trip_p;
-
if (MATCH("location", utf8_string, &dive_trip->location))
return;
if (MATCH("notes", utf8_string, &dive_trip->notes))
@@ -1379,11 +1377,10 @@ static void try_to_fill_trip(dive_trip_t **dive_trip_p, const char *name, char *
}
/* We're processing a divesite entry - try to fill the components */
-static void try_to_fill_dive_site(struct dive_site **ds_p, const char *name, char *buf)
+static void try_to_fill_dive_site(struct dive_site *ds, const char *name, char *buf)
{
start_match("divesite", name, buf);
- struct dive_site *ds = *ds_p;
if (ds->taxonomy.category == NULL)
ds->taxonomy.category = alloc_taxonomy();
@@ -1426,7 +1423,7 @@ static bool entry(const char *name, char *buf, struct parser_state *state)
return true;
}
if (state->cur_dive_site) {
- try_to_fill_dive_site(&state->cur_dive_site, name, buf);
+ try_to_fill_dive_site(state->cur_dive_site, name, buf);
return true;
}
if (!state->cur_event.deleted) {
@@ -1446,7 +1443,7 @@ static bool entry(const char *name, char *buf, struct parser_state *state)
return true;
}
if (state->cur_trip) {
- try_to_fill_trip(&state->cur_trip, name, buf, state);
+ try_to_fill_trip(state->cur_trip, name, buf, state);
return true;
}
return true;