diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2020-01-18 18:07:55 -0700 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2020-01-18 19:59:24 -0700 |
commit | 620ab66e75cb1b43e9a49cabf51de5b6c4c01c41 (patch) | |
tree | 4d73cd99ead1e2704c708ab074535f5cc8aeebcb /libs/ardour/ardour/transport_fsm.h | |
parent | d83cd0588278ac23b320694762e8fffd347fb4ad (diff) |
remove fragile union design
Absurd to be memory-conscious about a couple of member variables in an object that represents user input
Diffstat (limited to 'libs/ardour/ardour/transport_fsm.h')
-rw-r--r-- | libs/ardour/ardour/transport_fsm.h | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/libs/ardour/ardour/transport_fsm.h b/libs/ardour/ardour/transport_fsm.h index 86133e77c5..7f6728da07 100644 --- a/libs/ardour/ardour/transport_fsm.h +++ b/libs/ardour/ardour/transport_fsm.h @@ -44,21 +44,20 @@ struct TransportFSM struct Event : public boost::intrusive::list_base_hook<> { EventType type; - union { - bool abort; /* for stop */ - LocateTransportDisposition ltd; /* for locate */ - }; - union { - bool clear_state; /* for stop */ - bool with_flush; /* for locate */ - }; + /* for stop */ + bool abort; + bool clear_state; /* for locate */ + LocateTransportDisposition ltd; + bool with_flush; samplepos_t target; bool for_loop_end; bool force; Event (EventType t) : type (t) + , abort (false) + , clear_state (false) , ltd (MustStop) , with_flush (false) , target (0) @@ -72,11 +71,18 @@ struct TransportFSM : type (t) , abort (ab) , clear_state (cl) + , ltd (MustStop) + , with_flush (false) + , target (0) + , for_loop_end (false) + , force (false) { assert (t == StopTransport); } Event (EventType t, samplepos_t pos, LocateTransportDisposition l, bool fl, bool lp, bool f4c) : type (t) + , abort (false) + , clear_state (false) , ltd (l) , with_flush (fl) , target (pos) |