diff options
Diffstat (limited to 'include/modules')
-rw-r--r-- | include/modules/bs_badwords.h | 6 | ||||
-rw-r--r-- | include/modules/bs_kick.h | 4 | ||||
-rw-r--r-- | include/modules/cs_entrymsg.h | 4 | ||||
-rw-r--r-- | include/modules/cs_log.h | 6 | ||||
-rw-r--r-- | include/modules/cs_mode.h | 6 | ||||
-rw-r--r-- | include/modules/dns.h | 20 | ||||
-rw-r--r-- | include/modules/encryption.h | 4 | ||||
-rw-r--r-- | include/modules/httpd.h | 9 | ||||
-rw-r--r-- | include/modules/ldap.h | 4 | ||||
-rw-r--r-- | include/modules/ns_cert.h | 4 | ||||
-rw-r--r-- | include/modules/os_forbid.h | 8 | ||||
-rw-r--r-- | include/modules/os_ignore.h | 6 | ||||
-rw-r--r-- | include/modules/os_session.h | 8 | ||||
-rw-r--r-- | include/modules/redis.h | 2 | ||||
-rw-r--r-- | include/modules/sasl.h | 4 | ||||
-rw-r--r-- | include/modules/set_misc.h | 5 | ||||
-rw-r--r-- | include/modules/sql.h | 18 | ||||
-rw-r--r-- | include/modules/suspend.h | 4 | ||||
-rw-r--r-- | include/modules/xmlrpc.h | 2 |
19 files changed, 63 insertions, 61 deletions
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 3b90fad7a..6c9eda89f 100644 --- a/include/modules/dns.h +++ b/include/modules/dns.h @@ -73,10 +73,10 @@ namespace DNS struct Question { Anope::string name; - QueryType type; - unsigned short qclass; + QueryType type = QUERY_NONE; + unsigned short qclass = 0; - Question() : type(QUERY_NONE), qclass(0) { } + Question() = default; Question(const Anope::string &n, QueryType t, unsigned short c = 1) : name(n), type(t), qclass(c) { } inline bool operator==(const Question & other) const { return name == other.name && type == other.type && qclass == other.qclass; } @@ -91,12 +91,12 @@ namespace DNS struct ResourceRecord : Question { - unsigned int ttl; + unsigned int ttl = 0; Anope::string rdata; time_t created; - ResourceRecord(const Anope::string &n, QueryType t, unsigned short c = 1) : Question(n, t, c), ttl(0), created(Anope::CurTime) { } - ResourceRecord(const Question &q) : Question(q), ttl(0), created(Anope::CurTime) { } + ResourceRecord(const Anope::string &n, QueryType t, unsigned short c = 1) : Question(n, t, c), created(Anope::CurTime) { } + ResourceRecord(const Question &q) : Question(q), created(Anope::CurTime) { } }; struct Query @@ -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; @@ -139,12 +139,12 @@ namespace DNS /* Use result cache if available */ bool use_cache; /* Request id */ - unsigned short id; + unsigned short id = 0; /* Creator of this request */ Module *creator; Request(Manager *mgr, Module *c, const Anope::string &addr, QueryType qt, bool cache = false) : Timer(0), Question(addr, qt), manager(mgr), - use_cache(cache), id(0), creator(c) { } + use_cache(cache), creator(c) { } virtual ~Request() { @@ -164,7 +164,7 @@ namespace DNS /** Used to time out the query, xalls OnError and lets the TimerManager * delete this request. */ - void Tick(time_t) anope_override + void Tick(time_t) override { Log(LOG_DEBUG_2) << "Resolver: timeout for query " << this->name; Query rr(*this); 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/httpd.h b/include/modules/httpd.h index 6431534e3..c4c2c7d74 100644 --- a/include/modules/httpd.h +++ b/include/modules/httpd.h @@ -21,13 +21,14 @@ enum HTTPError /* A message to someone */ struct HTTPReply { - HTTPError error; + HTTPError error = HTTP_ERROR_OK; Anope::string content_type; std::map<Anope::string, Anope::string, ci::less> headers; typedef std::list<std::pair<Anope::string, Anope::string> > cookie; std::vector<cookie> cookies; - HTTPReply() : error(HTTP_ERROR_OK), length(0) { } + HTTPReply() = default; + HTTPReply& operator=(const HTTPReply &) = default; HTTPReply(const HTTPReply& other) : error(other.error), length(other.length) { @@ -65,7 +66,7 @@ struct HTTPReply }; std::deque<Data *> out; - size_t length; + size_t length = 0; void Write(const Anope::string &message) { @@ -93,7 +94,7 @@ struct HTTPMessage class HTTPClient; class HTTPProvider; -class HTTPPage : public Base +class HTTPPage : public virtual Base { Anope::string url; Anope::string content_type; 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 3ae9b7551..dd73dca4a 100644 --- a/include/modules/os_forbid.h +++ b/include/modules/os_forbid.h @@ -23,13 +23,13 @@ struct ForbidData Anope::string mask; Anope::string creator; Anope::string reason; - time_t created; - time_t expires; + time_t created = 0; + time_t expires = 0; ForbidType type; - virtual ~ForbidData() { } + virtual ~ForbidData() = default; protected: - ForbidData() : created(0), expires(0) { } + ForbidData() = default; }; class ForbidService : public Service diff --git a/include/modules/os_ignore.h b/include/modules/os_ignore.h index 69596c4bb..c4e401e81 100644 --- a/include/modules/os_ignore.h +++ b/include/modules/os_ignore.h @@ -14,11 +14,11 @@ struct IgnoreData Anope::string mask; Anope::string creator; Anope::string reason; - time_t time; /* When do we stop ignoring them? */ + time_t time = 0; /* When do we stop ignoring them? */ - virtual ~IgnoreData() { } + virtual ~IgnoreData() = default; protected: - IgnoreData() : time(0) { } + IgnoreData() = default; }; class IgnoreService : public Service diff --git a/include/modules/os_session.h b/include/modules/os_session.h index b8a889b8e..8318a40ec 100644 --- a/include/modules/os_session.h +++ b/include/modules/os_session.h @@ -12,10 +12,10 @@ struct Session { cidr addr; /* A cidr (sockaddrs + len) representing this session */ - unsigned count; /* Number of clients with this host */ - unsigned hits; /* Number of subsequent kills for a host */ + unsigned count = 1; /* Number of clients with this host */ + unsigned hits = 0; /* Number of subsequent kills for a host */ - Session(const sockaddrs &ip, int len) : addr(ip, len), count(1), hits(0) { } + Session(const sockaddrs &ip, int len) : addr(ip, len) { } }; struct Exception : Serializable @@ -28,7 +28,7 @@ struct Exception : Serializable time_t expires; /* Time when it expires. 0 == no expiry */ Exception() : Serializable("Exception") { } - void Serialize(Serialize::Data &data) const anope_override; + void Serialize(Serialize::Data &data) const override; static Serializable* Unserialize(Serializable *obj, Serialize::Data &data); }; 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/sasl.h b/include/modules/sasl.h index bd6cfdb31..3b2d587fa 100644 --- a/include/modules/sasl.h +++ b/include/modules/sasl.h @@ -82,7 +82,7 @@ namespace SASL public: IdentifyRequest(Module *m, const Anope::string &id, const Anope::string &acc, const Anope::string &pass, const Anope::string &h, const Anope::string &i) : ::IdentifyRequest(m, acc, pass), uid(id), hostname(h), ip(i) { } - void OnSuccess() anope_override + void OnSuccess() override { if (!sasl) return; @@ -108,7 +108,7 @@ namespace SASL } } - void OnFail() anope_override + void OnFail() override { if (!sasl) return; 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 c9849a8a5..f7734a717 100644 --- a/include/modules/sql.h +++ b/include/modules/sql.h @@ -21,7 +21,7 @@ namespace SQL Clear(); } - std::iostream& operator[](const Anope::string &key) anope_override + std::iostream& operator[](const Anope::string &key) override { std::stringstream *&ss = data[key]; if (!ss) @@ -29,7 +29,7 @@ namespace SQL return *ss; } - std::set<Anope::string> KeySet() const anope_override + std::set<Anope::string> KeySet() const override { std::set<Anope::string> keys; for (Map::const_iterator it = this->data.begin(), it_end = this->data.end(); it != it_end; ++it) @@ -37,7 +37,7 @@ namespace SQL return keys; } - size_t Hash() const anope_override + size_t Hash() const override { size_t hash = 0; for (Map::const_iterator it = this->data.begin(), it_end = this->data.end(); it != it_end; ++it) @@ -61,12 +61,12 @@ namespace SQL this->data.clear(); } - void SetType(const Anope::string &key, Type t) anope_override + void SetType(const Anope::string &key, Type t) override { this->types[key] = t; } - Type GetType(const Anope::string &key) const anope_override + Type GetType(const Anope::string &key) const override { std::map<Anope::string, Type>::const_iterator it = this->types.find(key); if (it != this->types.end()) @@ -82,7 +82,7 @@ namespace SQL public: Exception(const Anope::string &reason) : ModuleException(reason) { } - virtual ~Exception() throw() { } + virtual ~Exception() throw() = default; }; /** A SQL query @@ -141,10 +141,10 @@ namespace SQL Query query; Anope::string error; public: - unsigned int id; + unsigned int id = 0; Anope::string finished_query; - Result() : id(0) { } + Result() = default; Result(unsigned int i, const Query &q, const Anope::string &fq, const Anope::string &err = "") : query(q), error(err), id(i), finished_query(fq) { } inline operator bool() const { return this->error.empty(); } @@ -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; }; |