From cf4a848fd0c42e85e5ce68e33120386d932e6375 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Thu, 16 Apr 2020 16:00:26 -0700 Subject: Remove an always-true return value --- alc/effects/reverb.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'alc') diff --git a/alc/effects/reverb.cpp b/alc/effects/reverb.cpp index b328a790..ac950731 100644 --- a/alc/effects/reverb.cpp +++ b/alc/effects/reverb.cpp @@ -516,7 +516,7 @@ struct ReverbState final : public EffectState { } } - bool allocLines(const float frequency); + void allocLines(const float frequency); void updateDelayLine(const float earlyDelay, const float lateDelay, const float density, const float decayTime, const float frequency); @@ -549,7 +549,7 @@ inline float CalcDelayLengthMult(float density) * for all lines given the sample rate (frequency). If an allocation failure * occurs, it returns AL_FALSE. */ -bool ReverbState::allocLines(const float frequency) +void ReverbState::allocLines(const float frequency) { /* All delay line lengths are calculated to accomodate the full range of * lengths given their respective paramters. @@ -608,8 +608,6 @@ bool ReverbState::allocLines(const float frequency) mEarly.Delay.realizeLineOffset(mSampleBuffer.data()); mLate.VecAp.Delay.realizeLineOffset(mSampleBuffer.data()); mLate.Delay.realizeLineOffset(mSampleBuffer.data()); - - return true; } bool ReverbState::deviceUpdate(const ALCdevice *device) @@ -617,8 +615,7 @@ bool ReverbState::deviceUpdate(const ALCdevice *device) const auto frequency = static_cast(device->Frequency); /* Allocate the delay lines. */ - if(!allocLines(frequency)) - return false; + allocLines(frequency); const float multiplier{CalcDelayLengthMult(AL_EAXREVERB_MAX_DENSITY)}; @@ -746,8 +743,8 @@ float CalcLimitedHfRatio(const float hfRatio, const float airAbsorptionGainHF, * equation, solve for HF ratio. The delay length is cancelled out of * the equation, so it can be calculated once for all lines. */ - float limitRatio{1.0f / CalcDecayLength(airAbsorptionGainHF, decayTime) / - SPEEDOFSOUNDMETRESPERSEC}; + float limitRatio{1.0f / SPEEDOFSOUNDMETRESPERSEC / + CalcDecayLength(airAbsorptionGainHF, decayTime)}; /* Using the limit calculated above, apply the upper bound to the HF ratio. */ -- cgit v1.2.3