From 102ed4a9f20025d148fff5c81a27aab64e4987b9 Mon Sep 17 00:00:00 2001 From: Tom Poole Date: Wed, 27 Jun 2018 17:02:25 +0100 Subject: [PATCH] Fixed some compiler warnings --- .../juce_ThreadedAnalyticsDestination.cpp | 4 +- .../processors/juce_AudioPluginInstance.cpp | 2 +- .../juce_GenericAudioProcessorEditor.cpp | 20 ++-- .../juce_AudioProcessorValueTreeState.cpp | 4 +- .../players/juce_SoundPlayer.cpp | 4 +- .../littlefoot/juce_LittleFootRunner.h | 2 +- .../topology/juce_PhysicalTopologySource.cpp | 6 +- modules/juce_core/text/juce_String.h | 2 +- .../juce_dsp/native/juce_avx_SIMDNativeOps.h | 2 +- .../native/juce_fallback_SIMDNativeOps.h | 2 +- .../juce_dsp/processors/juce_Oversampling.cpp | 112 +++++++++--------- .../image_formats/juce_JPEGLoader.cpp | 35 ++++-- .../native/juce_RenderingHelpers.h | 6 +- .../layout/juce_GridUnitTests.cpp | 17 ++- modules/juce_osc/osc/juce_OSCReceiver.cpp | 2 +- 15 files changed, 114 insertions(+), 106 deletions(-) diff --git a/modules/juce_analytics/destinations/juce_ThreadedAnalyticsDestination.cpp b/modules/juce_analytics/destinations/juce_ThreadedAnalyticsDestination.cpp index ec53fabb0d..ba3c571731 100644 --- a/modules/juce_analytics/destinations/juce_ThreadedAnalyticsDestination.cpp +++ b/modules/juce_analytics/destinations/juce_ThreadedAnalyticsDestination.cpp @@ -64,9 +64,9 @@ void ThreadedAnalyticsDestination::stopAnalyticsThread (int timeout) saveUnloggedEvents (dispatcher.eventQueue); } -ThreadedAnalyticsDestination::EventDispatcher::EventDispatcher (const String& threadName, +ThreadedAnalyticsDestination::EventDispatcher::EventDispatcher (const String& dispatcherThreadName, ThreadedAnalyticsDestination& destination) - : Thread (threadName), + : Thread (dispatcherThreadName), parent (destination) {} diff --git a/modules/juce_audio_processors/processors/juce_AudioPluginInstance.cpp b/modules/juce_audio_processors/processors/juce_AudioPluginInstance.cpp index a228766bd5..2a9a7ae3a9 100644 --- a/modules/juce_audio_processors/processors/juce_AudioPluginInstance.cpp +++ b/modules/juce_audio_processors/processors/juce_AudioPluginInstance.cpp @@ -175,7 +175,7 @@ bool AudioPluginInstance::isMetaParameter (int parameterIndex) const if (auto* param = getParameters()[parameterIndex]) return param->isMetaParameter(); - return false; + return false; } AudioProcessorParameter::Category AudioPluginInstance::getParameterCategory (int parameterIndex) const diff --git a/modules/juce_audio_processors/processors/juce_GenericAudioProcessorEditor.cpp b/modules/juce_audio_processors/processors/juce_GenericAudioProcessorEditor.cpp index 58855f0b17..61f77512d5 100644 --- a/modules/juce_audio_processors/processors/juce_GenericAudioProcessorEditor.cpp +++ b/modules/juce_audio_processors/processors/juce_GenericAudioProcessorEditor.cpp @@ -32,8 +32,8 @@ class ParameterListener : private AudioProcessorParameter::Listener, private Timer { public: - ParameterListener (AudioProcessor& p, AudioProcessorParameter& param) - : processor (p), parameter (param) + ParameterListener (AudioProcessor& proc, AudioProcessorParameter& param) + : processor (proc), parameter (param) { if (LegacyAudioParameter::isLegacy (¶meter)) processor.addListener (this); @@ -101,8 +101,8 @@ class BooleanParameterComponent final : public Component, private ParameterListener { public: - BooleanParameterComponent (AudioProcessor& processor, AudioProcessorParameter& param) - : ParameterListener (processor, param) + BooleanParameterComponent (AudioProcessor& proc, AudioProcessorParameter& param) + : ParameterListener (proc, param) { // Set the initial value. handleNewParameterValue(); @@ -154,8 +154,8 @@ class SwitchParameterComponent final : public Component, private ParameterListener { public: - SwitchParameterComponent (AudioProcessor& processor, AudioProcessorParameter& param) - : ParameterListener (processor, param) + SwitchParameterComponent (AudioProcessor& proc, AudioProcessorParameter& param) + : ParameterListener (proc, param) { auto* leftButton = buttons.add (new TextButton()); auto* rightButton = buttons.add (new TextButton()); @@ -259,8 +259,8 @@ class ChoiceParameterComponent final : public Component, private ParameterListener { public: - ChoiceParameterComponent (AudioProcessor& processor, AudioProcessorParameter& param) - : ParameterListener (processor, param), + ChoiceParameterComponent (AudioProcessor& proc, AudioProcessorParameter& param) + : ParameterListener (proc, param), parameterValues (getParameter().getAllValueStrings()) { box.addItemList (parameterValues, 1); @@ -321,8 +321,8 @@ class SliderParameterComponent final : public Component, private ParameterListener { public: - SliderParameterComponent (AudioProcessor& processor, AudioProcessorParameter& param) - : ParameterListener (processor, param) + SliderParameterComponent (AudioProcessor& proc, AudioProcessorParameter& param) + : ParameterListener (proc, param) { if (getParameter().getNumSteps() != AudioProcessor::getDefaultNumParameterSteps()) slider.setRange (0.0, 1.0, 1.0 / (getParameter().getNumSteps() - 1.0)); diff --git a/modules/juce_audio_processors/utilities/juce_AudioProcessorValueTreeState.cpp b/modules/juce_audio_processors/utilities/juce_AudioProcessorValueTreeState.cpp index 1086f3c0df..f1d497ac0d 100644 --- a/modules/juce_audio_processors/utilities/juce_AudioProcessorValueTreeState.cpp +++ b/modules/juce_audio_processors/utilities/juce_AudioProcessorValueTreeState.cpp @@ -38,9 +38,9 @@ struct AudioProcessorValueTreeState::Parameter : public AudioProcessorParamete bool meta, bool automatable, bool discrete, - AudioProcessorParameter::Category category, + AudioProcessorParameter::Category paramCategory, bool boolean) - : AudioProcessorParameterWithID (parameterID, paramName, labelText, category), + : AudioProcessorParameterWithID (parameterID, paramName, labelText, paramCategory), owner (s), valueToTextFunction (valueToText), textToValueFunction (textToValue), range (r), value (defaultVal), defaultValue (defaultVal), listenersNeedCalling (true), diff --git a/modules/juce_audio_utils/players/juce_SoundPlayer.cpp b/modules/juce_audio_utils/players/juce_SoundPlayer.cpp index 45af97f5ce..cbf6e924c1 100644 --- a/modules/juce_audio_utils/players/juce_SoundPlayer.cpp +++ b/modules/juce_audio_utils/players/juce_SoundPlayer.cpp @@ -30,9 +30,9 @@ namespace juce // This is an AudioTransportSource which will own it's assigned source struct AudioSourceOwningTransportSource : public AudioTransportSource { - AudioSourceOwningTransportSource (PositionableAudioSource* s, double sampleRate) : source (s) + AudioSourceOwningTransportSource (PositionableAudioSource* s, double sr) : source (s) { - AudioTransportSource::setSource (s, 0, nullptr, sampleRate); + AudioTransportSource::setSource (s, 0, nullptr, sr); } ~AudioSourceOwningTransportSource() diff --git a/modules/juce_blocks_basics/littlefoot/juce_LittleFootRunner.h b/modules/juce_blocks_basics/littlefoot/juce_LittleFootRunner.h index 0091e6f7f4..8db41557af 100644 --- a/modules/juce_blocks_basics/littlefoot/juce_LittleFootRunner.h +++ b/modules/juce_blocks_basics/littlefoot/juce_LittleFootRunner.h @@ -231,7 +231,7 @@ struct Program uint16 calculateChecksum() const noexcept { auto size = getProgramSize(); - uint16 n = (uint16) size; + auto n = (uint16) size; for (uint32 i = 2; i < size; ++i) n += (n * 2) + programStart[i]; diff --git a/modules/juce_blocks_basics/topology/juce_PhysicalTopologySource.cpp b/modules/juce_blocks_basics/topology/juce_PhysicalTopologySource.cpp index 91ca9b1010..ef65e5f0ed 100644 --- a/modules/juce_blocks_basics/topology/juce_PhysicalTopologySource.cpp +++ b/modules/juce_blocks_basics/topology/juce_PhysicalTopologySource.cpp @@ -1432,10 +1432,10 @@ struct PhysicalTopologySource::Internal private MIDIDeviceConnection::Listener, private Timer { - BlockImplementation (const BlocksProtocol::BlockSerialNumber& serial, Detector& detectorToUse, BlocksProtocol::VersionNumber version, BlocksProtocol::BlockName name, bool master) - : Block (juce::String ((const char*) serial.serial, sizeof (serial.serial)), + BlockImplementation (const BlocksProtocol::BlockSerialNumber& serial, Detector& detectorToUse, BlocksProtocol::VersionNumber version, BlocksProtocol::BlockName blockName, bool master) + : Block (juce::String ((const char*) serial.serial, sizeof (serial.serial)), juce::String ((const char*) version.version, version.length), - juce::String ((const char*) name.name, name.length)), + juce::String ((const char*) blockName.name, blockName.length)), modelData (serial), remoteHeap (modelData.programAndHeapSize), detector (detectorToUse), diff --git a/modules/juce_core/text/juce_String.h b/modules/juce_core/text/juce_String.h index b7829f1ae8..9c49939fc1 100644 --- a/modules/juce_core/text/juce_String.h +++ b/modules/juce_core/text/juce_String.h @@ -1280,7 +1280,7 @@ private: static String createHex (uint64); template - static String createHex (Type n) { return createHex (static_cast::type> (n)); } + static String createHex (Type n) { return createHex (static_cast::type> (n)); } }; //============================================================================== diff --git a/modules/juce_dsp/native/juce_avx_SIMDNativeOps.h b/modules/juce_dsp/native/juce_avx_SIMDNativeOps.h index f9a125dea9..b506c162a9 100644 --- a/modules/juce_dsp/native/juce_avx_SIMDNativeOps.h +++ b/modules/juce_dsp/native/juce_avx_SIMDNativeOps.h @@ -496,7 +496,7 @@ struct SIMDNativeOps tmp = _mm256_hadd_epi32 (tmp, tmp); #if JUCE_GCC - return tmp[0] + tmp[2]; + return (int32_t) (tmp[0] + tmp[2]); #else constexpr int mask = (2 << 0) | (3 << 2) | (0 << 4) | (1 << 6); diff --git a/modules/juce_dsp/native/juce_fallback_SIMDNativeOps.h b/modules/juce_dsp/native/juce_fallback_SIMDNativeOps.h index dad1284093..92447a8b23 100644 --- a/modules/juce_dsp/native/juce_fallback_SIMDNativeOps.h +++ b/modules/juce_dsp/native/juce_fallback_SIMDNativeOps.h @@ -61,7 +61,7 @@ struct SIMDFallbackOps { static constexpr size_t n = sizeof (vSIMDType) / sizeof (ScalarType); static constexpr size_t mask = (sizeof (vSIMDType) / sizeof (ScalarType)) - 1; - static constexpr size_t bits = SIMDInternal::Log2Helper::value; + static constexpr size_t bits = SIMDInternal::Log2Helper<(int) n>::value; // helper types using MaskType = typename SIMDInternal::MaskTypeFor::type; diff --git a/modules/juce_dsp/processors/juce_Oversampling.cpp b/modules/juce_dsp/processors/juce_Oversampling.cpp index b0f3817e80..a8d527600a 100644 --- a/modules/juce_dsp/processors/juce_Oversampling.cpp +++ b/modules/juce_dsp/processors/juce_Oversampling.cpp @@ -38,9 +38,8 @@ class OversamplingEngine public: //=============================================================================== OversamplingEngine (size_t newNumChannels, size_t newFactor) + : numChannels (newNumChannels), factor (newFactor) { - numChannels = newNumChannels; - factor = newFactor; } virtual ~OversamplingEngine() {} @@ -70,8 +69,7 @@ public: protected: //=============================================================================== AudioBuffer buffer; - size_t factor; - size_t numChannels; + size_t numChannels, factor; }; @@ -80,11 +78,11 @@ protected: signal, which could be equivalent to a "one time" oversampling processing. */ template -class OversamplingDummy : public OversamplingEngine +class OversamplingDummy : public OversamplingEngine { public: //=============================================================================== - OversamplingDummy (size_t numChannels) : OversamplingEngine (numChannels, 1) {} + OversamplingDummy (size_t numChans) : OversamplingEngine (numChans, 1) {} ~OversamplingDummy() {} //=============================================================================== @@ -98,7 +96,7 @@ public: jassert (inputBlock.getNumChannels() <= static_cast (OversamplingEngine::buffer.getNumChannels())); jassert (inputBlock.getNumSamples() * OversamplingEngine::factor <= static_cast (OversamplingEngine::buffer.getNumSamples())); - for (size_t channel = 0; channel < inputBlock.getNumChannels(); channel++) + for (size_t channel = 0; channel < inputBlock.getNumChannels(); ++channel) OversamplingEngine::buffer.copyFrom (static_cast (channel), 0, inputBlock.getChannelPointer (channel), static_cast (inputBlock.getNumSamples())); } @@ -127,26 +125,27 @@ class Oversampling2TimesEquirippleFIR : public OversamplingEngine { public: //=============================================================================== - Oversampling2TimesEquirippleFIR (size_t numChannels, + Oversampling2TimesEquirippleFIR (size_t numChans, SampleType normalizedTransitionWidthUp, SampleType stopbandAttenuationdBUp, SampleType normalizedTransitionWidthDown, - SampleType stopbandAttenuationdBDown) : OversamplingEngine (numChannels, 2) + SampleType stopbandAttenuationdBDown) + : OversamplingEngine (numChans, 2) { coefficientsUp = *dsp::FilterDesign::designFIRLowpassHalfBandEquirippleMethod (normalizedTransitionWidthUp, stopbandAttenuationdBUp); coefficientsDown = *dsp::FilterDesign::designFIRLowpassHalfBandEquirippleMethod (normalizedTransitionWidthDown, stopbandAttenuationdBDown); auto N = coefficientsUp.getFilterOrder() + 1; - stateUp.setSize (static_cast (numChannels), static_cast (N)); + stateUp.setSize (static_cast (this->numChannels), static_cast (N)); N = coefficientsDown.getFilterOrder() + 1; auto Ndiv2 = N / 2; auto Ndiv4 = Ndiv2 / 2; - stateDown.setSize (static_cast (numChannels), static_cast (N)); - stateDown2.setSize (static_cast (numChannels), static_cast (Ndiv4 + 1)); + stateDown.setSize (static_cast (this->numChannels), static_cast (N)); + stateDown2.setSize (static_cast (this->numChannels), static_cast (Ndiv4 + 1)); - position.resize (static_cast (numChannels)); + position.resize (static_cast (this->numChannels)); } ~Oversampling2TimesEquirippleFIR() {} @@ -180,13 +179,13 @@ public: auto numSamples = inputBlock.getNumSamples(); // Processing - for (size_t channel = 0; channel < inputBlock.getNumChannels(); channel++) + for (size_t channel = 0; channel < inputBlock.getNumChannels(); ++channel) { auto bufferSamples = OversamplingEngine::buffer.getWritePointer (static_cast (channel)); auto buf = stateUp.getWritePointer (static_cast (channel)); auto samples = inputBlock.getChannelPointer (channel); - for (size_t i = 0; i < numSamples; i++) + for (size_t i = 0; i < numSamples; ++i) { // Input buf[N - 1] = 2 * samples[i]; @@ -220,7 +219,7 @@ public: auto numSamples = outputBlock.getNumSamples(); // Processing - for (size_t channel = 0; channel < outputBlock.getNumChannels(); channel++) + for (size_t channel = 0; channel < outputBlock.getNumChannels(); ++channel) { auto bufferSamples = OversamplingEngine::buffer.getWritePointer (static_cast (channel)); auto buf = stateDown.getWritePointer (static_cast (channel)); @@ -228,7 +227,7 @@ public: auto samples = outputBlock.getChannelPointer (channel); auto pos = position.getUnchecked (static_cast (channel)); - for (size_t i = 0; i < numSamples; i++) + for (size_t i = 0; i < numSamples; ++i) { // Input buf[N - 1] = bufferSamples[i << 1]; @@ -245,7 +244,7 @@ public: samples[i] = out; // Shift data - for (size_t k = 0; k < N - 2; k++) + for (size_t k = 0; k < N - 2; ++k) buf[k] = buf[k + 2]; // Circular buffer @@ -278,11 +277,12 @@ class Oversampling2TimesPolyphaseIIR : public OversamplingEngine { public: //=============================================================================== - Oversampling2TimesPolyphaseIIR (size_t numChannels, + Oversampling2TimesPolyphaseIIR (size_t numChans, SampleType normalizedTransitionWidthUp, SampleType stopbandAttenuationdBUp, SampleType normalizedTransitionWidthDown, - SampleType stopbandAttenuationdBDown) : OversamplingEngine (numChannels, 2) + SampleType stopbandAttenuationdBDown) + : OversamplingEngine (numChans, 2) { auto structureUp = dsp::FilterDesign::designIIRLowpassHalfBandPolyphaseAllpassMethod (normalizedTransitionWidthUp, stopbandAttenuationdBUp); dsp::IIR::Coefficients coeffsUp = getCoefficients (structureUp); @@ -292,21 +292,21 @@ public: dsp::IIR::Coefficients coeffsDown = getCoefficients (structureDown); latency += static_cast (-(coeffsDown.getPhaseForFrequency (0.0001, 1.0)) / (0.0001 * MathConstants::twoPi)); - for (auto i = 0; i < structureUp.directPath.size(); i++) + for (auto i = 0; i < structureUp.directPath.size(); ++i) coefficientsUp.add (structureUp.directPath[i].coefficients[0]); - for (auto i = 1; i < structureUp.delayedPath.size(); i++) + for (auto i = 1; i < structureUp.delayedPath.size(); ++i) coefficientsUp.add (structureUp.delayedPath[i].coefficients[0]); - for (auto i = 0; i < structureDown.directPath.size(); i++) + for (auto i = 0; i < structureDown.directPath.size(); ++i) coefficientsDown.add (structureDown.directPath[i].coefficients[0]); - for (auto i = 1; i < structureDown.delayedPath.size(); i++) + for (auto i = 1; i < structureDown.delayedPath.size(); ++i) coefficientsDown.add (structureDown.delayedPath[i].coefficients[0]); - v1Up.setSize (static_cast (numChannels), coefficientsUp.size()); - v1Down.setSize (static_cast (numChannels), coefficientsDown.size()); - delayDown.resize (static_cast (numChannels)); + v1Up.setSize (static_cast (this->numChannels), coefficientsUp.size()); + v1Down.setSize (static_cast (this->numChannels), coefficientsDown.size()); + delayDown.resize (static_cast (this->numChannels)); } ~Oversampling2TimesPolyphaseIIR() {} @@ -339,17 +339,17 @@ public: auto numSamples = inputBlock.getNumSamples(); // Processing - for (size_t channel = 0; channel < inputBlock.getNumChannels(); channel++) + for (size_t channel = 0; channel < inputBlock.getNumChannels(); ++channel) { auto bufferSamples = OversamplingEngine::buffer.getWritePointer (static_cast (channel)); auto lv1 = v1Up.getWritePointer (static_cast (channel)); auto samples = inputBlock.getChannelPointer (channel); - for (size_t i = 0; i < numSamples; i++) + for (size_t i = 0; i < numSamples; ++i) { // Direct path cascaded allpass filters auto input = samples[i]; - for (auto n = 0; n < directStages; n++) + for (auto n = 0; n < directStages; ++n) { auto alpha = coeffs[n]; auto output = alpha * input + lv1[n]; @@ -362,7 +362,7 @@ public: // Delayed path cascaded allpass filters input = samples[i]; - for (auto n = directStages; n < numStages; n++) + for (auto n = directStages; n < numStages; ++n) { auto alpha = coeffs[n]; auto output = alpha * input + lv1[n]; @@ -392,18 +392,18 @@ public: auto numSamples = outputBlock.getNumSamples(); // Processing - for (size_t channel = 0; channel < outputBlock.getNumChannels(); channel++) + for (size_t channel = 0; channel < outputBlock.getNumChannels(); ++channel) { auto bufferSamples = OversamplingEngine::buffer.getWritePointer (static_cast (channel)); auto lv1 = v1Down.getWritePointer (static_cast (channel)); auto samples = outputBlock.getChannelPointer (channel); auto delay = delayDown.getUnchecked (static_cast (channel)); - for (size_t i = 0; i < numSamples; i++) + for (size_t i = 0; i < numSamples; ++i) { // Direct path cascaded allpass filters auto input = bufferSamples[i << 1]; - for (auto n = 0; n < directStages; n++) + for (auto n = 0; n < directStages; ++n) { auto alpha = coeffs[n]; auto output = alpha * input + lv1[n]; @@ -414,7 +414,7 @@ public: // Delayed path cascaded allpass filters input = bufferSamples[(i << 1) + 1]; - for (auto n = directStages; n < numStages; n++) + for (auto n = directStages; n < numStages; ++n) { auto alpha = coeffs[n]; auto output = alpha * input + lv1[n]; @@ -438,23 +438,23 @@ public: { if (snapUpProcessing) { - for (auto channel = 0; channel < OversamplingEngine::buffer.getNumChannels(); channel++) + for (auto channel = 0; channel < OversamplingEngine::buffer.getNumChannels(); ++channel) { auto lv1 = v1Up.getWritePointer (channel); auto numStages = coefficientsUp.size(); - for (auto n = 0; n < numStages; n++) + for (auto n = 0; n < numStages; ++n) util::snapToZero (lv1[n]); } } else { - for (auto channel = 0; channel < OversamplingEngine::buffer.getNumChannels(); channel++) + for (auto channel = 0; channel < OversamplingEngine::buffer.getNumChannels(); ++channel) { auto lv1 = v1Down.getWritePointer (channel); auto numStages = coefficientsDown.size(); - for (auto n = 0; n < numStages; n++) + for (auto n = 0; n < numStages; ++n) util::snapToZero (lv1[n]); } } @@ -474,7 +474,7 @@ private: dsp::Polynomial temp; - for (auto n = 0; n < structure.directPath.size(); n++) + for (auto n = 0; n < structure.directPath.size(); ++n) { auto* coeffs = structure.directPath.getReference (n).getRawCoefficients(); @@ -496,7 +496,7 @@ private: } } - for (auto n = 0; n < structure.delayedPath.size(); n++) + for (auto n = 0; n < structure.delayedPath.size(); ++n) { auto* coeffs = structure.delayedPath.getReference (n).getRawCoefficients(); @@ -528,10 +528,10 @@ private: coeffs.coefficients.clear(); auto inversion = static_cast (1.0) / denominator[0]; - for (auto i = 0; i <= numerator.getOrder(); i++) + for (auto i = 0; i <= numerator.getOrder(); ++i) coeffs.coefficients.add (numerator[i] * inversion); - for (auto i = 1; i <= denominator.getOrder(); i++) + for (auto i = 1; i <= denominator.getOrder(); ++i) coeffs.coefficients.add (denominator[i] * inversion); return coeffs; @@ -569,15 +569,15 @@ Oversampling::Oversampling (size_t newNumChannels, size_t newFactor, { numStages = newFactor; - for (size_t n = 0; n < numStages; n++) + for (size_t n = 0; n < numStages; ++n) { - auto twUp = (isMaximumQuality ? 0.10f : 0.12f) * (n == 0 ? 0.5f : 1.f); + auto twUp = (isMaximumQuality ? 0.10f : 0.12f) * (n == 0 ? 0.5f : 1.f); auto twDown = (isMaximumQuality ? 0.12f : 0.15f) * (n == 0 ? 0.5f : 1.f); - auto gaindBStartUp = (isMaximumQuality ? -75.f : -65.f); - auto gaindBStartDown = (isMaximumQuality ? -70.f : -60.f); - auto gaindBFactorUp = (isMaximumQuality ? 10.f : 8.f); - auto gaindBFactorDown = (isMaximumQuality ? 10.f : 8.f); + auto gaindBStartUp = (isMaximumQuality ? -75.f : -65.f); + auto gaindBStartDown = (isMaximumQuality ? -70.f : -60.f); + auto gaindBFactorUp = (isMaximumQuality ? 10.f : 8.f); + auto gaindBFactorDown = (isMaximumQuality ? 10.f : 8.f); engines.add (new Oversampling2TimesPolyphaseIIR (numChannels, twUp, gaindBStartUp + gaindBFactorUp * n, @@ -588,7 +588,7 @@ Oversampling::Oversampling (size_t newNumChannels, size_t newFactor, { numStages = newFactor; - for (size_t n = 0; n < numStages; n++) + for (size_t n = 0; n < numStages; ++n) { auto twUp = (isMaximumQuality ? 0.10f : 0.12f) * (n == 0 ? 0.5f : 1.f); auto twDown = (isMaximumQuality ? 0.12f : 0.15f) * (n == 0 ? 0.5f : 1.f); @@ -618,7 +618,7 @@ SampleType Oversampling::getLatencyInSamples() noexcept auto latency = static_cast (0); size_t order = 1; - for (size_t n = 0; n < numStages; n++) + for (size_t n = 0; n < numStages; ++n) { auto& engine = *engines[static_cast (n)]; @@ -642,7 +642,7 @@ void Oversampling::initProcessing (size_t maximumNumberOfSamplesBefo jassert (! engines.isEmpty()); auto currentNumSamples = maximumNumberOfSamplesBeforeOversampling; - for (size_t n = 0; n < numStages; n++) + for (size_t n = 0; n < numStages; ++n) { auto& engine = *engines[static_cast (n)]; @@ -660,7 +660,7 @@ void Oversampling::reset() noexcept jassert (! engines.isEmpty()); if (isReady) - for (auto n = 0; n < engines.size(); n++) + for (auto n = 0; n < engines.size(); ++n) engines[n]->reset(); } @@ -674,7 +674,7 @@ typename dsp::AudioBlock Oversampling::processSamplesUp dsp::AudioBlock audioBlock = inputBlock; - for (size_t n = 0; n < numStages; n++) + for (size_t n = 0; n < numStages; ++n) { auto& engine = *engines[static_cast (n)]; engine.processSamplesUp (audioBlock); @@ -694,10 +694,10 @@ void Oversampling::processSamplesDown (dsp::AudioBlock & auto currentNumSamples = outputBlock.getNumSamples(); - for (size_t n = 0; n < numStages - 1; n++) + for (size_t n = 0; n < numStages - 1; ++n) currentNumSamples *= engines[static_cast (n)]->getFactor(); - for (size_t n = numStages - 1; n > 0; n--) + for (size_t n = numStages - 1; n > 0; --n) { auto& engine = *engines[static_cast (n)]; diff --git a/modules/juce_graphics/image_formats/juce_JPEGLoader.cpp b/modules/juce_graphics/image_formats/juce_JPEGLoader.cpp index 793d10ba64..9f8c4daec2 100644 --- a/modules/juce_graphics/image_formats/juce_JPEGLoader.cpp +++ b/modules/juce_graphics/image_formats/juce_JPEGLoader.cpp @@ -35,18 +35,23 @@ namespace juce namespace jpeglibNamespace { #if JUCE_INCLUDE_JPEGLIB_CODE || ! defined (JUCE_INCLUDE_JPEGLIB_CODE) - #if JUCE_MINGW - typedef unsigned char boolean; - #endif + #if JUCE_MINGW + typedef unsigned char boolean; + #endif - #if JUCE_CLANG - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wconversion" - #pragma clang diagnostic ignored "-Wdeprecated-register" - #if __has_warning("-Wcomma") - #pragma clang diagnostic ignored "-Wcomma" + #if JUCE_CLANG + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wconversion" + #pragma clang diagnostic ignored "-Wdeprecated-register" + #if __has_warning("-Wcomma") + #pragma clang diagnostic ignored "-Wcomma" + #endif + #endif + + #if JUCE_GCC && __GNUC__ > 5 + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wshift-negative-value" #endif - #endif #define JPEG_INTERNALS #undef FAR @@ -121,9 +126,13 @@ namespace jpeglibNamespace #include "jpglib/jutils.c" #include "jpglib/transupp.c" - #if JUCE_CLANG - #pragma clang diagnostic pop - #endif + #if JUCE_CLANG + #pragma clang diagnostic pop + #endif + + #if JUCE_GCC && __GNUC__ > 5 + #pragma GCC diagnostic pop + #endif #else #define JPEG_INTERNALS #undef FAR diff --git a/modules/juce_graphics/native/juce_RenderingHelpers.h b/modules/juce_graphics/native/juce_RenderingHelpers.h index eb472f35af..b837e483c6 100644 --- a/modules/juce_graphics/native/juce_RenderingHelpers.h +++ b/modules/juce_graphics/native/juce_RenderingHelpers.h @@ -580,7 +580,7 @@ namespace EdgeTableFillers SolidColour (const Image::BitmapData& image, PixelARGB colour) : destData (image), sourceColour (colour) { - if (sizeof (PixelType) == 3 && destData.pixelStride == sizeof (PixelType)) + if (sizeof (PixelType) == 3 && (size_t) destData.pixelStride == sizeof (PixelType)) { areRGBComponentsEqual = sourceColour.getRed() == sourceColour.getGreen() && sourceColour.getGreen() == sourceColour.getBlue(); @@ -689,7 +689,7 @@ namespace EdgeTableFillers forcedinline void replaceLine (PixelRGB* dest, PixelARGB colour, int width) const noexcept { - if (destData.pixelStride == sizeof (*dest)) + if ((size_t) destData.pixelStride == sizeof (*dest)) { if (areRGBComponentsEqual) // if all the component values are the same, we can cheat.. { @@ -734,7 +734,7 @@ namespace EdgeTableFillers forcedinline void replaceLine (PixelAlpha* dest, const PixelARGB colour, int width) const noexcept { - if (destData.pixelStride == sizeof (*dest)) + if ((size_t) destData.pixelStride == sizeof (*dest)) memset (dest, colour.getAlpha(), (size_t) width); else JUCE_PERFORM_PIXEL_OP_LOOP (setAlpha (colour.getAlpha())) diff --git a/modules/juce_gui_basics/layout/juce_GridUnitTests.cpp b/modules/juce_gui_basics/layout/juce_GridUnitTests.cpp index 99084d0993..f005e17cbd 100644 --- a/modules/juce_gui_basics/layout/juce_GridUnitTests.cpp +++ b/modules/juce_gui_basics/layout/juce_GridUnitTests.cpp @@ -27,16 +27,15 @@ namespace juce { -struct GridTests : public juce::UnitTest +struct GridTests : public UnitTest { - GridTests() : juce::UnitTest ("Grid class") {} + GridTests() : UnitTest ("Grid class") {} void runTest() override { - using Fr = juce::Grid::Fr; - using Tr = juce::Grid::TrackInfo; - using Rect = juce::Rectangle; - using Grid = juce::Grid; + using Fr = Grid::Fr; + using Tr = Grid::TrackInfo; + using Rect = Rectangle; { Grid grid; @@ -47,7 +46,7 @@ struct GridTests : public juce::UnitTest grid.items.addArray ({ GridItem().withArea (1, 1), GridItem().withArea (2, 1) }); - grid.performLayout (juce::Rectangle (200, 400)); + grid.performLayout (Rectangle (200, 400)); beginTest ("Layout calculation test: 1 column x 2 rows: no gap"); expect (grid.items[0].currentBounds == Rect (0.0f, 0.0f, 200.f, 20.0f)); @@ -61,7 +60,7 @@ struct GridTests : public juce::UnitTest GridItem().withArea (3, 1), GridItem().withArea (3, 2) }); - grid.performLayout (juce::Rectangle (150, 170)); + grid.performLayout (Rectangle (150, 170)); beginTest ("Layout calculation test: 2 columns x 3 rows: no gap"); expect (grid.items[0].currentBounds == Rect (0.0f, 0.0f, 100.0f, 20.0f)); @@ -74,7 +73,7 @@ struct GridTests : public juce::UnitTest grid.columnGap = 20_px; grid.rowGap = 10_px; - grid.performLayout (juce::Rectangle (200, 310)); + grid.performLayout (Rectangle (200, 310)); beginTest ("Layout calculation test: 2 columns x 3 rows: rowGap of 10 and columnGap of 20"); expect (grid.items[0].currentBounds == Rect (0.0f, 0.0f, 130.0f, 20.0f)); diff --git a/modules/juce_osc/osc/juce_OSCReceiver.cpp b/modules/juce_osc/osc/juce_OSCReceiver.cpp index c52ae4805d..b07bf88a00 100644 --- a/modules/juce_osc/osc/juce_OSCReceiver.cpp +++ b/modules/juce_osc/osc/juce_OSCReceiver.cpp @@ -321,7 +321,7 @@ namespace struct OSCReceiver::Pimpl : private Thread, private MessageListener { - Pimpl (const String& threadName) : Thread (threadName) + Pimpl (const String& oscThreadName) : Thread (oscThreadName) { }