From d281ffa9ce3abd8dfd5afd72914acebe4a4a92ff Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Fri, 16 Dec 2022 18:41:47 -0800 Subject: Use a bitset for the enabled event flags --- core/async_event.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'core/async_event.h') diff --git a/core/async_event.h b/core/async_event.h index 750f38c9..5a2f5f91 100644 --- a/core/async_event.h +++ b/core/async_event.h @@ -10,16 +10,17 @@ using uint = unsigned int; struct AsyncEvent { enum : uint { - /* End event thread processing. */ - KillThread = 0, - /* User event types. */ - SourceStateChange = 1<<0, - BufferCompleted = 1<<1, - Disconnected = 1<<2, + SourceStateChange, + BufferCompleted, + Disconnected, + UserEventCount, - /* Internal events. */ - ReleaseEffectState = 65536, + /* Internal events, always processed. */ + ReleaseEffectState = 128, + + /* End event thread processing. */ + KillThread, }; enum class SrcState { @@ -29,7 +30,7 @@ struct AsyncEvent { Pause }; - uint EnumType{0u}; + const uint EnumType; union { char dummy; struct { @@ -46,7 +47,6 @@ struct AsyncEvent { EffectState *mEffectState; } u{}; - AsyncEvent() noexcept = default; constexpr AsyncEvent(uint type) noexcept : EnumType{type} { } DISABLE_ALLOC() -- cgit v1.2.3