Commit graph

3 commits

Author SHA1 Message Date
Berthold Stoeger
4128fec1ea profile: register event names on creation of events
The event names were registered in add_event(). However,
the undo system did not use that function, but add_event_to_dc(),
which takes an already allocated event.

That gave the following unfortunate situation:

Load a log without setpoint changes.
Add a setpoint change.
The setpoint change event type now was not registered and
therefore couldn't be hidden.

Admittedly, a subtle bug, but still a bug. Fix by registering
event names on event creation.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2023-02-17 06:46:46 -08:00
Berthold Stoeger
0d3c9954f4 profile: redo eventname handling
The eventname handling code was splattered all over the place.
Collect it in a single source file and use C++ idioms to avoid
nasty memory management. Provide a C-only interface, however.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2023-02-17 06:46:46 -08:00
Berthold Stoeger
8212acc992 cleanup: break out event-related code into event.[c|h]
In an effort to reduce the size of dive.h and dive.c, break out
the event related functions. Moreover event-names were handled
by the profile-code, collect that also in the new source files.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-10-25 13:59:52 -07:00