diff options
author | Chris Robinson <[email protected]> | 2022-12-05 21:50:55 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2022-12-05 21:50:55 -0800 |
commit | c55d6d8c345223c062dfdbd747fb13a8fd44aad5 (patch) | |
tree | 5d9b8343eb03f495904de14e57d61611a94e38b5 /al/state.cpp | |
parent | 4de5c7dfeebc2335ad3d7c2dd4905284677a68c9 (diff) |
Avoid LIKELY/UNLIKELY macros
Diffstat (limited to 'al/state.cpp')
-rw-r--r-- | al/state.cpp | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/al/state.cpp b/al/state.cpp index f41016d6..581d5370 100644 --- a/al/state.cpp +++ b/al/state.cpp @@ -158,7 +158,7 @@ AL_API void AL_APIENTRY alEnable(ALenum capability) START_API_FUNC { ContextRef context{GetContextRef()}; - if UNLIKELY(!context) return; + if(!context) [[alunlikely]] return; switch(capability) { @@ -184,7 +184,7 @@ AL_API void AL_APIENTRY alDisable(ALenum capability) START_API_FUNC { ContextRef context{GetContextRef()}; - if UNLIKELY(!context) return; + if(!context) [[alunlikely]] return; switch(capability) { @@ -210,7 +210,7 @@ AL_API ALboolean AL_APIENTRY alIsEnabled(ALenum capability) START_API_FUNC { ContextRef context{GetContextRef()}; - if UNLIKELY(!context) return AL_FALSE; + if(!context) [[alunlikely]] return AL_FALSE; std::lock_guard<std::mutex> _{context->mPropLock}; ALboolean value{AL_FALSE}; @@ -236,7 +236,7 @@ AL_API ALboolean AL_APIENTRY alGetBoolean(ALenum pname) START_API_FUNC { ContextRef context{GetContextRef()}; - if UNLIKELY(!context) return AL_FALSE; + if(!context) [[alunlikely]] return AL_FALSE; std::lock_guard<std::mutex> _{context->mPropLock}; ALboolean value{AL_FALSE}; @@ -293,7 +293,7 @@ AL_API ALdouble AL_APIENTRY alGetDouble(ALenum pname) START_API_FUNC { ContextRef context{GetContextRef()}; - if UNLIKELY(!context) return 0.0; + if(!context) [[alunlikely]] return 0.0; std::lock_guard<std::mutex> _{context->mPropLock}; ALdouble value{0.0}; @@ -344,7 +344,7 @@ AL_API ALfloat AL_APIENTRY alGetFloat(ALenum pname) START_API_FUNC { ContextRef context{GetContextRef()}; - if UNLIKELY(!context) return 0.0f; + if(!context) [[alunlikely]] return 0.0f; std::lock_guard<std::mutex> _{context->mPropLock}; ALfloat value{0.0f}; @@ -395,7 +395,7 @@ AL_API ALint AL_APIENTRY alGetInteger(ALenum pname) START_API_FUNC { ContextRef context{GetContextRef()}; - if UNLIKELY(!context) return 0; + if(!context) [[alunlikely]] return 0; std::lock_guard<std::mutex> _{context->mPropLock}; ALint value{0}; @@ -481,7 +481,7 @@ AL_API ALint64SOFT AL_APIENTRY alGetInteger64SOFT(ALenum pname) START_API_FUNC { ContextRef context{GetContextRef()}; - if UNLIKELY(!context) return 0_i64; + if(!context) [[alunlikely]] return 0_i64; std::lock_guard<std::mutex> _{context->mPropLock}; ALint64SOFT value{0}; @@ -532,7 +532,7 @@ AL_API ALvoid* AL_APIENTRY alGetPointerSOFT(ALenum pname) START_API_FUNC { ContextRef context{GetContextRef()}; - if UNLIKELY(!context) return nullptr; + if(!context) [[alunlikely]] return nullptr; std::lock_guard<std::mutex> _{context->mPropLock}; void *value{nullptr}; @@ -575,7 +575,7 @@ START_API_FUNC } ContextRef context{GetContextRef()}; - if UNLIKELY(!context) return; + if(!context) [[alunlikely]] return; if(!values) context->setError(AL_INVALID_VALUE, "NULL pointer"); @@ -608,7 +608,7 @@ START_API_FUNC } ContextRef context{GetContextRef()}; - if UNLIKELY(!context) return; + if(!context) [[alunlikely]] return; if(!values) context->setError(AL_INVALID_VALUE, "NULL pointer"); @@ -641,7 +641,7 @@ START_API_FUNC } ContextRef context{GetContextRef()}; - if UNLIKELY(!context) return; + if(!context) [[alunlikely]] return; if(!values) context->setError(AL_INVALID_VALUE, "NULL pointer"); @@ -674,7 +674,7 @@ START_API_FUNC } ContextRef context{GetContextRef()}; - if UNLIKELY(!context) return; + if(!context) [[alunlikely]] return; if(!values) context->setError(AL_INVALID_VALUE, "NULL pointer"); @@ -707,7 +707,7 @@ START_API_FUNC } ContextRef context{GetContextRef()}; - if UNLIKELY(!context) return; + if(!context) [[alunlikely]] return; if(!values) context->setError(AL_INVALID_VALUE, "NULL pointer"); @@ -734,7 +734,7 @@ START_API_FUNC } ContextRef context{GetContextRef()}; - if UNLIKELY(!context) return; + if(!context) [[alunlikely]] return; if(!values) context->setError(AL_INVALID_VALUE, "NULL pointer"); @@ -750,7 +750,7 @@ AL_API const ALchar* AL_APIENTRY alGetString(ALenum pname) START_API_FUNC { ContextRef context{GetContextRef()}; - if UNLIKELY(!context) return nullptr; + if(!context) [[alunlikely]] return nullptr; const ALchar *value{nullptr}; switch(pname) @@ -806,7 +806,7 @@ AL_API void AL_APIENTRY alDopplerFactor(ALfloat value) START_API_FUNC { ContextRef context{GetContextRef()}; - if UNLIKELY(!context) return; + if(!context) [[alunlikely]] return; if(!(value >= 0.0f && std::isfinite(value))) context->setError(AL_INVALID_VALUE, "Doppler factor %f out of range", value); @@ -823,7 +823,7 @@ AL_API void AL_APIENTRY alDopplerVelocity(ALfloat value) START_API_FUNC { ContextRef context{GetContextRef()}; - if UNLIKELY(!context) return; + if(!context) [[alunlikely]] return; if(!(value >= 0.0f && std::isfinite(value))) context->setError(AL_INVALID_VALUE, "Doppler velocity %f out of range", value); @@ -840,7 +840,7 @@ AL_API void AL_APIENTRY alSpeedOfSound(ALfloat value) START_API_FUNC { ContextRef context{GetContextRef()}; - if UNLIKELY(!context) return; + if(!context) [[alunlikely]] return; if(!(value > 0.0f && std::isfinite(value))) context->setError(AL_INVALID_VALUE, "Speed of sound %f out of range", value); @@ -857,7 +857,7 @@ AL_API void AL_APIENTRY alDistanceModel(ALenum value) START_API_FUNC { ContextRef context{GetContextRef()}; - if UNLIKELY(!context) return; + if(!context) [[alunlikely]] return; if(auto model = DistanceModelFromALenum(value)) { @@ -876,7 +876,7 @@ AL_API void AL_APIENTRY alDeferUpdatesSOFT(void) START_API_FUNC { ContextRef context{GetContextRef()}; - if UNLIKELY(!context) return; + if(!context) [[alunlikely]] return; std::lock_guard<std::mutex> _{context->mPropLock}; context->deferUpdates(); @@ -887,7 +887,7 @@ AL_API void AL_APIENTRY alProcessUpdatesSOFT(void) START_API_FUNC { ContextRef context{GetContextRef()}; - if UNLIKELY(!context) return; + if(!context) [[alunlikely]] return; std::lock_guard<std::mutex> _{context->mPropLock}; context->processUpdates(); @@ -899,7 +899,7 @@ AL_API const ALchar* AL_APIENTRY alGetStringiSOFT(ALenum pname, ALsizei index) START_API_FUNC { ContextRef context{GetContextRef()}; - if UNLIKELY(!context) return nullptr; + if(!context) [[alunlikely]] return nullptr; const ALchar *value{nullptr}; switch(pname) |