summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2018-08-14 14:09:30 -0400
committerGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2018-08-14 14:09:30 -0400
commit8a394b9db42a21f684c6ae85005a55c29d060c38 (patch)
treea85c21348cd7dbc416801df09fc028917d1f3c41 /core
parentfb47c15cd81970f19aeb9777c4c576b973889674 (diff)
downloadsubsurface-8a394b9db42a21f684c6ae85005a55c29d060c38.tar.gz
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>
Diffstat (limited to 'core')
-rw-r--r--core/dive.c4
-rw-r--r--core/dive.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/core/dive.c b/core/dive.c
index da4b19346..482ba585b 100644
--- a/core/dive.c
+++ b/core/dive.c
@@ -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;
diff --git a/core/dive.h b/core/dive.h
index 98ac06fdc..01ec1fd3d 100644
--- a/core/dive.h
+++ b/core/dive.h
@@ -444,7 +444,7 @@ extern struct dive *get_dive(int nr);
extern struct dive *get_dive_from_table(int nr, struct dive_table *dt);
extern struct dive_site *get_dive_site_for_dive(struct dive *dive);
extern const char *get_dive_country(struct dive *dive);
-extern char *get_dive_location(struct dive *dive);
+extern const char *get_dive_location(const struct dive *dive);
extern unsigned int number_of_computers(struct dive *dive);
extern struct divecomputer *get_dive_dc(struct dive *dive, int nr);
extern timestamp_t dive_endtime(const struct dive *dive);