mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
core: turn dive-trip location and notes into std::string
Simpler memory management. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
2fd226964c
commit
3ee41328f9
29 changed files with 157 additions and 179 deletions
|
@ -1385,13 +1385,13 @@ 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, const char *name, char *buf, struct parser_state *state)
|
||||
static void try_to_fill_trip(dive_trip *dive_trip, const char *name, char *buf, struct parser_state *state)
|
||||
{
|
||||
start_match("trip", name, buf);
|
||||
|
||||
if (MATCH("location", utf8_string, &dive_trip->location))
|
||||
if (MATCH("location", utf8_string_std, &dive_trip->location))
|
||||
return;
|
||||
if (MATCH("notes", utf8_string, &dive_trip->notes))
|
||||
if (MATCH("notes", utf8_string_std, &dive_trip->notes))
|
||||
return;
|
||||
|
||||
nonmatch("trip", name, buf);
|
||||
|
@ -1528,7 +1528,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.get(), name, buf, state);
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue