From aee68f8b00f2c95ba7993bfeafddf652bc7bfda8 Mon Sep 17 00:00:00 2001 From: RickyRister <42636155+RickyRister@users.noreply.github.com> Date: Sat, 25 Jan 2025 06:06:03 -0800 Subject: [PATCH] add missing override and explicit specifiers in common (#5527) --- common/rng_abstract.h | 2 +- common/rng_sfmt.h | 4 ++-- common/server.h | 2 +- common/server_abstractuserinterface.h | 4 ++-- common/server_database_interface.h | 2 +- common/server_game.h | 2 +- common/server_room.h | 2 +- common/serverinfo_user_container.h | 4 ++-- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/common/rng_abstract.h b/common/rng_abstract.h index 84c7066c0..ffd45b9d7 100644 --- a/common/rng_abstract.h +++ b/common/rng_abstract.h @@ -8,7 +8,7 @@ class RNG_Abstract : public QObject { Q_OBJECT public: - RNG_Abstract(QObject *parent = 0) : QObject(parent) + explicit RNG_Abstract(QObject *parent = nullptr) : QObject(parent) { } virtual unsigned int rand(int min, int max) = 0; diff --git a/common/rng_sfmt.h b/common/rng_sfmt.h index b4e87ae1c..7e9f53df3 100644 --- a/common/rng_sfmt.h +++ b/common/rng_sfmt.h @@ -36,8 +36,8 @@ private: unsigned int cdf(unsigned int min, unsigned int max); public: - RNG_SFMT(QObject *parent = 0); - unsigned int rand(int min, int max); + explicit RNG_SFMT(QObject *parent = nullptr); + unsigned int rand(int min, int max) override; }; #endif diff --git a/common/server.h b/common/server.h index 16cbf4086..293aeb5b2 100644 --- a/common/server.h +++ b/common/server.h @@ -58,7 +58,7 @@ private slots: public: mutable QReadWriteLock clientsLock, roomsLock; // locking order: roomsLock before clientsLock explicit Server(QObject *parent = nullptr); - virtual ~Server() = default; + ~Server() override = default; AuthenticationResult loginUser(Server_ProtocolHandler *session, QString &name, const QString &password, diff --git a/common/server_abstractuserinterface.h b/common/server_abstractuserinterface.h index cf65480d6..763bcc567 100644 --- a/common/server_abstractuserinterface.h +++ b/common/server_abstractuserinterface.h @@ -26,14 +26,14 @@ protected: Server *server; public: - Server_AbstractUserInterface(Server *_server) : server(_server) + explicit Server_AbstractUserInterface(Server *_server) : server(_server) { } Server_AbstractUserInterface(Server *_server, const ServerInfo_User_Container &other) : ServerInfo_User_Container(other), server(_server) { } - virtual ~Server_AbstractUserInterface() + ~Server_AbstractUserInterface() override { } diff --git a/common/server_database_interface.h b/common/server_database_interface.h index 80578cc60..fdbded4ba 100644 --- a/common/server_database_interface.h +++ b/common/server_database_interface.h @@ -9,7 +9,7 @@ class Server_DatabaseInterface : public QObject { Q_OBJECT public: - Server_DatabaseInterface(QObject *parent = 0) : QObject(parent) + explicit Server_DatabaseInterface(QObject *parent = nullptr) : QObject(parent) { } diff --git a/common/server_game.h b/common/server_game.h index d1a8dda96..2f8c005b6 100644 --- a/common/server_game.h +++ b/common/server_game.h @@ -108,7 +108,7 @@ public: bool _spectatorsSeeEverything, int startingLifeTotal, Server_Room *parent); - ~Server_Game(); + ~Server_Game() override; Server_Room *getRoom() const { return room; diff --git a/common/server_room.h b/common/server_room.h index 76988f012..7c804a461 100644 --- a/common/server_room.h +++ b/common/server_room.h @@ -64,7 +64,7 @@ public: const QString &_joinMessage, const QStringList &_gameTypes, Server *parent); - ~Server_Room(); + ~Server_Room() override; int getId() const { return id; diff --git a/common/serverinfo_user_container.h b/common/serverinfo_user_container.h index 3a6484661..4a29bce2d 100644 --- a/common/serverinfo_user_container.h +++ b/common/serverinfo_user_container.h @@ -9,8 +9,8 @@ protected: ServerInfo_User *userInfo; public: - ServerInfo_User_Container(ServerInfo_User *_userInfo = nullptr); - ServerInfo_User_Container(const ServerInfo_User &_userInfo); + explicit ServerInfo_User_Container(ServerInfo_User *_userInfo = nullptr); + explicit ServerInfo_User_Container(const ServerInfo_User &_userInfo); ServerInfo_User_Container(const ServerInfo_User_Container &other); ServerInfo_User_Container &operator=(const ServerInfo_User_Container &other) = default; virtual ~ServerInfo_User_Container();