diff options
author | Sven Gothel <[email protected]> | 2023-05-03 16:17:49 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2023-05-03 16:17:49 +0200 |
commit | ec167fd05661a5b02dd406c87081f84a0f8dd77d (patch) | |
tree | 9c4669e471c9969bda59265381b18d2d416db060 /al/error.cpp | |
parent | 0d14d30808cfe7b9e3413353e3eef8a0f201399a (diff) | |
parent | d3875f333fb6abe2f39d82caca329414871ae53b (diff) |
Merge branch 'v1.23.1'
Resolved Conflicts:
CMakeLists.txt
Diffstat (limited to 'al/error.cpp')
-rw-r--r-- | al/error.cpp | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/al/error.cpp b/al/error.cpp index b667d14f..afa7019a 100644 --- a/al/error.cpp +++ b/al/error.cpp @@ -35,12 +35,10 @@ #include "AL/al.h" #include "AL/alc.h" -#include "alcontext.h" -#include "alexcpt.h" +#include "alc/context.h" #include "almalloc.h" -#include "event.h" -#include "inprogext.h" -#include "logging.h" +#include "core/except.h" +#include "core/logging.h" #include "opthelpers.h" #include "vector.h" @@ -65,7 +63,6 @@ void ALCcontext::setError(ALenum errorCode, const char *msg, ...) if(msglen >= 0) msg = message.data(); else msg = "<internal error constructing message>"; - msglen = static_cast<int>(strlen(msg)); WARN("Error generated on context %p, code 0x%04x, \"%s\"\n", decltype(std::declval<void*>()){this}, errorCode, msg); @@ -82,23 +79,15 @@ void ALCcontext::setError(ALenum errorCode, const char *msg, ...) ALenum curerr{AL_NO_ERROR}; mLastError.compare_exchange_strong(curerr, errorCode); - if((mEnabledEvts.load(std::memory_order_relaxed)&EventType_Error)) - { - std::lock_guard<std::mutex> _{mEventCbLock}; - ALbitfieldSOFT enabledevts{mEnabledEvts.load(std::memory_order_relaxed)}; - if((enabledevts&EventType_Error) && mEventCb) - (*mEventCb)(AL_EVENT_TYPE_ERROR_SOFT, 0, static_cast<ALuint>(errorCode), msglen, msg, - mEventParam); - } } AL_API ALenum AL_APIENTRY alGetError(void) START_API_FUNC { ContextRef context{GetContextRef()}; - if UNLIKELY(!context) + if(!context) UNLIKELY { - constexpr ALenum deferror{AL_INVALID_OPERATION}; + static constexpr ALenum deferror{AL_INVALID_OPERATION}; WARN("Querying error state on null context (implicitly 0x%04x)\n", deferror); if(TrapALError) { |