diff --git a/modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp b/modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp index 384359f13e..c1081898ba 100644 --- a/modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp +++ b/modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp @@ -28,7 +28,7 @@ #include "../../juce_audio_processors/format_types/juce_LegacyAudioParameter.cpp" -JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4127 4512) +JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4127 4512 4996) JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wnon-virtual-dtor", "-Wsign-conversion", "-Wextra-semi", diff --git a/modules/juce_audio_plugin_client/Unity/juce_Unity_Wrapper.cpp b/modules/juce_audio_plugin_client/Unity/juce_Unity_Wrapper.cpp index f4c9b22fbe..392fdf5ffd 100644 --- a/modules/juce_audio_plugin_client/Unity/juce_Unity_Wrapper.cpp +++ b/modules/juce_audio_plugin_client/Unity/juce_Unity_Wrapper.cpp @@ -52,6 +52,9 @@ public: Point localToGlobal (Point relativePosition) override { return relativePosition + getBounds().getPosition().toFloat(); } Point globalToLocal (Point screenPosition) override { return screenPosition - getBounds().getPosition().toFloat(); } + using ComponentPeer::localToGlobal; + using ComponentPeer::globalToLocal; + StringArray getAvailableRenderingEngines() override { return StringArray ("Software Renderer"); } void setBounds (const Rectangle& newBounds, bool) override @@ -368,10 +371,13 @@ public: auto* parameter = juceParameters.params[i]; auto& paramDef = parametersPtr.get()[i]; - strncpy (paramDef.name, parameter->getName (15).toRawUTF8(), 15); + const auto nameLength = (size_t) numElementsInArray (paramDef.name); + const auto unitLength = (size_t) numElementsInArray (paramDef.unit); + + parameter->getName ((int) nameLength - 1).copyToUTF8 (paramDef.name, nameLength); if (parameter->getLabel().isNotEmpty()) - strncpy (paramDef.unit, parameter->getLabel().toRawUTF8(), 15); + parameter->getLabel().copyToUTF8 (paramDef.unit, unitLength); parameterDescriptions.add (parameter->getName (15)); paramDef.description = parameterDescriptions[i].toRawUTF8(); @@ -546,7 +552,7 @@ namespace UnityCallbacks auto* pluginInstance = state->getEffectData(); *value = pluginInstance->getParameter (index); - strncpy (valueStr, pluginInstance->getParameterString (index).toRawUTF8(), 15); + pluginInstance->getParameterString (index).copyToUTF8 (valueStr, 15); return 0; } @@ -630,7 +636,7 @@ static void declareEffect (UnityAudioEffectDefinition& definition) if (! name.startsWithIgnoreCase ("audioplugin")) name = "audioplugin_" + name; - strcpy (definition.name, name.toRawUTF8()); + name.copyToUTF8 (definition.name, (size_t) numElementsInArray (definition.name)); definition.structSize = sizeof (UnityAudioEffectDefinition); definition.parameterStructSize = sizeof (UnityAudioParameterDefinition); diff --git a/modules/juce_core/javascript/juce_Javascript.cpp b/modules/juce_core/javascript/juce_Javascript.cpp index a85184c7aa..77cb2d9811 100644 --- a/modules/juce_core/javascript/juce_Javascript.cpp +++ b/modules/juce_core/javascript/juce_Javascript.cpp @@ -814,7 +814,9 @@ struct JavascriptEngine::RootObject : public DynamicObject a.add (values.getUnchecked(i)->getResult (s)); // std::move() needed here for older compilers + JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wredundant-move") return std::move (a); + JUCE_END_IGNORE_WARNINGS_GCC_LIKE } OwnedArray values; @@ -1624,7 +1626,9 @@ struct JavascriptEngine::RootObject : public DynamicObject array->insert (start++, get (a, i)); // std::move() needed here for older compilers + JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wredundant-move") return std::move (itemsRemoved); + JUCE_END_IGNORE_WARNINGS_GCC_LIKE } return var::undefined(); diff --git a/modules/juce_core/memory/juce_LeakedObjectDetector.h b/modules/juce_core/memory/juce_LeakedObjectDetector.h index ce15910d0a..f14c70085f 100644 --- a/modules/juce_core/memory/juce_LeakedObjectDetector.h +++ b/modules/juce_core/memory/juce_LeakedObjectDetector.h @@ -46,6 +46,8 @@ public: LeakedObjectDetector() noexcept { ++(getCounter().numObjects); } LeakedObjectDetector (const LeakedObjectDetector&) noexcept { ++(getCounter().numObjects); } + LeakedObjectDetector& operator= (const LeakedObjectDetector&) noexcept = default; + ~LeakedObjectDetector() { if (--(getCounter().numObjects) < 0) diff --git a/modules/juce_gui_basics/native/juce_ios_UIViewComponentPeer.mm b/modules/juce_gui_basics/native/juce_ios_UIViewComponentPeer.mm index e23aad7822..96a4078612 100644 --- a/modules/juce_gui_basics/native/juce_ios_UIViewComponentPeer.mm +++ b/modules/juce_gui_basics/native/juce_ios_UIViewComponentPeer.mm @@ -222,8 +222,8 @@ public: Rectangle getBounds() const override { return getBounds (! isSharedWindow); } Rectangle getBounds (bool global) const; Point localToGlobal (Point relativePosition) override; - using ComponentPeer::localToGlobal; Point globalToLocal (Point screenPosition) override; + using ComponentPeer::localToGlobal; using ComponentPeer::globalToLocal; void setAlpha (float newAlpha) override; void setMinimised (bool) override {} diff --git a/modules/juce_gui_basics/native/juce_linux_Windowing.cpp b/modules/juce_gui_basics/native/juce_linux_Windowing.cpp index 93e158e224..42c73654f5 100644 --- a/modules/juce_gui_basics/native/juce_linux_Windowing.cpp +++ b/modules/juce_gui_basics/native/juce_linux_Windowing.cpp @@ -113,18 +113,19 @@ public: return windowBorder; } - using ComponentPeer::localToGlobal; Point localToGlobal (Point relativePosition) override { return relativePosition + getScreenPosition (false).toFloat(); } - using ComponentPeer::globalToLocal; Point globalToLocal (Point screenPosition) override { return screenPosition - getScreenPosition (false).toFloat(); } + using ComponentPeer::localToGlobal; + using ComponentPeer::globalToLocal; + //============================================================================== StringArray getAvailableRenderingEngines() override { diff --git a/modules/juce_gui_basics/native/juce_win32_Windowing.cpp b/modules/juce_gui_basics/native/juce_win32_Windowing.cpp index 371619fc9d..6c2a7d17fe 100644 --- a/modules/juce_gui_basics/native/juce_win32_Windowing.cpp +++ b/modules/juce_gui_basics/native/juce_win32_Windowing.cpp @@ -1431,6 +1431,7 @@ public: Point localToGlobal (Point relativePosition) override { return relativePosition + getScreenPosition().toFloat(); } Point globalToLocal (Point screenPosition) override { return screenPosition - getScreenPosition().toFloat(); } + using ComponentPeer::localToGlobal; using ComponentPeer::globalToLocal;