diff --git a/extras/audio plugin host/Source/HostStartup.cpp b/extras/audio plugin host/Source/HostStartup.cpp index 2cc1ca52a9..5b9785c05c 100644 --- a/extras/audio plugin host/Source/HostStartup.cpp +++ b/extras/audio plugin host/Source/HostStartup.cpp @@ -37,7 +37,7 @@ class PluginHostApp : public JUCEApplication public: PluginHostApp() {} - void initialise (const String& commandLine) + void initialise (const String& commandLine) override { // initialise our settings file.. @@ -66,14 +66,14 @@ public: .getChildFile (commandLine), true); } - void shutdown() + void shutdown() override { mainWindow = nullptr; appProperties = nullptr; LookAndFeel::setDefaultLookAndFeel (nullptr); } - void systemRequestedQuit() + void systemRequestedQuit() override { if (mainWindow != nullptr) mainWindow->tryToQuitApplication(); @@ -81,9 +81,9 @@ public: JUCEApplicationBase::quit(); } - const String getApplicationName() { return "Juce Plug-In Host"; } - const String getApplicationVersion() { return ProjectInfo::versionString; } - bool moreThanOneInstanceAllowed() { return true; } + const String getApplicationName() override { return "Juce Plug-In Host"; } + const String getApplicationVersion() override { return ProjectInfo::versionString; } + bool moreThanOneInstanceAllowed() override { return true; } ApplicationCommandManager commandManager; ScopedPointer appProperties; diff --git a/extras/example projects/Source/Main.cpp b/extras/example projects/Source/Main.cpp index bd161a12dd..ce1e40177f 100644 --- a/extras/example projects/Source/Main.cpp +++ b/extras/example projects/Source/Main.cpp @@ -42,7 +42,7 @@ public: } //============================================================================== - void closeButtonPressed() + void closeButtonPressed() override { // When the user presses the close button, we'll tell the app to quit. This // HelloWorldWindow object will be deleted by the JUCEHelloWorldApplication class. @@ -61,7 +61,7 @@ public: JUCEHelloWorldApplication() {} //============================================================================== - void initialise (const String& commandLine) + void initialise (const String& commandLine) override { // For this demo, we'll just create the main window... helloWorldWindow = new HelloWorldWindow(); @@ -75,7 +75,7 @@ public: */ } - void shutdown() + void shutdown() override { // This method is where you should clear-up your app's resources.. @@ -85,24 +85,24 @@ public: } //============================================================================== - const String getApplicationName() + const String getApplicationName() override { return "Hello World for JUCE"; } - const String getApplicationVersion() + const String getApplicationVersion() override { // The ProjectInfo::versionString value is automatically updated by the Jucer, and // can be found in the JuceHeader.h file that it generates for our project. return ProjectInfo::versionString; } - bool moreThanOneInstanceAllowed() + bool moreThanOneInstanceAllowed() override { return true; } - void anotherInstanceStarted (const String& commandLine) + void anotherInstanceStarted (const String& commandLine) override { } diff --git a/modules/juce_events/messages/juce_ApplicationBase.h b/modules/juce_events/messages/juce_ApplicationBase.h index 51f098c9bd..073e5d6c71 100644 --- a/modules/juce_events/messages/juce_ApplicationBase.h +++ b/modules/juce_events/messages/juce_ApplicationBase.h @@ -50,24 +50,24 @@ MyJUCEApp() {} ~MyJUCEApp() {} - void initialise (const String& commandLine) + void initialise (const String& commandLine) override { myMainWindow = new MyApplicationWindow(); myMainWindow->setBounds (100, 100, 400, 500); myMainWindow->setVisible (true); } - void shutdown() + void shutdown() override { myMainWindow = nullptr; } - const String getApplicationName() + const String getApplicationName() override { return "Super JUCE-o-matic"; } - const String getApplicationVersion() + const String getApplicationVersion() override { return "1.0"; } diff --git a/modules/juce_gui_basics/application/juce_Application.h b/modules/juce_gui_basics/application/juce_Application.h index 1ffb27e676..140cf9df21 100644 --- a/modules/juce_gui_basics/application/juce_Application.h +++ b/modules/juce_gui_basics/application/juce_Application.h @@ -53,24 +53,24 @@ MyJUCEApp() {} ~MyJUCEApp() {} - void initialise (const String& commandLine) + void initialise (const String& commandLine) override { myMainWindow = new MyApplicationWindow(); myMainWindow->setBounds (100, 100, 400, 500); myMainWindow->setVisible (true); } - void shutdown() + void shutdown() override { myMainWindow = nullptr; } - const String getApplicationName() + const String getApplicationName() override { return "Super JUCE-o-matic"; } - const String getApplicationVersion() + const String getApplicationVersion() override { return "1.0"; } diff --git a/modules/juce_gui_basics/components/juce_Component.cpp b/modules/juce_gui_basics/components/juce_Component.cpp index 0b5e5929eb..0b47d593af 100644 --- a/modules/juce_gui_basics/components/juce_Component.cpp +++ b/modules/juce_gui_basics/components/juce_Component.cpp @@ -141,7 +141,7 @@ public: } private: - Array listeners; + Array listeners; int numDeepMouseListeners; class BailOutChecker2 @@ -256,7 +256,7 @@ struct Component::ComponentHelpers #if JUCE_MODAL_LOOPS_PERMITTED static void* runModalLoopCallback (void* userData) { - return (void*) (pointer_sized_int) static_cast (userData)->runModalLoop(); + return (void*) (pointer_sized_int) static_cast (userData)->runModalLoop(); } #endif @@ -480,7 +480,7 @@ struct Component::ComponentHelpers }; //============================================================================== -Component::Component() +Component::Component() noexcept : parentComponent (nullptr), lookAndFeel (nullptr), effect (nullptr), @@ -489,7 +489,7 @@ Component::Component() { } -Component::Component (const String& name) +Component::Component (const String& name) noexcept : componentName (name), parentComponent (nullptr), lookAndFeel (nullptr), @@ -880,7 +880,7 @@ void Component::setBufferedToImage (const bool shouldBeBuffered) // so by calling setBufferedToImage, you'll be deleting the custom one - this is almost certainly // not what you wanted to happen... If you really do know what you're doing here, and want to // avoid this assertion, just call setCachedComponentImage (nullptr) before setBufferedToImage(). - jassert (cachedImage == nullptr || dynamic_cast (cachedImage.get()) != nullptr); + jassert (cachedImage == nullptr || dynamic_cast (cachedImage.get()) != nullptr); if (shouldBeBuffered) { @@ -1643,7 +1643,7 @@ Component* Component::getChildComponent (const int index) const noexcept int Component::getIndexOfChildComponent (const Component* const child) const noexcept { - return childComponentList.indexOf (const_cast (child)); + return childComponentList.indexOf (const_cast (child)); } Component* Component::findChildWithID (StringRef targetID) const noexcept @@ -1665,7 +1665,7 @@ Component* Component::getTopLevelComponent() const noexcept while (comp->parentComponent != nullptr) comp = comp->parentComponent; - return const_cast (comp); + return const_cast (comp); } bool Component::isParentOf (const Component* possibleChild) const noexcept @@ -2205,7 +2205,7 @@ void Component::sendLookAndFeelChange() Colour Component::findColour (const int colourId, const bool inheritFromParent) const { if (const var* const v = properties.getVarPointer (ComponentHelpers::getColourPropertyId (colourId))) - return Colour ((uint32) static_cast (*v)); + return Colour ((uint32) static_cast (*v)); if (inheritFromParent && parentComponent != nullptr && (lookAndFeel == nullptr || ! lookAndFeel->isColourSpecified (colourId))) @@ -2856,7 +2856,7 @@ void Component::grabFocusInternal (const FocusChangeType cause, const bool canTr else { // find the default child component.. - ScopedPointer traverser (createFocusTraverser()); + ScopedPointer traverser (createFocusTraverser()); if (traverser != nullptr) { @@ -2898,7 +2898,7 @@ void Component::moveKeyboardFocusToSibling (const bool moveToNext) if (parentComponent != nullptr) { - ScopedPointer traverser (createFocusTraverser()); + ScopedPointer traverser (createFocusTraverser()); if (traverser != nullptr) { @@ -3052,7 +3052,7 @@ Point Component::getMouseXYRelative() const void Component::addKeyListener (KeyListener* const newListener) { if (keyListeners == nullptr) - keyListeners = new Array (); + keyListeners = new Array(); keyListeners->addIfNotAlreadyThere (newListener); } diff --git a/modules/juce_gui_basics/components/juce_Component.h b/modules/juce_gui_basics/components/juce_Component.h index 85a9d03926..f381a8af9b 100644 --- a/modules/juce_gui_basics/components/juce_Component.h +++ b/modules/juce_gui_basics/components/juce_Component.h @@ -46,7 +46,7 @@ public: subclass of Component or use one of the other types of component from the library. */ - Component(); + Component() noexcept; /** Destructor. @@ -66,7 +66,7 @@ public: /** Creates a component, setting its name at the same time. @see getName, setName */ - explicit Component (const String& componentName); + explicit Component (const String& componentName) noexcept; /** Returns the name of this component. @see setName @@ -807,7 +807,7 @@ public: TargetClass* findParentComponentOfClass() const { for (Component* p = parentComponent; p != nullptr; p = p->parentComponent) - if (TargetClass* const target = dynamic_cast (p)) + if (TargetClass* const target = dynamic_cast (p)) return target; return nullptr; @@ -2136,31 +2136,31 @@ public: SafePointer() noexcept {} /** Creates a SafePointer that points at the given component. */ - SafePointer (ComponentType* const component) : weakRef (component) {} + SafePointer (ComponentType* component) : weakRef (component) {} /** Creates a copy of another SafePointer. */ - SafePointer (const SafePointer& other) noexcept : weakRef (other.weakRef) {} + SafePointer (const SafePointer& other) noexcept : weakRef (other.weakRef) {} /** Copies another pointer to this one. */ - SafePointer& operator= (const SafePointer& other) { weakRef = other.weakRef; return *this; } + SafePointer& operator= (const SafePointer& other) { weakRef = other.weakRef; return *this; } /** Copies another pointer to this one. */ - SafePointer& operator= (ComponentType* const newComponent) { weakRef = newComponent; return *this; } + SafePointer& operator= (ComponentType* newComponent) { weakRef = newComponent; return *this; } /** Returns the component that this pointer refers to, or null if the component no longer exists. */ - ComponentType* getComponent() const noexcept { return dynamic_cast (weakRef.get()); } + ComponentType* getComponent() const noexcept { return dynamic_cast (weakRef.get()); } /** Returns the component that this pointer refers to, or null if the component no longer exists. */ - operator ComponentType*() const noexcept { return getComponent(); } + operator ComponentType*() const noexcept { return getComponent(); } /** Returns the component that this pointer refers to, or null if the component no longer exists. */ - ComponentType* operator->() noexcept { return getComponent(); } + ComponentType* operator->() noexcept { return getComponent(); } /** Returns the component that this pointer refers to, or null if the component no longer exists. */ - const ComponentType* operator->() const noexcept { return getComponent(); } + const ComponentType* operator->() const noexcept { return getComponent(); } /** If the component is valid, this deletes it and sets this pointer to null. */ - void deleteAndZero() { delete getComponent(); } + void deleteAndZero() { delete getComponent(); } bool operator== (ComponentType* component) const noexcept { return weakRef == component; } bool operator!= (ComponentType* component) const noexcept { return weakRef != component; } @@ -2268,20 +2268,20 @@ private: String componentName, componentID; Component* parentComponent; Rectangle bounds; - ScopedPointer positioner; - ScopedPointer affineTransform; - Array childComponentList; + ScopedPointer positioner; + ScopedPointer affineTransform; + Array childComponentList; LookAndFeel* lookAndFeel; MouseCursor cursor; ImageEffectFilter* effect; - ScopedPointer cachedImage; + ScopedPointer cachedImage; class MouseListenerList; friend class MouseListenerList; friend struct ContainerDeletePolicy; - ScopedPointer mouseListeners; - ScopedPointer > keyListeners; - ListenerList componentListeners; + ScopedPointer mouseListeners; + ScopedPointer > keyListeners; + ListenerList componentListeners; NamedValueSet properties; friend class WeakReference; diff --git a/modules/juce_gui_basics/mouse/juce_MouseCursor.cpp b/modules/juce_gui_basics/mouse/juce_MouseCursor.cpp index 7aef739f39..3f2c84f209 100644 --- a/modules/juce_gui_basics/mouse/juce_MouseCursor.cpp +++ b/modules/juce_gui_basics/mouse/juce_MouseCursor.cpp @@ -128,7 +128,7 @@ private: SpinLock MouseCursor::SharedCursorHandle::lock; //============================================================================== -MouseCursor::MouseCursor() +MouseCursor::MouseCursor() noexcept : cursorHandle (nullptr) { } diff --git a/modules/juce_gui_basics/mouse/juce_MouseCursor.h b/modules/juce_gui_basics/mouse/juce_MouseCursor.h index 45bf3a66de..df540f01a1 100644 --- a/modules/juce_gui_basics/mouse/juce_MouseCursor.h +++ b/modules/juce_gui_basics/mouse/juce_MouseCursor.h @@ -72,10 +72,10 @@ public: //============================================================================== /** Creates the standard arrow cursor. */ - MouseCursor(); + MouseCursor() noexcept; /** Creates one of the standard mouse cursor */ - MouseCursor (StandardCursorType type); + MouseCursor (StandardCursorType); /** Creates a custom cursor from an image.