diff options
author | Chris Robinson <[email protected]> | 2022-12-05 14:51:03 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2022-12-05 14:51:03 -0800 |
commit | df6d61dd40b602af55f903564358b083bb8b37e4 (patch) | |
tree | 84113a098867e2ba82aa1f156911e94755fde727 /al | |
parent | 73df39b8f8cefa0c0fca0e287b548063e9e62636 (diff) |
Use standard likely/unlikely attributes when available
Diffstat (limited to 'al')
-rw-r--r-- | al/auxeffectslot.cpp | 112 | ||||
-rw-r--r-- | al/buffer.cpp | 4 | ||||
-rw-r--r-- | al/error.cpp | 2 | ||||
-rw-r--r-- | al/event.cpp | 8 | ||||
-rw-r--r-- | al/extension.cpp | 4 | ||||
-rw-r--r-- | al/source.cpp | 36 |
6 files changed, 83 insertions, 83 deletions
diff --git a/al/auxeffectslot.cpp b/al/auxeffectslot.cpp index 172a3566..0eca5cb7 100644 --- a/al/auxeffectslot.cpp +++ b/al/auxeffectslot.cpp @@ -90,10 +90,10 @@ inline ALeffectslot *LookupEffectSlot(ALCcontext *context, ALuint id) noexcept const size_t lidx{(id-1) >> 6}; const ALuint slidx{(id-1) & 0x3f}; - if UNLIKELY(lidx >= context->mEffectSlotList.size()) + if(lidx >= context->mEffectSlotList.size()) [[alunlikely]] return nullptr; EffectSlotSubList &sublist{context->mEffectSlotList[lidx]}; - if UNLIKELY(sublist.FreeMask & (1_u64 << slidx)) + if(sublist.FreeMask & (1_u64 << slidx)) [[alunlikely]] return nullptr; return sublist.EffectSlots + slidx; } @@ -103,10 +103,10 @@ inline ALeffect *LookupEffect(ALCdevice *device, ALuint id) noexcept const size_t lidx{(id-1) >> 6}; const ALuint slidx{(id-1) & 0x3f}; - if UNLIKELY(lidx >= device->EffectList.size()) + if(lidx >= device->EffectList.size()) [[alunlikely]] return nullptr; EffectSubList &sublist = device->EffectList[lidx]; - if UNLIKELY(sublist.FreeMask & (1_u64 << slidx)) + if(sublist.FreeMask & (1_u64 << slidx)) [[alunlikely]] return nullptr; return sublist.Effects + slidx; } @@ -116,10 +116,10 @@ inline ALbuffer *LookupBuffer(ALCdevice *device, ALuint id) noexcept const size_t lidx{(id-1) >> 6}; const ALuint slidx{(id-1) & 0x3f}; - if UNLIKELY(lidx >= device->BufferList.size()) + if(lidx >= device->BufferList.size()) [[alunlikely]] return nullptr; BufferSubList &sublist = device->BufferList[lidx]; - if UNLIKELY(sublist.FreeMask & (1_u64 << slidx)) + if(sublist.FreeMask & (1_u64 << slidx)) [[alunlikely]] return nullptr; return sublist.Buffers + slidx; } @@ -159,7 +159,7 @@ void AddActiveEffectSlots(const al::span<ALeffectslot*> auxslots, ALCcontext *co /* Reallocate newarray if the new size ended up smaller from duplicate * removal. */ - if UNLIKELY(newcount < newarray->size()) + if(newcount < newarray->size()) [[alunlikely]] { curarray = newarray; newarray = EffectSlot::CreatePtrArray(newcount); @@ -197,7 +197,7 @@ void RemoveActiveEffectSlots(const al::span<ALeffectslot*> auxslots, ALCcontext /* Reallocate with the new size. */ auto newsize = static_cast<size_t>(std::distance(newarray->begin(), new_end)); - if LIKELY(newsize != newarray->size()) + if(newsize != newarray->size()) [[allikely]] { curarray = newarray; newarray = EffectSlot::CreatePtrArray(newsize); @@ -251,7 +251,7 @@ bool EnsureEffectSlots(ALCcontext *context, size_t needed) while(needed > count) { - if UNLIKELY(context->mEffectSlotList.size() >= 1<<25) + if(context->mEffectSlotList.size() >= 1<<25) [[alunlikely]] return false; context->mEffectSlotList.emplace_back(); @@ -259,7 +259,7 @@ bool EnsureEffectSlots(ALCcontext *context, size_t needed) sublist->FreeMask = ~0_u64; sublist->EffectSlots = static_cast<ALeffectslot*>( al_calloc(alignof(ALeffectslot), sizeof(ALeffectslot)*64)); - if UNLIKELY(!sublist->EffectSlots) + if(!sublist->EffectSlots) [[alunlikely]] { context->mEffectSlotList.pop_back(); return false; @@ -320,11 +320,11 @@ AL_API void AL_APIENTRY alGenAuxiliaryEffectSlots(ALsizei n, ALuint *effectslots START_API_FUNC { ContextRef context{GetContextRef()}; - if UNLIKELY(!context) return; + if(!context) [[alunlikely]] return; - if UNLIKELY(n < 0) + if(n < 0) [[alunlikely]] context->setError(AL_INVALID_VALUE, "Generating %d effect slots", n); - if UNLIKELY(n <= 0) return; + if(n <= 0) [[alunlikely]] return; std::lock_guard<std::mutex> _{context->mEffectSlotLock}; ALCdevice *device{context->mALDevice.get()}; @@ -364,22 +364,22 @@ AL_API void AL_APIENTRY alDeleteAuxiliaryEffectSlots(ALsizei n, const ALuint *ef START_API_FUNC { ContextRef context{GetContextRef()}; - if UNLIKELY(!context) return; + if(!context) [[alunlikely]] return; - if UNLIKELY(n < 0) + if(n < 0) [[alunlikely]] context->setError(AL_INVALID_VALUE, "Deleting %d effect slots", n); - if UNLIKELY(n <= 0) return; + if(n <= 0) [[alunlikely]] return; std::lock_guard<std::mutex> _{context->mEffectSlotLock}; if(n == 1) { ALeffectslot *slot{LookupEffectSlot(context.get(), effectslots[0])}; - if UNLIKELY(!slot) + if(!slot) [[alunlikely]] { context->setError(AL_INVALID_NAME, "Invalid effect slot ID %u", effectslots[0]); return; } - if UNLIKELY(ReadRef(slot->ref) != 0) + if(ReadRef(slot->ref) != 0) [[alunlikely]] { context->setError(AL_INVALID_OPERATION, "Deleting in-use effect slot %u", effectslots[0]); @@ -394,12 +394,12 @@ START_API_FUNC for(size_t i{0};i < slots.size();++i) { ALeffectslot *slot{LookupEffectSlot(context.get(), effectslots[i])}; - if UNLIKELY(!slot) + if(!slot) [[alunlikely]] { context->setError(AL_INVALID_NAME, "Invalid effect slot ID %u", effectslots[i]); return; } - if UNLIKELY(ReadRef(slot->ref) != 0) + if(ReadRef(slot->ref) != 0) [[alunlikely]] { context->setError(AL_INVALID_OPERATION, "Deleting in-use effect slot %u", effectslots[i]); @@ -428,7 +428,7 @@ AL_API ALboolean AL_APIENTRY alIsAuxiliaryEffectSlot(ALuint effectslot) START_API_FUNC { ContextRef context{GetContextRef()}; - if LIKELY(context) + if(context) [[allikely]] { std::lock_guard<std::mutex> _{context->mEffectSlotLock}; if(LookupEffectSlot(context.get(), effectslot) != nullptr) @@ -443,11 +443,11 @@ AL_API void AL_APIENTRY alAuxiliaryEffectSlotPlaySOFT(ALuint slotid) START_API_FUNC { ContextRef context{GetContextRef()}; - if UNLIKELY(!context) return; + if(!context) [[alunlikely]] return; std::lock_guard<std::mutex> _{context->mEffectSlotLock}; ALeffectslot *slot{LookupEffectSlot(context.get(), slotid)}; - if UNLIKELY(!slot) + if(!slot) [[alunlikely]] { context->setError(AL_INVALID_NAME, "Invalid effect slot ID %u", slotid); return; @@ -467,18 +467,18 @@ AL_API void AL_APIENTRY alAuxiliaryEffectSlotPlayvSOFT(ALsizei n, const ALuint * START_API_FUNC { ContextRef context{GetContextRef()}; - if UNLIKELY(!context) return; + if(!context) [[alunlikely]] return; - if UNLIKELY(n < 0) + if(n < 0) [[alunlikely]] context->setError(AL_INVALID_VALUE, "Playing %d effect slots", n); - if UNLIKELY(n <= 0) return; + if(n <= 0) [[alunlikely]] return; auto slots = al::vector<ALeffectslot*>(static_cast<ALuint>(n)); std::lock_guard<std::mutex> _{context->mEffectSlotLock}; for(size_t i{0};i < slots.size();++i) { ALeffectslot *slot{LookupEffectSlot(context.get(), slotids[i])}; - if UNLIKELY(!slot) + if(!slot) [[alunlikely]] { context->setError(AL_INVALID_NAME, "Invalid effect slot ID %u", slotids[i]); return; @@ -502,11 +502,11 @@ AL_API void AL_APIENTRY alAuxiliaryEffectSlotStopSOFT(ALuint slotid) START_API_FUNC { ContextRef context{GetContextRef()}; - if UNLIKELY(!context) return; + if(!context) [[alunlikely]] return; std::lock_guard<std::mutex> _{context->mEffectSlotLock}; ALeffectslot *slot{LookupEffectSlot(context.get(), slotid)}; - if UNLIKELY(!slot) + if(!slot) [[alunlikely]] { context->setError(AL_INVALID_NAME, "Invalid effect slot ID %u", slotid); return; @@ -521,18 +521,18 @@ AL_API void AL_APIENTRY alAuxiliaryEffectSlotStopvSOFT(ALsizei n, const ALuint * START_API_FUNC { ContextRef context{GetContextRef()}; - if UNLIKELY(!context) return; + if(!context) [[alunlikely]] return; - if UNLIKELY(n < 0) + if(n < 0) [[alunlikely]] context->setError(AL_INVALID_VALUE, "Stopping %d effect slots", n); - if UNLIKELY(n <= 0) return; + if(n <= 0) [[alunlikely]] return; auto slots = al::vector<ALeffectslot*>(static_cast<ALuint>(n)); std::lock_guard<std::mutex> _{context->mEffectSlotLock}; for(size_t i{0};i < slots.size();++i) { ALeffectslot *slot{LookupEffectSlot(context.get(), slotids[i])}; - if UNLIKELY(!slot) + if(!slot) [[alunlikely]] { context->setError(AL_INVALID_NAME, "Invalid effect slot ID %u", slotids[i]); return; @@ -552,12 +552,12 @@ AL_API void AL_APIENTRY alAuxiliaryEffectSloti(ALuint effectslot, ALenum param, START_API_FUNC { ContextRef context{GetContextRef()}; - if UNLIKELY(!context) return; + if(!context) [[alunlikely]] return; std::lock_guard<std::mutex> _{context->mPropLock}; std::lock_guard<std::mutex> __{context->mEffectSlotLock}; ALeffectslot *slot = LookupEffectSlot(context.get(), effectslot); - if UNLIKELY(!slot) + if(!slot) [[alunlikely]] SETERR_RETURN(context, AL_INVALID_NAME,, "Invalid effect slot ID %u", effectslot); ALeffectslot *target{}; @@ -580,12 +580,12 @@ START_API_FUNC err = slot->initEffect(AL_EFFECT_NULL, EffectProps{}, context.get()); } } - if UNLIKELY(err != AL_NO_ERROR) + if(err != AL_NO_ERROR) [[alunlikely]] { context->setError(err, "Effect initialization failed"); return; } - if UNLIKELY(slot->mState == SlotState::Initial) + if(slot->mState == SlotState::Initial) [[alunlikely]] { slot->mPropsDirty = false; slot->updateProps(context.get()); @@ -600,7 +600,7 @@ START_API_FUNC if(!(value == AL_TRUE || value == AL_FALSE)) SETERR_RETURN(context, AL_INVALID_VALUE,, "Effect slot auxiliary send auto out of range"); - if UNLIKELY(slot->AuxSendAuto == !!value) + if(slot->AuxSendAuto == !!value) [[alunlikely]] return; slot->AuxSendAuto = !!value; break; @@ -609,7 +609,7 @@ START_API_FUNC target = LookupEffectSlot(context.get(), static_cast<ALuint>(value)); if(value && !target) SETERR_RETURN(context, AL_INVALID_VALUE,, "Invalid effect slot target ID"); - if UNLIKELY(slot->Target == target) + if(slot->Target == target) [[alunlikely]] return; if(target) { @@ -647,10 +647,10 @@ START_API_FUNC if(ALbuffer *buffer{slot->Buffer}) { - if UNLIKELY(buffer->id == static_cast<ALuint>(value)) + if(buffer->id == static_cast<ALuint>(value)) [[alunlikely]] return; } - else if UNLIKELY(value == 0) + else if(value == 0) [[alunlikely]] return; { @@ -703,11 +703,11 @@ START_API_FUNC } ContextRef context{GetContextRef()}; - if UNLIKELY(!context) return; + if(!context) [[alunlikely]] return; std::lock_guard<std::mutex> _{context->mEffectSlotLock}; ALeffectslot *slot = LookupEffectSlot(context.get(), effectslot); - if UNLIKELY(!slot) + if(!slot) [[alunlikely]] SETERR_RETURN(context, AL_INVALID_NAME,, "Invalid effect slot ID %u", effectslot); switch(param) @@ -723,12 +723,12 @@ AL_API void AL_APIENTRY alAuxiliaryEffectSlotf(ALuint effectslot, ALenum param, START_API_FUNC { ContextRef context{GetContextRef()}; - if UNLIKELY(!context) return; + if(!context) [[alunlikely]] return; std::lock_guard<std::mutex> _{context->mPropLock}; std::lock_guard<std::mutex> __{context->mEffectSlotLock}; ALeffectslot *slot = LookupEffectSlot(context.get(), effectslot); - if UNLIKELY(!slot) + if(!slot) [[alunlikely]] SETERR_RETURN(context, AL_INVALID_NAME,, "Invalid effect slot ID %u", effectslot); switch(param) @@ -736,7 +736,7 @@ START_API_FUNC case AL_EFFECTSLOT_GAIN: if(!(value >= 0.0f && value <= 1.0f)) SETERR_RETURN(context, AL_INVALID_VALUE,, "Effect slot gain out of range"); - if UNLIKELY(slot->Gain == value) + if(slot->Gain == value) [[alunlikely]] return; slot->Gain = value; break; @@ -760,11 +760,11 @@ START_API_FUNC } ContextRef context{GetContextRef()}; - if UNLIKELY(!context) return; + if(!context) [[alunlikely]] return; std::lock_guard<std::mutex> _{context->mEffectSlotLock}; ALeffectslot *slot = LookupEffectSlot(context.get(), effectslot); - if UNLIKELY(!slot) + if(!slot) [[alunlikely]] SETERR_RETURN(context, AL_INVALID_NAME,, "Invalid effect slot ID %u", effectslot); switch(param) @@ -781,11 +781,11 @@ AL_API void AL_APIENTRY alGetAuxiliaryEffectSloti(ALuint effectslot, ALenum para START_API_FUNC { ContextRef context{GetContextRef()}; - if UNLIKELY(!context) return; + if(!context) [[alunlikely]] return; std::lock_guard<std::mutex> _{context->mEffectSlotLock}; ALeffectslot *slot = LookupEffectSlot(context.get(), effectslot); - if UNLIKELY(!slot) + if(!slot) [[alunlikely]] SETERR_RETURN(context, AL_INVALID_NAME,, "Invalid effect slot ID %u", effectslot); switch(param) @@ -833,11 +833,11 @@ START_API_FUNC } ContextRef context{GetContextRef()}; - if UNLIKELY(!context) return; + if(!context) [[alunlikely]] return; std::lock_guard<std::mutex> _{context->mEffectSlotLock}; ALeffectslot *slot = LookupEffectSlot(context.get(), effectslot); - if UNLIKELY(!slot) + if(!slot) [[alunlikely]] SETERR_RETURN(context, AL_INVALID_NAME,, "Invalid effect slot ID %u", effectslot); switch(param) @@ -853,11 +853,11 @@ AL_API void AL_APIENTRY alGetAuxiliaryEffectSlotf(ALuint effectslot, ALenum para START_API_FUNC { ContextRef context{GetContextRef()}; - if UNLIKELY(!context) return; + if(!context) [[alunlikely]] return; std::lock_guard<std::mutex> _{context->mEffectSlotLock}; ALeffectslot *slot = LookupEffectSlot(context.get(), effectslot); - if UNLIKELY(!slot) + if(!slot) [[alunlikely]] SETERR_RETURN(context, AL_INVALID_NAME,, "Invalid effect slot ID %u", effectslot); switch(param) @@ -883,11 +883,11 @@ START_API_FUNC } ContextRef context{GetContextRef()}; - if UNLIKELY(!context) return; + if(!context) [[alunlikely]] return; std::lock_guard<std::mutex> _{context->mEffectSlotLock}; ALeffectslot *slot = LookupEffectSlot(context.get(), effectslot); - if UNLIKELY(!slot) + if(!slot) [[alunlikely]] SETERR_RETURN(context, AL_INVALID_NAME,, "Invalid effect slot ID %u", effectslot); switch(param) diff --git a/al/buffer.cpp b/al/buffer.cpp index d427f214..77b484d0 100644 --- a/al/buffer.cpp +++ b/al/buffer.cpp @@ -1766,7 +1766,7 @@ START_API_FUNC continue; const auto al_buffer = LookupBuffer(device, buffer); - if (!al_buffer) + if(!al_buffer) [[alunlikely]] { ERR(EAX_PREFIX "Invalid buffer ID %u.\n", buffer); return ALC_FALSE; @@ -1782,7 +1782,7 @@ START_API_FUNC * buffer ID is specified multiple times in the provided list, it * counts each instance as more memory that needs to fit in X-RAM. */ - if(unlikely(std::numeric_limits<size_t>::max()-al_buffer->OriginalSize < total_needed)) + if(std::numeric_limits<size_t>::max()-al_buffer->OriginalSize < total_needed) [[alunlikely]] { context->setError(AL_OUT_OF_MEMORY, EAX_PREFIX "Buffer size overflow (%u + %zu)\n", al_buffer->OriginalSize, total_needed); diff --git a/al/error.cpp b/al/error.cpp index 90671011..5817e153 100644 --- a/al/error.cpp +++ b/al/error.cpp @@ -85,7 +85,7 @@ AL_API ALenum AL_APIENTRY alGetError(void) START_API_FUNC { ContextRef context{GetContextRef()}; - if(unlikely(!context)) + if(!context) [[alunlikely]] { static constexpr ALenum deferror{AL_INVALID_OPERATION}; WARN("Querying error state on null context (implicitly 0x%04x)\n", deferror); diff --git a/al/event.cpp b/al/event.cpp index e5923c43..1e31a144 100644 --- a/al/event.cpp +++ b/al/event.cpp @@ -35,7 +35,7 @@ static int EventThread(ALCcontext *context) { RingBuffer *ring{context->mAsyncEvents.get()}; bool quitnow{false}; - while(likely(!quitnow)) + while(!quitnow) [[allikely]] { auto evt_data = ring->getReadVector().first; if(evt_data.len == 0) @@ -55,7 +55,7 @@ static int EventThread(ALCcontext *context) ring->readAdvance(1); quitnow = evt.EnumType == AsyncEvent::KillThread; - if(unlikely(quitnow)) break; + if(quitnow) [[alunlikely]] break; if(evt.EnumType == AsyncEvent::ReleaseEffectState) { @@ -155,7 +155,7 @@ AL_API void AL_APIENTRY alEventControlSOFT(ALsizei count, const ALenum *types, A START_API_FUNC { ContextRef context{GetContextRef()}; - if(unlikely(!context)) return; + if(!context) [[alunlikely]] return; if(count < 0) context->setError(AL_INVALID_VALUE, "Controlling %d events", count); if(count <= 0) return; @@ -210,7 +210,7 @@ AL_API void AL_APIENTRY alEventCallbackSOFT(ALEVENTPROCSOFT callback, void *user START_API_FUNC { ContextRef context{GetContextRef()}; - if(unlikely(!context)) return; + if(!context) [[alunlikely]] return; std::lock_guard<std::mutex> _{context->mPropLock}; std::lock_guard<std::mutex> __{context->mEventCbLock}; diff --git a/al/extension.cpp b/al/extension.cpp index 5dda2a86..4327b082 100644 --- a/al/extension.cpp +++ b/al/extension.cpp @@ -37,9 +37,9 @@ AL_API ALboolean AL_APIENTRY alIsExtensionPresent(const ALchar *extName) START_API_FUNC { ContextRef context{GetContextRef()}; - if(unlikely(!context)) return AL_FALSE; + if(!context) [[alunlikely]] return AL_FALSE; - if(!extName) + if(!extName) [[alunlikely]] SETERR_RETURN(context, AL_INVALID_VALUE, AL_FALSE, "NULL pointer"); size_t len{strlen(extName)}; diff --git a/al/source.cpp b/al/source.cpp index c0ad3b81..1babfb2e 100644 --- a/al/source.cpp +++ b/al/source.cpp @@ -110,8 +110,8 @@ void UpdateSourceProps(const ALsource *source, Voice *voice, ALCcontext *context VoicePropsItem *next; do { next = props->next.load(std::memory_order_relaxed); - } while(unlikely(context->mFreeVoiceProps.compare_exchange_weak(props, next, - std::memory_order_acq_rel, std::memory_order_acquire) == false)); + } while(context->mFreeVoiceProps.compare_exchange_weak(props, next, + std::memory_order_acq_rel, std::memory_order_acquire) == false); props->Pitch = source->Pitch; props->Gain = source->Gain; @@ -611,7 +611,7 @@ bool SetVoiceOffset(Voice *oldvoice, const VoicePos &vpos, ALsource *source, ALC } ++vidx; } - if(unlikely(!newvoice)) + if(!newvoice) [[alunlikely]] { auto &allvoices = *context->mVoices.load(std::memory_order_relaxed); if(allvoices.size() == voicelist.size()) @@ -2440,7 +2440,7 @@ void StartSources(ALCcontext *context, const al::span<ALsource*> srchandles, /* If the device is disconnected, and voices stop on disconnect, go right * to stopped. */ - if(unlikely(!device->Connected.load(std::memory_order_acquire))) + if(!device->Connected.load(std::memory_order_acquire)) [[alunlikely]] { if(context->mStopVoicesOnDisconnect.load(std::memory_order_acquire)) { @@ -2466,7 +2466,7 @@ void StartSources(ALCcontext *context, const al::span<ALsource*> srchandles, if(free_voices == srchandles.size()) break; } - if(unlikely(srchandles.size() != free_voices)) + if(srchandles.size() != free_voices) [[alunlikely]] { const size_t inc_amount{srchandles.size() - free_voices}; auto &allvoices = *context->mVoices.load(std::memory_order_relaxed); @@ -2495,7 +2495,7 @@ void StartSources(ALCcontext *context, const al::span<ALsource*> srchandles, } /* If there's nothing to play, go right to stopped. */ - if(unlikely(BufferList == source->mQueue.end())) + if(BufferList == source->mQueue.end()) [[alunlikely]] { /* NOTE: A source without any playable buffers should not have a * Voice since it shouldn't be in a playing or paused state. So @@ -2600,7 +2600,7 @@ void StartSources(ALCcontext *context, const al::span<ALsource*> srchandles, cur->mSourceID = source->id; cur->mState = VChangeState::Play; } - if(likely(tail)) + if(tail) [[allikely]] SendVoiceChanges(context, tail); } @@ -3220,9 +3220,9 @@ void AL_APIENTRY alSourcePlayAtTimeSOFT(ALuint source, ALint64SOFT start_time) START_API_FUNC { ContextRef context{GetContextRef()}; - if UNLIKELY(!context) return; + if(!context) [[alunlikely]] return; - if(unlikely(start_time < 0)) + if(start_time < 0) [[alunlikely]] SETERR_RETURN(context, AL_INVALID_VALUE,, "Invalid time point %" PRId64, start_time); std::lock_guard<std::mutex> _{context->mSourceLock}; @@ -3238,16 +3238,16 @@ AL_API void AL_APIENTRY alSourcePlayv(ALsizei n, const ALuint *sources) START_API_FUNC { ContextRef context{GetContextRef()}; - if UNLIKELY(!context) return; + if(!context) [[alunlikely]] return; - if UNLIKELY(n < 0) + if(n < 0) [[alunlikely]] context->setError(AL_INVALID_VALUE, "Playing %d sources", n); - if UNLIKELY(n <= 0) return; + if(n <= 0) [[alunlikely]] return; al::vector<ALsource*> extra_sources; std::array<ALsource*,8> source_storage; al::span<ALsource*> srchandles; - if LIKELY(static_cast<ALuint>(n) <= source_storage.size()) + if(static_cast<ALuint>(n) <= source_storage.size()) [[allikely]] srchandles = {source_storage.data(), static_cast<ALuint>(n)}; else { @@ -3259,7 +3259,7 @@ START_API_FUNC for(auto &srchdl : srchandles) { srchdl = LookupSource(context.get(), *sources); - if(!srchdl) + if(!srchdl) [[alunlikely]] SETERR_RETURN(context, AL_INVALID_NAME,, "Invalid source ID %u", *sources); ++sources; } @@ -3272,13 +3272,13 @@ void AL_APIENTRY alSourcePlayAtTimevSOFT(ALsizei n, const ALuint *sources, ALint START_API_FUNC { ContextRef context{GetContextRef()}; - if UNLIKELY(!context) return; + if(!context) [[alunlikely]] return; - if UNLIKELY(n < 0) + if(n < 0) [[alunlikely]] context->setError(AL_INVALID_VALUE, "Playing %d sources", n); - if UNLIKELY(n <= 0) return; + if(n <= 0) [[alunlikely]] return; - if(unlikely(start_time < 0)) + if(start_time < 0) [[alunlikely]] SETERR_RETURN(context, AL_INVALID_VALUE,, "Invalid time point %" PRId64, start_time); al::vector<ALsource*> extra_sources; |