diff options
author | Chris Robinson <[email protected]> | 2023-05-22 02:25:30 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2023-05-22 02:25:30 -0700 |
commit | eca86489e422f00d96ce59a5c53fa45bdcea593e (patch) | |
tree | 023fafac55d3dc6888021fccf444f0e0990f3b83 /al/auxeffectslot.cpp | |
parent | 586b725cc37345601f01473dcc622241ee80d174 (diff) |
Make the API functions noexcept
Only relevant for C++, but these functions can't throw as it's a C-based API.
Letting the compiler know that helps improve code generation. Extension
callbacks must also not let exceptions leave the callback, or else Bad Things
can happen.
The macro AL_DISABLE_NOEXCEPT may be defined before including the headers to
not mark functions as noexcept, but this should only be done if the caller
can't otherwise be fixed.
Diffstat (limited to 'al/auxeffectslot.cpp')
-rw-r--r-- | al/auxeffectslot.cpp | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/al/auxeffectslot.cpp b/al/auxeffectslot.cpp index acc05f94..8fd158e8 100644 --- a/al/auxeffectslot.cpp +++ b/al/auxeffectslot.cpp @@ -420,8 +420,7 @@ FORCE_ALIGN ALboolean AL_APIENTRY alIsAuxiliaryEffectSlotDirect(ALCcontext *cont } -AL_API void AL_APIENTRY alAuxiliaryEffectSlotPlaySOFT(ALuint slotid) -START_API_FUNC +AL_API void AL_APIENTRY alAuxiliaryEffectSlotPlaySOFT(ALuint slotid) noexcept { ContextRef context{GetContextRef()}; if(!context) UNLIKELY return; @@ -442,10 +441,8 @@ START_API_FUNC AddActiveEffectSlots({&slot, 1}, context.get()); slot->mState = SlotState::Playing; } -END_API_FUNC -AL_API void AL_APIENTRY alAuxiliaryEffectSlotPlayvSOFT(ALsizei n, const ALuint *slotids) -START_API_FUNC +AL_API void AL_APIENTRY alAuxiliaryEffectSlotPlayvSOFT(ALsizei n, const ALuint *slotids) noexcept { ContextRef context{GetContextRef()}; if(!context) UNLIKELY return; @@ -477,10 +474,8 @@ START_API_FUNC for(auto slot : slots) slot->mState = SlotState::Playing; } -END_API_FUNC -AL_API void AL_APIENTRY alAuxiliaryEffectSlotStopSOFT(ALuint slotid) -START_API_FUNC +AL_API void AL_APIENTRY alAuxiliaryEffectSlotStopSOFT(ALuint slotid) noexcept { ContextRef context{GetContextRef()}; if(!context) UNLIKELY return; @@ -496,10 +491,8 @@ START_API_FUNC RemoveActiveEffectSlots({&slot, 1}, context.get()); slot->mState = SlotState::Stopped; } -END_API_FUNC -AL_API void AL_APIENTRY alAuxiliaryEffectSlotStopvSOFT(ALsizei n, const ALuint *slotids) -START_API_FUNC +AL_API void AL_APIENTRY alAuxiliaryEffectSlotStopvSOFT(ALsizei n, const ALuint *slotids) noexcept { ContextRef context{GetContextRef()}; if(!context) UNLIKELY return; @@ -526,7 +519,6 @@ START_API_FUNC for(auto slot : slots) slot->mState = SlotState::Stopped; } -END_API_FUNC FORCE_ALIGN void AL_APIENTRY alAuxiliaryEffectSlotiDirect(ALCcontext *context, ALuint effectslot, |