diff options
Diffstat (limited to 'OpenAL32/alError.c')
-rw-r--r-- | OpenAL32/alError.c | 37 |
1 files changed, 17 insertions, 20 deletions
diff --git a/OpenAL32/alError.c b/OpenAL32/alError.c index 0ffb5e6b..f6c430a2 100644 --- a/OpenAL32/alError.c +++ b/OpenAL32/alError.c @@ -26,32 +26,29 @@ ALAPI ALenum ALAPIENTRY alGetError(ALvoid) { - ALCcontext *Context; - ALenum errorCode; + ALCcontext *Context; + ALenum errorCode; - Context = GetContextSuspended(); + Context = GetContextSuspended(); + if(!Context) return AL_INVALID_OPERATION; - if (Context) - { - errorCode = Context->LastError; - Context->LastError = AL_NO_ERROR; - } - else - errorCode = AL_INVALID_OPERATION; + errorCode = Context->LastError; + Context->LastError = AL_NO_ERROR; - ProcessContext(Context); + ProcessContext(Context); - return errorCode; + return errorCode; } ALvoid alSetError(ALenum errorCode) { - ALCcontext *Context; - - Context=GetContextSuspended(); - - if (Context && Context->LastError == AL_NO_ERROR) - Context->LastError = errorCode; - - ProcessContext(Context); + ALCcontext *Context; + + Context = GetContextSuspended(); + if(Context) + { + if(Context->LastError == AL_NO_ERROR) + Context->LastError = errorCode; + ProcessContext(Context); + } } |