From fa64b1fd6d48165d1e028d1ec96174c3b7fc6341 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sat, 14 Sep 2019 10:59:02 -0700 Subject: Fix implicit conversions in the effects --- alc/effects/pshifter.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'alc/effects/pshifter.cpp') diff --git a/alc/effects/pshifter.cpp b/alc/effects/pshifter.cpp index 9d011b12..a4d66706 100644 --- a/alc/effects/pshifter.cpp +++ b/alc/effects/pshifter.cpp @@ -55,9 +55,9 @@ std::array InitHannWindow() { std::array ret; /* Create lookup table of the Hann window for the desired size, i.e. HIL_SIZE */ - for(ALsizei i{0};i < STFT_SIZE>>1;i++) + for(size_t i{0};i < STFT_SIZE>>1;i++) { - ALdouble val = std::sin(al::MathDefs::Pi() * i / ALdouble{STFT_SIZE-1}); + const double val{std::sin(al::MathDefs::Pi() * i / ALdouble{STFT_SIZE-1})}; ret[i] = ret[STFT_SIZE-1-i] = val * val; } return ret; @@ -93,7 +93,7 @@ inline complex_d polar2rect(const ALphasor &number) struct PshifterState final : public EffectState { /* Effect parameters */ size_t mCount; - ALsizei mPitchShiftI; + ALuint mPitchShiftI; ALfloat mPitchShift; ALfloat mFreqPerBin; @@ -151,7 +151,7 @@ void PshifterState::update(const ALCcontext*, const ALeffectslot *slot, const Ef const float pitch{std::pow(2.0f, static_cast(props->Pshifter.CoarseTune*100 + props->Pshifter.FineTune) / 1200.0f )}; - mPitchShiftI = fastf2i(pitch*FRACTIONONE); + mPitchShiftI = fastf2u(pitch*FRACTIONONE); mPitchShift = mPitchShiftI * (1.0f/FRACTIONONE); ALfloat coeffs[MAX_AMBI_CHANNELS]; -- cgit v1.2.3