diff options
author | Filip Gawin <[email protected]> | 2019-01-08 19:42:44 +0100 |
---|---|---|
committer | Filip Gawin <[email protected]> | 2019-01-08 19:42:44 +0100 |
commit | 0d3a0635d946ab1f43fd98cec4882248bc990846 (patch) | |
tree | f9cade218fe90b815bf1b529607fadd7bfa0f656 /Alc/effects/chorus.cpp | |
parent | 2a7f27ca58f9897be06fe815a46ea76a01734a0b (diff) |
Avoid using old style casts
To think about:
examples/alffplay.cpp:600
OpenAL32/Include/alMain.h:295
Diffstat (limited to 'Alc/effects/chorus.cpp')
-rw-r--r-- | Alc/effects/chorus.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Alc/effects/chorus.cpp b/Alc/effects/chorus.cpp index 1132a33a..990b3cc4 100644 --- a/Alc/effects/chorus.cpp +++ b/Alc/effects/chorus.cpp @@ -141,7 +141,7 @@ void ChorusState::update(const ALCcontext *Context, const ALeffectslot *Slot, co const ALCdevice *device{Context->Device}; auto frequency = static_cast<ALfloat>(device->Frequency); mDelay = maxi(float2int(props->Chorus.Delay*frequency*FRACTIONONE + 0.5f), mindelay); - mDepth = minf(props->Chorus.Depth * mDelay, (ALfloat)(mDelay - mindelay)); + mDepth = minf(props->Chorus.Depth * mDelay, static_cast<ALfloat>(mDelay - mindelay)); mFeedback = props->Chorus.Feedback; @@ -168,9 +168,9 @@ void ChorusState::update(const ALCcontext *Context, const ALeffectslot *Slot, co /* Calculate LFO coefficient (number of samples per cycle). Limit the * max range to avoid overflow when calculating the displacement. */ - ALsizei lfo_range = float2int(minf(frequency/rate + 0.5f, (ALfloat)(INT_MAX/360 - 180))); + ALsizei lfo_range = float2int(minf(frequency/rate + 0.5f, static_cast<ALfloat>(INT_MAX/360 - 180))); - mLfoOffset = float2int((ALfloat)mLfoOffset/mLfoRange*lfo_range + 0.5f) % lfo_range; + mLfoOffset = float2int(static_cast<ALfloat>(mLfoOffset)/mLfoRange*lfo_range + 0.5f) % lfo_range; mLfoRange = lfo_range; switch(mWaveform) { |