diff options
| author | Adam <Adam@anope.org> | 2012-02-18 15:04:26 -0500 |
|---|---|---|
| committer | Adam <Adam@anope.org> | 2012-02-18 15:04:26 -0500 |
| commit | ee5cd8493e34a1c049066ead25e9094b30cd49b5 (patch) | |
| tree | 846c6dcd9bb2c4d721c6290a9b9d6b6ed880acdb /modules/extra | |
| parent | 41e8d276023e8fefc22fb89c2f81ae17b8222155 (diff) | |
Use C++11's explicit override feature if available
Diffstat (limited to 'modules/extra')
| -rw-r--r-- | modules/extra/bs_autoassign.cpp | 4 | ||||
| -rw-r--r-- | modules/extra/ldap.h | 5 | ||||
| -rw-r--r-- | modules/extra/m_dnsbl.cpp | 6 | ||||
| -rw-r--r-- | modules/extra/m_helpchan.cpp | 4 | ||||
| -rw-r--r-- | modules/extra/m_ldap.cpp | 18 | ||||
| -rw-r--r-- | modules/extra/m_ldap_authentication.cpp | 22 | ||||
| -rw-r--r-- | modules/extra/m_ldap_oper.cpp | 10 | ||||
| -rw-r--r-- | modules/extra/m_mysql.cpp | 16 | ||||
| -rw-r--r-- | modules/extra/m_proxyscan.cpp | 26 | ||||
| -rw-r--r-- | modules/extra/m_rewrite.cpp | 4 | ||||
| -rw-r--r-- | modules/extra/m_sqlite.cpp | 25 | ||||
| -rw-r--r-- | modules/extra/m_ssl.cpp | 18 | ||||
| -rw-r--r-- | modules/extra/m_statusupdate.cpp | 4 | ||||
| -rw-r--r-- | modules/extra/m_xmlrpc.cpp | 12 | ||||
| -rw-r--r-- | modules/extra/m_xmlrpc_main.cpp | 11 | ||||
| -rw-r--r-- | modules/extra/ns_maxemail.cpp | 4 | ||||
| -rw-r--r-- | modules/extra/sql.h | 5 | ||||
| -rw-r--r-- | modules/extra/xmlrpc.h | 4 |
18 files changed, 96 insertions, 102 deletions
diff --git a/modules/extra/bs_autoassign.cpp b/modules/extra/bs_autoassign.cpp index b57564e23..be4b58cf9 100644 --- a/modules/extra/bs_autoassign.cpp +++ b/modules/extra/bs_autoassign.cpp @@ -26,7 +26,7 @@ class BSAutoAssign : public Module this->OnReload(); } - void OnChanRegistered(ChannelInfo *ci) + void OnChanRegistered(ChannelInfo *ci) anope_override { if (this->bot.empty()) return; @@ -41,7 +41,7 @@ class BSAutoAssign : public Module bi->Assign(NULL, ci); } - void OnReload() + void OnReload() anope_override { ConfigReader config; this->bot = config.ReadValue("bs_autoassign", "bot", "", 0); diff --git a/modules/extra/ldap.h b/modules/extra/ldap.h index c21d60b05..232bec808 100644 --- a/modules/extra/ldap.h +++ b/modules/extra/ldap.h @@ -107,9 +107,8 @@ class LDAPInterface LDAPInterface(Module *m) : owner(m) { } virtual ~LDAPInterface() { } - virtual void OnResult(const LDAPResult &r) { } - - virtual void OnError(const LDAPResult &err) { } + virtual void OnResult(const LDAPResult &r) = 0; + virtual void OnError(const LDAPResult &err) = 0; }; class LDAPProvider : public Service diff --git a/modules/extra/m_dnsbl.cpp b/modules/extra/m_dnsbl.cpp index 0d863ad8d..71011760e 100644 --- a/modules/extra/m_dnsbl.cpp +++ b/modules/extra/m_dnsbl.cpp @@ -28,7 +28,7 @@ class DNSBLResolver : public DNSRequest public: DNSBLResolver(Module *c, User *u, const Blacklist &b, const Anope::string &host, bool add_akill) : DNSRequest(host, DNS_QUERY_A, true, c), user(u), blacklist(b), add_to_akill(add_akill) { } - void OnLookupComplete(const DNSQuery *record) + void OnLookupComplete(const DNSQuery *record) anope_override { if (!user || user->HasExt("m_dnsbl_akilled")) return; @@ -95,7 +95,7 @@ class ModuleDNSBL : public Module OnReload(); } - void OnReload() + void OnReload() anope_override { ConfigReader config; @@ -126,7 +126,7 @@ class ModuleDNSBL : public Module } } - void OnUserConnect(dynamic_reference<User> &user, bool &exempt) + void OnUserConnect(dynamic_reference<User> &user, bool &exempt) anope_override { if (exempt || !user || (!this->check_on_connect && !Me->IsSynced())) return; diff --git a/modules/extra/m_helpchan.cpp b/modules/extra/m_helpchan.cpp index baf1429e3..7152f81ae 100644 --- a/modules/extra/m_helpchan.cpp +++ b/modules/extra/m_helpchan.cpp @@ -22,7 +22,7 @@ class HelpChannel : public Module OnReload(); } - EventReturn OnChannelModeSet(Channel *c, ChannelModeName Name, const Anope::string ¶m) + EventReturn OnChannelModeSet(Channel *c, ChannelModeName Name, const Anope::string ¶m) anope_override { if (Name == CMODE_OP && c && c->ci && c->name.equals_ci(this->HelpChan)) { @@ -35,7 +35,7 @@ class HelpChannel : public Module return EVENT_CONTINUE; } - void OnReload() + void OnReload() anope_override { ConfigReader config; diff --git a/modules/extra/m_ldap.cpp b/modules/extra/m_ldap.cpp index ab0aaa928..67a433bbd 100644 --- a/modules/extra/m_ldap.cpp +++ b/modules/extra/m_ldap.cpp @@ -97,7 +97,7 @@ class LDAPService : public LDAPProvider, public Thread, public Condition return this->Bind(i, this->admin_binddn, this->admin_pass); } - LDAPQuery Bind(LDAPInterface *i, const Anope::string &who, const Anope::string &pass) + LDAPQuery Bind(LDAPInterface *i, const Anope::string &who, const Anope::string &pass) anope_override { berval cred; cred.bv_val = strdup(pass.c_str()); @@ -120,7 +120,7 @@ class LDAPService : public LDAPProvider, public Thread, public Condition return msgid; } - LDAPQuery Search(LDAPInterface *i, const Anope::string &base, const Anope::string &filter) + LDAPQuery Search(LDAPInterface *i, const Anope::string &base, const Anope::string &filter) anope_override { if (i == NULL) throw LDAPException("No interface"); @@ -138,7 +138,7 @@ class LDAPService : public LDAPProvider, public Thread, public Condition return msgid; } - LDAPQuery Add(LDAPInterface *i, const Anope::string &dn, LDAPMods &attributes) + LDAPQuery Add(LDAPInterface *i, const Anope::string &dn, LDAPMods &attributes) anope_override { LDAPMod **mods = this->BuildMods(attributes); LDAPQuery msgid; @@ -159,7 +159,7 @@ class LDAPService : public LDAPProvider, public Thread, public Condition return msgid; } - LDAPQuery Del(LDAPInterface *i, const Anope::string &dn) + LDAPQuery Del(LDAPInterface *i, const Anope::string &dn) anope_override { LDAPQuery msgid; int ret = ldap_delete_ext(this->con, dn.c_str(), NULL, NULL, &msgid); @@ -178,7 +178,7 @@ class LDAPService : public LDAPProvider, public Thread, public Condition return msgid; } - LDAPQuery Modify(LDAPInterface *i, const Anope::string &base, LDAPMods &attributes) + LDAPQuery Modify(LDAPInterface *i, const Anope::string &base, LDAPMods &attributes) anope_override { LDAPMod **mods = this->BuildMods(attributes); LDAPQuery msgid; @@ -199,7 +199,7 @@ class LDAPService : public LDAPProvider, public Thread, public Condition return msgid; } - void Run() + void Run() anope_override { while (!this->GetExitState()) { @@ -356,7 +356,7 @@ class ModuleLDAP : public Module, public Pipe LDAPServices.clear(); } - void OnReload() + void OnReload() anope_override { ConfigReader config; int i, num; @@ -412,7 +412,7 @@ class ModuleLDAP : public Module, public Pipe } } - void OnModuleUnload(User *, Module *m) + void OnModuleUnload(User *, Module *m) anope_override { for (std::map<Anope::string, LDAPService *>::iterator it = this->LDAPServices.begin(); it != this->LDAPServices.end(); ++it) { @@ -436,7 +436,7 @@ class ModuleLDAP : public Module, public Pipe } } - void OnNotify() + void OnNotify() anope_override { for (std::map<Anope::string, LDAPService *>::iterator it = this->LDAPServices.begin(); it != this->LDAPServices.end(); ++it) { diff --git a/modules/extra/m_ldap_authentication.cpp b/modules/extra/m_ldap_authentication.cpp index 02fc05649..a34e6a709 100644 --- a/modules/extra/m_ldap_authentication.cpp +++ b/modules/extra/m_ldap_authentication.cpp @@ -32,7 +32,7 @@ class IdentifyInterface : public LDAPInterface this->requests[id] = ii; } - void OnResult(const LDAPResult &r) + void OnResult(const LDAPResult &r) anope_override { std::map<LDAPQuery, IdentifyInfo *>::iterator it = this->requests.find(r.id); if (it == this->requests.end()) @@ -70,7 +70,7 @@ class IdentifyInterface : public LDAPInterface delete ii; } - void OnError(const LDAPResult &r) + void OnError(const LDAPResult &r) anope_override { std::map<LDAPQuery, IdentifyInfo *>::iterator it = this->requests.find(r.id); if (it == this->requests.end()) @@ -107,7 +107,7 @@ class OnIdentifyInterface : public LDAPInterface this->requests[id] = nick; } - void OnResult(const LDAPResult &r) + void OnResult(const LDAPResult &r) anope_override { std::map<LDAPQuery, Anope::string>::iterator it = this->requests.find(r.id); if (it == this->requests.end()) @@ -138,7 +138,7 @@ class OnIdentifyInterface : public LDAPInterface } } - void OnError(const LDAPResult &r) + void OnError(const LDAPResult &r) anope_override { this->requests.erase(r.id); Log() << "m_ldap_authentication: " << r.error; @@ -150,12 +150,12 @@ class OnRegisterInterface : public LDAPInterface public: OnRegisterInterface(Module *m) : LDAPInterface(m) { } - void OnResult(const LDAPResult &r) + void OnResult(const LDAPResult &r) anope_override { Log() << "m_ldap_authentication: Successfully added newly created account to LDAP"; } - void OnError(const LDAPResult &r) + void OnError(const LDAPResult &r) anope_override { Log() << "m_ldap_authentication: Error adding newly created account to LDAP: " << r.getError(); } @@ -187,7 +187,7 @@ class NSIdentifyLDAP : public Module OnReload(); } - void OnReload() + void OnReload() anope_override { ConfigReader config; @@ -200,7 +200,7 @@ class NSIdentifyLDAP : public Module this->disable_reason = config.ReadValue("m_ldap_authentication", "disable_reason", "", 0); } - EventReturn OnPreCommand(CommandSource &source, Command *command, std::vector<Anope::string> ¶ms) + EventReturn OnPreCommand(CommandSource &source, Command *command, std::vector<Anope::string> ¶ms) anope_override { if (this->disable_register && !this->disable_reason.empty() && command->name == "nickserv/register") { @@ -211,7 +211,7 @@ class NSIdentifyLDAP : public Module return EVENT_CONTINUE; } - EventReturn OnCheckAuthentication(Command *c, CommandSource *source, const std::vector<Anope::string> ¶ms, const Anope::string &account, const Anope::string &password) + EventReturn OnCheckAuthentication(Command *c, CommandSource *source, const std::vector<Anope::string> ¶ms, const Anope::string &account, const Anope::string &password) anope_override { if (c == NULL || source == NULL || !this->ldap) @@ -246,7 +246,7 @@ class NSIdentifyLDAP : public Module return EVENT_STOP; } - void OnNickIdentify(User *u) + void OnNickIdentify(User *u) anope_override { if (email_attribute.empty() || !this->ldap) return; @@ -262,7 +262,7 @@ class NSIdentifyLDAP : public Module } } - void OnNickRegister(NickAlias *na) + void OnNickRegister(NickAlias *na) anope_override { if (this->disable_register || !this->ldap) return; diff --git a/modules/extra/m_ldap_oper.cpp b/modules/extra/m_ldap_oper.cpp index b25dd8eff..6a3bec89f 100644 --- a/modules/extra/m_ldap_oper.cpp +++ b/modules/extra/m_ldap_oper.cpp @@ -19,7 +19,7 @@ class IdentifyInterface : public LDAPInterface this->requests[id] = nick; } - void OnResult(const LDAPResult &r) + void OnResult(const LDAPResult &r) anope_override { std::map<LDAPQuery, Anope::string>::iterator it = this->requests.find(r.id); if (it == this->requests.end()) @@ -68,7 +68,7 @@ class IdentifyInterface : public LDAPInterface } } - void OnError(const LDAPResult &r) + void OnError(const LDAPResult &r) anope_override { this->requests.erase(r.id); } @@ -95,7 +95,7 @@ class LDAPOper : public Module OnReload(); } - void OnReload() + void OnReload() anope_override { ConfigReader config; @@ -110,7 +110,7 @@ class LDAPOper : public Module my_opers.clear(); } - void OnNickIdentify(User *u) + void OnNickIdentify(User *u) anope_override { try { @@ -130,7 +130,7 @@ class LDAPOper : public Module } } - void OnDelCore(NickCore *nc) + void OnDelCore(NickCore *nc) anope_override { if (nc->o != NULL && my_opers.count(nc->o) > 0) { diff --git a/modules/extra/m_mysql.cpp b/modules/extra/m_mysql.cpp index 189a950d8..138c726d8 100644 --- a/modules/extra/m_mysql.cpp +++ b/modules/extra/m_mysql.cpp @@ -119,13 +119,13 @@ class MySQLService : public SQLProvider ~MySQLService(); - void Run(SQLInterface *i, const SQLQuery &query); + void Run(SQLInterface *i, const SQLQuery &query) anope_override; - SQLResult RunQuery(const SQLQuery &query); + SQLResult RunQuery(const SQLQuery &query) anope_override; - SQLQuery CreateTable(const Anope::string &table, const Serializable::serialized_data &data); + SQLQuery CreateTable(const Anope::string &table, const Serializable::serialized_data &data) anope_override; - SQLQuery GetTables(); + SQLQuery GetTables() anope_override; void Connect(); @@ -141,7 +141,7 @@ class DispatcherThread : public Thread, public Condition public: DispatcherThread() : Thread() { } - void Run(); + void Run() anope_override; }; class ModuleSQL; @@ -183,7 +183,7 @@ class ModuleSQL : public Module, public Pipe delete DThread; } - void OnReload() + void OnReload() anope_override { ConfigReader config; int i, num; @@ -238,7 +238,7 @@ class ModuleSQL : public Module, public Pipe } } - void OnModuleUnload(User *, Module *m) + void OnModuleUnload(User *, Module *m) anope_override { this->DThread->Lock(); @@ -263,7 +263,7 @@ class ModuleSQL : public Module, public Pipe this->OnNotify(); } - void OnNotify() + void OnNotify() anope_override { this->DThread->Lock(); std::deque<QueryResult> finishedRequests = this->FinishedRequests; diff --git a/modules/extra/m_proxyscan.cpp b/modules/extra/m_proxyscan.cpp index 37fd7c432..ea35e8f77 100644 --- a/modules/extra/m_proxyscan.cpp +++ b/modules/extra/m_proxyscan.cpp @@ -29,12 +29,12 @@ class ProxyCallbackListener : public ListenSocket { } - void OnAccept() + void OnAccept() anope_override { this->Write(ProxyCheckString); } - bool ProcessWrite() + bool ProcessWrite() anope_override { return !BufferedSocket::ProcessWrite() || this->WriteBuffer.empty() ? false : true; } @@ -45,7 +45,7 @@ class ProxyCallbackListener : public ListenSocket { } - ClientSocket *OnAccept(int fd, const sockaddrs &addr) + ClientSocket *OnAccept(int fd, const sockaddrs &addr) anope_override { return new ProxyCallbackClient(this, fd, addr); } @@ -73,7 +73,7 @@ class ProxyConnect : public ConnectionSocket proxies.erase(this); } - virtual void OnConnect() = 0; + virtual void OnConnect() anope_override = 0; virtual const Anope::string GetType() const = 0; protected: @@ -112,7 +112,7 @@ class HTTPProxyConnect : public ProxyConnect, public BufferedSocket { } - void OnConnect() + void OnConnect() anope_override { this->Write("CONNECT %s:%d HTTP/1.0", target_ip.c_str(), target_port); this->Write("Content-length: 0"); @@ -120,12 +120,12 @@ class HTTPProxyConnect : public ProxyConnect, public BufferedSocket this->Write(""); } - const Anope::string GetType() const + const Anope::string GetType() const anope_override { return "HTTP"; } - bool Read(const Anope::string &buf) + bool Read(const Anope::string &buf) anope_override { if (buf == ProxyCheckString) { @@ -143,7 +143,7 @@ class SOCKS5ProxyConnect : public ProxyConnect, public BinarySocket { } - void OnConnect() + void OnConnect() anope_override { sockaddrs target_addr; char buf[4 + sizeof(target_addr.sa4.sin_addr.s_addr) + sizeof(target_addr.sa4.sin_port)]; @@ -175,12 +175,12 @@ class SOCKS5ProxyConnect : public ProxyConnect, public BinarySocket this->Write(buf, ptr); } - const Anope::string GetType() const + const Anope::string GetType() const anope_override { return "SOCKS5"; } - bool Read(const char *buffer, size_t l) + bool Read(const char *buffer, size_t l) anope_override { if (l >= ProxyCheckString.length() && !strncmp(buffer, ProxyCheckString.c_str(), ProxyCheckString.length())) { @@ -207,7 +207,7 @@ class ModuleProxyScan : public Module { } - void Tick(time_t) + void Tick(time_t) anope_override { for (std::set<ProxyConnect *>::iterator it = ProxyConnect::proxies.begin(), it_end = ProxyConnect::proxies.end(); it != it_end; ++it) { @@ -262,7 +262,7 @@ class ModuleProxyScan : public Module delete this->listener; } - void OnReload() + void OnReload() anope_override { ConfigReader config; @@ -341,7 +341,7 @@ class ModuleProxyScan : public Module } } - void OnUserConnect(dynamic_reference<User> &user, bool &exempt) + void OnUserConnect(dynamic_reference<User> &user, bool &exempt) anope_override { if (exempt || !user || !Me->IsSynced() || !user->server->IsSynced()) return; diff --git a/modules/extra/m_rewrite.cpp b/modules/extra/m_rewrite.cpp index 751e4e5aa..6d8690960 100644 --- a/modules/extra/m_rewrite.cpp +++ b/modules/extra/m_rewrite.cpp @@ -83,7 +83,7 @@ class ModuleRewrite : public Module this->OnReload(); } - void OnReload() + void OnReload() anope_override { ConfigReader config; @@ -104,7 +104,7 @@ class ModuleRewrite : public Module } } - EventReturn OnBotPrivmsg(User *u, BotInfo *bi, Anope::string &message) + EventReturn OnBotPrivmsg(User *u, BotInfo *bi, Anope::string &message) anope_override { std::vector<Anope::string> tokens = BuildStringVector(message); for (unsigned i = 0; i < this->rewrites.size(); ++i) diff --git a/modules/extra/m_sqlite.cpp b/modules/extra/m_sqlite.cpp index ccb9c2a2f..02923cfa7 100644 --- a/modules/extra/m_sqlite.cpp +++ b/modules/extra/m_sqlite.cpp @@ -40,11 +40,11 @@ class SQLiteService : public SQLProvider ~SQLiteService(); - void Run(SQLInterface *i, const SQLQuery &query); + void Run(SQLInterface *i, const SQLQuery &query) anope_override; SQLResult RunQuery(const SQLQuery &query); - SQLQuery CreateTable(const Anope::string &table, const Serializable::serialized_data &data); + SQLQuery CreateTable(const Anope::string &table, const Serializable::serialized_data &data) anope_override; SQLQuery GetTables(); @@ -71,7 +71,7 @@ class ModuleSQLite : public Module SQLiteServices.clear(); } - void OnReload() + void OnReload() anope_override { ConfigReader config; int i, num; @@ -158,22 +158,17 @@ SQLResult SQLiteService::RunQuery(const SQLQuery &query) SQLiteResult result(query, real_query); - do + while ((err = sqlite3_step(stmt)) == SQLITE_ROW) { - err = sqlite3_step(stmt); - if (err == SQLITE_ROW) + std::map<Anope::string, Anope::string> items; + for (int i = 0; i < cols; ++i) { - std::map<Anope::string, Anope::string> items; - for (int i = 0; i < cols; ++i) - { - const char *data = reinterpret_cast<const char *>(sqlite3_column_text(stmt, i)); - if (data && *data) - items[columns[i]] = data; - } - result.addRow(items); + const char *data = reinterpret_cast<const char *>(sqlite3_column_text(stmt, i)); + if (data && *data) + items[columns[i]] = data; } + result.addRow(items); } - while (err == SQLITE_ROW); sqlite3_finalize(stmt); diff --git a/modules/extra/m_ssl.cpp b/modules/extra/m_ssl.cpp index 829d3e532..fcfbb8f28 100644 --- a/modules/extra/m_ssl.cpp +++ b/modules/extra/m_ssl.cpp @@ -23,7 +23,7 @@ class MySSLService : public SSLService /** Initialize a socket to use SSL * @param s The socket */ - void Init(Socket *s); + void Init(Socket *s) anope_override; }; class SSLSocketIO : public SocketIO @@ -42,43 +42,43 @@ class SSLSocketIO : public SocketIO * @param sz How much to read * @return Number of bytes received */ - int Recv(Socket *s, char *buf, size_t sz); + int Recv(Socket *s, char *buf, size_t sz) anope_override; /** Write something to the socket * @param s The socket * @param buf The data to write * @param size The length of the data */ - int Send(Socket *s, const char *buf, size_t sz); + int Send(Socket *s, const char *buf, size_t sz) anope_override; /** Accept a connection from a socket * @param s The socket * @return The new socket */ - ClientSocket *Accept(ListenSocket *s); + ClientSocket *Accept(ListenSocket *s) anope_override; /** Finished accepting a connection from a socket * @param s The socket * @return SF_ACCEPTED if accepted, SF_ACCEPTING if still in process, SF_DEAD on error */ - SocketFlag FinishAccept(ClientSocket *cs); + SocketFlag FinishAccept(ClientSocket *cs) anope_override; /** Connect the socket * @param s THe socket * @param target IP to connect to * @param port to connect to */ - void Connect(ConnectionSocket *s, const Anope::string &target, int port); + void Connect(ConnectionSocket *s, const Anope::string &target, int port) anope_override; /** Called to potentially finish a pending connection * @param s The socket * @return SF_CONNECTED on success, SF_CONNECTING if still pending, and SF_DEAD on error. */ - SocketFlag FinishConnect(ConnectionSocket *s); + SocketFlag FinishConnect(ConnectionSocket *s) anope_override; /** Called when the socket is destructing */ - void Destroy(); + void Destroy() anope_override; }; class SSLModule; @@ -167,7 +167,7 @@ class SSLModule : public Module SSL_CTX_free(server_ctx); } - void OnPreServerConnect() + void OnPreServerConnect() anope_override { ConfigReader config; diff --git a/modules/extra/m_statusupdate.cpp b/modules/extra/m_statusupdate.cpp index db865e3c1..3caf09f64 100644 --- a/modules/extra/m_statusupdate.cpp +++ b/modules/extra/m_statusupdate.cpp @@ -31,7 +31,7 @@ class StatusUpdate : public Module ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); } - void OnAccessAdd(ChannelInfo *ci, User *u, ChanAccess *access) + void OnAccessAdd(ChannelInfo *ci, User *u, ChanAccess *access) anope_override { if (ci->c) for (CUserList::iterator it = ci->c->users.begin(), it_end = ci->c->users.end(); it != it_end; ++it) @@ -48,7 +48,7 @@ class StatusUpdate : public Module } } - void OnAccessDel(ChannelInfo *ci, User *u, ChanAccess *access) + void OnAccessDel(ChannelInfo *ci, User *u, ChanAccess *access) anope_override { if (ci->c) for (CUserList::iterator it = ci->c->users.begin(), it_end = ci->c->users.end(); it != it_end; ++it) diff --git a/modules/extra/m_xmlrpc.cpp b/modules/extra/m_xmlrpc.cpp index 40a032092..138f73a2a 100644 --- a/modules/extra/m_xmlrpc.cpp +++ b/modules/extra/m_xmlrpc.cpp @@ -14,7 +14,7 @@ class MyXMLRPCClientSocket : public XMLRPCClientSocket { } - bool Read(const Anope::string &message) + bool Read(const Anope::string &message) anope_override { if (message.find("xml version") != Anope::string::npos) this->in_query = true; @@ -100,7 +100,7 @@ class MyXMLRPCListenSocket : public XMLRPCListenSocket listen_sockets.erase(it); } - ClientSocket *OnAccept(int fd, const sockaddrs &addr) + ClientSocket *OnAccept(int fd, const sockaddrs &addr) anope_override { MyXMLRPCClientSocket *socket = new MyXMLRPCClientSocket(this, fd, addr); @@ -150,7 +150,7 @@ class MyXMLRPCServiceInterface : public XMLRPCServiceInterface this->events.erase(it); } - void Reply(XMLRPCClientSocket *source, XMLRPCRequest *request) + void Reply(XMLRPCClientSocket *source, XMLRPCRequest *request) anope_override { if (!request->id.empty()) request->reply("id", request->id); @@ -174,7 +174,7 @@ class MyXMLRPCServiceInterface : public XMLRPCServiceInterface Log(LOG_DEBUG) << reply; } - Anope::string Sanitize(const Anope::string &string) + Anope::string Sanitize(const Anope::string &string) anope_override { static struct special_chars { @@ -204,7 +204,7 @@ class MyXMLRPCServiceInterface : public XMLRPCServiceInterface return ret; } - void RunXMLRPC(XMLRPCClientSocket *source, XMLRPCRequest *request) + void RunXMLRPC(XMLRPCClientSocket *source, XMLRPCRequest *request) anope_override { for (unsigned i = 0; i < this->events.size(); ++i) { @@ -262,7 +262,7 @@ class ModuleXMLRPC : public Module listen_sockets.clear(); } - void OnReload() + void OnReload() anope_override { ConfigReader config; diff --git a/modules/extra/m_xmlrpc_main.cpp b/modules/extra/m_xmlrpc_main.cpp index 8762872ad..06ed55c86 100644 --- a/modules/extra/m_xmlrpc_main.cpp +++ b/modules/extra/m_xmlrpc_main.cpp @@ -14,22 +14,22 @@ class XMLRPCUser : public User this->server = Me; } - void SendMessage(BotInfo *, Anope::string msg) + void SendMessage(BotInfo *, Anope::string msg) anope_override { this->out += msg + "\n"; } - NickCore *Account() + NickCore *Account() anope_override { return (na ? na->nc : NULL); } - bool IsIdentified(bool CheckNick = false) + bool IsIdentified(bool CheckNick = false) anope_override { return na; } - bool IsRecognized(bool CheckSecure = true) + bool IsRecognized(bool CheckSecure = true) anope_override { return na; } @@ -43,7 +43,7 @@ class XMLRPCUser : public User class MyXMLRPCEvent : public XMLRPCEvent { public: - void Run(XMLRPCServiceInterface *iface, XMLRPCClientSocket *source, XMLRPCRequest *request) + void Run(XMLRPCServiceInterface *iface, XMLRPCClientSocket *source, XMLRPCRequest *request) anope_override { if (request->name == "command") this->DoCommand(iface, source, request); @@ -59,6 +59,7 @@ class MyXMLRPCEvent : public XMLRPCEvent this->DoOperType(iface, source, request); } + private: void DoCommand(XMLRPCServiceInterface *iface, XMLRPCClientSocket *source, XMLRPCRequest *request) { Anope::string service = request->data.size() > 0 ? request->data[0] : ""; diff --git a/modules/extra/ns_maxemail.cpp b/modules/extra/ns_maxemail.cpp index 6973b9c5e..350913fab 100644 --- a/modules/extra/ns_maxemail.cpp +++ b/modules/extra/ns_maxemail.cpp @@ -64,14 +64,14 @@ class NSMaxEmail : public Module OnReload(); } - void OnReload() + void OnReload() anope_override { ConfigReader config; this->NSEmailMax = config.ReadInteger("ns_maxemail", "maxemails", "0", 0, false); Log(LOG_DEBUG) << "[ns_maxemail] NSEmailMax set to " << NSEmailMax; } - EventReturn OnPreCommand(CommandSource &source, Command *command, std::vector<Anope::string> ¶ms) + EventReturn OnPreCommand(CommandSource &source, Command *command, std::vector<Anope::string> ¶ms) anope_override { if (command->name == "nickserv/register") { diff --git a/modules/extra/sql.h b/modules/extra/sql.h index 40c893722..0b27fe744 100644 --- a/modules/extra/sql.h +++ b/modules/extra/sql.h @@ -101,9 +101,8 @@ class SQLInterface SQLInterface(Module *m) : owner(m) { } - virtual void OnResult(const SQLResult &r) { } - - virtual void OnError(const SQLResult &r) { } + virtual void OnResult(const SQLResult &r) = 0; + virtual void OnError(const SQLResult &r) = 0; }; /** Class providing the SQL service, modules call this to execute queries diff --git a/modules/extra/xmlrpc.h b/modules/extra/xmlrpc.h index ef300e583..baff9b18d 100644 --- a/modules/extra/xmlrpc.h +++ b/modules/extra/xmlrpc.h @@ -13,7 +13,7 @@ class XMLRPCClientSocket : public ClientSocket, public BufferedSocket virtual ~XMLRPCClientSocket() { } - virtual bool Read(const Anope::string &message) = 0; + virtual bool Read(const Anope::string &message) anope_override = 0; virtual bool GetData(Anope::string &tag, Anope::string &data) = 0; @@ -33,7 +33,7 @@ class XMLRPCListenSocket : public ListenSocket virtual ~XMLRPCListenSocket() { } - virtual ClientSocket *OnAccept(int fd, const sockaddrs &addr) = 0; + virtual ClientSocket *OnAccept(int fd, const sockaddrs &addr) anope_override = 0; }; class XMLRPCRequest |
