diff options
author | Chris Robinson <[email protected]> | 2010-09-21 16:54:33 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2010-09-21 16:54:33 -0700 |
commit | 97daaade8a123a8bcac52752febbca9f1d43b0aa (patch) | |
tree | 70d3c92437ea6d65ec73065472d0d96825784347 /OpenAL32/alAuxEffectSlot.c | |
parent | 8a1d5a21c3b569424bdbe5b92d9e53aab00a60c6 (diff) |
Reduce some more indentation
Diffstat (limited to 'OpenAL32/alAuxEffectSlot.c')
-rw-r--r-- | OpenAL32/alAuxEffectSlot.c | 49 |
1 files changed, 25 insertions, 24 deletions
diff --git a/OpenAL32/alAuxEffectSlot.c b/OpenAL32/alAuxEffectSlot.c index dfc0ad18..5d86409f 100644 --- a/OpenAL32/alAuxEffectSlot.c +++ b/OpenAL32/alAuxEffectSlot.c @@ -104,52 +104,53 @@ AL_API ALvoid AL_APIENTRY alDeleteAuxiliaryEffectSlots(ALsizei n, ALuint *effect { ALCcontext *Context; ALeffectslot *EffectSlot; + ALboolean SlotsValid = AL_FALSE; ALsizei i; Context = GetContextSuspended(); if(!Context) return; - if (n >= 0) + if(n < 0) + alSetError(Context, AL_INVALID_VALUE); + else { + SlotsValid = AL_TRUE; // Check that all effectslots are valid - for (i = 0; i < n; i++) + for(i = 0;i < n;i++) { if((EffectSlot=LookupEffectSlot(Context->EffectSlotMap, effectslots[i])) == NULL) { alSetError(Context, AL_INVALID_NAME); + SlotsValid = AL_FALSE; break; } - else + else if(EffectSlot->refcount > 0) { - if(EffectSlot->refcount > 0) - { - alSetError(Context, AL_INVALID_NAME); - break; - } + alSetError(Context, AL_INVALID_NAME); + SlotsValid = AL_FALSE; + break; } } + } - if (i == n) + if(SlotsValid) + { + // All effectslots are valid + for(i = 0;i < n;i++) { - // All effectslots are valid - for (i = 0; i < n; i++) - { - // Recheck that the effectslot is valid, because there could be duplicated names - if((EffectSlot=LookupEffectSlot(Context->EffectSlotMap, effectslots[i])) != NULL) - { - ALEffect_Destroy(EffectSlot->EffectState); + // Recheck that the effectslot is valid, because there could be duplicated names + if((EffectSlot=LookupEffectSlot(Context->EffectSlotMap, effectslots[i])) == NULL) + continue; - RemoveUIntMapKey(&Context->EffectSlotMap, EffectSlot->effectslot); - ALTHUNK_REMOVEENTRY(EffectSlot->effectslot); + ALEffect_Destroy(EffectSlot->EffectState); - memset(EffectSlot, 0, sizeof(ALeffectslot)); - free(EffectSlot); - } - } + RemoveUIntMapKey(&Context->EffectSlotMap, EffectSlot->effectslot); + ALTHUNK_REMOVEENTRY(EffectSlot->effectslot); + + memset(EffectSlot, 0, sizeof(ALeffectslot)); + free(EffectSlot); } } - else - alSetError(Context, AL_INVALID_VALUE); ProcessContext(Context); } |