Browse Source

Warnings: Silence some GCC warnings

tags/2021-05-28
reuk 5 years ago
parent
commit
f49b3733ec
No known key found for this signature in database GPG Key ID: 9ADCD339CFC98A11
7 changed files with 22 additions and 8 deletions
  1. +1
    -1
      modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp
  2. +10
    -4
      modules/juce_audio_plugin_client/Unity/juce_Unity_Wrapper.cpp
  3. +4
    -0
      modules/juce_core/javascript/juce_Javascript.cpp
  4. +2
    -0
      modules/juce_core/memory/juce_LeakedObjectDetector.h
  5. +1
    -1
      modules/juce_gui_basics/native/juce_ios_UIViewComponentPeer.mm
  6. +3
    -2
      modules/juce_gui_basics/native/juce_linux_Windowing.cpp
  7. +1
    -0
      modules/juce_gui_basics/native/juce_win32_Windowing.cpp

+ 1
- 1
modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp View File

@@ -28,7 +28,7 @@
#include "../../juce_audio_processors/format_types/juce_LegacyAudioParameter.cpp" #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", JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wnon-virtual-dtor",
"-Wsign-conversion", "-Wsign-conversion",
"-Wextra-semi", "-Wextra-semi",


+ 10
- 4
modules/juce_audio_plugin_client/Unity/juce_Unity_Wrapper.cpp View File

@@ -52,6 +52,9 @@ public:
Point<float> localToGlobal (Point<float> relativePosition) override { return relativePosition + getBounds().getPosition().toFloat(); } Point<float> localToGlobal (Point<float> relativePosition) override { return relativePosition + getBounds().getPosition().toFloat(); }
Point<float> globalToLocal (Point<float> screenPosition) override { return screenPosition - getBounds().getPosition().toFloat(); } Point<float> globalToLocal (Point<float> screenPosition) override { return screenPosition - getBounds().getPosition().toFloat(); }
using ComponentPeer::localToGlobal;
using ComponentPeer::globalToLocal;
StringArray getAvailableRenderingEngines() override { return StringArray ("Software Renderer"); } StringArray getAvailableRenderingEngines() override { return StringArray ("Software Renderer"); }
void setBounds (const Rectangle<int>& newBounds, bool) override void setBounds (const Rectangle<int>& newBounds, bool) override
@@ -368,10 +371,13 @@ public:
auto* parameter = juceParameters.params[i]; auto* parameter = juceParameters.params[i];
auto& paramDef = parametersPtr.get()[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()) if (parameter->getLabel().isNotEmpty())
strncpy (paramDef.unit, parameter->getLabel().toRawUTF8(), 15);
parameter->getLabel().copyToUTF8 (paramDef.unit, unitLength);
parameterDescriptions.add (parameter->getName (15)); parameterDescriptions.add (parameter->getName (15));
paramDef.description = parameterDescriptions[i].toRawUTF8(); paramDef.description = parameterDescriptions[i].toRawUTF8();
@@ -546,7 +552,7 @@ namespace UnityCallbacks
auto* pluginInstance = state->getEffectData<AudioProcessorUnityWrapper>(); auto* pluginInstance = state->getEffectData<AudioProcessorUnityWrapper>();
*value = pluginInstance->getParameter (index); *value = pluginInstance->getParameter (index);
strncpy (valueStr, pluginInstance->getParameterString (index).toRawUTF8(), 15);
pluginInstance->getParameterString (index).copyToUTF8 (valueStr, 15);
return 0; return 0;
} }
@@ -630,7 +636,7 @@ static void declareEffect (UnityAudioEffectDefinition& definition)
if (! name.startsWithIgnoreCase ("audioplugin")) if (! name.startsWithIgnoreCase ("audioplugin"))
name = "audioplugin_" + name; name = "audioplugin_" + name;
strcpy (definition.name, name.toRawUTF8());
name.copyToUTF8 (definition.name, (size_t) numElementsInArray (definition.name));
definition.structSize = sizeof (UnityAudioEffectDefinition); definition.structSize = sizeof (UnityAudioEffectDefinition);
definition.parameterStructSize = sizeof (UnityAudioParameterDefinition); definition.parameterStructSize = sizeof (UnityAudioParameterDefinition);


+ 4
- 0
modules/juce_core/javascript/juce_Javascript.cpp View File

@@ -814,7 +814,9 @@ struct JavascriptEngine::RootObject : public DynamicObject
a.add (values.getUnchecked(i)->getResult (s)); a.add (values.getUnchecked(i)->getResult (s));
// std::move() needed here for older compilers // std::move() needed here for older compilers
JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wredundant-move")
return std::move (a); return std::move (a);
JUCE_END_IGNORE_WARNINGS_GCC_LIKE
} }
OwnedArray<Expression> values; OwnedArray<Expression> values;
@@ -1624,7 +1626,9 @@ struct JavascriptEngine::RootObject : public DynamicObject
array->insert (start++, get (a, i)); array->insert (start++, get (a, i));
// std::move() needed here for older compilers // std::move() needed here for older compilers
JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wredundant-move")
return std::move (itemsRemoved); return std::move (itemsRemoved);
JUCE_END_IGNORE_WARNINGS_GCC_LIKE
} }
return var::undefined(); return var::undefined();


+ 2
- 0
modules/juce_core/memory/juce_LeakedObjectDetector.h View File

@@ -46,6 +46,8 @@ public:
LeakedObjectDetector() noexcept { ++(getCounter().numObjects); } LeakedObjectDetector() noexcept { ++(getCounter().numObjects); }
LeakedObjectDetector (const LeakedObjectDetector&) noexcept { ++(getCounter().numObjects); } LeakedObjectDetector (const LeakedObjectDetector&) noexcept { ++(getCounter().numObjects); }
LeakedObjectDetector& operator= (const LeakedObjectDetector&) noexcept = default;
~LeakedObjectDetector() ~LeakedObjectDetector()
{ {
if (--(getCounter().numObjects) < 0) if (--(getCounter().numObjects) < 0)


+ 1
- 1
modules/juce_gui_basics/native/juce_ios_UIViewComponentPeer.mm View File

@@ -222,8 +222,8 @@ public:
Rectangle<int> getBounds() const override { return getBounds (! isSharedWindow); } Rectangle<int> getBounds() const override { return getBounds (! isSharedWindow); }
Rectangle<int> getBounds (bool global) const; Rectangle<int> getBounds (bool global) const;
Point<float> localToGlobal (Point<float> relativePosition) override; Point<float> localToGlobal (Point<float> relativePosition) override;
using ComponentPeer::localToGlobal;
Point<float> globalToLocal (Point<float> screenPosition) override; Point<float> globalToLocal (Point<float> screenPosition) override;
using ComponentPeer::localToGlobal;
using ComponentPeer::globalToLocal; using ComponentPeer::globalToLocal;
void setAlpha (float newAlpha) override; void setAlpha (float newAlpha) override;
void setMinimised (bool) override {} void setMinimised (bool) override {}


+ 3
- 2
modules/juce_gui_basics/native/juce_linux_Windowing.cpp View File

@@ -113,18 +113,19 @@ public:
return windowBorder; return windowBorder;
} }
using ComponentPeer::localToGlobal;
Point<float> localToGlobal (Point<float> relativePosition) override Point<float> localToGlobal (Point<float> relativePosition) override
{ {
return relativePosition + getScreenPosition (false).toFloat(); return relativePosition + getScreenPosition (false).toFloat();
} }
using ComponentPeer::globalToLocal;
Point<float> globalToLocal (Point<float> screenPosition) override Point<float> globalToLocal (Point<float> screenPosition) override
{ {
return screenPosition - getScreenPosition (false).toFloat(); return screenPosition - getScreenPosition (false).toFloat();
} }
using ComponentPeer::localToGlobal;
using ComponentPeer::globalToLocal;
//============================================================================== //==============================================================================
StringArray getAvailableRenderingEngines() override StringArray getAvailableRenderingEngines() override
{ {


+ 1
- 0
modules/juce_gui_basics/native/juce_win32_Windowing.cpp View File

@@ -1431,6 +1431,7 @@ public:
Point<float> localToGlobal (Point<float> relativePosition) override { return relativePosition + getScreenPosition().toFloat(); } Point<float> localToGlobal (Point<float> relativePosition) override { return relativePosition + getScreenPosition().toFloat(); }
Point<float> globalToLocal (Point<float> screenPosition) override { return screenPosition - getScreenPosition().toFloat(); } Point<float> globalToLocal (Point<float> screenPosition) override { return screenPosition - getScreenPosition().toFloat(); }
using ComponentPeer::localToGlobal; using ComponentPeer::localToGlobal;
using ComponentPeer::globalToLocal; using ComponentPeer::globalToLocal;


Loading…
Cancel
Save