Filter: constify doFilter() argument

Conceptually, the doFilter() functions shouldn't modify the dive
they test. Therefore, make the argument const. To do this, constify
the parameter of get_dive_location(), which likewise seems to be
the right thing to do.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2018-08-14 14:09:30 -04:00
parent fb47c15cd8
commit 8a394b9db4
4 changed files with 14 additions and 12 deletions

View file

@ -4202,9 +4202,9 @@ const char *get_dive_country(struct dive *dive)
return NULL;
}
char *get_dive_location(struct dive *dive)
const char *get_dive_location(const struct dive *dive)
{
struct dive_site *ds = get_dive_site_by_uuid(dive->dive_site_uuid);
const struct dive_site *ds = get_dive_site_by_uuid(dive->dive_site_uuid);
if (ds && ds->name)
return ds->name;
return NULL;