From 164626a7be1cd0a9b92d34b9bb7f5c891fe57fae Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sun, 25 Aug 2019 17:54:36 -0700 Subject: Pass unsigned sample count to aluMixData --- alc/alu.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'alc/alu.cpp') diff --git a/alc/alu.cpp b/alc/alu.cpp index c961f5d5..ba42c21f 100644 --- a/alc/alu.cpp +++ b/alc/alu.cpp @@ -1343,7 +1343,7 @@ void ProcessParamUpdates(ALCcontext *ctx, const ALeffectslotArray &slots, IncrementRef(ctx->mUpdateCount); } -void ProcessContext(ALCcontext *ctx, const ALsizei SamplesToDo) +void ProcessContext(ALCcontext *ctx, const ALuint SamplesToDo) { ASSUME(SamplesToDo > 0); @@ -1424,7 +1424,7 @@ void ProcessContext(ALCcontext *ctx, const ALsizei SamplesToDo) void ApplyStablizer(FrontStablizer *Stablizer, const al::span Buffer, - const ALuint lidx, const ALuint ridx, const ALuint cidx, const ALsizei SamplesToDo) + const ALuint lidx, const ALuint ridx, const ALuint cidx, const ALuint SamplesToDo) { ASSUME(SamplesToDo > 0); @@ -1439,7 +1439,7 @@ void ApplyStablizer(FrontStablizer *Stablizer, const al::span B auto &DelayBuf = Stablizer->DelayBuf[i]; auto buffer_end = Buffer[i].begin() + SamplesToDo; - if LIKELY(SamplesToDo >= ALsizei{FrontStablizer::DelayLength}) + if LIKELY(SamplesToDo >= ALuint{FrontStablizer::DelayLength}) { auto delay_end = std::rotate(Buffer[i].begin(), buffer_end - FrontStablizer::DelayLength, buffer_end); @@ -1489,7 +1489,7 @@ void ApplyStablizer(FrontStablizer *Stablizer, const al::span B apply_splitter(Buffer[lidx], Stablizer->DelayBuf[lidx], Stablizer->LFilter, lsplit); apply_splitter(Buffer[ridx], Stablizer->DelayBuf[ridx], Stablizer->RFilter, rsplit); - for(ALsizei i{0};i < SamplesToDo;i++) + for(ALuint i{0};i < SamplesToDo;i++) { ALfloat lfsum{lsplit[0][i] + rsplit[0][i]}; ALfloat hfsum{lsplit[1][i] + rsplit[1][i]}; @@ -1515,7 +1515,7 @@ void ApplyStablizer(FrontStablizer *Stablizer, const al::span B } } -void ApplyDistanceComp(const al::span Samples, const ALsizei SamplesToDo, +void ApplyDistanceComp(const al::span Samples, const ALuint SamplesToDo, const DistanceComp::DistData *distcomp) { ASSUME(SamplesToDo > 0); @@ -1523,7 +1523,7 @@ void ApplyDistanceComp(const al::span Samples, const ALsizei Sa for(auto &chanbuffer : Samples) { const ALfloat gain{distcomp->Gain}; - const ALsizei base{distcomp->Length}; + const ALuint base{distcomp->Length}; ALfloat *distbuf{al::assume_aligned<16>(distcomp->Buffer)}; ++distcomp; @@ -1547,7 +1547,7 @@ void ApplyDistanceComp(const al::span Samples, const ALsizei Sa } void ApplyDither(const al::span Samples, ALuint *dither_seed, - const ALfloat quant_scale, const ALsizei SamplesToDo) + const ALfloat quant_scale, const ALuint SamplesToDo) { /* Dithering. Generate whitenoise (uniform distribution of random values * between -1 and +1) and add it to the sample values, after scaling up to @@ -1605,7 +1605,7 @@ template<> inline ALubyte SampleConv(ALfloat val) noexcept template void Write(const al::span InBuffer, ALvoid *OutBuffer, const size_t Offset, - const ALsizei SamplesToDo) + const ALuint SamplesToDo) { using SampleType = typename DevFmtTypeTraits::Type; @@ -1629,12 +1629,12 @@ void Write(const al::span InBuffer, ALvoid *OutBuffer, co } // namespace -void aluMixData(ALCdevice *device, ALvoid *OutBuffer, ALsizei NumSamples) +void aluMixData(ALCdevice *device, ALvoid *OutBuffer, const ALuint NumSamples) { FPUCtl mixer_mode{}; - for(ALsizei SamplesDone{0};SamplesDone < NumSamples;) + for(ALuint SamplesDone{0u};SamplesDone < NumSamples;) { - const ALsizei SamplesToDo{mini(NumSamples-SamplesDone, BUFFERSIZE)}; + const ALuint SamplesToDo{minu(NumSamples-SamplesDone, BUFFERSIZE)}; /* Clear main mixing buffers. */ std::for_each(device->MixBuffer.begin(), device->MixBuffer.end(), -- cgit v1.2.3