From 38d3ea35017944929f9d52a1c840ace68846fee9 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sun, 3 Oct 2021 06:41:14 -0700 Subject: Make simpler likely/unlikely functions and use them in some places --- al/event.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'al/event.cpp') diff --git a/al/event.cpp b/al/event.cpp index fd4667f7..2c5fa539 100644 --- a/al/event.cpp +++ b/al/event.cpp @@ -35,7 +35,7 @@ static int EventThread(ALCcontext *context) { RingBuffer *ring{context->mAsyncEvents.get()}; bool quitnow{false}; - while LIKELY(!quitnow) + while(likely(!quitnow)) { auto evt_data = ring->getReadVector().first; if(evt_data.len == 0) @@ -55,7 +55,7 @@ static int EventThread(ALCcontext *context) ring->readAdvance(1); quitnow = evt.EnumType == EventType_KillThread; - if UNLIKELY(quitnow) break; + if(unlikely(quitnow)) break; if(evt.EnumType == EventType_ReleaseEffectState) { @@ -155,7 +155,7 @@ AL_API void AL_APIENTRY alEventControlSOFT(ALsizei count, const ALenum *types, A START_API_FUNC { ContextRef context{GetContextRef()}; - if UNLIKELY(!context) return; + if(unlikely(!context)) return; if(count < 0) context->setError(AL_INVALID_VALUE, "Controlling %d events", count); if(count <= 0) return; @@ -210,7 +210,7 @@ AL_API void AL_APIENTRY alEventCallbackSOFT(ALEVENTPROCSOFT callback, void *user START_API_FUNC { ContextRef context{GetContextRef()}; - if UNLIKELY(!context) return; + if(unlikely(!context)) return; std::lock_guard _{context->mPropLock}; std::lock_guard __{context->mEventCbLock}; -- cgit v1.2.3