diff options
Diffstat (limited to 'al')
-rw-r--r-- | al/auxeffectslot.cpp | 2 | ||||
-rw-r--r-- | al/source.cpp | 12 |
2 files changed, 7 insertions, 7 deletions
diff --git a/al/auxeffectslot.cpp b/al/auxeffectslot.cpp index c1577679..c33fb149 100644 --- a/al/auxeffectslot.cpp +++ b/al/auxeffectslot.cpp @@ -915,7 +915,7 @@ END_API_FUNC ALeffectslot::ALeffectslot() { EffectStateFactory *factory{getFactoryByType(EffectSlotType::None)}; - assert(factory != nullptr); + if(!factory) throw std::runtime_error{"Failed to get null effect factory"}; al::intrusive_ptr<EffectState> state{factory->create()}; Effect.State = state; diff --git a/al/source.cpp b/al/source.cpp index ea3a4de7..dee4af2a 100644 --- a/al/source.cpp +++ b/al/source.cpp @@ -266,7 +266,7 @@ double GetSourceSecOffset(ALsource *Source, ALCcontext *context, nanoseconds *cl BufferFmt = BufferList->mBuffer; ++BufferList; } - assert(BufferFmt != nullptr); + ASSUME(BufferFmt != nullptr); return static_cast<double>(readPos) / double{MixerFracOne} / BufferFmt->mSampleRate; } @@ -315,7 +315,7 @@ double GetSourceOffset(ALsource *Source, ALenum name, ALCcontext *context) BufferFmt = BufferList->mBuffer; ++BufferList; } - assert(BufferFmt != nullptr); + ASSUME(BufferFmt != nullptr); double offset{}; switch(name) @@ -375,7 +375,7 @@ double GetSourceLength(const ALsource *source, ALenum name) if(length == 0) return 0.0; - assert(BufferFmt != nullptr); + ASSUME(BufferFmt != nullptr); switch(name) { case AL_SEC_LENGTH_SOFT: @@ -585,7 +585,7 @@ bool SetVoiceOffset(Voice *oldvoice, const VoicePos &vpos, ALsource *source, ALC } ++vidx; } - if UNLIKELY(!newvoice) + if(unlikely(!newvoice)) { auto &allvoices = *context->mVoices.load(std::memory_order_relaxed); if(allvoices.size() == voicelist.size()) @@ -605,7 +605,7 @@ bool SetVoiceOffset(Voice *oldvoice, const VoicePos &vpos, ALsource *source, ALC } ++vidx; } - assert(newvoice != nullptr); + ASSUME(newvoice != nullptr); } /* Initialize the new voice and set its starting offset. @@ -3169,7 +3169,7 @@ START_API_FUNC break; } } - assert(voice != nullptr); + ASSUME(voice != nullptr); voice->mPosition.store(0u, std::memory_order_relaxed); voice->mPositionFrac.store(0, std::memory_order_relaxed); |