diff options
34 files changed, 52 insertions, 93 deletions
diff --git a/include/anope.h b/include/anope.h index 96967bfb8..0ee78c540 100644 --- a/include/anope.h +++ b/include/anope.h @@ -665,7 +665,7 @@ class CoreException : public std::exception * Actually no, it does nothing. Never mind. * @throws Nothing! */ - virtual ~CoreException() throw() { } + virtual ~CoreException() throw() = default; /** Returns the reason for the exception. * The module should probably put something informative here as the user will see this upon failure. */ @@ -694,7 +694,7 @@ class ModuleException : public CoreException * Actually no, it does nothing. Never mind. * @throws Nothing! */ - virtual ~ModuleException() throw() { } + virtual ~ModuleException() throw() = default; }; class ConvertException : public CoreException @@ -702,7 +702,7 @@ class ConvertException : public CoreException public: ConvertException(const Anope::string &reason = "") : CoreException(reason) { } - virtual ~ConvertException() throw() { } + virtual ~ConvertException() throw() = default; }; /** Convert something to a string diff --git a/include/base.h b/include/base.h index 408f8dd16..3f0180247 100644 --- a/include/base.h +++ b/include/base.h @@ -36,7 +36,7 @@ class ReferenceBase public: ReferenceBase() = default; ReferenceBase(const ReferenceBase &other) : invalid(other.invalid) { } - virtual ~ReferenceBase() { } + virtual ~ReferenceBase() = default; inline void Invalidate() { this->invalid = true; } }; diff --git a/include/commands.h b/include/commands.h index 29fa3a601..c5b718dea 100644 --- a/include/commands.h +++ b/include/commands.h @@ -43,7 +43,7 @@ struct CommandInfo */ struct CoreExport CommandReply { - virtual ~CommandReply() { } + virtual ~CommandReply() = default; virtual void SendMessage(BotInfo *source, const Anope::string &msg) = 0; }; @@ -118,7 +118,7 @@ class CoreExport Command : public Service Command(Module *owner, const Anope::string &sname, size_t min_params, size_t max_params = 0); public: - virtual ~Command(); + virtual ~Command() = default; protected: void SetDesc(const Anope::string &d); diff --git a/include/config.h b/include/config.h index b59b5ad69..d2989cab4 100644 --- a/include/config.h +++ b/include/config.h @@ -178,7 +178,7 @@ class ConfigException : public CoreException * Actually no, it does nothing. Never mind. * @throws Nothing! */ - virtual ~ConfigException() throw() { } + virtual ~ConfigException() throw() = default; }; extern Configuration::File ServicesConf; diff --git a/include/lists.h b/include/lists.h index baff1a20b..cbde1494f 100644 --- a/include/lists.h +++ b/include/lists.h @@ -39,7 +39,7 @@ class CoreExport NumberList /** Destructor, does nothing */ - virtual ~NumberList(); + virtual ~NumberList() = default; /** Should be called after the constructors are done running. This calls the callbacks. */ diff --git a/include/modes.h b/include/modes.h index 3b4b0c1bb..af66a877c 100644 --- a/include/modes.h +++ b/include/modes.h @@ -55,7 +55,7 @@ class CoreExport Mode : public Base * @param type The mode type */ Mode(const Anope::string &mname, ModeClass mclass, char mc, ModeType type); - virtual ~Mode(); + virtual ~Mode() = default; /** Can a user set this mode, used for mlock * @param u The user @@ -229,7 +229,7 @@ class CoreExport ChannelStatus { Anope::string modes; public: - ChannelStatus(); + ChannelStatus() = default; ChannelStatus(const Anope::string &modes); void AddMode(char c); void DelMode(char c); diff --git a/include/modules/bs_badwords.h b/include/modules/bs_badwords.h index e2361616e..7bb7f1130 100644 --- a/include/modules/bs_badwords.h +++ b/include/modules/bs_badwords.h @@ -30,14 +30,14 @@ struct BadWord Anope::string word; BadWordType type; - virtual ~BadWord() { } + virtual ~BadWord() = default; protected: - BadWord() { } + BadWord() = default; }; struct BadWords { - virtual ~BadWords() { } + virtual ~BadWords() = default; /** Add a badword to the badword list * @param word The badword diff --git a/include/modules/bs_kick.h b/include/modules/bs_kick.h index 1e292b25f..69c5c43ad 100644 --- a/include/modules/bs_kick.h +++ b/include/modules/bs_kick.h @@ -36,9 +36,9 @@ struct KickerData bool dontkickops, dontkickvoices; protected: - KickerData() { } + KickerData() = default; public: - virtual ~KickerData() { } + virtual ~KickerData() = default; virtual void Check(ChannelInfo *ci) = 0; }; diff --git a/include/modules/cs_entrymsg.h b/include/modules/cs_entrymsg.h index 23a40b4c2..5b899ec84 100644 --- a/include/modules/cs_entrymsg.h +++ b/include/modules/cs_entrymsg.h @@ -13,9 +13,9 @@ struct EntryMsg Anope::string message; time_t when; - virtual ~EntryMsg() { } + virtual ~EntryMsg() = default; protected: - EntryMsg() { } + EntryMsg() = default; }; struct EntryMessageList : Serialize::Checker<std::vector<EntryMsg *> > diff --git a/include/modules/cs_log.h b/include/modules/cs_log.h index 0df61d4db..14f9764e3 100644 --- a/include/modules/cs_log.h +++ b/include/modules/cs_log.h @@ -22,9 +22,9 @@ struct LogSetting Anope::string creator; time_t created; - virtual ~LogSetting() { } + virtual ~LogSetting() = default; protected: - LogSetting() { } + LogSetting() = default; }; struct LogSettings : Serialize::Checker<std::vector<LogSetting *> > @@ -37,6 +37,6 @@ struct LogSettings : Serialize::Checker<std::vector<LogSetting *> > } public: - virtual ~LogSettings() { } + virtual ~LogSettings() = default; virtual LogSetting *Create() = 0; }; diff --git a/include/modules/cs_mode.h b/include/modules/cs_mode.h index fe59f17f9..d99a9a1ff 100644 --- a/include/modules/cs_mode.h +++ b/include/modules/cs_mode.h @@ -18,16 +18,16 @@ struct ModeLock Anope::string setter; time_t created; - virtual ~ModeLock() { } + virtual ~ModeLock() = default; protected: - ModeLock() { } + ModeLock() = default; }; struct ModeLocks { typedef std::vector<ModeLock *> ModeList; - virtual ~ModeLocks() { } + virtual ~ModeLocks() = default; /** Check if a mode is mlocked * @param mode The mode diff --git a/include/modules/dns.h b/include/modules/dns.h index afbac2944..6c9eda89f 100644 --- a/include/modules/dns.h +++ b/include/modules/dns.h @@ -118,7 +118,7 @@ namespace DNS { public: Manager(Module *creator) : Service(creator, "DNS::Manager", "dns/manager") { } - virtual ~Manager() { } + virtual ~Manager() = default; virtual void Process(Request *req) = 0; virtual void RemoveRequest(Request *req) = 0; diff --git a/include/modules/encryption.h b/include/modules/encryption.h index acb084835..4adc77136 100644 --- a/include/modules/encryption.h +++ b/include/modules/encryption.h @@ -17,7 +17,7 @@ namespace Encryption class Context { public: - virtual ~Context() { } + virtual ~Context() = default; virtual void Update(const unsigned char *data, size_t len) = 0; virtual void Finalize() = 0; virtual Hash GetFinalizedHash() = 0; @@ -27,7 +27,7 @@ namespace Encryption { public: Provider(Module *creator, const Anope::string &sname) : Service(creator, "Encryption::Provider", sname) { } - virtual ~Provider() { } + virtual ~Provider() = default; virtual Context *CreateContext(IV * = NULL) = 0; virtual IV GetDefaultIV() = 0; diff --git a/include/modules/ldap.h b/include/modules/ldap.h index 74dad36a3..7b778b6d4 100644 --- a/include/modules/ldap.h +++ b/include/modules/ldap.h @@ -14,7 +14,7 @@ class LDAPException : public ModuleException public: LDAPException(const Anope::string &reason) : ModuleException(reason) { } - virtual ~LDAPException() throw() { } + virtual ~LDAPException() throw() = default; }; struct LDAPModification @@ -116,7 +116,7 @@ class LDAPInterface Module *owner; LDAPInterface(Module *m) : owner(m) { } - virtual ~LDAPInterface() { } + virtual ~LDAPInterface() = default; virtual void OnResult(const LDAPResult &r) = 0; virtual void OnError(const LDAPResult &err) = 0; diff --git a/include/modules/ns_cert.h b/include/modules/ns_cert.h index a84276b52..62ac07846 100644 --- a/include/modules/ns_cert.h +++ b/include/modules/ns_cert.h @@ -12,9 +12,9 @@ struct NSCertList { protected: - NSCertList() { } + NSCertList() = default; public: - virtual ~NSCertList() { } + virtual ~NSCertList() = default; /** Add an entry to the nick's certificate list * diff --git a/include/modules/os_forbid.h b/include/modules/os_forbid.h index 140731593..dd73dca4a 100644 --- a/include/modules/os_forbid.h +++ b/include/modules/os_forbid.h @@ -27,7 +27,7 @@ struct ForbidData time_t expires = 0; ForbidType type; - virtual ~ForbidData() { } + virtual ~ForbidData() = default; protected: ForbidData() = default; }; diff --git a/include/modules/os_ignore.h b/include/modules/os_ignore.h index 55eb96554..c4e401e81 100644 --- a/include/modules/os_ignore.h +++ b/include/modules/os_ignore.h @@ -16,7 +16,7 @@ struct IgnoreData Anope::string reason; time_t time = 0; /* When do we stop ignoring them? */ - virtual ~IgnoreData() { } + virtual ~IgnoreData() = default; protected: IgnoreData() = default; }; diff --git a/include/modules/redis.h b/include/modules/redis.h index cb6f5380f..4d72b2afa 100644 --- a/include/modules/redis.h +++ b/include/modules/redis.h @@ -47,7 +47,7 @@ namespace Redis Module *owner; Interface(Module *m) : owner(m) { } - virtual ~Interface() { } + virtual ~Interface() = default; virtual void OnResult(const Reply &r) = 0; virtual void OnError(const Anope::string &error) { Log(owner) << error; } diff --git a/include/modules/set_misc.h b/include/modules/set_misc.h index de3d63228..c056c4c98 100644 --- a/include/modules/set_misc.h +++ b/include/modules/set_misc.h @@ -12,6 +12,7 @@ struct MiscData Anope::string name; Anope::string data; - MiscData() { } - virtual ~MiscData() { } + virtual ~MiscData() = default; + protected: + MiscData() = default; }; diff --git a/include/modules/sql.h b/include/modules/sql.h index d78f64391..dbb21afcd 100644 --- a/include/modules/sql.h +++ b/include/modules/sql.h @@ -82,7 +82,7 @@ namespace SQL public: Exception(const Anope::string &reason) : ModuleException(reason) { } - virtual ~Exception() throw() { } + virtual ~Exception() throw() = default; }; /** A SQL query @@ -187,7 +187,7 @@ namespace SQL Module *owner; Interface(Module *m) : owner(m) { } - virtual ~Interface() { } + virtual ~Interface() = default; virtual void OnResult(const Result &r) = 0; virtual void OnError(const Result &r) = 0; diff --git a/include/modules/suspend.h b/include/modules/suspend.h index 6b9177da4..b9865717d 100644 --- a/include/modules/suspend.h +++ b/include/modules/suspend.h @@ -14,6 +14,6 @@ struct SuspendInfo Anope::string what, by, reason; time_t when, expires; - SuspendInfo() { } - virtual ~SuspendInfo() { } + SuspendInfo() = default; + virtual ~SuspendInfo() = default; }; diff --git a/include/modules/xmlrpc.h b/include/modules/xmlrpc.h index 42d29bd2d..a39cdf061 100644 --- a/include/modules/xmlrpc.h +++ b/include/modules/xmlrpc.h @@ -28,7 +28,7 @@ class XMLRPCServiceInterface; class XMLRPCEvent { public: - virtual ~XMLRPCEvent() { } + virtual ~XMLRPCEvent() = default; virtual bool Run(XMLRPCServiceInterface *iface, HTTPClient *client, XMLRPCRequest &request) = 0; }; diff --git a/include/regexpr.h b/include/regexpr.h index 92be87c89..20ed28098 100644 --- a/include/regexpr.h +++ b/include/regexpr.h @@ -21,7 +21,7 @@ class RegexException : public CoreException public: RegexException(const Anope::string &reason = "") : CoreException(reason) { } - virtual ~RegexException() throw() { } + virtual ~RegexException() throw() = default; }; class CoreExport Regex @@ -30,7 +30,7 @@ class CoreExport Regex protected: Regex(const Anope::string &expr) : expression(expr) { } public: - virtual ~Regex() { } + virtual ~Regex() = default; const Anope::string &GetExpression() { return expression; } virtual bool Matches(const Anope::string &str) = 0; }; diff --git a/include/serialize.h b/include/serialize.h index a09f30e08..afe75c6d3 100644 --- a/include/serialize.h +++ b/include/serialize.h @@ -28,7 +28,7 @@ namespace Serialize DT_INT }; - virtual ~Data() { } + virtual ~Data() = default; virtual std::iostream& operator[](const Anope::string &key) = 0; virtual std::set<Anope::string> KeySet() const { throw CoreException("Not supported"); } diff --git a/include/service.h b/include/service.h index 1aa4034df..a29728b32 100644 --- a/include/service.h +++ b/include/service.h @@ -122,7 +122,7 @@ class ServiceReference : public Reference<T> Anope::string name; public: - ServiceReference() { } + ServiceReference() = default; ServiceReference(const Anope::string &t, const Anope::string &n) : type(t), name(n) { diff --git a/include/sockets.h b/include/sockets.h index aed9957b6..823756a0e 100644 --- a/include/sockets.h +++ b/include/sockets.h @@ -126,7 +126,7 @@ class SocketException : public CoreException /** Destructor * @throws Nothing */ - virtual ~SocketException() throw() { } + virtual ~SocketException() throw() = default; }; enum SocketFlag @@ -144,7 +144,7 @@ enum SocketFlag class CoreExport SocketIO { public: - virtual ~SocketIO() { } + virtual ~SocketIO() = default; /** Receive something from the buffer * @param s The socket @@ -285,8 +285,7 @@ class CoreExport BufferedSocket : public virtual Socket int recv_len; public: - BufferedSocket(); - virtual ~BufferedSocket(); + virtual ~BufferedSocket() = default; /** Called when there is something to be received for this socket * @return true on success, false to drop this socket @@ -339,8 +338,7 @@ class CoreExport BinarySocket : public virtual Socket std::deque<DataBlock *> write_buffer; public: - BinarySocket(); - virtual ~BinarySocket(); + virtual ~BinarySocket() = default; /** Called when there is something to be received for this socket * @return true on success, false to drop this socket @@ -377,7 +375,7 @@ class CoreExport ListenSocket : public virtual Socket * @param ipv6 true for ipv6 */ ListenSocket(const Anope::string &bindip, int port, bool ipv6); - virtual ~ListenSocket(); + virtual ~ListenSocket() = default; /** Process what has come in from the connection * @return false to destroy this socket diff --git a/include/threadengine.h b/include/threadengine.h index e45987e26..b5f8e5755 100644 --- a/include/threadengine.h +++ b/include/threadengine.h @@ -27,7 +27,7 @@ class CoreExport Thread : public Pipe, public Extensible /** Threads destructor */ - virtual ~Thread(); + virtual ~Thread() = default; /** Join to the thread, sets the exit state to true */ diff --git a/modules/m_dns.cpp b/modules/m_dns.cpp index 50c4c60a0..8b39b75b8 100644 --- a/modules/m_dns.cpp +++ b/modules/m_dns.cpp @@ -453,7 +453,7 @@ namespace DNS class ReplySocket : public virtual Socket { public: - virtual ~ReplySocket() { } + virtual ~ReplySocket() = default; virtual void Reply(Packet *p) = 0; }; } diff --git a/src/command.cpp b/src/command.cpp index 8e699255d..5216563d8 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -122,10 +122,6 @@ Command::Command(Module *o, const Anope::string &sname, size_t minparams, size_t allow_unregistered = require_user = false; } -Command::~Command() -{ -} - void Command::SetDesc(const Anope::string &d) { this->desc = d; diff --git a/src/misc.cpp b/src/misc.cpp index 815b8dc39..ff1b05b02 100644 --- a/src/misc.cpp +++ b/src/misc.cpp @@ -90,10 +90,6 @@ NumberList::NumberList(const Anope::string &list, bool descending) : desc(descen } while (sep.GetToken(token)); } -NumberList::~NumberList() -{ -} - void NumberList::Process() { if (!is_valid) diff --git a/src/modes.cpp b/src/modes.cpp index e6568d98f..0028ea37d 100644 --- a/src/modes.cpp +++ b/src/modes.cpp @@ -56,10 +56,6 @@ struct StackerInfo void AddMode(Mode *mode, bool set, const Anope::string ¶m); }; -ChannelStatus::ChannelStatus() -{ -} - ChannelStatus::ChannelStatus(const Anope::string &m) : modes(m) { } @@ -116,10 +112,6 @@ Mode::Mode(const Anope::string &mname, ModeClass mcl, char mch, ModeType mt) : n { } -Mode::~Mode() -{ -} - bool Mode::CanSet(User *u) const { return true; diff --git a/src/socket_transport.cpp b/src/socket_transport.cpp index 5abb308d2..94c69facf 100644 --- a/src/socket_transport.cpp +++ b/src/socket_transport.cpp @@ -13,14 +13,6 @@ #include "sockets.h" #include "socketengine.h" -BufferedSocket::BufferedSocket() -{ -} - -BufferedSocket::~BufferedSocket() -{ -} - bool BufferedSocket::ProcessRead() { char tbuffer[NET_BUFSIZE]; @@ -115,14 +107,6 @@ BinarySocket::DataBlock::~DataBlock() delete [] this->orig; } -BinarySocket::BinarySocket() -{ -} - -BinarySocket::~BinarySocket() -{ -} - bool BinarySocket::ProcessRead() { char tbuffer[NET_BUFSIZE]; diff --git a/src/sockets.cpp b/src/sockets.cpp index e2191dbd8..37ba6e446 100644 --- a/src/sockets.cpp +++ b/src/sockets.cpp @@ -567,10 +567,6 @@ ListenSocket::ListenSocket(const Anope::string &bindip, int port, bool i) throw SocketException("Unable to listen: " + Anope::LastError()); } -ListenSocket::~ListenSocket() -{ -} - bool ListenSocket::ProcessRead() { try diff --git a/src/threadengine.cpp b/src/threadengine.cpp index 4dd439a51..fc9ee742e 100644 --- a/src/threadengine.cpp +++ b/src/threadengine.cpp @@ -44,10 +44,6 @@ static void *entry_point(void *parameter) return NULL; } -Thread::~Thread() -{ -} - void Thread::Join() { this->SetExitState(); |