diff options
author | Tim Segers <tsegers@pm.me> | 2022-10-20 20:33:43 +0200 |
---|---|---|
committer | Tim Segers <tsegers@pm.me> | 2022-10-21 11:12:03 +0200 |
commit | 92dadbc1d4bacd5af4eb1b2e5bb3e6d2f0e954fa (patch) | |
tree | 70878418c3183f3a035ac6c865b0325db6ea9d0d /src/opendeco.c | |
parent | 569ad230c20dce6b5db49b961e5198c490ba59fd (diff) | |
download | opendeco-92dadbc1d4bacd5af4eb1b2e5bb3e6d2f0e954fa.tar.gz |
Change waypoint callback from function-only to function+arg combination
Diffstat (limited to 'src/opendeco.c')
-rw-r--r-- | src/opendeco.c | 7 |
1 files changed, 6 insertions, 1 deletions
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); |