From 047448fbce3a03359bf0285d9165db9b2777fcfd Mon Sep 17 00:00:00 2001 From: reuk Date: Wed, 24 Jan 2024 12:00:28 +0000 Subject: [PATCH] Warnings: Add missing overrides --- examples/GUI/WidgetsDemo.h | 6 +- examples/GUI/WindowsDemo.h | 8 +- examples/Utilities/Box2DDemo.h | 6 +- .../Source/UI/GraphEditorPanel.cpp | 2 +- .../Windows/jucer_PIPCreatorWindowComponent.h | 2 +- .../CodeEditor/jucer_OpenDocumentManager.h | 4 +- .../Components/jucer_ButtonHandler.h | 24 +-- .../Components/jucer_ComboBoxHandler.h | 28 ++-- .../Components/jucer_ComponentNameProperty.h | 12 +- .../Components/jucer_ComponentTypeHandler.cpp | 14 +- .../jucer_ComponentUndoableAction.h | 2 +- .../jucer_GenericComponentHandler.h | 8 +- .../Components/jucer_GroupComponentHandler.h | 8 +- .../Components/jucer_HyperlinkButtonHandler.h | 4 +- .../Components/jucer_ImageButtonHandler.h | 8 +- .../Components/jucer_JucerComponentHandler.h | 12 +- .../Components/jucer_LabelHandler.h | 40 ++--- .../Components/jucer_TabbedComponentHandler.h | 73 +++++---- .../Components/jucer_TextEditorHandler.h | 44 +++--- .../Components/jucer_ToggleButtonHandler.h | 8 +- .../Components/jucer_TreeViewHandler.h | 16 +- .../Components/jucer_ViewportHandler.h | 34 ++-- .../Documents/jucer_ButtonDocument.cpp | 8 +- .../Documents/jucer_ButtonDocument.h | 28 ++-- .../Documents/jucer_ComponentDocument.h | 24 +-- .../PaintElements/jucer_ColouredElement.cpp | 52 +++--- .../jucer_GradientPointComponent.h | 6 +- .../jucer_ImageResourceProperty.h | 8 +- .../PaintElements/jucer_PaintElement.cpp | 16 +- .../PaintElements/jucer_PaintElementEllipse.h | 4 +- .../PaintElements/jucer_PaintElementGroup.h | 4 +- .../PaintElements/jucer_PaintElementImage.h | 28 ++-- .../PaintElements/jucer_PaintElementPath.cpp | 34 ++-- .../PaintElements/jucer_PaintElementPath.h | 14 +- .../jucer_PaintElementRectangle.h | 4 +- .../jucer_PaintElementRoundedRectangle.h | 8 +- .../PaintElements/jucer_PaintElementText.h | 36 ++--- .../jucer_PaintElementUndoableAction.h | 2 +- .../jucer_ComponentBooleanProperty.h | 4 +- .../jucer_ComponentChoiceProperty.h | 4 +- .../jucer_ComponentColourProperty.h | 14 +- .../Properties/jucer_ComponentTextProperty.h | 4 +- .../Properties/jucer_FontPropertyComponent.h | 4 +- .../Properties/jucer_JustificationProperty.h | 4 +- .../Properties/jucer_PositionPropertyBase.h | 6 +- .../UI/jucer_ComponentLayoutPanel.h | 6 +- .../UI/jucer_EditingPanelBase.cpp | 10 +- .../UI/jucer_JucerDocumentEditor.cpp | 4 +- .../UI/jucer_PaintRoutineEditor.h | 26 +-- .../UI/jucer_PaintRoutinePanel.h | 6 +- .../UI/jucer_ResourceEditorPanel.cpp | 2 +- .../ComponentEditor/jucer_ComponentLayout.cpp | 22 +-- .../ComponentEditor/jucer_PaintRoutine.cpp | 16 +- .../Projucer/Source/Project/jucer_Project.h | 2 +- .../jucer_LabelPropertyComponent.h | 2 +- .../native/juce_ALSA_linux.cpp | 14 +- .../native/juce_WASAPI_windows.cpp | 30 ++-- .../codecs/juce_WindowsMediaAudioFormat.cpp | 24 +-- .../scanning/juce_PluginListComponent.cpp | 2 +- .../native/juce_AudioCDBurner_windows.cpp | 36 +++-- .../native/juce_AudioCDReader_windows.cpp | 16 +- modules/juce_box2d/juce_box2d.cpp | 3 +- modules/juce_box2d/juce_box2d.h | 3 +- .../containers/juce_AbstractFifo.cpp | 4 +- modules/juce_core/maths/juce_Expression.cpp | 148 +++++++++--------- .../native/juce_ComSmartPtr_windows.h | 8 +- .../containers/juce_SIMDRegister_test.cpp | 2 +- .../juce_DirectWriteTypeface_windows.cpp | 12 +- .../native/juce_Fonts_freetype.cpp | 2 +- .../native/juce_Fonts_windows.cpp | 14 +- .../layout/juce_TabbedComponent.cpp | 6 +- .../native/juce_DragAndDrop_windows.cpp | 24 +-- .../positioning/juce_RelativeRectangle.cpp | 2 +- .../widgets/juce_TableListBox.cpp | 4 +- .../native/juce_ActiveXComponent_windows.cpp | 98 ++++++------ .../juce_opengl/opengl/juce_OpenGLContext.cpp | 2 +- modules/juce_osc/osc/juce_OSCAddress.cpp | 6 +- modules/juce_osc/osc/juce_OSCArgument.cpp | 2 +- modules/juce_osc/osc/juce_OSCBundle.cpp | 4 +- modules/juce_osc/osc/juce_OSCMessage.cpp | 2 +- modules/juce_osc/osc/juce_OSCReceiver.cpp | 2 +- modules/juce_osc/osc/juce_OSCSender.cpp | 4 +- modules/juce_osc/osc/juce_OSCTimeTag.cpp | 2 +- .../native/juce_CameraDevice_windows.h | 6 +- 84 files changed, 630 insertions(+), 627 deletions(-) diff --git a/examples/GUI/WidgetsDemo.h b/examples/GUI/WidgetsDemo.h index cd10969ad5..8a64df2b07 100644 --- a/examples/GUI/WidgetsDemo.h +++ b/examples/GUI/WidgetsDemo.h @@ -690,7 +690,7 @@ struct MenuPage final : public Component { void drawPopupMenuColumnSeparatorWithOptions (Graphics& g, const Rectangle& bounds, - const PopupMenu::Options& opt) + const PopupMenu::Options& opt) override { if (auto* target = opt.getTargetComponent()) { @@ -708,7 +708,7 @@ struct MenuPage final : public Component } } - void drawPopupMenuBackgroundWithOptions (Graphics& g, int, int, const PopupMenu::Options& opt) + void drawPopupMenuBackgroundWithOptions (Graphics& g, int, int, const PopupMenu::Options& opt) override { if (auto* target = opt.getTargetComponent()) { @@ -717,7 +717,7 @@ struct MenuPage final : public Component } // Return the amount of space that should be left between popup menu columns. - int getPopupMenuColumnSeparatorWidthWithOptions (const PopupMenu::Options&) + int getPopupMenuColumnSeparatorWidthWithOptions (const PopupMenu::Options&) override { return 10; } diff --git a/examples/GUI/WindowsDemo.h b/examples/GUI/WindowsDemo.h index 9838210569..f0dea3d7f0 100644 --- a/examples/GUI/WindowsDemo.h +++ b/examples/GUI/WindowsDemo.h @@ -57,7 +57,7 @@ public: : DocumentWindow (name, backgroundColour, buttonsNeeded) {} - void closeButtonPressed() + void closeButtonPressed() override { delete this; } @@ -81,12 +81,12 @@ public: setContentOwned (&selector, false); } - ~ColourSelectorWindow() + ~ColourSelectorWindow() override { selector.removeChangeListener (this); } - void closeButtonPressed() + void closeButtonPressed() override { delete this; } @@ -96,7 +96,7 @@ private: | ColourSelector::showSliders | ColourSelector::showColourspace }; - void changeListenerCallback (ChangeBroadcaster* source) + void changeListenerCallback (ChangeBroadcaster* source) override { if (source == &selector) setBackgroundColour (selector.getCurrentColour()); diff --git a/examples/Utilities/Box2DDemo.h b/examples/Utilities/Box2DDemo.h index 019a469a8e..90582a1e07 100644 --- a/examples/Utilities/Box2DDemo.h +++ b/examples/Utilities/Box2DDemo.h @@ -79,8 +79,8 @@ struct Settings struct Test { - Test() {} - virtual ~Test() {} + Test() = default; + virtual ~Test() = default; virtual void Keyboard (unsigned char /*key*/) {} virtual void KeyboardUp (unsigned char /*key*/) {} @@ -88,7 +88,7 @@ struct Test std::unique_ptr m_world { new b2World (b2Vec2 (0.0f, -10.0f)) }; }; -JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wimplicit-int-float-conversion") +JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wimplicit-int-float-conversion", "-Wsuggest-override") #include "../Assets/Box2DTests/AddPair.h" #include "../Assets/Box2DTests/ApplyForce.h" diff --git a/extras/AudioPluginHost/Source/UI/GraphEditorPanel.cpp b/extras/AudioPluginHost/Source/UI/GraphEditorPanel.cpp index 8b59d4bb71..bb45ac4b82 100644 --- a/extras/AudioPluginHost/Source/UI/GraphEditorPanel.cpp +++ b/extras/AudioPluginHost/Source/UI/GraphEditorPanel.cpp @@ -74,7 +74,7 @@ { ScanJob (AUScanner& s) : ThreadPoolJob ("pluginscan"), scanner (s) {} - JobStatus runJob() + JobStatus runJob() override { while (scanner.doNextScan() && ! shouldExit()) {} diff --git a/extras/Projucer/Source/Application/Windows/jucer_PIPCreatorWindowComponent.h b/extras/Projucer/Source/Application/Windows/jucer_PIPCreatorWindowComponent.h index 6402609d90..528aacfa69 100644 --- a/extras/Projucer/Source/Application/Windows/jucer_PIPCreatorWindowComponent.h +++ b/extras/Projucer/Source/Application/Windows/jucer_PIPCreatorWindowComponent.h @@ -113,7 +113,7 @@ private: { PIPCreatorLookAndFeel() {} - Rectangle getPropertyComponentContentPosition (PropertyComponent& component) + Rectangle getPropertyComponentContentPosition (PropertyComponent& component) override { auto textW = jmin (200, component.getWidth() / 3); return { textW, 0, component.getWidth() - textW, component.getHeight() - 1 }; diff --git a/extras/Projucer/Source/CodeEditor/jucer_OpenDocumentManager.h b/extras/Projucer/Source/CodeEditor/jucer_OpenDocumentManager.h index e7c3ba4b84..60ccf27784 100644 --- a/extras/Projucer/Source/CodeEditor/jucer_OpenDocumentManager.h +++ b/extras/Projucer/Source/CodeEditor/jucer_OpenDocumentManager.h @@ -138,7 +138,7 @@ class RecentDocumentList final : private OpenDocumentManager::DocumentCloseListe { public: RecentDocumentList(); - ~RecentDocumentList(); + ~RecentDocumentList() override; void clear(); @@ -160,7 +160,7 @@ public: std::unique_ptr createXML() const; private: - bool documentAboutToClose (OpenDocumentManager::Document*); + bool documentAboutToClose (OpenDocumentManager::Document*) override; Array previousDocs, nextDocs; }; diff --git a/extras/Projucer/Source/ComponentEditor/Components/jucer_ButtonHandler.h b/extras/Projucer/Source/ComponentEditor/Components/jucer_ButtonHandler.h index d1643bffc1..7d7dea97fb 100644 --- a/extras/Projucer/Source/ComponentEditor/Components/jucer_ButtonHandler.h +++ b/extras/Projucer/Source/ComponentEditor/Components/jucer_ButtonHandler.h @@ -204,7 +204,7 @@ private: oldName = comp->getButtonText(); } - bool perform() + bool perform() override { showCorrectTab(); getComponent()->setButtonText (newName); @@ -212,7 +212,7 @@ private: return true; } - bool undo() + bool undo() override { showCorrectTab(); getComponent()->setButtonText (oldName); @@ -232,13 +232,13 @@ private: { } - void setState (bool newState) + void setState (bool newState) override { document.perform (new ButtonCallbackChangeAction (component, *document.getComponentLayout(), newState), "Change button callback"); } - bool getState() const { return needsButtonListener (component); } + bool getState() const override { return needsButtonListener (component); } private: class ButtonCallbackChangeAction : public ComponentUndoableAction