From 24910cc4b470a724da6717c055e6d1b86bca5be4 Mon Sep 17 00:00:00 2001 From: ed Date: Mon, 13 Sep 2021 12:58:35 +0100 Subject: [PATCH] Fix GCC Wshadow warnings --- examples/Plugins/DSPModulePluginDemo.h | 28 +++++++++---------- .../StartPage/jucer_ContentComponents.h | 4 +-- .../StartPage/jucer_StartPageTreeHolder.h | 6 ++-- .../Windows/jucer_PIPCreatorWindowComponent.h | 8 +++--- .../ProjectSaving/jucer_ProjectExport_MSVC.h | 4 +-- .../jucer_PropertyComponentsWithEnablement.h | 4 +-- .../format_types/juce_VST3PluginFormat.cpp | 4 +-- .../juce_gui_basics/buttons/juce_Button.cpp | 6 ++-- .../documents/juce_FileBasedDocument.cpp | 16 +++++------ .../misc/juce_WebBrowserComponent.h | 2 +- .../juce_android_WebBrowserComponent.cpp | 4 +-- .../juce_linux_X11_WebBrowserComponent.cpp | 4 +-- .../native/juce_mac_WebBrowserComponent.mm | 4 +-- .../native/juce_win32_WebBrowserComponent.cpp | 6 ++-- 14 files changed, 50 insertions(+), 50 deletions(-) diff --git a/examples/Plugins/DSPModulePluginDemo.h b/examples/Plugins/DSPModulePluginDemo.h index ad712abe61..dca87b0e29 100644 --- a/examples/Plugins/DSPModulePluginDemo.h +++ b/examples/Plugins/DSPModulePluginDemo.h @@ -1625,16 +1625,16 @@ private: class AttachedSlider : public ComponentWithParamMenu { public: - AttachedSlider (AudioProcessorEditor& editorIn, RangedAudioParameter& param) - : ComponentWithParamMenu (editorIn, param), - label ("", param.name), - attachment (param, slider) + AttachedSlider (AudioProcessorEditor& editorIn, RangedAudioParameter& paramIn) + : ComponentWithParamMenu (editorIn, paramIn), + label ("", paramIn.name), + attachment (paramIn, slider) { slider.addMouseListener (this, true); addAllAndMakeVisible (*this, slider, label); - slider.setTextValueSuffix (" " + param.label); + slider.setTextValueSuffix (" " + paramIn.label); label.attachToComponent (&slider, false); label.setJustificationType (Justification::centred); @@ -1651,10 +1651,10 @@ private: class AttachedToggle : public ComponentWithParamMenu { public: - AttachedToggle (AudioProcessorEditor& editorIn, RangedAudioParameter& param) - : ComponentWithParamMenu (editorIn, param), - toggle (param.name), - attachment (param, toggle) + AttachedToggle (AudioProcessorEditor& editorIn, RangedAudioParameter& paramIn) + : ComponentWithParamMenu (editorIn, paramIn), + toggle (paramIn.name), + attachment (paramIn, toggle) { toggle.addMouseListener (this, true); addAndMakeVisible (toggle); @@ -1670,11 +1670,11 @@ private: class AttachedCombo : public ComponentWithParamMenu { public: - AttachedCombo (AudioProcessorEditor& editorIn, RangedAudioParameter& param) - : ComponentWithParamMenu (editorIn, param), - combo (param), - label ("", param.name), - attachment (param, combo) + AttachedCombo (AudioProcessorEditor& editorIn, RangedAudioParameter& paramIn) + : ComponentWithParamMenu (editorIn, paramIn), + combo (paramIn), + label ("", paramIn.name), + attachment (paramIn, combo) { combo.addMouseListener (this, true); diff --git a/extras/Projucer/Source/Application/StartPage/jucer_ContentComponents.h b/extras/Projucer/Source/Application/StartPage/jucer_ContentComponents.h index b9f5cf6525..3c2ccfca9a 100644 --- a/extras/Projucer/Source/Application/StartPage/jucer_ContentComponents.h +++ b/extras/Projucer/Source/Application/StartPage/jucer_ContentComponents.h @@ -100,9 +100,9 @@ public: createProjectButton.onClick = [this] { chooser = std::make_unique ("Save Project", NewProjectWizard::getLastWizardFolder()); - auto flags = FileBrowserComponent::openMode | FileBrowserComponent::canSelectDirectories; + auto browserFlags = FileBrowserComponent::openMode | FileBrowserComponent::canSelectDirectories; - chooser->launchAsync (flags, [this] (const FileChooser& fc) + chooser->launchAsync (browserFlags, [this] (const FileChooser& fc) { auto dir = fc.getResult(); diff --git a/extras/Projucer/Source/Application/StartPage/jucer_StartPageTreeHolder.h b/extras/Projucer/Source/Application/StartPage/jucer_StartPageTreeHolder.h index 4a7cd34e2c..68ea3424dd 100644 --- a/extras/Projucer/Source/Application/StartPage/jucer_StartPageTreeHolder.h +++ b/extras/Projucer/Source/Application/StartPage/jucer_StartPageTreeHolder.h @@ -85,10 +85,10 @@ private: class TreeSubItem : public TreeViewItem { public: - TreeSubItem (StartPageTreeHolder& o, const String& n, const StringArray& subItems) - : owner (o), name (n), isHeader (subItems.size() > 0) + TreeSubItem (StartPageTreeHolder& o, const String& n, const StringArray& subItemsIn) + : owner (o), name (n), isHeader (subItemsIn.size() > 0) { - for (auto& s : subItems) + for (auto& s : subItemsIn) addSubItem (new TreeSubItem (owner, s, {})); } diff --git a/extras/Projucer/Source/Application/Windows/jucer_PIPCreatorWindowComponent.h b/extras/Projucer/Source/Application/Windows/jucer_PIPCreatorWindowComponent.h index 8a2188ebbf..4ec2ff4989 100644 --- a/extras/Projucer/Source/Application/Windows/jucer_PIPCreatorWindowComponent.h +++ b/extras/Projucer/Source/Application/Windows/jucer_PIPCreatorWindowComponent.h @@ -76,11 +76,11 @@ public: chooser = std::make_unique ("Save PIP File", File::getSpecialLocation (File::SpecialLocationType::userDesktopDirectory) .getChildFile (nameValue.get().toString() + ".h")); - auto flags = FileBrowserComponent::saveMode - | FileBrowserComponent::canSelectFiles - | FileBrowserComponent::warnAboutOverwriting; + auto browserFlags = FileBrowserComponent::saveMode + | FileBrowserComponent::canSelectFiles + | FileBrowserComponent::warnAboutOverwriting; - chooser->launchAsync (flags, [this] (const FileChooser& fc) + chooser->launchAsync (browserFlags, [this] (const FileChooser& fc) { const auto result = fc.getResult(); diff --git a/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_MSVC.h b/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_MSVC.h index d59c41242b..50ff135e0b 100644 --- a/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_MSVC.h +++ b/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_MSVC.h @@ -1161,9 +1161,9 @@ public: auto bundleDir = getOwner().getOutDirFile (config, outputFilename); auto bundleContents = bundleDir + "\\Contents"; auto archDir = bundleContents + String ("\\") + (config.is64Bit() ? "x64" : "Win32"); - auto executable = archDir + String ("\\") + outputFilename; + auto executablePath = archDir + String ("\\") + outputFilename; - auto pkgScript = String ("copy /Y ") + getOutputFilePath (config, false).quoted() + String (" ") + executable.quoted() + String ("\r\ncall ") + auto pkgScript = String ("copy /Y ") + getOutputFilePath (config, false).quoted() + String (" ") + executablePath.quoted() + String ("\r\ncall ") + createRebasedPath (bundleScript) + String (" ") + archDir.quoted() + String (" ") + createRebasedPath (iconFilePath); if (config.isPluginBinaryCopyStepEnabled()) diff --git a/extras/Projucer/Source/Utility/UI/PropertyComponents/jucer_PropertyComponentsWithEnablement.h b/extras/Projucer/Source/Utility/UI/PropertyComponents/jucer_PropertyComponentsWithEnablement.h index 664b2eddc9..0dbe0ca2c3 100644 --- a/extras/Projucer/Source/Utility/UI/PropertyComponents/jucer_PropertyComponentsWithEnablement.h +++ b/extras/Projucer/Source/Utility/UI/PropertyComponents/jucer_PropertyComponentsWithEnablement.h @@ -35,8 +35,8 @@ public: ValueWithDefault valueToListenTo, const String& propertyName, int maxNumChars, - bool isMultiLine) - : TextPropertyComponent (valueToControl, propertyName, maxNumChars, isMultiLine), + bool multiLine) + : TextPropertyComponent (valueToControl, propertyName, maxNumChars, multiLine), valueWithDefault (valueToListenTo), value (valueWithDefault.getPropertyAsValue()) { diff --git a/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp b/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp index 6cb5ae837b..9dc44ec557 100644 --- a/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp +++ b/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp @@ -1396,9 +1396,9 @@ struct VST3PluginWindow : public AudioProcessorEditor, } #if JUCE_LINUX || JUCE_BSD - Steinberg::tresult PLUGIN_API queryInterface (const Steinberg::TUID iid, void** obj) override + Steinberg::tresult PLUGIN_API queryInterface (const Steinberg::TUID queryIid, void** obj) override { - if (doUIDsMatch (iid, Steinberg::Linux::IRunLoop::iid)) + if (doUIDsMatch (queryIid, Steinberg::Linux::IRunLoop::iid)) { *obj = &runLoop.get(); return kResultTrue; diff --git a/modules/juce_gui_basics/buttons/juce_Button.cpp b/modules/juce_gui_basics/buttons/juce_Button.cpp index 078d8a0f1d..34343e28aa 100644 --- a/modules/juce_gui_basics/buttons/juce_Button.cpp +++ b/modules/juce_gui_basics/buttons/juce_Button.cpp @@ -706,10 +706,10 @@ void Button::repeatTimerCallback() class ButtonAccessibilityHandler : public AccessibilityHandler { public: - explicit ButtonAccessibilityHandler (Button& buttonToWrap, AccessibilityRole role) + explicit ButtonAccessibilityHandler (Button& buttonToWrap, AccessibilityRole roleIn) : AccessibilityHandler (buttonToWrap, - isRadioButton (buttonToWrap) ? AccessibilityRole::radioButton : role, - getAccessibilityActions (buttonToWrap, role)), + isRadioButton (buttonToWrap) ? AccessibilityRole::radioButton : roleIn, + getAccessibilityActions (buttonToWrap, roleIn)), button (buttonToWrap) { } diff --git a/modules/juce_gui_extra/documents/juce_FileBasedDocument.cpp b/modules/juce_gui_extra/documents/juce_FileBasedDocument.cpp index 8c3dca9bda..bd1a1aede8 100644 --- a/modules/juce_gui_extra/documents/juce_FileBasedDocument.cpp +++ b/modules/juce_gui_extra/documents/juce_FileBasedDocument.cpp @@ -725,9 +725,9 @@ private: warnAboutOverwritingExistingFiles, [doSaveAs = std::forward (doSaveAs), doAskToOverwriteFile = std::forward (doAskToOverwriteFile), - callback = std::move (callback)] (SafeParentPointer ptr, File chosen) + callback = std::move (callback)] (SafeParentPointer parentPtr, File chosen) { - if (ptr.shouldExitAsyncCallback()) + if (parentPtr.shouldExitAsyncCallback()) return; if (chosen == File{}) @@ -738,18 +738,18 @@ private: return; } - auto updateAndSaveAs = [ptr, doSaveAs, callback] (const File& chosenFile) + auto updateAndSaveAs = [parentPtr, doSaveAs, callback] (const File& chosenFile) { - if (ptr.shouldExitAsyncCallback()) + if (parentPtr.shouldExitAsyncCallback()) return; - ptr->document.setLastDocumentOpened (chosenFile); - doSaveAs (ptr, chosenFile, false, false, true, callback, false); + parentPtr->document.setLastDocumentOpened (chosenFile); + doSaveAs (parentPtr, chosenFile, false, false, true, callback, false); }; if (chosen.getFileExtension().isEmpty()) { - chosen = chosen.withFileExtension (ptr->fileExtension); + chosen = chosen.withFileExtension (parentPtr->fileExtension); if (chosen.exists()) { @@ -765,7 +765,7 @@ private: callback (userCancelledSave); }; - doAskToOverwriteFile (ptr, chosen, std::move (afterAsking)); + doAskToOverwriteFile (parentPtr, chosen, std::move (afterAsking)); return; } } diff --git a/modules/juce_gui_extra/misc/juce_WebBrowserComponent.h b/modules/juce_gui_extra/misc/juce_WebBrowserComponent.h index 4d355251f8..6a0237f085 100644 --- a/modules/juce_gui_extra/misc/juce_WebBrowserComponent.h +++ b/modules/juce_gui_extra/misc/juce_WebBrowserComponent.h @@ -151,7 +151,7 @@ private: //============================================================================== std::unique_ptr browser; - bool blankPageShown = false, unloadPageWhenBrowserIsHidden; + bool blankPageShown = false, unloadPageWhenHidden; String lastURL; StringArray lastHeaders; MemoryBlock lastPostData; diff --git a/modules/juce_gui_extra/native/juce_android_WebBrowserComponent.cpp b/modules/juce_gui_extra/native/juce_android_WebBrowserComponent.cpp index fbecb064b0..5cbf182d9c 100644 --- a/modules/juce_gui_extra/native/juce_android_WebBrowserComponent.cpp +++ b/modules/juce_gui_extra/native/juce_android_WebBrowserComponent.cpp @@ -584,7 +584,7 @@ private: //============================================================================== WebBrowserComponent::WebBrowserComponent (const bool unloadWhenHidden) : blankPageShown (false), - unloadPageWhenBrowserIsHidden (unloadWhenHidden) + unloadPageWhenHidden (unloadWhenHidden) { setOpaque (true); @@ -665,7 +665,7 @@ void WebBrowserComponent::checkWindowAssociation() } else { - if (unloadPageWhenBrowserIsHidden && ! blankPageShown) + if (unloadPageWhenHidden && ! blankPageShown) { // when the component becomes invisible, some stuff like flash // carries on playing audio, so we need to force it onto a blank diff --git a/modules/juce_gui_extra/native/juce_linux_X11_WebBrowserComponent.cpp b/modules/juce_gui_extra/native/juce_linux_X11_WebBrowserComponent.cpp index 7ad40ee351..ef092cb242 100644 --- a/modules/juce_gui_extra/native/juce_linux_X11_WebBrowserComponent.cpp +++ b/modules/juce_gui_extra/native/juce_linux_X11_WebBrowserComponent.cpp @@ -907,10 +907,10 @@ private: //============================================================================== WebBrowserComponent::WebBrowserComponent (const bool unloadWhenHidden) : browser (new Pimpl (*this)), - unloadPageWhenBrowserIsHidden (unloadWhenHidden) + unloadPageWhenHidden (unloadWhenHidden) { ignoreUnused (blankPageShown); - ignoreUnused (unloadPageWhenBrowserIsHidden); + ignoreUnused (unloadPageWhenHidden); setOpaque (true); diff --git a/modules/juce_gui_extra/native/juce_mac_WebBrowserComponent.mm b/modules/juce_gui_extra/native/juce_mac_WebBrowserComponent.mm index 8a10ea908e..fe3228a7a8 100644 --- a/modules/juce_gui_extra/native/juce_mac_WebBrowserComponent.mm +++ b/modules/juce_gui_extra/native/juce_mac_WebBrowserComponent.mm @@ -677,7 +677,7 @@ private: //============================================================================== WebBrowserComponent::WebBrowserComponent (bool unloadWhenHidden) - : unloadPageWhenBrowserIsHidden (unloadWhenHidden) + : unloadPageWhenHidden (unloadWhenHidden) { setOpaque (true); browser.reset (new Pimpl (this)); @@ -756,7 +756,7 @@ void WebBrowserComponent::checkWindowAssociation() } else { - if (unloadPageWhenBrowserIsHidden && ! blankPageShown) + if (unloadPageWhenHidden && ! blankPageShown) { // when the component becomes invisible, some stuff like flash // carries on playing audio, so we need to force it onto a blank diff --git a/modules/juce_gui_extra/native/juce_win32_WebBrowserComponent.cpp b/modules/juce_gui_extra/native/juce_win32_WebBrowserComponent.cpp index a192d4b593..6cc5516fc6 100644 --- a/modules/juce_gui_extra/native/juce_win32_WebBrowserComponent.cpp +++ b/modules/juce_gui_extra/native/juce_win32_WebBrowserComponent.cpp @@ -780,7 +780,7 @@ private: //============================================================================== WebBrowserComponent::WebBrowserComponent (bool unloadWhenHidden) : browser (new Pimpl (*this, {}, {}, false)), - unloadPageWhenBrowserIsHidden (unloadWhenHidden) + unloadPageWhenHidden (unloadWhenHidden) { setOpaque (true); } @@ -789,7 +789,7 @@ WebBrowserComponent::WebBrowserComponent (bool unloadWhenHidden, const File& dllLocation, const File& userDataFolder) : browser (new Pimpl (*this, dllLocation, userDataFolder, true)), - unloadPageWhenBrowserIsHidden (unloadWhenHidden) + unloadPageWhenHidden (unloadWhenHidden) { setOpaque (true); } @@ -875,7 +875,7 @@ void WebBrowserComponent::checkWindowAssociation() } else { - if (browser != nullptr && unloadPageWhenBrowserIsHidden && ! blankPageShown) + if (browser != nullptr && unloadPageWhenHidden && ! blankPageShown) { // when the component becomes invisible, some stuff like flash // carries on playing audio, so we need to force it onto a blank