From 87c91af82407857ca0b14bbef992bca2ce0cfafd Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Fri, 22 May 2020 22:14:24 +0200 Subject: [PATCH] cleanup: constify time_during_dive_with_offset() function There is no reason to pass a non-const dive pointer as first argument. 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 7b37eef38..60b7d1faa 100644 --- a/core/dive.c +++ b/core/dive.c @@ -3394,7 +3394,7 @@ timestamp_t dive_endtime(const struct dive *dive) return dive->when + dive_totaltime(dive); } -bool time_during_dive_with_offset(struct dive *dive, timestamp_t when, timestamp_t offset) +bool time_during_dive_with_offset(const struct dive *dive, timestamp_t when, timestamp_t offset) { timestamp_t start = dive->when; timestamp_t end = dive_endtime(dive); diff --git a/core/dive.h b/core/dive.h index 3cf0323c9..7f4f805c6 100644 --- a/core/dive.h +++ b/core/dive.h @@ -272,7 +272,7 @@ extern bool dive_site_has_gps_location(const struct dive_site *ds); extern int dive_has_gps_location(const struct dive *dive); extern location_t dive_get_gps_location(const struct dive *d); -extern bool time_during_dive_with_offset(struct dive *dive, timestamp_t when, timestamp_t offset); +extern bool time_during_dive_with_offset(const struct dive *dive, timestamp_t when, timestamp_t offset); /* Check if two dive computer entries are the exact same dive (-1=no/0=maybe/1=yes) */ extern int match_one_dc(const struct divecomputer *a, const struct divecomputer *b);