mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
core: convert filter_constraint_data_to_string to C++
Return an std::string to avoid memory management headaches. While doing that, convert time.c to C++ so that format_datetime directly returns an std::string. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
898ecd2df5
commit
2e1d852e36
8 changed files with 29 additions and 32 deletions
|
@ -957,7 +957,6 @@ static void format_one_filter_constraint(int preset_id, int constraint_id, struc
|
|||
{
|
||||
const struct filter_constraint *constraint = filter_preset_constraint(preset_id, constraint_id);
|
||||
const char *type = filter_constraint_type_to_string(constraint->type);
|
||||
char *data;
|
||||
|
||||
show_utf8(b, "constraint type=", type, "");
|
||||
if (filter_constraint_has_string_mode(constraint->type)) {
|
||||
|
@ -970,9 +969,8 @@ static void format_one_filter_constraint(int preset_id, int constraint_id, struc
|
|||
}
|
||||
if (constraint->negate)
|
||||
put_format(b, " negate");
|
||||
data = filter_constraint_data_to_string(constraint);
|
||||
show_utf8(b, " data=", data, "\n");
|
||||
free(data);
|
||||
std::string data = filter_constraint_data_to_string(constraint);
|
||||
show_utf8(b, " data=", data.c_str(), "\n");
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue