From 92dadbc1d4bacd5af4eb1b2e5bb3e6d2f0e954fa Mon Sep 17 00:00:00 2001 From: Tim Segers Date: Thu, 20 Oct 2022 20:33:43 +0200 Subject: Change waypoint callback from function-only to function+arg combination --- src/opendeco.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/opendeco.c') diff --git a/src/opendeco.c b/src/opendeco.c index 7759b1d..9ef08fa 100644 --- a/src/opendeco.c +++ b/src/opendeco.c @@ -174,7 +174,7 @@ void print_gas_use() } } -void print_segment_callback(const decostate_t *ds, const waypoint_t wp, segtype_t type) +void print_segment_callback_fn(const decostate_t *ds, const waypoint_t wp, segtype_t type, void *arg) { static double last_depth; static double runtime; @@ -299,6 +299,11 @@ int main(int argc, char *argv[]) {.depth = abs_depth(msw_to_bar(arguments.depth)), .time = bottom_time, &bottom_gas}, }; + waypoint_callback_t print_segment_callback = { + .fn = &print_segment_callback_fn, + .arg = NULL, + }; + print_planhead(); simulate_dive(&ds, waypoints, len(waypoints), &print_segment_callback); -- cgit v1.2.3-70-g09d2