From fd60158af1819cfcabde661bc183c5c4273b201c Mon Sep 17 00:00:00 2001 From: Tom Poole Date: Thu, 12 Dec 2019 21:57:21 +0000 Subject: [PATCH] macOS: Fixed some compiler warnings --- .../juce_audio_plugin_client_AU_2.mm | 3 +++ .../format_types/juce_VST3Common.h | 2 +- .../format_types/juce_VST3Headers.h | 6 ++++++ .../format_types/juce_VST3PluginFormat.cpp | 12 ++++++------ 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/modules/juce_audio_plugin_client/juce_audio_plugin_client_AU_2.mm b/modules/juce_audio_plugin_client/juce_audio_plugin_client_AU_2.mm index 8250ac795e..5b83f67116 100644 --- a/modules/juce_audio_plugin_client/juce_audio_plugin_client_AU_2.mm +++ b/modules/juce_audio_plugin_client/juce_audio_plugin_client_AU_2.mm @@ -45,6 +45,9 @@ #if __has_warning("-Wnullable-to-nonnull-conversion") #pragma clang diagnostic ignored "-Wnullable-to-nonnull-conversion" #endif + #if __has_warning("-Wignored-qualifiers") + #pragma clang diagnostic ignored "-Wignored-qualifiers" + #endif #endif // From MacOS 10.13 and iOS 11 Apple has (sensibly!) stopped defining a whole diff --git a/modules/juce_audio_processors/format_types/juce_VST3Common.h b/modules/juce_audio_processors/format_types/juce_VST3Common.h index dbbc8e163d..dc40caf601 100644 --- a/modules/juce_audio_processors/format_types/juce_VST3Common.h +++ b/modules/juce_audio_processors/format_types/juce_VST3Common.h @@ -536,7 +536,7 @@ public: } } - Steinberg::Vst::Event e = { 0 }; + Steinberg::Vst::Event e{}; if (msg.isNoteOn()) { diff --git a/modules/juce_audio_processors/format_types/juce_VST3Headers.h b/modules/juce_audio_processors/format_types/juce_VST3Headers.h index ccdfa19a72..f8b1351de7 100644 --- a/modules/juce_audio_processors/format_types/juce_VST3Headers.h +++ b/modules/juce_audio_processors/format_types/juce_VST3Headers.h @@ -65,6 +65,12 @@ #if __has_warning("-Wcast-align") #pragma clang diagnostic ignored "-Wcast-align" #endif + #if __has_warning("-Wignored-qualifiers") + #pragma clang diagnostic ignored "-Wignored-qualifiers" + #endif + #if __has_warning("-Wmissing-field-initializers") + #pragma clang diagnostic ignored "-Wmissing-field-initializers" + #endif #endif #undef DEVELOPMENT diff --git a/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp b/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp index 2f2a33750c..ff99a5485a 100644 --- a/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp +++ b/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp @@ -2561,7 +2561,7 @@ private: for (int i = 1; i < numUnits; ++i) { - Vst::UnitInfo ui = { 0 }; + Vst::UnitInfo ui{}; unitInfo->getUnitInfo (i, ui); infoMap[ui.id] = std::move (ui); } @@ -2777,7 +2777,7 @@ private: Vst::ParameterInfo getParameterInfoForIndex (int index) const { - Vst::ParameterInfo paramInfo = { 0 }; + Vst::ParameterInfo paramInfo{}; if (processor != nullptr) editController->getParameterInfo (index, paramInfo); @@ -2787,7 +2787,7 @@ private: Vst::ProgramListInfo getProgramListInfo (int index) const { - Vst::ProgramListInfo paramInfo = { 0 }; + Vst::ProgramListInfo paramInfo{}; if (unitInfo != nullptr) unitInfo->getProgramListInfo (index, paramInfo); @@ -2803,7 +2803,7 @@ private: return; Vst::UnitID programUnitID; - Vst::ParameterInfo paramInfo = { 0 }; + Vst::ParameterInfo paramInfo{}; { int idx, num = editController->getParameterCount(); @@ -2822,7 +2822,7 @@ private: if (unitInfo != nullptr) { - Vst::UnitInfo uInfo = { 0 }; + Vst::UnitInfo uInfo{}; const int unitCount = unitInfo->getUnitCount(); for (int idx = 0; idx < unitCount; ++idx) @@ -2834,7 +2834,7 @@ private: for (int j = 0; j < programListCount; ++j) { - Vst::ProgramListInfo programListInfo = { 0 }; + Vst::ProgramListInfo programListInfo{}; if (unitInfo->getProgramListInfo (j, programListInfo) == kResultOk && programListInfo.id == uInfo.programListId)