mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
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>
This commit is contained in:
parent
b013611707
commit
14c37ba733
1 changed files with 4 additions and 7 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue