diff options
author | Chris Robinson <[email protected]> | 2022-12-06 01:48:58 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2022-12-06 01:48:58 -0800 |
commit | 4d757068c4784a18026089fd812949703bd9470a (patch) | |
tree | 1a1c2f819d14acc7a32cc26f10ffa1227c72b744 /al/filter.cpp | |
parent | 25a6814cf36bee82b24cb1b5f40769e66c327db4 (diff) |
Avoid using a macro to wrap standard attributes
Diffstat (limited to 'al/filter.cpp')
-rw-r--r-- | al/filter.cpp | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/al/filter.cpp b/al/filter.cpp index f0274ed7..298bef5d 100644 --- a/al/filter.cpp +++ b/al/filter.cpp @@ -331,14 +331,14 @@ bool EnsureFilters(ALCdevice *device, size_t needed) while(needed > count) { - if(device->FilterList.size() >= 1<<25) [[alunlikely]] + if(device->FilterList.size() >= 1<<25) [[unlikely]] return false; device->FilterList.emplace_back(); auto sublist = device->FilterList.end() - 1; sublist->FreeMask = ~0_u64; sublist->Filters = static_cast<ALfilter*>(al_calloc(alignof(ALfilter), sizeof(ALfilter)*64)); - if(!sublist->Filters) [[alunlikely]] + if(!sublist->Filters) [[unlikely]] { device->FilterList.pop_back(); return false; @@ -386,10 +386,10 @@ inline ALfilter *LookupFilter(ALCdevice *device, ALuint id) const size_t lidx{(id-1) >> 6}; const ALuint slidx{(id-1) & 0x3f}; - if(lidx >= device->FilterList.size()) [[alunlikely]] + if(lidx >= device->FilterList.size()) [[unlikely]] return nullptr; FilterSubList &sublist = device->FilterList[lidx]; - if(sublist.FreeMask & (1_u64 << slidx)) [[alunlikely]] + if(sublist.FreeMask & (1_u64 << slidx)) [[unlikely]] return nullptr; return sublist.Filters + slidx; } @@ -400,11 +400,11 @@ AL_API void AL_APIENTRY alGenFilters(ALsizei n, ALuint *filters) START_API_FUNC { ContextRef context{GetContextRef()}; - if(!context) [[alunlikely]] return; + if(!context) [[unlikely]] return; - if(n < 0) [[alunlikely]] + if(n < 0) [[unlikely]] context->setError(AL_INVALID_VALUE, "Generating %d filters", n); - if(n <= 0) [[alunlikely]] return; + if(n <= 0) [[unlikely]] return; ALCdevice *device{context->mALDevice.get()}; std::lock_guard<std::mutex> _{device->FilterLock}; @@ -414,7 +414,7 @@ START_API_FUNC return; } - if(n == 1) [[allikely]] + if(n == 1) [[likely]] { /* Special handling for the easy and normal case. */ ALfilter *filter{AllocFilter(device)}; @@ -440,11 +440,11 @@ AL_API void AL_APIENTRY alDeleteFilters(ALsizei n, const ALuint *filters) START_API_FUNC { ContextRef context{GetContextRef()}; - if(!context) [[alunlikely]] return; + if(!context) [[unlikely]] return; - if(n < 0) [[alunlikely]] + if(n < 0) [[unlikely]] context->setError(AL_INVALID_VALUE, "Deleting %d filters", n); - if(n <= 0) [[alunlikely]] return; + if(n <= 0) [[unlikely]] return; ALCdevice *device{context->mALDevice.get()}; std::lock_guard<std::mutex> _{device->FilterLock}; @@ -455,7 +455,7 @@ START_API_FUNC const ALuint *filters_end = filters + n; auto invflt = std::find_if_not(filters, filters_end, validate_filter); - if(invflt != filters_end) [[alunlikely]] + if(invflt != filters_end) [[unlikely]] { context->setError(AL_INVALID_NAME, "Invalid filter ID %u", *invflt); return; @@ -475,7 +475,7 @@ AL_API ALboolean AL_APIENTRY alIsFilter(ALuint filter) START_API_FUNC { ContextRef context{GetContextRef()}; - if(context) [[allikely]] + if(context) [[likely]] { ALCdevice *device{context->mALDevice.get()}; std::lock_guard<std::mutex> _{device->FilterLock}; @@ -491,13 +491,13 @@ AL_API void AL_APIENTRY alFilteri(ALuint filter, ALenum param, ALint value) START_API_FUNC { ContextRef context{GetContextRef()}; - if(!context) [[alunlikely]] return; + if(!context) [[unlikely]] return; ALCdevice *device{context->mALDevice.get()}; std::lock_guard<std::mutex> _{device->FilterLock}; ALfilter *alfilt{LookupFilter(device, filter)}; - if(!alfilt) [[alunlikely]] + if(!alfilt) [[unlikely]] context->setError(AL_INVALID_NAME, "Invalid filter ID %u", filter); else { @@ -532,13 +532,13 @@ START_API_FUNC } ContextRef context{GetContextRef()}; - if(!context) [[alunlikely]] return; + if(!context) [[unlikely]] return; ALCdevice *device{context->mALDevice.get()}; std::lock_guard<std::mutex> _{device->FilterLock}; ALfilter *alfilt{LookupFilter(device, filter)}; - if(!alfilt) [[alunlikely]] + if(!alfilt) [[unlikely]] context->setError(AL_INVALID_NAME, "Invalid filter ID %u", filter); else try { @@ -555,13 +555,13 @@ AL_API void AL_APIENTRY alFilterf(ALuint filter, ALenum param, ALfloat value) START_API_FUNC { ContextRef context{GetContextRef()}; - if(!context) [[alunlikely]] return; + if(!context) [[unlikely]] return; ALCdevice *device{context->mALDevice.get()}; std::lock_guard<std::mutex> _{device->FilterLock}; ALfilter *alfilt{LookupFilter(device, filter)}; - if(!alfilt) [[alunlikely]] + if(!alfilt) [[unlikely]] context->setError(AL_INVALID_NAME, "Invalid filter ID %u", filter); else try { @@ -578,13 +578,13 @@ AL_API void AL_APIENTRY alFilterfv(ALuint filter, ALenum param, const ALfloat *v START_API_FUNC { ContextRef context{GetContextRef()}; - if(!context) [[alunlikely]] return; + if(!context) [[unlikely]] return; ALCdevice *device{context->mALDevice.get()}; std::lock_guard<std::mutex> _{device->FilterLock}; ALfilter *alfilt{LookupFilter(device, filter)}; - if(!alfilt) [[alunlikely]] + if(!alfilt) [[unlikely]] context->setError(AL_INVALID_NAME, "Invalid filter ID %u", filter); else try { @@ -601,13 +601,13 @@ AL_API void AL_APIENTRY alGetFilteri(ALuint filter, ALenum param, ALint *value) START_API_FUNC { ContextRef context{GetContextRef()}; - if(!context) [[alunlikely]] return; + if(!context) [[unlikely]] return; ALCdevice *device{context->mALDevice.get()}; std::lock_guard<std::mutex> _{device->FilterLock}; const ALfilter *alfilt{LookupFilter(device, filter)}; - if(!alfilt) [[alunlikely]] + if(!alfilt) [[unlikely]] context->setError(AL_INVALID_NAME, "Invalid filter ID %u", filter); else { @@ -636,13 +636,13 @@ START_API_FUNC } ContextRef context{GetContextRef()}; - if(!context) [[alunlikely]] return; + if(!context) [[unlikely]] return; ALCdevice *device{context->mALDevice.get()}; std::lock_guard<std::mutex> _{device->FilterLock}; const ALfilter *alfilt{LookupFilter(device, filter)}; - if(!alfilt) [[alunlikely]] + if(!alfilt) [[unlikely]] context->setError(AL_INVALID_NAME, "Invalid filter ID %u", filter); else try { @@ -659,13 +659,13 @@ AL_API void AL_APIENTRY alGetFilterf(ALuint filter, ALenum param, ALfloat *value START_API_FUNC { ContextRef context{GetContextRef()}; - if(!context) [[alunlikely]] return; + if(!context) [[unlikely]] return; ALCdevice *device{context->mALDevice.get()}; std::lock_guard<std::mutex> _{device->FilterLock}; const ALfilter *alfilt{LookupFilter(device, filter)}; - if(!alfilt) [[alunlikely]] + if(!alfilt) [[unlikely]] context->setError(AL_INVALID_NAME, "Invalid filter ID %u", filter); else try { @@ -682,13 +682,13 @@ AL_API void AL_APIENTRY alGetFilterfv(ALuint filter, ALenum param, ALfloat *valu START_API_FUNC { ContextRef context{GetContextRef()}; - if(!context) [[alunlikely]] return; + if(!context) [[unlikely]] return; ALCdevice *device{context->mALDevice.get()}; std::lock_guard<std::mutex> _{device->FilterLock}; const ALfilter *alfilt{LookupFilter(device, filter)}; - if(!alfilt) [[alunlikely]] + if(!alfilt) [[unlikely]] context->setError(AL_INVALID_NAME, "Invalid filter ID %u", filter); else try { |