Browse Source

Fixed more compiler warnings

tags/2021-05-28
Tom Poole 6 years ago
parent
commit
d4b7cceb32
6 changed files with 59 additions and 25 deletions
  1. +11
    -4
      modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp
  2. +31
    -12
      modules/juce_audio_plugin_client/AU/juce_AU_Wrapper.mm
  3. +2
    -2
      modules/juce_audio_plugin_client/AU/juce_AUv3_Wrapper.mm
  4. +1
    -1
      modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp
  5. +6
    -6
      modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp
  6. +8
    -0
      modules/juce_audio_plugin_client/juce_audio_plugin_client_AU_2.mm

+ 11
- 4
modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp View File

@@ -41,9 +41,16 @@
#pragma clang diagnostic ignored "-Wnon-virtual-dtor" #pragma clang diagnostic ignored "-Wnon-virtual-dtor"
#pragma clang diagnostic ignored "-Wsign-conversion" #pragma clang diagnostic ignored "-Wsign-conversion"
#pragma clang diagnostic ignored "-Wextra-semi" #pragma clang diagnostic ignored "-Wextra-semi"
#pragma clang diagnostic ignored "-Wshift-sign-overflow"
#if __has_warning("-Wpragma-pack") #if __has_warning("-Wpragma-pack")
#pragma clang diagnostic ignored "-Wpragma-pack" #pragma clang diagnostic ignored "-Wpragma-pack"
#endif #endif
#if __has_warning("-Wzero-as-null-pointer-constant")
#pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant"
#endif
#if __has_warning("-Winconsistent-missing-destructor-override")
#pragma clang diagnostic ignored "-Winconsistent-missing-destructor-override"
#endif
#endif #endif
#ifdef _MSC_VER #ifdef _MSC_VER
@@ -455,8 +462,8 @@ namespace AAXClasses
public ModifierKeyProvider public ModifierKeyProvider
{ {
public: public:
JuceAAX_GUI() {}
~JuceAAX_GUI() { DeleteViewContainer(); }
JuceAAX_GUI() = default;
~JuceAAX_GUI() override { DeleteViewContainer(); }
static AAX_IEffectGUI* AAX_CALLBACK Create() { return new JuceAAX_GUI(); } static AAX_IEffectGUI* AAX_CALLBACK Create() { return new JuceAAX_GUI(); }
@@ -580,7 +587,7 @@ namespace AAXClasses
ignoreUnused (fakeMouseGenerator); ignoreUnused (fakeMouseGenerator);
} }
~ContentWrapperComponent()
~ContentWrapperComponent() override
{ {
if (pluginEditor != nullptr) if (pluginEditor != nullptr)
{ {
@@ -681,7 +688,7 @@ namespace AAXClasses
activeProcessors.add (this); activeProcessors.add (this);
} }
~JuceAAX_Processor()
~JuceAAX_Processor() override
{ {
activeProcessors.removeAllInstancesOf (this); activeProcessors.removeAllInstancesOf (this);
} }


+ 31
- 12
modules/juce_audio_plugin_client/AU/juce_AU_Wrapper.mm View File

@@ -33,7 +33,7 @@
#define JUCE_SUPPORT_CARBON 0 #define JUCE_SUPPORT_CARBON 0
#endif #endif
#ifdef __clang__
#ifdef JUCE_CLANG
#pragma clang diagnostic push #pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wshorten-64-to-32" #pragma clang diagnostic ignored "-Wshorten-64-to-32"
#pragma clang diagnostic ignored "-Wunused-parameter" #pragma clang diagnostic ignored "-Wunused-parameter"
@@ -42,6 +42,13 @@
#pragma clang diagnostic ignored "-Wconversion" #pragma clang diagnostic ignored "-Wconversion"
#pragma clang diagnostic ignored "-Woverloaded-virtual" #pragma clang diagnostic ignored "-Woverloaded-virtual"
#pragma clang diagnostic ignored "-Wextra-semi" #pragma clang diagnostic ignored "-Wextra-semi"
#pragma clang diagnostic ignored "-Wcast-align"
#if __has_warning("-Wzero-as-null-pointer-constant")
#pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant"
#endif
#if __has_warning("-Wnullable-to-nonnull-conversion")
#pragma clang diagnostic ignored "-Wnullable-to-nonnull-conversion"
#endif
#endif #endif
#include "../utility/juce_IncludeSystemHeaders.h" #include "../utility/juce_IncludeSystemHeaders.h"
@@ -69,7 +76,7 @@
#include "CoreAudioUtilityClasses/AUCarbonViewBase.h" #include "CoreAudioUtilityClasses/AUCarbonViewBase.h"
#endif #endif
#ifdef __clang__
#ifdef JUCE_CLANG
#pragma clang diagnostic pop #pragma clang diagnostic pop
#endif #endif
@@ -179,7 +186,7 @@ public:
jassertfalse; jassertfalse;
} }
~JuceAU()
~JuceAU() override
{ {
if (bypassParam != nullptr) if (bypassParam != nullptr)
bypassParam->removeListener (this); bypassParam->removeListener (this);
@@ -726,7 +733,7 @@ public:
if (juceFilter != nullptr) if (juceFilter != nullptr)
{ {
CFDictionaryRef dict = (CFDictionaryRef) inData; CFDictionaryRef dict = (CFDictionaryRef) inData;
CFDataRef data = 0;
CFDataRef data = nullptr;
CFStringRef key = CFStringCreateWithCString (kCFAllocatorDefault, JUCE_STATE_DICTIONARY_KEY, kCFStringEncodingUTF8); CFStringRef key = CFStringCreateWithCString (kCFAllocatorDefault, JUCE_STATE_DICTIONARY_KEY, kCFStringEncodingUTF8);
@@ -735,7 +742,7 @@ public:
if (valuePresent) if (valuePresent)
{ {
if (data != 0)
if (data != nullptr)
{ {
const int numBytes = (int) CFDataGetLength (data); const int numBytes = (int) CFDataGetLength (data);
const juce::uint8* const rawBytes = CFDataGetBytePtr (data); const juce::uint8* const rawBytes = CFDataGetBytePtr (data);
@@ -968,10 +975,10 @@ public:
if (auto* valueStrings = parameterValueStringArrays[index]) if (auto* valueStrings = parameterValueStringArrays[index])
{ {
*outStrings = CFArrayCreate (NULL,
*outStrings = CFArrayCreate (nullptr,
(const void **) valueStrings->getRawDataPointer(), (const void **) valueStrings->getRawDataPointer(),
valueStrings->size(), valueStrings->size(),
NULL);
nullptr);
return noErr; return noErr;
} }
@@ -1129,7 +1136,7 @@ public:
{ {
auEvent.mEventType = type; auEvent.mEventType = type;
auEvent.mArgument.mParameter.mParameterID = getAUParameterIDForIndex (juceParamIndex); auEvent.mArgument.mParameter.mParameterID = getAUParameterIDForIndex (juceParamIndex);
AUEventListenerNotify (0, 0, &auEvent);
AUEventListenerNotify (nullptr, nullptr, &auEvent);
} }
void audioProcessorParameterChanged (AudioProcessor*, int index, float /*newValue*/) override void audioProcessorParameterChanged (AudioProcessor*, int index, float /*newValue*/) override
@@ -1402,7 +1409,7 @@ public:
clearPresetsArray(); clearPresetsArray();
presetsArray.insertMultiple (0, AUPreset(), numPrograms); presetsArray.insertMultiple (0, AUPreset(), numPrograms);
CFMutableArrayRef presetsArrayRef = CFArrayCreateMutable (0, numPrograms, 0);
CFMutableArrayRef presetsArrayRef = CFArrayCreateMutable (nullptr, numPrograms, nullptr);
for (int i = 0; i < numPrograms; ++i) for (int i = 0; i < numPrograms; ++i)
{ {
@@ -1478,7 +1485,7 @@ public:
setBounds (getSizeToContainChild()); setBounds (getSizeToContainChild());
} }
~EditorCompHolder()
~EditorCompHolder() override
{ {
deleteAllChildren(); // note that we can't use a std::unique_ptr because the editor may deleteAllChildren(); // note that we can't use a std::unique_ptr because the editor may
// have been transferred to another parent which takes over ownership. // have been transferred to another parent which takes over ownership.
@@ -1564,7 +1571,7 @@ public:
NSWindow* hostWindow = [hostView window]; NSWindow* hostWindow = [hostView window];
[hostWindow makeFirstResponder: hostView]; [hostWindow makeFirstResponder: hostView];
[hostView keyDown: [NSApp currentEvent]];
[hostView keyDown: (NSEvent*) [NSApp currentEvent]];
[hostWindow makeFirstResponder: view]; [hostWindow makeFirstResponder: view];
} }
} }
@@ -1976,7 +1983,7 @@ private:
#if JUCE_USE_STUDIO_ONE_COMPATIBLE_PARAMETERS #if JUCE_USE_STUDIO_ONE_COMPATIBLE_PARAMETERS
// studio one doesn't like negative parameters // studio one doesn't like negative parameters
paramHash &= ~(1 << (sizeof (AudioUnitParameterID) * 8 - 1));
paramHash &= ~(((AudioUnitParameterID) 1) << (sizeof (AudioUnitParameterID) * 8 - 1));
#endif #endif
return forceUseLegacyParamIDs ? static_cast<AudioUnitParameterID> (juceParamID.getIntValue()) return forceUseLegacyParamIDs ? static_cast<AudioUnitParameterID> (juceParamID.getIntValue())
@@ -2487,7 +2494,19 @@ JUCE_FACTORY_ENTRY (JuceAU, JucePlugin_AUExportPrefix)
#endif #endif
#if ! JUCE_DISABLE_AU_FACTORY_ENTRY #if ! JUCE_DISABLE_AU_FACTORY_ENTRY
#ifdef JUCE_CLANG
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wcast-align"
#if __has_warning("-Wzero-as-null-pointer-constant")
#pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant"
#endif
#endif
#include "CoreAudioUtilityClasses/AUPlugInDispatch.cpp" #include "CoreAudioUtilityClasses/AUPlugInDispatch.cpp"
#ifdef JUCE_CLANG
#pragma clang diagnostic push
#endif
#endif #endif
#endif #endif

+ 2
- 2
modules/juce_audio_plugin_client/AU/juce_AUv3_Wrapper.mm View File

@@ -131,7 +131,7 @@ public:
initialiseJuce_GUI(); initialiseJuce_GUI();
} }
virtual ~JuceAudioUnitv3Base() {}
virtual ~JuceAudioUnitv3Base() = default;
//============================================================================== //==============================================================================
AUAudioUnit* getAudioUnit() noexcept { return au; } AUAudioUnit* getAudioUnit() noexcept { return au; }
@@ -441,7 +441,7 @@ public:
init(); init();
} }
~JuceAudioUnitv3()
~JuceAudioUnitv3() override
{ {
auto& processor = getAudioProcessor(); auto& processor = getAudioProcessor();
processor.removeListener (this); processor.removeListener (this);


+ 1
- 1
modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp View File

@@ -1339,7 +1339,7 @@ public:
#endif #endif
#if JUCE_LINUX #if JUCE_LINUX
hostWindow = 0;
hostWindow = {};
#endif #endif
} }


+ 6
- 6
modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp View File

@@ -309,7 +309,7 @@ private:
#if JUCE_USE_STUDIO_ONE_COMPATIBLE_PARAMETERS #if JUCE_USE_STUDIO_ONE_COMPATIBLE_PARAMETERS
// studio one doesn't like negative parameters // studio one doesn't like negative parameters
paramHash &= ~(1 << (sizeof (Vst::ParamID) * 8 - 1));
paramHash &= ~(((Vst::ParamID) 1) << (sizeof (Vst::ParamID) * 8 - 1));
#endif #endif
return paramHash; return paramHash;
@@ -454,7 +454,7 @@ public:
valueNormalized = info.defaultNormalizedValue; valueNormalized = info.defaultNormalizedValue;
} }
virtual ~Param() {}
virtual ~Param() override = default;
bool setNormalized (Vst::ParamValue v) override bool setNormalized (Vst::ParamValue v) override
{ {
@@ -537,7 +537,7 @@ public:
info.flags = Vst::ParameterInfo::kIsProgramChange | Vst::ParameterInfo::kCanAutomate; info.flags = Vst::ParameterInfo::kIsProgramChange | Vst::ParameterInfo::kCanAutomate;
} }
virtual ~ProgramChangeParameter() {}
virtual ~ProgramChangeParameter() override = default;
bool setNormalized (Vst::ParamValue v) override bool setNormalized (Vst::ParamValue v) override
{ {
@@ -991,7 +991,7 @@ private:
parameterToMidiController[p].ctrlNumber = i; parameterToMidiController[p].ctrlNumber = i;
parameters.addParameter (new Vst::Parameter (toString ("MIDI CC " + String (c) + "|" + String (i)), parameters.addParameter (new Vst::Parameter (toString ("MIDI CC " + String (c) + "|" + String (i)),
static_cast<Vst::ParamID> (p) + parameterToMidiControllerOffset, 0, 0, 0,
static_cast<Vst::ParamID> (p) + parameterToMidiControllerOffset, nullptr, 0, 0,
0, Vst::kRootUnitId)); 0, Vst::kRootUnitId));
} }
} }
@@ -1342,7 +1342,7 @@ private:
ignoreUnused (fakeMouseGenerator); ignoreUnused (fakeMouseGenerator);
} }
~ContentWrapperComponent()
~ContentWrapperComponent() override
{ {
if (pluginEditor != nullptr) if (pluginEditor != nullptr)
{ {
@@ -1573,7 +1573,7 @@ public:
pluginInstance->setPlayHead (this); pluginInstance->setPlayHead (this);
} }
~JuceVST3Component()
~JuceVST3Component() override
{ {
if (juceVST3EditController != nullptr) if (juceVST3EditController != nullptr)
juceVST3EditController->vst3IsPlaying = 0; juceVST3EditController->vst3IsPlaying = 0;


+ 8
- 0
modules/juce_audio_plugin_client/juce_audio_plugin_client_AU_2.mm View File

@@ -35,6 +35,14 @@
#pragma clang diagnostic ignored "-Wextra-semi" #pragma clang diagnostic ignored "-Wextra-semi"
#pragma clang diagnostic ignored "-Wformat-pedantic" #pragma clang diagnostic ignored "-Wformat-pedantic"
#pragma clang diagnostic ignored "-Wgnu-zero-variadic-macro-arguments" #pragma clang diagnostic ignored "-Wgnu-zero-variadic-macro-arguments"
#pragma clang diagnostic ignored "-Wshadow-all"
#pragma clang diagnostic ignored "-Wcast-align"
#if __has_warning("-Wzero-as-null-pointer-constant")
#pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant"
#endif
#if __has_warning("-Wnullable-to-nonnull-conversion")
#pragma clang diagnostic ignored "-Wnullable-to-nonnull-conversion"
#endif
#endif #endif
// From MacOS 10.13 and iOS 11 Apple has (sensibly!) stopped defining a whole // From MacOS 10.13 and iOS 11 Apple has (sensibly!) stopped defining a whole


Loading…
Cancel
Save