mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
core: turn event-list of divecomputer into std::vector<>
This is a rather long commit, because it refactors lots of the event code from pointer to value semantics: pointers to entries in an std::vector<> are not stable, so better use indexes. To step through the event-list at diven time stamps, add *_loop classes, which encapsulate state that had to be manually handled before by the caller. I'm not happy about the interface, but it tries to mirror the one we had before. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
8ddc960fa0
commit
27dbdd35c6
36 changed files with 644 additions and 821 deletions
|
@ -363,7 +363,7 @@ static void handle_event(struct divecomputer *dc, const struct sample &sample, d
|
|||
time += sample.time.seconds;
|
||||
|
||||
ev = add_event(dc, time, type, value.event.flags, value.event.value, name);
|
||||
if (event_is_gaschange(ev) && ev->gas.index >= 0)
|
||||
if (event_is_gaschange(*ev) && ev->gas.index >= 0)
|
||||
current_gas_index = ev->gas.index;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue