From 23703ff40fdcb56ff4bca76a3c60a250ae61add6 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Tue, 19 Mar 2013 07:38:42 -0700 Subject: Avoid an unnecessary size variable --- OpenAL32/alEffect.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'OpenAL32/alEffect.c') diff --git a/OpenAL32/alEffect.c b/OpenAL32/alEffect.c index 07bbaa8e..2739ad5e 100644 --- a/OpenAL32/alEffect.c +++ b/OpenAL32/alEffect.c @@ -654,11 +654,10 @@ static const struct { DECL(SMALLWATERROOM), }; #undef DECL -static const ALsizei reverblistsize = COUNTOF(reverblist); ALvoid LoadReverbPreset(const char *name, ALeffect *effect) { - int i; + size_t i; if(strcasecmp(name, "NONE") == 0) { @@ -673,7 +672,7 @@ ALvoid LoadReverbPreset(const char *name, ALeffect *effect) InitEffectParams(effect, AL_EFFECT_REVERB); else InitEffectParams(effect, AL_EFFECT_NULL); - for(i = 0;i < reverblistsize;i++) + for(i = 0;i < COUNTOF(reverblist);i++) { const EFXEAXREVERBPROPERTIES *props; @@ -709,8 +708,8 @@ ALvoid LoadReverbPreset(const char *name, ALeffect *effect) effect->Reverb.LFReference = props->flLFReference; effect->Reverb.RoomRolloffFactor = props->flRoomRolloffFactor; effect->Reverb.DecayHFLimit = props->iDecayHFLimit; - break; + return; } - if(i == reverblistsize) - WARN("Reverb preset '%s' not found\n", name); + + WARN("Reverb preset '%s' not found\n", name); } -- cgit v1.2.3