From cc0da9527a3940b4bd4896a2febc7ac774f35e0d Mon Sep 17 00:00:00 2001 From: ed Date: Wed, 26 Aug 2020 11:55:31 +0100 Subject: [PATCH] DSP: Fixed some lambda capture lists that trip up GCC 5 in the convolution tests --- modules/juce_dsp/frequency/juce_Convolution_test.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/modules/juce_dsp/frequency/juce_Convolution_test.cpp b/modules/juce_dsp/frequency/juce_Convolution_test.cpp index 93209732c5..d7ec4b8198 100644 --- a/modules/juce_dsp/frequency/juce_Convolution_test.cpp +++ b/modules/juce_dsp/frequency/juce_Convolution_test.cpp @@ -63,7 +63,7 @@ class ConvolutionTest : public UnitTest result.clear(); auto** channels = result.getArrayOfWritePointers(); - std::for_each (channels, channels + result.getNumChannels(), [&] (auto* channel) + std::for_each (channels, channels + result.getNumChannels(), [length] (auto* channel) { std::fill (channel, channel + length, 1.0f); }); @@ -238,7 +238,7 @@ public: AudioBlock block { buffer }; ProcessContextReplacing context { block }; - const auto impulseData = [&] + const auto impulseData = [] { Random random; AudioBuffer result (2, 1000); @@ -361,15 +361,17 @@ public: const auto numChannels = copy.getNumChannels(); const auto numSamples = copy.getNumSamples(); - const auto factor = 0.125f / std::sqrt (std::accumulate (channels, channels + numChannels, 0.0f, [&] (auto max, auto* channel) + const auto factor = 0.125f / std::sqrt (std::accumulate (channels, channels + numChannels, 0.0f, + [numSamples] (auto max, auto* channel) { - return juce::jmax (max, std::accumulate (channel, channel + numSamples, 0.0f, [] (auto sum, auto sample) + return juce::jmax (max, std::accumulate (channel, channel + numSamples, 0.0f, + [] (auto sum, auto sample) { return sum + sample * sample; })); })); - std::for_each (channels, channels + numChannels, [&] (auto* channel) + std::for_each (channels, channels + numChannels, [factor, numSamples] (auto* channel) { FloatVectorOperations::multiply (channel, factor, numSamples); });