From a353bcb2961b5c9104097ecf57eeeda4b9e37a9f Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sun, 22 Sep 2019 21:44:16 +0200 Subject: Cleanup: make table argument to get_dive_from_table() const Even though the returned dive is not const, the table is not changed, as it only contains pointers. Signed-off-by: Berthold Stoeger --- core/dive.c | 2 +- core/dive.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/dive.c b/core/dive.c index 05fa970b6..dd6edaa84 100644 --- a/core/dive.c +++ b/core/dive.c @@ -3872,7 +3872,7 @@ struct dive *get_dive(int nr) return dive_table.dives[nr]; } -struct dive *get_dive_from_table(int nr, struct dive_table *dt) +struct dive *get_dive_from_table(int nr, const struct dive_table *dt) { if (nr >= dt->nr || nr < 0) return NULL; diff --git a/core/dive.h b/core/dive.h index d3101cc83..5f525c013 100644 --- a/core/dive.h +++ b/core/dive.h @@ -255,7 +255,7 @@ extern struct dive *current_dive; #define displayed_dc (get_dive_dc(&displayed_dive, dc_number)) extern struct dive *get_dive(int nr); -extern struct dive *get_dive_from_table(int nr, struct dive_table *dt); +extern struct dive *get_dive_from_table(int nr, const struct dive_table *dt); extern struct dive_site *get_dive_site_for_dive(const struct dive *dive); extern const char *get_dive_country(const struct dive *dive); extern const char *get_dive_location(const struct dive *dive); -- cgit v1.2.3-70-g09d2