diff options
author | Chris Robinson <[email protected]> | 2022-12-05 14:51:03 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2022-12-05 14:51:03 -0800 |
commit | df6d61dd40b602af55f903564358b083bb8b37e4 (patch) | |
tree | 84113a098867e2ba82aa1f156911e94755fde727 /al/event.cpp | |
parent | 73df39b8f8cefa0c0fca0e287b548063e9e62636 (diff) |
Use standard likely/unlikely attributes when available
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 e5923c43..1e31a144 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(!quitnow) [[allikely]] { 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 == AsyncEvent::KillThread; - if(unlikely(quitnow)) break; + if(quitnow) [[alunlikely]] break; if(evt.EnumType == AsyncEvent::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(!context) [[alunlikely]] 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(!context) [[alunlikely]] return; std::lock_guard<std::mutex> _{context->mPropLock}; std::lock_guard<std::mutex> __{context->mEventCbLock}; |