diff --git a/extras/Projucer/Source/Project/UI/jucer_HeaderComponent.cpp b/extras/Projucer/Source/Project/UI/jucer_HeaderComponent.cpp index f3ba6502ac..fa8a38b898 100644 --- a/extras/Projucer/Source/Project/UI/jucer_HeaderComponent.cpp +++ b/extras/Projucer/Source/Project/UI/jucer_HeaderComponent.cpp @@ -289,7 +289,7 @@ void HeaderComponent::initialiseButtons() noexcept { sendProjectButtonAnalyticsEvent ("User Settings"); - if (auto* pcc = findParentComponentOfClass()) + if (findParentComponentOfClass() != nullptr) showUserSettings(); }; diff --git a/modules/juce_audio_formats/codecs/juce_MP3AudioFormat.cpp b/modules/juce_audio_formats/codecs/juce_MP3AudioFormat.cpp index ffa9a2fd98..14dc9d1e63 100644 --- a/modules/juce_audio_formats/codecs/juce_MP3AudioFormat.cpp +++ b/modules/juce_audio_formats/codecs/juce_MP3AudioFormat.cpp @@ -1961,8 +1961,8 @@ private: { const uint8 n0 = si.allocation[i][0]; const uint8 n1 = si.allocation[i][1]; - fraction[0][i] = n0 > 0 ? (float) (((-1 << n0) + getBitsUint16 (n0 + 1) + 1) * constants.muls[n0 + 1][si.scaleFactor[i][0]]) : 0; - fraction[1][i] = n1 > 0 ? (float) (((-1 << n1) + getBitsUint16 (n1 + 1) + 1) * constants.muls[n1 + 1][si.scaleFactor[i][1]]) : 0; + fraction[0][i] = n0 > 0 ? (float) ((-(1 << n0) + getBitsUint16 (n0 + 1) + 1) * constants.muls[n0 + 1][si.scaleFactor[i][0]]) : 0; + fraction[1][i] = n1 > 0 ? (float) ((-(1 << n1) + getBitsUint16 (n1 + 1) + 1) * constants.muls[n1 + 1][si.scaleFactor[i][1]]) : 0; } for (i = jsbound; i < 32; ++i) @@ -1971,7 +1971,7 @@ private: if (n > 0) { - const uint32 w = ((uint32) (-1 << n) + getBitsUint16 (n + 1) + 1); + const uint32 w = ((uint32) -(1 << n) + getBitsUint16 (n + 1) + 1); fraction[0][i] = (float) (w * constants.muls[n + 1][si.scaleFactor[i][0]]); fraction[1][i] = (float) (w * constants.muls[n + 1][si.scaleFactor[i][1]]); } @@ -1987,7 +1987,7 @@ private: const uint8 j = si.scaleFactor[i][0]; if (n > 0) - fraction[0][i] = (float) (((-1 << n) + getBitsUint16 (n + 1) + 1) * constants.muls[n + 1][j]); + fraction[0][i] = (float) ((-(1 << n) + getBitsUint16 (n + 1) + 1) * constants.muls[n + 1][j]); else fraction[0][i] = 0; } diff --git a/modules/juce_audio_processors/format_types/juce_LADSPAPluginFormat.cpp b/modules/juce_audio_processors/format_types/juce_LADSPAPluginFormat.cpp index 9499dc4067..3d439fed52 100644 --- a/modules/juce_audio_processors/format_types/juce_LADSPAPluginFormat.cpp +++ b/modules/juce_audio_processors/format_types/juce_LADSPAPluginFormat.cpp @@ -516,7 +516,7 @@ private: if (useLog && low > 0 && high > 0) return expf (logf (low) * (1.0f - alpha) + logf (high) * alpha); - return low + (high - low) * alpha; + return low + (high - low) * alpha; } static float toIntIfNecessary (const LADSPA_PortRangeHintDescriptor& desc, float value) diff --git a/modules/juce_box2d/box2d/Collision/b2DynamicTree.cpp b/modules/juce_box2d/box2d/Collision/b2DynamicTree.cpp index 11785b1eee..7389fc0b2b 100644 --- a/modules/juce_box2d/box2d/Collision/b2DynamicTree.cpp +++ b/modules/juce_box2d/box2d/Collision/b2DynamicTree.cpp @@ -29,7 +29,7 @@ b2DynamicTree::b2DynamicTree() m_nodeCapacity = 16; m_nodeCount = 0; m_nodes = (b2TreeNode*)b2Alloc(m_nodeCapacity * sizeof(b2TreeNode)); - memset(m_nodes, 0, m_nodeCapacity * sizeof(b2TreeNode)); + memset((void*)m_nodes, 0, m_nodeCapacity * sizeof(b2TreeNode)); // Build a linked list for the free list. for (int32 i = 0; i < m_nodeCapacity - 1; ++i) diff --git a/modules/juce_core/memory/juce_Memory.h b/modules/juce_core/memory/juce_Memory.h index 3e82fa875c..ebe7012a5f 100644 --- a/modules/juce_core/memory/juce_Memory.h +++ b/modules/juce_core/memory/juce_Memory.h @@ -29,7 +29,7 @@ inline void zeromem (void* memory, size_t numBytes) noexcept { memset (me /** Overwrites a structure or object with zeros. */ template -inline void zerostruct (Type& structure) noexcept { memset (&structure, 0, sizeof (structure)); } +inline void zerostruct (Type& structure) noexcept { memset ((void*) &structure, 0, sizeof (structure)); } /** Delete an object pointer, and sets the pointer to null. diff --git a/modules/juce_dsp/processors/juce_IIRFilter_Impl.h b/modules/juce_dsp/processors/juce_IIRFilter_Impl.h index 709c7dbbc4..b2ce0d0d4b 100644 --- a/modules/juce_dsp/processors/juce_IIRFilter_Impl.h +++ b/modules/juce_dsp/processors/juce_IIRFilter_Impl.h @@ -66,7 +66,6 @@ void Filter::reset (SampleType resetToValue) template void Filter::prepare (const ProcessSpec&) noexcept { reset(); } - template template void Filter::processInternal (const ProcessContext& context) noexcept @@ -88,11 +87,6 @@ void Filter::processInternal (const ProcessContext& context) noexcep auto* dst = outputBlock.getChannelPointer (0); auto* coeffs = coefficients->getRawCoefficients(); - // we need to copy this template parameter into a constexpr - // otherwise MSVC will moan that the tenary expressions below - // are constant conditional expressions - constexpr bool isBypassed = bypassed; - switch (order) { case 1: @@ -105,12 +99,12 @@ void Filter::processInternal (const ProcessContext& context) noexcep for (size_t i = 0; i < numSamples; ++i) { - auto in = src[i]; - auto out = in * b0 + lv1; + auto input = src[i]; + auto output = input * b0 + lv1; - dst[i] = isBypassed ? in : out; + dst[i] = bypassed ? input : output; - lv1 = (in * b1) - (out * a1); + lv1 = (input * b1) - (output * a1); } util::snapToZero (lv1); state[0] = lv1; @@ -130,12 +124,12 @@ void Filter::processInternal (const ProcessContext& context) noexcep for (size_t i = 0; i < numSamples; ++i) { - auto in = src[i]; - auto out = (in * b0) + lv1; - dst[i] = isBypassed ? in : out; + auto input = src[i]; + auto output = (input * b0) + lv1; + dst[i] = bypassed ? input : output; - lv1 = (in * b1) - (out * a1) + lv2; - lv2 = (in * b2) - (out * a2); + lv1 = (input * b1) - (output* a1) + lv2; + lv2 = (input * b2) - (output* a2); } util::snapToZero (lv1); state[0] = lv1; @@ -159,13 +153,13 @@ void Filter::processInternal (const ProcessContext& context) noexcep for (size_t i = 0; i < numSamples; ++i) { - auto in = src[i]; - auto out = (in * b0) + lv1; - dst[i] = isBypassed ? in : out; + auto input = src[i]; + auto output = (input * b0) + lv1; + dst[i] = bypassed ? input : output; - lv1 = (in * b1) - (out * a1) + lv2; - lv2 = (in * b2) - (out * a2) + lv3; - lv3 = (in * b3) - (out * a3); + lv1 = (input * b1) - (output* a1) + lv2; + lv2 = (input * b2) - (output* a2) + lv3; + lv3 = (input * b3) - (output* a3); } util::snapToZero (lv1); state[0] = lv1; @@ -178,14 +172,14 @@ void Filter::processInternal (const ProcessContext& context) noexcep { for (size_t i = 0; i < numSamples; ++i) { - auto in = src[i]; - auto out = (in * coeffs[0]) + state[0]; - dst[i] = isBypassed ? in : out; + auto input = src[i]; + auto output= (input * coeffs[0]) + state[0]; + dst[i] = bypassed ? input : output; for (size_t j = 0; j < order - 1; ++j) - state[j] = (in * coeffs[j + 1]) - (out * coeffs[order + j + 1]) + state[j + 1]; + state[j] = (input * coeffs[j + 1]) - (output* coeffs[order + j + 1]) + state[j + 1]; - state[order - 1] = (in * coeffs[order]) - (out * coeffs[order * 2]); + state[order - 1] = (input * coeffs[order]) - (output* coeffs[order * 2]); } snapToZero(); @@ -199,14 +193,14 @@ SampleType JUCE_VECTOR_CALLTYPE Filter::processSample (SampleType sa check(); auto* c = coefficients->getRawCoefficients(); - auto out = (c[0] * sample) + state[0]; + auto output= (c[0] * sample) + state[0]; for (size_t j = 0; j < order - 1; ++j) - state[j] = (c[j + 1] * sample) - (c[order + j + 1] * out) + state[j + 1]; + state[j] = (c[j + 1] * sample) - (c[order + j + 1] * output) + state[j + 1]; - state[order - 1] = (c[order] * sample) - (c[order * 2] * out); + state[order - 1] = (c[order] * sample) - (c[order * 2] * output); - return out; + return output; } template diff --git a/modules/juce_gui_basics/mouse/juce_SelectedItemSet.h b/modules/juce_gui_basics/mouse/juce_SelectedItemSet.h index 79fcb50059..723cc2beb1 100644 --- a/modules/juce_gui_basics/mouse/juce_SelectedItemSet.h +++ b/modules/juce_gui_basics/mouse/juce_SelectedItemSet.h @@ -53,9 +53,7 @@ public: //============================================================================== /** Creates an empty set. */ - SelectedItemSet() - { - } + SelectedItemSet() = default; /** Creates a set based on an array of items. */ explicit SelectedItemSet (const ItemArray& items) @@ -65,7 +63,7 @@ public: /** Creates a copy of another set. */ SelectedItemSet (const SelectedItemSet& other) - : selectedItems (other.selectedItems) + : ChangeBroadcaster(), selectedItems (other.selectedItems) { } diff --git a/modules/juce_gui_extra/juce_gui_extra.cpp b/modules/juce_gui_extra/juce_gui_extra.cpp index 49b2d6b422..e107705425 100644 --- a/modules/juce_gui_extra/juce_gui_extra.cpp +++ b/modules/juce_gui_extra/juce_gui_extra.cpp @@ -100,7 +100,18 @@ #include #include #include + + #if JUCE_GCC && __GNUC__ > 7 + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wparentheses" + #endif + #include + + #if JUCE_GCC && __GNUC__ > 7 + #pragma GCC diagnostic pop + #endif + #include #include #include diff --git a/modules/juce_osc/osc/juce_OSCReceiver.cpp b/modules/juce_osc/osc/juce_OSCReceiver.cpp index 97b3eb77fd..0f60abb666 100644 --- a/modules/juce_osc/osc/juce_OSCReceiver.cpp +++ b/modules/juce_osc/osc/juce_OSCReceiver.cpp @@ -439,7 +439,7 @@ struct OSCReceiver::Pimpl : private Thread, if (listeners.size() > 0 || listenersWithAddress.size() > 0) postMessage (new CallbackMessage (content)); } - catch (OSCFormatError) + catch (const OSCFormatError&) { if (formatErrorHandler != nullptr) formatErrorHandler (data, (int) dataSize);