diff options
author | Chris Robinson <[email protected]> | 2019-08-04 11:59:14 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2019-08-04 11:59:14 -0700 |
commit | 2fa2c35bdc2a09d5e856bb12ad6dff556bbe65a8 (patch) | |
tree | 4a6c7a5f2a80ad7870e9028e48b8b99e558042f5 /al/event.cpp | |
parent | 7897de31d0f75f4ac1d91fe8c470953e9f54d151 (diff) |
Modify LIKELY and UNLIKELY to not need extra parenthesis
Diffstat (limited to 'al/event.cpp')
-rw-r--r-- | al/event.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/al/event.cpp b/al/event.cpp index 06a2e008..530f9679 100644 --- a/al/event.cpp +++ b/al/event.cpp @@ -32,7 +32,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) @@ -60,7 +60,7 @@ static int EventThread(ALCcontext *context) } _{evt, ring}; quitnow = evt.EnumType == EventType_KillThread; - if(UNLIKELY(quitnow)) break; + if UNLIKELY(quitnow) break; if(evt.EnumType == EventType_ReleaseEffectState) { @@ -141,10 +141,10 @@ 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) SETERR_RETURN(context, AL_INVALID_VALUE,, "Controlling %d events", count); - if(count == 0) return; + if(count < 0) context->setError(AL_INVALID_VALUE, "Controlling %d events", count); + if(count <= 0) return; if(!types) SETERR_RETURN(context, AL_INVALID_VALUE,, "NULL pointer"); ALbitfieldSOFT flags{0}; @@ -202,7 +202,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}; |