From 6b75a4dfc32e870e001cc2856fb4498069c39708 Mon Sep 17 00:00:00 2001 From: Ben Wiederhake Date: Sun, 31 Oct 2021 23:32:56 +0100 Subject: [PATCH] Everywhere: Mark overridden methods 'override' This is good practice, and fixes some IDE warnings. --- Userland/Games/Chess/Engine.h | 2 +- Userland/Libraries/LibChess/UCIEndpoint.h | 2 +- Userland/Libraries/LibGUI/Calendar.h | 2 +- Userland/Libraries/LibGUI/ColorPicker.cpp | 6 +++--- Userland/Services/ChessEngine/ChessEngine.h | 6 +++--- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Userland/Games/Chess/Engine.h b/Userland/Games/Chess/Engine.h index 22c0c072d6..2e728d647d 100644 --- a/Userland/Games/Chess/Engine.h +++ b/Userland/Games/Chess/Engine.h @@ -20,7 +20,7 @@ public: Engine(const Engine&) = delete; Engine& operator=(const Engine&) = delete; - virtual void handle_bestmove(const Chess::UCI::BestMoveCommand&); + virtual void handle_bestmove(const Chess::UCI::BestMoveCommand&) override; template void get_best_move(const Chess::Board& board, int time_limit, Callback&& callback) diff --git a/Userland/Libraries/LibChess/UCIEndpoint.h b/Userland/Libraries/LibChess/UCIEndpoint.h index e80f996c73..8207525028 100644 --- a/Userland/Libraries/LibChess/UCIEndpoint.h +++ b/Userland/Libraries/LibChess/UCIEndpoint.h @@ -36,7 +36,7 @@ public: void send_command(const Command&); - virtual void event(Core::Event&); + virtual void event(Core::Event&) override; Core::IODevice& in() { return *m_in; } Core::IODevice& out() { return *m_out; } diff --git a/Userland/Libraries/LibGUI/Calendar.h b/Userland/Libraries/LibGUI/Calendar.h index 033fc715bd..28db8c7d16 100644 --- a/Userland/Libraries/LibGUI/Calendar.h +++ b/Userland/Libraries/LibGUI/Calendar.h @@ -80,7 +80,7 @@ private: virtual void mousemove_event(GUI::MouseEvent&) override; virtual void mousedown_event(MouseEvent&) override; virtual void mouseup_event(MouseEvent&) override; - virtual void doubleclick_event(MouseEvent&); + virtual void doubleclick_event(MouseEvent&) override; virtual void leave_event(Core::Event&) override; struct Day { diff --git a/Userland/Libraries/LibGUI/ColorPicker.cpp b/Userland/Libraries/LibGUI/ColorPicker.cpp index d6c02a6408..f2e602f837 100644 --- a/Userland/Libraries/LibGUI/ColorPicker.cpp +++ b/Userland/Libraries/LibGUI/ColorPicker.cpp @@ -156,8 +156,8 @@ public: Function on_color_changed; private: - virtual void mousedown_event(GUI::MouseEvent&) { m_event_loop->quit(1); } - virtual void mousemove_event(GUI::MouseEvent&) + virtual void mousedown_event(GUI::MouseEvent&) override { m_event_loop->quit(1); } + virtual void mousemove_event(GUI::MouseEvent&) override { auto new_col = WindowServerConnection::the().get_color_under_cursor(); if (new_col == m_col) @@ -167,7 +167,7 @@ private: on_color_changed(m_col); } - virtual void keydown_event(GUI::KeyEvent& event) + virtual void keydown_event(GUI::KeyEvent& event) override { if (event.key() == KeyCode::Key_Escape) { event.accept(); diff --git a/Userland/Services/ChessEngine/ChessEngine.h b/Userland/Services/ChessEngine/ChessEngine.h index 61e356f069..05e541c1f9 100644 --- a/Userland/Services/ChessEngine/ChessEngine.h +++ b/Userland/Services/ChessEngine/ChessEngine.h @@ -20,9 +20,9 @@ public: { } - virtual void handle_uci(); - virtual void handle_position(const Chess::UCI::PositionCommand&); - virtual void handle_go(const Chess::UCI::GoCommand&); + virtual void handle_uci() override; + virtual void handle_position(const Chess::UCI::PositionCommand&) override; + virtual void handle_go(const Chess::UCI::GoCommand&) override; private: Chess::Board m_board;