aboutsummaryrefslogtreecommitdiffstats
path: root/al/state.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2019-08-04 11:59:14 -0700
committerChris Robinson <[email protected]>2019-08-04 11:59:14 -0700
commit2fa2c35bdc2a09d5e856bb12ad6dff556bbe65a8 (patch)
tree4a6c7a5f2a80ad7870e9028e48b8b99e558042f5 /al/state.cpp
parent7897de31d0f75f4ac1d91fe8c470953e9f54d151 (diff)
Modify LIKELY and UNLIKELY to not need extra parenthesis
Diffstat (limited to 'al/state.cpp')
-rw-r--r--al/state.cpp46
1 files changed, 23 insertions, 23 deletions
diff --git a/al/state.cpp b/al/state.cpp
index 3e8f4d18..b0338296 100644
--- a/al/state.cpp
+++ b/al/state.cpp
@@ -90,7 +90,7 @@ AL_API ALvoid AL_APIENTRY alEnable(ALenum capability)
START_API_FUNC
{
ContextRef context{GetContextRef()};
- if(UNLIKELY(!context)) return;
+ if UNLIKELY(!context) return;
std::lock_guard<std::mutex> _{context->mPropLock};
switch(capability)
@@ -110,7 +110,7 @@ AL_API ALvoid AL_APIENTRY alDisable(ALenum capability)
START_API_FUNC
{
ContextRef context{GetContextRef()};
- if(UNLIKELY(!context)) return;
+ if UNLIKELY(!context) return;
std::lock_guard<std::mutex> _{context->mPropLock};
switch(capability)
@@ -130,7 +130,7 @@ AL_API ALboolean AL_APIENTRY alIsEnabled(ALenum capability)
START_API_FUNC
{
ContextRef context{GetContextRef()};
- if(UNLIKELY(!context)) return AL_FALSE;
+ if UNLIKELY(!context) return AL_FALSE;
std::lock_guard<std::mutex> _{context->mPropLock};
ALboolean value{AL_FALSE};
@@ -152,7 +152,7 @@ AL_API ALboolean AL_APIENTRY alGetBoolean(ALenum pname)
START_API_FUNC
{
ContextRef context{GetContextRef()};
- if(UNLIKELY(!context)) return AL_FALSE;
+ if UNLIKELY(!context) return AL_FALSE;
std::lock_guard<std::mutex> _{context->mPropLock};
ALboolean value{AL_FALSE};
@@ -209,7 +209,7 @@ AL_API ALdouble AL_APIENTRY alGetDouble(ALenum pname)
START_API_FUNC
{
ContextRef context{GetContextRef()};
- if(UNLIKELY(!context)) return 0.0;
+ if UNLIKELY(!context) return 0.0;
std::lock_guard<std::mutex> _{context->mPropLock};
ALdouble value{0.0};
@@ -260,7 +260,7 @@ AL_API ALfloat AL_APIENTRY alGetFloat(ALenum pname)
START_API_FUNC
{
ContextRef context{GetContextRef()};
- if(UNLIKELY(!context)) return 0.0f;
+ if UNLIKELY(!context) return 0.0f;
std::lock_guard<std::mutex> _{context->mPropLock};
ALfloat value{0.0f};
@@ -311,7 +311,7 @@ AL_API ALint AL_APIENTRY alGetInteger(ALenum pname)
START_API_FUNC
{
ContextRef context{GetContextRef()};
- if(UNLIKELY(!context)) return 0;
+ if UNLIKELY(!context) return 0;
std::lock_guard<std::mutex> _{context->mPropLock};
ALint value{0};
@@ -362,7 +362,7 @@ extern "C" AL_API ALint64SOFT AL_APIENTRY alGetInteger64SOFT(ALenum pname)
START_API_FUNC
{
ContextRef context{GetContextRef()};
- if(UNLIKELY(!context)) return 0;
+ if UNLIKELY(!context) return 0_i64;
std::lock_guard<std::mutex> _{context->mPropLock};
ALint64SOFT value{0};
@@ -413,7 +413,7 @@ AL_API void* AL_APIENTRY alGetPointerSOFT(ALenum pname)
START_API_FUNC
{
ContextRef context{GetContextRef()};
- if(UNLIKELY(!context)) return nullptr;
+ if UNLIKELY(!context) return nullptr;
std::lock_guard<std::mutex> _{context->mPropLock};
void *value{nullptr};
@@ -456,7 +456,7 @@ START_API_FUNC
}
ContextRef context{GetContextRef()};
- if(UNLIKELY(!context)) return;
+ if UNLIKELY(!context) return;
if(!values)
context->setError(AL_INVALID_VALUE, "NULL pointer");
@@ -489,7 +489,7 @@ START_API_FUNC
}
ContextRef context{GetContextRef()};
- if(UNLIKELY(!context)) return;
+ if UNLIKELY(!context) return;
if(!values)
context->setError(AL_INVALID_VALUE, "NULL pointer");
@@ -522,7 +522,7 @@ START_API_FUNC
}
ContextRef context{GetContextRef()};
- if(UNLIKELY(!context)) return;
+ if UNLIKELY(!context) return;
if(!values)
context->setError(AL_INVALID_VALUE, "NULL pointer");
@@ -555,7 +555,7 @@ START_API_FUNC
}
ContextRef context{GetContextRef()};
- if(UNLIKELY(!context)) return;
+ if UNLIKELY(!context) return;
if(!values)
context->setError(AL_INVALID_VALUE, "NULL pointer");
@@ -588,7 +588,7 @@ START_API_FUNC
}
ContextRef context{GetContextRef()};
- if(UNLIKELY(!context)) return;
+ if UNLIKELY(!context) return;
if(!values)
context->setError(AL_INVALID_VALUE, "NULL pointer");
@@ -615,7 +615,7 @@ START_API_FUNC
}
ContextRef context{GetContextRef()};
- if(UNLIKELY(!context)) return;
+ if UNLIKELY(!context) return;
if(!values)
context->setError(AL_INVALID_VALUE, "NULL pointer");
@@ -631,7 +631,7 @@ AL_API const ALchar* AL_APIENTRY alGetString(ALenum pname)
START_API_FUNC
{
ContextRef context{GetContextRef()};
- if(UNLIKELY(!context)) return nullptr;
+ if UNLIKELY(!context) return nullptr;
const ALchar *value{nullptr};
switch(pname)
@@ -687,7 +687,7 @@ AL_API ALvoid AL_APIENTRY alDopplerFactor(ALfloat value)
START_API_FUNC
{
ContextRef context{GetContextRef()};
- if(UNLIKELY(!context)) return;
+ if UNLIKELY(!context) return;
if(!(value >= 0.0f && std::isfinite(value)))
context->setError(AL_INVALID_VALUE, "Doppler factor %f out of range", value);
@@ -704,7 +704,7 @@ AL_API ALvoid AL_APIENTRY alDopplerVelocity(ALfloat value)
START_API_FUNC
{
ContextRef context{GetContextRef()};
- if(UNLIKELY(!context)) return;
+ if UNLIKELY(!context) return;
if((context->mEnabledEvts.load(std::memory_order_relaxed)&EventType_Deprecated))
{
@@ -733,7 +733,7 @@ AL_API ALvoid AL_APIENTRY alSpeedOfSound(ALfloat value)
START_API_FUNC
{
ContextRef context{GetContextRef()};
- if(UNLIKELY(!context)) return;
+ if UNLIKELY(!context) return;
if(!(value > 0.0f && std::isfinite(value)))
context->setError(AL_INVALID_VALUE, "Speed of sound %f out of range", value);
@@ -750,7 +750,7 @@ AL_API ALvoid AL_APIENTRY alDistanceModel(ALenum value)
START_API_FUNC
{
ContextRef context{GetContextRef()};
- if(UNLIKELY(!context)) return;
+ if UNLIKELY(!context) return;
if(!(value == AL_INVERSE_DISTANCE || value == AL_INVERSE_DISTANCE_CLAMPED ||
value == AL_LINEAR_DISTANCE || value == AL_LINEAR_DISTANCE_CLAMPED ||
@@ -772,7 +772,7 @@ AL_API ALvoid AL_APIENTRY alDeferUpdatesSOFT(void)
START_API_FUNC
{
ContextRef context{GetContextRef()};
- if(UNLIKELY(!context)) return;
+ if UNLIKELY(!context) return;
context->deferUpdates();
}
@@ -782,7 +782,7 @@ AL_API ALvoid AL_APIENTRY alProcessUpdatesSOFT(void)
START_API_FUNC
{
ContextRef context{GetContextRef()};
- if(UNLIKELY(!context)) return;
+ if UNLIKELY(!context) return;
context->processUpdates();
}
@@ -800,7 +800,7 @@ START_API_FUNC
static_assert(al::size(ResamplerNames) == ResamplerMax+1, "Incorrect ResamplerNames list");
ContextRef context{GetContextRef()};
- if(UNLIKELY(!context)) return nullptr;
+ if UNLIKELY(!context) return nullptr;
const ALchar *value{nullptr};
switch(pname)