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/compressor.cpp | |
parent | 3e499e70fd947e6c4487f9496c1647909a61586f (diff) |
Pass samplesToDo as size_t to effects
Diffstat (limited to 'alc/effects/compressor.cpp')
-rw-r--r-- | alc/effects/compressor.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/alc/effects/compressor.cpp b/alc/effects/compressor.cpp index 63867762..e2f644ed 100644 --- a/alc/effects/compressor.cpp +++ b/alc/effects/compressor.cpp @@ -51,7 +51,7 @@ struct CompressorState 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(CompressorState) }; @@ -85,18 +85,18 @@ void CompressorState::update(const ALCcontext*, const ALeffectslot *slot, const } } -void CompressorState::process(const ALsizei samplesToDo, const FloatBufferLine *RESTRICT samplesIn, const ALsizei numInput, const al::span<FloatBufferLine> samplesOut) +void CompressorState::process(const size_t samplesToDo, const FloatBufferLine *RESTRICT samplesIn, const ALsizei numInput, const al::span<FloatBufferLine> samplesOut) { - for(ALsizei base{0};base < samplesToDo;) + for(size_t base{0u};base < samplesToDo;) { ALfloat gains[256]; - const ALsizei td{mini(256, samplesToDo-base)}; + const size_t td{minz(256, samplesToDo-base)}; /* Generate the per-sample gains from the signal envelope. */ ALfloat env{mEnvFollower}; if(mEnabled) { - for(ALsizei i{0};i < td;++i) + for(size_t i{0u};i < td;++i) { /* Clamp the absolute amplitude to the defined envelope limits, * then attack or release the envelope to reach it. @@ -120,7 +120,7 @@ void CompressorState::process(const ALsizei samplesToDo, const FloatBufferLine * * ensure smooth gain changes when the compressor is turned on and * off. */ - for(ALsizei i{0};i < td;++i) + for(size_t i{0u};i < td;++i) { const ALfloat amplitude{1.0f}; if(amplitude > env) @@ -144,7 +144,7 @@ void CompressorState::process(const ALsizei samplesToDo, const FloatBufferLine * if(!(std::fabs(gain) > GAIN_SILENCE_THRESHOLD)) continue; - for(ALsizei i{0};i < td;i++) + for(size_t i{0u};i < td;i++) output[base+i] += samplesIn[j][base+i] * gains[i] * gain; } } |