mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
core: add make_manually_added_dc() function
For reasons of symmetry (there is a is_manually_added_dc() function), create a make_manually_added_dc() function. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
f687e51d4b
commit
261f07dfa4
5 changed files with 12 additions and 4 deletions
|
@ -549,8 +549,15 @@ void free_dc(struct divecomputer *dc)
|
|||
free(dc);
|
||||
}
|
||||
|
||||
static const char *manual_dc_name = "manually added dive";
|
||||
bool is_manually_added_dc(const struct divecomputer *dc)
|
||||
{
|
||||
return dc && dc->samples <= 50 &&
|
||||
same_string(dc->model, "manually added dive");
|
||||
same_string(dc->model, manual_dc_name);
|
||||
}
|
||||
|
||||
void make_manually_added_dc(struct divecomputer *dc)
|
||||
{
|
||||
free((void *)dc->model);
|
||||
dc->model = strdup(manual_dc_name);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue