diff options
author | Chris Robinson <[email protected]> | 2019-01-06 04:16:51 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2019-01-06 04:16:51 -0800 |
commit | da3a916042a7ba9426af1d6f03e689dbd7760191 (patch) | |
tree | ab6cfc0d2fd26504a013989af7ecd399a4034914 /Alc/effects/fshifter.cpp | |
parent | 98f3e6a16295029129193a073680a70c034703dd (diff) |
Replace macros with constexpr inline functions
Diffstat (limited to 'Alc/effects/fshifter.cpp')
-rw-r--r-- | Alc/effects/fshifter.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Alc/effects/fshifter.cpp b/Alc/effects/fshifter.cpp index 9b8499cf..c444872c 100644 --- a/Alc/effects/fshifter.cpp +++ b/Alc/effects/fshifter.cpp @@ -52,7 +52,7 @@ std::array<ALdouble,HIL_SIZE> InitHannWindow(void) /* Create lookup table of the Hann window for the desired size, i.e. HIL_SIZE */ for(ALsizei i{0};i < HIL_SIZE>>1;i++) { - ALdouble val = std::sin(M_PI * (ALdouble)i / (ALdouble)(HIL_SIZE-1)); + ALdouble val = std::sin(al::MathDefs<double>::Pi() * i / ALdouble{HIL_SIZE-1}); ret[i] = ret[HIL_SIZE-1-i] = val * val; } return ret; @@ -140,13 +140,13 @@ void ALfshifterState::update(const ALCcontext *context, const ALeffectslot *slot void ALfshifterState::process(ALsizei SamplesToDo, const ALfloat (*RESTRICT SamplesIn)[BUFFERSIZE], ALfloat (*RESTRICT SamplesOut)[BUFFERSIZE], ALsizei NumChannels) { - static const complex_d complex_zero{0.0, 0.0}; + static constexpr complex_d complex_zero{0.0, 0.0}; ALfloat *RESTRICT BufferOut = mBufferOut; ALsizei j, k, base; for(base = 0;base < SamplesToDo;) { - ALsizei todo = mini(HIL_SIZE-mCount, SamplesToDo-base); + const ALsizei todo{mini(HIL_SIZE-mCount, SamplesToDo-base)}; ASSUME(todo > 0); @@ -189,7 +189,7 @@ void ALfshifterState::process(ALsizei SamplesToDo, const ALfloat (*RESTRICT Samp /* Process frequency shifter using the analytic signal obtained. */ for(k = 0;k < SamplesToDo;k++) { - double phase = mPhase * ((1.0/FRACTIONONE) * 2.0*M_PI); + double phase = mPhase * ((1.0/FRACTIONONE) * al::MathDefs<double>::Tau()); BufferOut[k] = (float)(mOutdata[k].real()*std::cos(phase) + mOutdata[k].imag()*std::sin(phase)*mLdSign); |