aboutsummaryrefslogtreecommitdiffstats
path: root/al
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2023-05-24 11:56:56 -0700
committerChris Robinson <[email protected]>2023-05-24 11:56:56 -0700
commitf3e9d066df50a6e77e8c15ea97b195a4b069f254 (patch)
tree1823b869dd881b1c46243ba3e653979d210caba6 /al
parentda56dd074595d6590273eeb1739f1c9bfc1b5fee (diff)
Be a bit more safe with type mangling
Diffstat (limited to 'al')
-rw-r--r--al/event.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/al/event.cpp b/al/event.cpp
index 7bd5ae1b..a5b5fdc5 100644
--- a/al/event.cpp
+++ b/al/event.cpp
@@ -56,7 +56,7 @@ int EventThread(ALCcontext *context)
std::lock_guard<std::mutex> _{context->mEventCbLock};
do {
- auto *evt_ptr = reinterpret_cast<AsyncEvent*>(evt_data.buf);
+ auto *evt_ptr = std::launder(reinterpret_cast<AsyncEvent*>(evt_data.buf));
evt_data.buf += sizeof(AsyncEvent);
evt_data.len -= 1;
@@ -164,7 +164,7 @@ void StopEventThrd(ALCcontext *ctx)
evt_data = ring->getWriteVector().first;
} while(evt_data.len == 0);
}
- std::ignore = InitAsyncEvent<AsyncKillThread>(reinterpret_cast<AsyncEvent*>(evt_data.buf));
+ std::ignore = InitAsyncEvent<AsyncKillThread>(evt_data.buf);
ring->writeAdvance(1);
ctx->mEventSem.post();