aboutsummaryrefslogtreecommitdiffstats
path: root/alc/effects/echo.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2019-09-14 16:55:28 -0700
committerChris Robinson <[email protected]>2019-09-14 18:35:23 -0700
commit2c348cecb68bd3a71d388547d6b3330f9cebbfad (patch)
tree445e6387a7356da79c93db166ca8da057a0a0cfc /alc/effects/echo.cpp
parent1c45b1791b784fb9b70e8c6ce8a1ea158e9004ff (diff)
Fix some more implicit conversions noted by GCC
Diffstat (limited to 'alc/effects/echo.cpp')
-rw-r--r--alc/effects/echo.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/alc/effects/echo.cpp b/alc/effects/echo.cpp
index 47c0fedb..a9213df5 100644
--- a/alc/effects/echo.cpp
+++ b/alc/effects/echo.cpp
@@ -66,10 +66,12 @@ struct EchoState final : public EffectState {
ALboolean EchoState::deviceUpdate(const ALCdevice *Device)
{
+ const auto frequency = static_cast<float>(Device->Frequency);
+
// Use the next power of 2 for the buffer length, so the tap offsets can be
// wrapped using a mask instead of a modulo
- const ALuint maxlen{NextPowerOf2(float2uint(AL_ECHO_MAX_DELAY*Device->Frequency + 0.5f) +
- float2uint(AL_ECHO_MAX_LRDELAY*Device->Frequency + 0.5f))};
+ const ALuint maxlen{NextPowerOf2(float2uint(AL_ECHO_MAX_DELAY*frequency + 0.5f) +
+ float2uint(AL_ECHO_MAX_LRDELAY*frequency + 0.5f))};
if(maxlen != mSampleBuffer.size())
{
mSampleBuffer.resize(maxlen);