diff options
author | Chris Robinson <[email protected]> | 2023-05-24 11:56:56 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2023-05-24 11:56:56 -0700 |
commit | f3e9d066df50a6e77e8c15ea97b195a4b069f254 (patch) | |
tree | 1823b869dd881b1c46243ba3e653979d210caba6 /core/voice.cpp | |
parent | da56dd074595d6590273eeb1739f1c9bfc1b5fee (diff) |
Be a bit more safe with type mangling
Diffstat (limited to 'core/voice.cpp')
-rw-r--r-- | core/voice.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/core/voice.cpp b/core/voice.cpp index 3e78b176..65986cd1 100644 --- a/core/voice.cpp +++ b/core/voice.cpp @@ -226,8 +226,7 @@ void SendSourceStoppedEvent(ContextBase *context, uint id) auto evt_vec = ring->getWriteVector(); if(evt_vec.first.len < 1) return; - AsyncSourceStateEvent &evt = InitAsyncEvent<AsyncSourceStateEvent>( - reinterpret_cast<AsyncEvent*>(evt_vec.first.buf)); + auto &evt = InitAsyncEvent<AsyncSourceStateEvent>(evt_vec.first.buf); evt.mId = id; evt.mState = AsyncSrcState::Stop; @@ -1151,8 +1150,7 @@ void Voice::mix(const State vstate, ContextBase *Context, const nanoseconds devi auto evt_vec = ring->getWriteVector(); if(evt_vec.first.len > 0) { - AsyncBufferCompleteEvent &evt = InitAsyncEvent<AsyncBufferCompleteEvent>( - reinterpret_cast<AsyncEvent*>(evt_vec.first.buf)); + auto &evt = InitAsyncEvent<AsyncBufferCompleteEvent>(evt_vec.first.buf); evt.mId = SourceID; evt.mCount = buffers_done; ring->writeAdvance(1); |