From a9bc4aa576522022cc816d62c728e7033d1c0754 Mon Sep 17 00:00:00 2001 From: Chris Thrasher Date: Sun, 15 Jan 2023 12:07:13 -0700 Subject: [PATCH] Add clang-tidy modernize-use-override check --- .clang-tidy | 1 + src/SFML/Window/DRM/DRMContext.hpp | 8 +++---- src/SFML/Window/DRM/WindowImplDRM.hpp | 32 ++++++++++++------------- src/SFML/Window/OSX/SFContext.hpp | 2 +- src/SFML/Window/OSX/WindowImplCocoa.hpp | 2 +- src/SFML/Window/Unix/GlxContext.hpp | 2 +- src/SFML/Window/Unix/WindowImplX11.hpp | 2 +- 7 files changed, 25 insertions(+), 24 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index 0aa8d3a3..f4289b8a 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -8,6 +8,7 @@ Checks: > modernize-use-equals-default, modernize-use-equals-delete, modernize-use-nullptr, + modernize-use-override, portability-*, readability-container-size-empty, readability-identifier-naming, diff --git a/src/SFML/Window/DRM/DRMContext.hpp b/src/SFML/Window/DRM/DRMContext.hpp index e63d1ae9..72602792 100644 --- a/src/SFML/Window/DRM/DRMContext.hpp +++ b/src/SFML/Window/DRM/DRMContext.hpp @@ -93,7 +93,7 @@ public: /// \brief Destructor /// //////////////////////////////////////////////////////////// - ~DRMContext(); + ~DRMContext() override; //////////////////////////////////////////////////////////// /// \brief Activate the context as the current target @@ -104,13 +104,13 @@ public: /// \return True on success, false if any error happened /// //////////////////////////////////////////////////////////// - virtual bool makeCurrent(bool current) override; + bool makeCurrent(bool current) override; //////////////////////////////////////////////////////////// /// \brief Display what has been rendered to the context so far /// //////////////////////////////////////////////////////////// - virtual void display() override; + void display() override; //////////////////////////////////////////////////////////// /// \brief Enable or disable vertical synchronization @@ -123,7 +123,7 @@ public: /// \param enabled: True to enable v-sync, false to deactivate /// //////////////////////////////////////////////////////////// - virtual void setVerticalSyncEnabled(bool enabled) override; + void setVerticalSyncEnabled(bool enabled) override; //////////////////////////////////////////////////////////// /// \brief Create the EGL context diff --git a/src/SFML/Window/DRM/WindowImplDRM.hpp b/src/SFML/Window/DRM/WindowImplDRM.hpp index 4fc48adf..308c3fe0 100644 --- a/src/SFML/Window/DRM/WindowImplDRM.hpp +++ b/src/SFML/Window/DRM/WindowImplDRM.hpp @@ -62,7 +62,7 @@ public: /// \brief Destructor /// //////////////////////////////////////////////////////////// - ~WindowImplDRM(); + ~WindowImplDRM() override; //////////////////////////////////////////////////////////// /// \brief Get the OS-specific handle of the window @@ -70,7 +70,7 @@ public: /// \return Handle of the window /// //////////////////////////////////////////////////////////// - virtual WindowHandle getSystemHandle() const override; + WindowHandle getSystemHandle() const override; //////////////////////////////////////////////////////////// /// \brief Get the position of the window @@ -78,7 +78,7 @@ public: /// \return Position of the window, in pixels /// //////////////////////////////////////////////////////////// - virtual Vector2i getPosition() const override; + Vector2i getPosition() const override; //////////////////////////////////////////////////////////// /// \brief Change the position of the window on screen @@ -86,7 +86,7 @@ public: /// \param position New position of the window, in pixels /// //////////////////////////////////////////////////////////// - virtual void setPosition(const Vector2i& position) override; + void setPosition(const Vector2i& position) override; //////////////////////////////////////////////////////////// /// \brief Get the client size of the window @@ -94,7 +94,7 @@ public: /// \return Size of the window, in pixels /// //////////////////////////////////////////////////////////// - virtual Vector2u getSize() const override; + Vector2u getSize() const override; //////////////////////////////////////////////////////////// /// \brief Change the size of the rendering region of the window @@ -102,7 +102,7 @@ public: /// \param size New size, in pixels /// //////////////////////////////////////////////////////////// - virtual void setSize(const Vector2u& size) override; + void setSize(const Vector2u& size) override; //////////////////////////////////////////////////////////// /// \brief Change the title of the window @@ -110,7 +110,7 @@ public: /// \param title New title /// //////////////////////////////////////////////////////////// - virtual void setTitle(const String& title) override; + void setTitle(const String& title) override; //////////////////////////////////////////////////////////// /// \brief Change the window's icon @@ -119,7 +119,7 @@ public: /// \param pixels Pointer to the pixels in memory, format must be RGBA 32 bits /// //////////////////////////////////////////////////////////// - virtual void setIcon(const Vector2u& size, const std::uint8_t* pixels) override; + void setIcon(const Vector2u& size, const std::uint8_t* pixels) override; //////////////////////////////////////////////////////////// /// \brief Show or hide the window @@ -127,7 +127,7 @@ public: /// \param visible True to show, false to hide /// //////////////////////////////////////////////////////////// - virtual void setVisible(bool visible) override; + void setVisible(bool visible) override; //////////////////////////////////////////////////////////// /// \brief Show or hide the mouse cursor @@ -135,7 +135,7 @@ public: /// \param visible True to show, false to hide /// //////////////////////////////////////////////////////////// - virtual void setMouseCursorVisible(bool visible) override; + void setMouseCursorVisible(bool visible) override; //////////////////////////////////////////////////////////// /// \brief Grab or release the mouse cursor @@ -143,7 +143,7 @@ public: /// \param grabbed True to enable, false to disable /// //////////////////////////////////////////////////////////// - virtual void setMouseCursorGrabbed(bool grabbed) override; + void setMouseCursorGrabbed(bool grabbed) override; //////////////////////////////////////////////////////////// /// \brief Set the displayed cursor to a native system cursor @@ -151,7 +151,7 @@ public: /// \param cursor Native system cursor type to display /// //////////////////////////////////////////////////////////// - virtual void setMouseCursor(const CursorImpl& cursor) override; + void setMouseCursor(const CursorImpl& cursor) override; //////////////////////////////////////////////////////////// /// \brief Enable or disable automatic key-repeat @@ -159,14 +159,14 @@ public: /// \param enabled True to enable, false to disable /// //////////////////////////////////////////////////////////// - virtual void setKeyRepeatEnabled(bool enabled) override; + void setKeyRepeatEnabled(bool enabled) override; //////////////////////////////////////////////////////////// /// \brief Request the current window to be made the active /// foreground window /// //////////////////////////////////////////////////////////// - virtual void requestFocus() override; + void requestFocus() override; //////////////////////////////////////////////////////////// /// \brief Check whether the window has the input focus @@ -174,14 +174,14 @@ public: /// \return True if window has focus, false otherwise /// //////////////////////////////////////////////////////////// - virtual bool hasFocus() const override; + bool hasFocus() const override; protected: //////////////////////////////////////////////////////////// /// \brief Process incoming events from the operating system /// //////////////////////////////////////////////////////////// - virtual void processEvents() override; + void processEvents() override; private: //////////////////////////////////////////////////////////// diff --git a/src/SFML/Window/OSX/SFContext.hpp b/src/SFML/Window/OSX/SFContext.hpp index 822375f2..07caaa5f 100644 --- a/src/SFML/Window/OSX/SFContext.hpp +++ b/src/SFML/Window/OSX/SFContext.hpp @@ -95,7 +95,7 @@ public: /// \brief Destructor /// //////////////////////////////////////////////////////////// - ~SFContext(); + ~SFContext() override; //////////////////////////////////////////////////////////// /// \brief Get the address of an OpenGL function diff --git a/src/SFML/Window/OSX/WindowImplCocoa.hpp b/src/SFML/Window/OSX/WindowImplCocoa.hpp index c4016c2c..638d32e7 100644 --- a/src/SFML/Window/OSX/WindowImplCocoa.hpp +++ b/src/SFML/Window/OSX/WindowImplCocoa.hpp @@ -90,7 +90,7 @@ public: /// \brief Destructor /// //////////////////////////////////////////////////////////// - ~WindowImplCocoa(); + ~WindowImplCocoa() override; //////////////////////////////////////////////////////////// /// \brief Window Closed Event - called by the cocoa window object diff --git a/src/SFML/Window/Unix/GlxContext.hpp b/src/SFML/Window/Unix/GlxContext.hpp index 8b2e6fe1..7f2e6bc3 100644 --- a/src/SFML/Window/Unix/GlxContext.hpp +++ b/src/SFML/Window/Unix/GlxContext.hpp @@ -76,7 +76,7 @@ public: /// \brief Destructor /// //////////////////////////////////////////////////////////// - ~GlxContext(); + ~GlxContext() override; //////////////////////////////////////////////////////////// /// \brief Get the address of an OpenGL function diff --git a/src/SFML/Window/Unix/WindowImplX11.hpp b/src/SFML/Window/Unix/WindowImplX11.hpp index 39f04855..d49d8900 100644 --- a/src/SFML/Window/Unix/WindowImplX11.hpp +++ b/src/SFML/Window/Unix/WindowImplX11.hpp @@ -69,7 +69,7 @@ public: /// \brief Destructor /// //////////////////////////////////////////////////////////// - ~WindowImplX11(); + ~WindowImplX11() override; //////////////////////////////////////////////////////////// /// \brief Get the OS-specific handle of the window