From 2fa2c35bdc2a09d5e856bb12ad6dff556bbe65a8 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sun, 4 Aug 2019 11:59:14 -0700 Subject: Modify LIKELY and UNLIKELY to not need extra parenthesis --- al/event.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'al/event.cpp') 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 _{context->mPropLock}; std::lock_guard __{context->mEventCbLock}; -- cgit v1.2.3