core: fold event-related functions into event class

Not strictly necessary, but more idiomatic C++ and less
polution of the global namespace. This one is so trivial
that there seems to be no reason not to do it.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2024-05-25 20:12:10 +02:00 committed by bstoeger
parent c27314d603
commit e237f29fb2
12 changed files with 28 additions and 29 deletions

View file

@ -91,7 +91,7 @@ void event_end(struct parser_state *state)
if (ev.time.seconds == 0 && ev.type == SAMPLE_EVENT_PO2 && ev.value && dc->divemode==OC)
dc->divemode = CCR;
if (event_is_gaschange(ev)) {
if (ev.is_gaschange()) {
/* See try_to_fill_event() on why the filled-in index is one too big */
ev.gas.index = state->cur_event.gas.index-1;
if (state->cur_event.gas.mix.o2.permille || state->cur_event.gas.mix.he.permille)