diff options
author | Chris Robinson <[email protected]> | 2019-08-20 14:30:04 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2019-08-20 14:30:04 -0700 |
commit | bb46cec0b1acd8848774aedba45adb929108fa8e (patch) | |
tree | 7439cd8bddebc7c52e34105dac4dd0fccc647fd2 /alc/effects/fshifter.cpp | |
parent | 3e499e70fd947e6c4487f9496c1647909a61586f (diff) |
Pass samplesToDo as size_t to effects
Diffstat (limited to 'alc/effects/fshifter.cpp')
-rw-r--r-- | alc/effects/fshifter.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/alc/effects/fshifter.cpp b/alc/effects/fshifter.cpp index 638325ec..6983ae42 100644 --- a/alc/effects/fshifter.cpp +++ b/alc/effects/fshifter.cpp @@ -61,7 +61,7 @@ alignas(16) const std::array<ALdouble,HIL_SIZE> HannWindow = InitHannWindow(); struct FshifterState final : public EffectState { /* Effect parameters */ - ALsizei mCount{}; + size_t mCount{}; ALsizei mPhaseStep[2]{}; ALsizei mPhase[2]{}; ALdouble mSign[2]{}; @@ -85,7 +85,7 @@ struct FshifterState final : public EffectState { ALboolean deviceUpdate(const ALCdevice *device) override; void update(const ALCcontext *context, const ALeffectslot *slot, const EffectProps *props, const EffectTarget target) override; - void process(const ALsizei samplesToDo, const FloatBufferLine *RESTRICT samplesIn, const ALsizei numInput, const al::span<FloatBufferLine> samplesOut) override; + void process(const size_t samplesToDo, const FloatBufferLine *RESTRICT samplesIn, const ALsizei numInput, const al::span<FloatBufferLine> samplesOut) override; DEF_NEWDEL(FshifterState) }; @@ -117,7 +117,7 @@ void FshifterState::update(const ALCcontext *context, const ALeffectslot *slot, const ALCdevice *device{context->mDevice.get()}; ALfloat step{props->Fshifter.Frequency / static_cast<ALfloat>(device->Frequency)}; - mPhaseStep[0] = mPhaseStep[1] = fastf2i(minf(step, 0.5f) * FRACTIONONE); + mPhaseStep[0] = mPhaseStep[1] = fastf2i(minf(step, 0.5f) * FRACTIONONE); switch(props->Fshifter.LeftDirection) { @@ -160,15 +160,15 @@ void FshifterState::update(const ALCcontext *context, const ALeffectslot *slot, ComputePanGains(target.Main, coeffs[1], slot->Params.Gain, mGains[1].Target); } -void FshifterState::process(const ALsizei samplesToDo, const FloatBufferLine *RESTRICT samplesIn, const ALsizei /*numInput*/, const al::span<FloatBufferLine> samplesOut) +void FshifterState::process(const size_t samplesToDo, const FloatBufferLine *RESTRICT samplesIn, const ALsizei /*numInput*/, const al::span<FloatBufferLine> samplesOut) { static constexpr complex_d complex_zero{0.0, 0.0}; ALfloat *RESTRICT BufferOut = mBufferOut; - ALsizei j, k, base; + size_t j, k; - for(base = 0;base < samplesToDo;) + for(size_t base{0u};base < samplesToDo;) { - const ALsizei todo{mini(HIL_SIZE-mCount, samplesToDo-base)}; + const size_t todo{minz(HIL_SIZE-mCount, samplesToDo-base)}; ASSUME(todo > 0); @@ -222,8 +222,8 @@ void FshifterState::process(const ALsizei samplesToDo, const FloatBufferLine *RE } /* Now, mix the processed sound data to the output. */ - MixSamples({BufferOut, BufferOut+samplesToDo}, samplesOut, mGains[c].Current, - mGains[c].Target, maxi(samplesToDo, 512), 0); + MixSamples({BufferOut, samplesToDo}, samplesOut, mGains[c].Current, mGains[c].Target, + maxz(samplesToDo, 512), 0); } } |