mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Warnings: Silence some GCC warnings
This commit is contained in:
parent
f0642979f9
commit
f49b3733ec
7 changed files with 22 additions and 8 deletions
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -52,6 +52,9 @@ public:
|
|||
Point<float> localToGlobal (Point<float> relativePosition) override { return relativePosition + 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"); }
|
||||
|
||||
void setBounds (const Rectangle<int>& 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<AudioProcessorUnityWrapper>();
|
||||
*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);
|
||||
|
|
|
|||
|
|
@ -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<Expression> 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();
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -222,8 +222,8 @@ public:
|
|||
Rectangle<int> getBounds() const override { return getBounds (! isSharedWindow); }
|
||||
Rectangle<int> getBounds (bool global) const;
|
||||
Point<float> localToGlobal (Point<float> relativePosition) override;
|
||||
using ComponentPeer::localToGlobal;
|
||||
Point<float> globalToLocal (Point<float> screenPosition) override;
|
||||
using ComponentPeer::localToGlobal;
|
||||
using ComponentPeer::globalToLocal;
|
||||
void setAlpha (float newAlpha) override;
|
||||
void setMinimised (bool) override {}
|
||||
|
|
|
|||
|
|
@ -113,18 +113,19 @@ public:
|
|||
return windowBorder;
|
||||
}
|
||||
|
||||
using ComponentPeer::localToGlobal;
|
||||
Point<float> localToGlobal (Point<float> relativePosition) override
|
||||
{
|
||||
return relativePosition + getScreenPosition (false).toFloat();
|
||||
}
|
||||
|
||||
using ComponentPeer::globalToLocal;
|
||||
Point<float> globalToLocal (Point<float> screenPosition) override
|
||||
{
|
||||
return screenPosition - getScreenPosition (false).toFloat();
|
||||
}
|
||||
|
||||
using ComponentPeer::localToGlobal;
|
||||
using ComponentPeer::globalToLocal;
|
||||
|
||||
//==============================================================================
|
||||
StringArray getAvailableRenderingEngines() override
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1431,6 +1431,7 @@ public:
|
|||
|
||||
Point<float> localToGlobal (Point<float> relativePosition) override { return relativePosition + getScreenPosition().toFloat(); }
|
||||
Point<float> globalToLocal (Point<float> screenPosition) override { return screenPosition - getScreenPosition().toFloat(); }
|
||||
|
||||
using ComponentPeer::localToGlobal;
|
||||
using ComponentPeer::globalToLocal;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue