From 6699f3cf1cd563814ec5c4513613d588a05e2941 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Thu, 12 Sep 2019 04:17:21 -0700 Subject: Use unsigned channel indices --- alc/effects/dedicated.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'alc/effects/dedicated.cpp') diff --git a/alc/effects/dedicated.cpp b/alc/effects/dedicated.cpp index 02fdcc78..aa81e13b 100644 --- a/alc/effects/dedicated.cpp +++ b/alc/effects/dedicated.cpp @@ -58,8 +58,9 @@ void DedicatedState::update(const ALCcontext*, const ALeffectslot *slot, const E if(slot->Params.EffectType == AL_EFFECT_DEDICATED_LOW_FREQUENCY_EFFECT) { - const int idx{!target.RealOut ? -1 : GetChannelIdxByName(*target.RealOut, LFE)}; - if(idx != -1) + const ALuint idx{!target.RealOut ? INVALID_CHANNEL_INDEX : + GetChannelIdxByName(*target.RealOut, LFE)}; + if(idx != INVALID_CHANNEL_INDEX) { mOutTarget = target.RealOut->Buffer; mTargetGains[idx] = Gain; @@ -69,8 +70,9 @@ void DedicatedState::update(const ALCcontext*, const ALeffectslot *slot, const E { /* Dialog goes to the front-center speaker if it exists, otherwise it * plays from the front-center location. */ - const int idx{!target.RealOut ? -1 : GetChannelIdxByName(*target.RealOut, FrontCenter)}; - if(idx != -1) + const ALuint idx{!target.RealOut ? INVALID_CHANNEL_INDEX : + GetChannelIdxByName(*target.RealOut, FrontCenter)}; + if(idx != INVALID_CHANNEL_INDEX) { mOutTarget = target.RealOut->Buffer; mTargetGains[idx] = Gain; -- cgit v1.2.3