diff options
author | Chris Robinson <[email protected]> | 2021-10-03 06:41:14 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2021-10-03 06:41:14 -0700 |
commit | 38d3ea35017944929f9d52a1c840ace68846fee9 (patch) | |
tree | 3e667cfd07130b4e09d21658fdf48ba0d9e89163 /al/event.cpp | |
parent | c66e4f5bd447d2bb1a38446510bff87ada00fb9f (diff) |
Make simpler likely/unlikely functions and use them in some places
Diffstat (limited to 'al/event.cpp')
-rw-r--r-- | al/event.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
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<std::mutex> _{context->mPropLock}; std::lock_guard<std::mutex> __{context->mEventCbLock}; |