From 0de7ea42fa197833bff70b4c370ed29f9859889d Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Mon, 6 Feb 2023 12:35:51 -0800 Subject: [PATCH] Avoid using auto for lambda parameters --- alc/alu.cpp | 2 +- alc/context.cpp | 2 +- common/alcomplex.cpp | 2 +- core/mastering.cpp | 10 +++++----- utils/makemhr/makemhr.cpp | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/alc/alu.cpp b/alc/alu.cpp index d49b0d668b..6e24341245 100644 --- a/alc/alu.cpp +++ b/alc/alu.cpp @@ -1966,7 +1966,7 @@ void ApplyDistanceComp(const al::span Samples, const size_t Sam auto delay_start = std::swap_ranges(inout, inout_end, distbuf); std::rotate(distbuf, delay_start, distbuf + base); } - std::transform(inout, inout_end, inout, [gain](auto a){ return a * gain; }); + std::transform(inout, inout_end, inout, [gain](float s) { return s * gain; }); } } diff --git a/alc/context.cpp b/alc/context.cpp index 32bd36eb3e..0aacaac58e 100644 --- a/alc/context.cpp +++ b/alc/context.cpp @@ -230,7 +230,7 @@ bool ALCcontext::deinit() * given context. */ std::copy_if(oldarray->begin(), oldarray->end(), newarray->begin(), - [this](auto a){ return a != this; }); + [this](ContextBase *ctx) { return ctx != this; }); /* Store the new context array in the device. Wait for any current mix * to finish before deleting the old array. diff --git a/common/alcomplex.cpp b/common/alcomplex.cpp index b6cac4cd68..a9e2844103 100644 --- a/common/alcomplex.cpp +++ b/common/alcomplex.cpp @@ -158,7 +158,7 @@ void complex_hilbert(const al::span> buffer) *bufiter *= inverse_size; ++bufiter; bufiter = std::transform(bufiter, halfiter, bufiter, - [scale=inverse_size*2.0](auto a){ return a * scale; }); + [scale=inverse_size*2.0](std::complex d){ return d * scale; }); *bufiter *= inverse_size; ++bufiter; std::fill(bufiter, buffer.end(), std::complex{}); diff --git a/core/mastering.cpp b/core/mastering.cpp index 88a0b5e0be..cff162da26 100644 --- a/core/mastering.cpp +++ b/core/mastering.cpp @@ -87,10 +87,10 @@ void ShiftSlidingHold(SlidingHold *Hold, const uint n) if(exp_last-exp_begin < 0) { std::transform(exp_begin, std::end(Hold->mExpiries), exp_begin, - [n](auto a){ return a - n; }); + [n](uint e){ return e - n; }); exp_begin = std::begin(Hold->mExpiries); } - std::transform(exp_begin, exp_last+1, exp_begin, [n](auto a){ return a - n; }); + std::transform(exp_begin, exp_last+1, exp_begin, [n](uint e){ return e - n; }); } @@ -155,7 +155,7 @@ void PeakDetector(Compressor *Comp, const uint SamplesToDo) /* Clamp the minimum amplitude to near-zero and convert to logarithm. */ auto side_begin = std::begin(Comp->mSideChain) + Comp->mLookAhead; std::transform(side_begin, side_begin+SamplesToDo, side_begin, - [](auto s) { return std::log(maxf(0.000001f, s)); }); + [](float s) { return std::log(maxf(0.000001f, s)); }); } /* An optional hold can be used to extend the peak detector so it can more @@ -404,7 +404,7 @@ void Compressor::process(const uint SamplesToDo, FloatBufferLine *OutBuffer) { float *buffer{al::assume_aligned<16>(input.data())}; std::transform(buffer, buffer+SamplesToDo, buffer, - [preGain](auto a){ return a * preGain; }); + [preGain](float s) { return s * preGain; }); }; std::for_each(OutBuffer, OutBuffer+numChans, apply_gain); } @@ -430,7 +430,7 @@ void Compressor::process(const uint SamplesToDo, FloatBufferLine *OutBuffer) float *buffer{al::assume_aligned<16>(input.data())}; const float *gains{al::assume_aligned<16>(&sideChain[0])}; std::transform(gains, gains+SamplesToDo, buffer, buffer, - [](auto a, auto b){ return a * b; }); + [](float g, float s) { return g * s; }); }; std::for_each(OutBuffer, OutBuffer+numChans, apply_comp); diff --git a/utils/makemhr/makemhr.cpp b/utils/makemhr/makemhr.cpp index 6cf3076d16..ae301dc337 100644 --- a/utils/makemhr/makemhr.cpp +++ b/utils/makemhr/makemhr.cpp @@ -1019,7 +1019,7 @@ static void NormalizeHrirs(HrirDataT *hData) /* Now scale all IRs by the given factor. */ auto proc_channel = [irSize,factor](double *ir) - { std::transform(ir, ir+irSize, ir, [factor](auto s){ return s * factor; }); }; + { std::transform(ir, ir+irSize, ir, [factor](double s){ return s * factor; }); }; auto proc_azi = [channels,proc_channel](HrirAzT &azi) { std::for_each(azi.mIrs, azi.mIrs+channels, proc_channel); }; auto proc_elev = [proc_azi](HrirEvT &elev)