1
0
Fork 0

Codechange: use default virtual destructors over empty destructors

pull/13152/head
rubidium42 2024-12-06 12:20:39 +01:00 committed by rubidium42
parent 701cb2e9d7
commit ef76f0e758
8 changed files with 13 additions and 20 deletions

View File

@ -30,7 +30,7 @@ using GrfIDMapping = std::map<uint32_t, GRFPresence>;
struct LoggedChange { struct LoggedChange {
LoggedChange(GamelogChangeType type = GLCT_NONE) : ct(type) {} LoggedChange(GamelogChangeType type = GLCT_NONE) : ct(type) {}
virtual ~LoggedChange() {} virtual ~LoggedChange() = default;
virtual void FormatTo(std::back_insert_iterator<std::string> &output_iterator, GrfIDMapping &grf_names, GamelogActionType action_type) = 0; virtual void FormatTo(std::back_insert_iterator<std::string> &output_iterator, GrfIDMapping &grf_names, GamelogActionType action_type) = 0;
GamelogChangeType ct; GamelogChangeType ct;

View File

@ -56,7 +56,7 @@ struct IniLoadFile {
const IniGroupNameList seq_group_names; ///< list of group names that are sequences. const IniGroupNameList seq_group_names; ///< list of group names that are sequences.
IniLoadFile(const IniGroupNameList &list_group_names = {}, const IniGroupNameList &seq_group_names = {}); IniLoadFile(const IniGroupNameList &list_group_names = {}, const IniGroupNameList &seq_group_names = {});
virtual ~IniLoadFile() { } virtual ~IniLoadFile() = default;
const IniGroup *GetGroup(std::string_view name) const; const IniGroup *GetGroup(std::string_view name) const;
IniGroup *GetGroup(std::string_view name); IniGroup *GetGroup(std::string_view name);

View File

@ -40,7 +40,7 @@
*/ */
class NetworkEncryptionHandler { class NetworkEncryptionHandler {
public: public:
virtual ~NetworkEncryptionHandler() {} virtual ~NetworkEncryptionHandler() = default;
/** /**
* Get the size of the MAC (Message Authentication Code) used by the underlying encryption protocol. * Get the size of the MAC (Message Authentication Code) used by the underlying encryption protocol.
@ -70,7 +70,7 @@ public:
*/ */
class NetworkAuthenticationPasswordRequest { class NetworkAuthenticationPasswordRequest {
public: public:
virtual ~NetworkAuthenticationPasswordRequest() {} virtual ~NetworkAuthenticationPasswordRequest() = default;
/** /**
* Reply to the request with the given password. * Reply to the request with the given password.
@ -108,7 +108,7 @@ public:
*/ */
class NetworkAuthenticationPasswordProvider { class NetworkAuthenticationPasswordProvider {
public: public:
virtual ~NetworkAuthenticationPasswordProvider() {} virtual ~NetworkAuthenticationPasswordProvider() = default;
/** /**
* Callback to return the password where to validate against. * Callback to return the password where to validate against.
@ -139,7 +139,7 @@ public:
*/ */
class NetworkAuthenticationAuthorizedKeyHandler { class NetworkAuthenticationAuthorizedKeyHandler {
public: public:
virtual ~NetworkAuthenticationAuthorizedKeyHandler() {} virtual ~NetworkAuthenticationAuthorizedKeyHandler() = default;
/** /**
* Check whether the key handler can be used, i.e. whether there are authorized keys to check against. * Check whether the key handler can be used, i.e. whether there are authorized keys to check against.
@ -189,7 +189,7 @@ using NetworkAuthenticationMethodMask = uint16_t;
*/ */
class NetworkAuthenticationHandler { class NetworkAuthenticationHandler {
public: public:
virtual ~NetworkAuthenticationHandler() {} virtual ~NetworkAuthenticationHandler() = default;
/** /**
* Get the name of the handler for debug messages. * Get the name of the handler for debug messages.

View File

@ -40,7 +40,7 @@ public:
RandomAccessFile(const RandomAccessFile&) = delete; RandomAccessFile(const RandomAccessFile&) = delete;
void operator=(const RandomAccessFile&) = delete; void operator=(const RandomAccessFile&) = delete;
virtual ~RandomAccessFile() {} virtual ~RandomAccessFile() = default;
const std::string &GetFilename() const; const std::string &GetFilename() const;
const std::string &GetSimplifiedFilename() const; const std::string &GetSimplifiedFilename() const;

View File

@ -24,9 +24,7 @@ struct LoadFilter {
} }
/** Make sure the writers are properly closed. */ /** Make sure the writers are properly closed. */
virtual ~LoadFilter() virtual ~LoadFilter() = default;
{
}
/** /**
* Read a given number of bytes from the savegame. * Read a given number of bytes from the savegame.
@ -69,9 +67,7 @@ struct SaveFilter {
} }
/** Make sure the writers are properly closed. */ /** Make sure the writers are properly closed. */
virtual ~SaveFilter() virtual ~SaveFilter() = default;
{
}
/** /**
* Write a given number of bytes into the savegame. * Write a given number of bytes into the savegame.

View File

@ -44,7 +44,7 @@ typedef bool (ScriptAsyncModeProc)();
class SimpleCountedObject { class SimpleCountedObject {
public: public:
SimpleCountedObject() : ref_count(0) {} SimpleCountedObject() : ref_count(0) {}
virtual ~SimpleCountedObject() {} virtual ~SimpleCountedObject() = default;
inline void AddRef() { ++this->ref_count; } inline void AddRef() { ++this->ref_count; }
void Release(); void Release();

View File

@ -62,7 +62,7 @@ struct StringReader {
bool translation; ///< Are we reading a translation, implies !master. However, the base translation will have this false. bool translation; ///< Are we reading a translation, implies !master. However, the base translation will have this false.
StringReader(StringData &data, const std::string &file, bool master, bool translation); StringReader(StringData &data, const std::string &file, bool master, bool translation);
virtual ~StringReader() {} virtual ~StringReader() = default;
void HandleString(char *str); void HandleString(char *str);
/** /**

View File

@ -115,10 +115,7 @@ protected:
} }
public: public:
/** Some compilers really like this. */ virtual ~TileIterator() = default;
virtual ~TileIterator()
{
}
/** /**
* Get the tile we are currently at. * Get the tile we are currently at.