From 605e1e19ed0c52a16580c95e36ae79e71b539351 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Fri, 17 Aug 2018 00:58:30 +0200 Subject: Cleanup: const-ify functions taking pointers to events This is another entry in the series to make more things "const-clean" with the ultimate goal of merge_dive() take const pointers. This concerns functions taking pointers to events and the fallout from making these const. The somewhat debatable part of this commit might be that get_next_event() is split in a two distinct (const and non-const) versions with different names, since C doesn't allow overloading. The linker should recognize that these functions are identical and remove one of them. Signed-off-by: Berthold Stoeger --- core/planner.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'core/planner.c') diff --git a/core/planner.c b/core/planner.c index 673c2b6b7..1077fb313 100644 --- a/core/planner.c +++ b/core/planner.c @@ -136,7 +136,7 @@ int tissue_at_end(struct deco_state *ds, struct dive *dive, struct deco_state ** return 0; psample = sample = dc->sample; - struct event *evdm = NULL; + const struct event *evdm = NULL; enum divemode_t divemode = UNDEF_COMP_TYPE; for (i = 0; i < dc->samples; i++, sample++) { @@ -716,7 +716,7 @@ bool plan(struct deco_state *ds, struct diveplan *diveplan, struct dive *dive, i current_cylinder = get_cylinderid_at_time(dive, &dive->dc, sample->time); // FIXME: This needs a function to find the divemode at the end of the dive like in - struct event *ev = NULL; + const struct event *ev = NULL; divemode = UNDEF_COMP_TYPE; divemode = get_current_divemode(&dive->dc, bottom_time, &ev, &divemode); gas = dive->cylinder[current_cylinder].gasmix; -- cgit v1.2.3-70-g09d2