From a5f7aac2953e94e49b93e9195ae8d4dccba46f6d Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Mon, 3 Jan 2022 16:50:06 +0000 Subject: Replace anope_{final,override} with their C++11 equivalent. --- docs/EVENTS | 7 +- include/access.h | 2 +- include/account.h | 4 +- include/extensible.h | 16 +-- include/hashcomp.h | 8 +- include/mail.h | 2 +- include/memo.h | 2 +- include/messages.h | 40 +++---- include/modes.h | 18 ++-- include/modules/dns.h | 2 +- include/modules/os_session.h | 2 +- include/modules/sasl.h | 4 +- include/modules/sql.h | 10 +- include/regchannel.h | 4 +- include/service.h | 2 +- include/services.h | 8 -- include/sockets.h | 18 ++-- include/uplink.h | 6 +- include/users.h | 2 +- include/xline.h | 2 +- modules/bs_autoassign.cpp | 2 +- modules/commands/bs_assign.cpp | 16 +-- modules/commands/bs_badwords.cpp | 22 ++-- modules/commands/bs_bot.cpp | 4 +- modules/commands/bs_botlist.cpp | 4 +- modules/commands/bs_control.cpp | 8 +- modules/commands/bs_info.cpp | 6 +- modules/commands/bs_kick.cpp | 68 ++++++------ modules/commands/bs_set.cpp | 16 +-- modules/commands/cs_access.cpp | 30 +++--- modules/commands/cs_akick.cpp | 10 +- modules/commands/cs_ban.cpp | 6 +- modules/commands/cs_clone.cpp | 4 +- modules/commands/cs_drop.cpp | 4 +- modules/commands/cs_enforce.cpp | 4 +- modules/commands/cs_entrymsg.cpp | 10 +- modules/commands/cs_flags.cpp | 14 +-- modules/commands/cs_getkey.cpp | 4 +- modules/commands/cs_info.cpp | 4 +- modules/commands/cs_invite.cpp | 4 +- modules/commands/cs_kick.cpp | 4 +- modules/commands/cs_list.cpp | 10 +- modules/commands/cs_log.cpp | 14 +-- modules/commands/cs_mode.cpp | 40 +++---- modules/commands/cs_register.cpp | 4 +- modules/commands/cs_seen.cpp | 26 ++--- modules/commands/cs_set.cpp | 86 +++++++-------- modules/commands/cs_set_misc.cpp | 12 +-- modules/commands/cs_status.cpp | 4 +- modules/commands/cs_suspend.cpp | 18 ++-- modules/commands/cs_sync.cpp | 4 +- modules/commands/cs_topic.cpp | 14 +-- modules/commands/cs_unban.cpp | 4 +- modules/commands/cs_updown.cpp | 8 +- modules/commands/cs_xop.cpp | 20 ++-- modules/commands/gl_global.cpp | 4 +- modules/commands/greet.cpp | 18 ++-- modules/commands/help.cpp | 2 +- modules/commands/hs_del.cpp | 8 +- modules/commands/hs_group.cpp | 10 +- modules/commands/hs_list.cpp | 4 +- modules/commands/hs_off.cpp | 4 +- modules/commands/hs_on.cpp | 4 +- modules/commands/hs_request.cpp | 18 ++-- modules/commands/hs_set.cpp | 8 +- modules/commands/ms_cancel.cpp | 4 +- modules/commands/ms_check.cpp | 4 +- modules/commands/ms_del.cpp | 6 +- modules/commands/ms_ignore.cpp | 4 +- modules/commands/ms_info.cpp | 4 +- modules/commands/ms_list.cpp | 6 +- modules/commands/ms_read.cpp | 6 +- modules/commands/ms_rsend.cpp | 4 +- modules/commands/ms_send.cpp | 4 +- modules/commands/ms_sendall.cpp | 4 +- modules/commands/ms_set.cpp | 4 +- modules/commands/ms_staff.cpp | 4 +- modules/commands/ns_access.cpp | 6 +- modules/commands/ns_ajoin.cpp | 8 +- modules/commands/ns_alist.cpp | 4 +- modules/commands/ns_cert.cpp | 28 ++--- modules/commands/ns_drop.cpp | 4 +- modules/commands/ns_getemail.cpp | 4 +- modules/commands/ns_group.cpp | 16 +-- modules/commands/ns_identify.cpp | 8 +- modules/commands/ns_info.cpp | 12 +-- modules/commands/ns_list.cpp | 14 +-- modules/commands/ns_logout.cpp | 4 +- modules/commands/ns_recover.cpp | 12 +-- modules/commands/ns_register.cpp | 20 ++-- modules/commands/ns_resetpass.cpp | 6 +- modules/commands/ns_set.cpp | 104 +++++++++--------- modules/commands/ns_set_misc.cpp | 14 +-- modules/commands/ns_status.cpp | 4 +- modules/commands/ns_suspend.cpp | 18 ++-- modules/commands/ns_update.cpp | 4 +- modules/commands/os_akill.cpp | 8 +- modules/commands/os_chankill.cpp | 4 +- modules/commands/os_config.cpp | 4 +- modules/commands/os_defcon.cpp | 20 ++-- modules/commands/os_dns.cpp | 20 ++-- modules/commands/os_forbid.cpp | 26 ++--- modules/commands/os_ignore.cpp | 20 ++-- modules/commands/os_info.cpp | 10 +- modules/commands/os_jupe.cpp | 4 +- modules/commands/os_kick.cpp | 4 +- modules/commands/os_kill.cpp | 4 +- modules/commands/os_list.cpp | 8 +- modules/commands/os_login.cpp | 14 +-- modules/commands/os_logsearch.cpp | 4 +- modules/commands/os_mode.cpp | 8 +- modules/commands/os_modinfo.cpp | 8 +- modules/commands/os_module.cpp | 12 +-- modules/commands/os_news.cpp | 28 ++--- modules/commands/os_noop.cpp | 6 +- modules/commands/os_oper.cpp | 8 +- modules/commands/os_reload.cpp | 4 +- modules/commands/os_session.cpp | 38 +++---- modules/commands/os_set.cpp | 4 +- modules/commands/os_shutdown.cpp | 12 +-- modules/commands/os_stats.cpp | 8 +- modules/commands/os_svs.cpp | 12 +-- modules/commands/os_sxline.cpp | 22 ++-- modules/commands/os_update.cpp | 4 +- modules/cs_statusupdate.cpp | 4 +- modules/database/db_flatfile.cpp | 20 ++-- modules/database/db_old.cpp | 4 +- modules/database/db_redis.cpp | 34 +++--- modules/database/db_sql.cpp | 26 ++--- modules/database/db_sql_live.cpp | 18 ++-- modules/encryption/enc_bcrypt.cpp | 6 +- modules/encryption/enc_md5.cpp | 14 +-- modules/encryption/enc_none.cpp | 4 +- modules/encryption/enc_old.cpp | 8 +- modules/encryption/enc_sha1.cpp | 14 +-- modules/encryption/enc_sha256.cpp | 14 +-- modules/extra/m_ldap.cpp | 30 +++--- modules/extra/m_ldap_authentication.cpp | 28 ++--- modules/extra/m_ldap_oper.cpp | 12 +-- modules/extra/m_mysql.cpp | 18 ++-- modules/extra/m_regex_pcre.cpp | 2 +- modules/extra/m_regex_posix.cpp | 2 +- modules/extra/m_regex_tre.cpp | 2 +- modules/extra/m_sql_authentication.cpp | 10 +- modules/extra/m_sql_log.cpp | 4 +- modules/extra/m_sql_oper.cpp | 8 +- modules/extra/m_sqlite.cpp | 6 +- modules/extra/m_ssl_gnutls.cpp | 20 ++-- modules/extra/m_ssl_openssl.cpp | 20 ++-- modules/extra/stats/cs_fantasy_stats.cpp | 6 +- modules/extra/stats/cs_fantasy_top.cpp | 6 +- modules/extra/stats/irc2sql/irc2sql.h | 48 ++++----- modules/extra/stats/m_chanstats.cpp | 38 +++---- modules/fantasy.cpp | 8 +- modules/m_dns.cpp | 36 +++---- modules/m_dnsbl.cpp | 6 +- modules/m_helpchan.cpp | 2 +- modules/m_httpd.cpp | 24 ++--- modules/m_proxyscan.cpp | 26 ++--- modules/m_redis.cpp | 28 ++--- modules/m_rewrite.cpp | 8 +- modules/m_sasl.cpp | 32 +++--- modules/m_xmlrpc.cpp | 12 +-- modules/m_xmlrpc_main.cpp | 8 +- modules/ns_maxemail.cpp | 4 +- modules/protocol/bahamut.cpp | 68 ++++++------ modules/protocol/hybrid.cpp | 90 ++++++++-------- modules/protocol/inspircd.cpp | 166 ++++++++++++++--------------- modules/protocol/ngircd.cpp | 58 +++++----- modules/protocol/plexus.cpp | 68 ++++++------ modules/protocol/ratbox.cpp | 54 +++++----- modules/protocol/solanum.cpp | 84 +++++++-------- modules/protocol/unrealircd.cpp | 150 +++++++++++++------------- modules/pseudoclients/botserv.cpp | 22 ++-- modules/pseudoclients/chanserv.cpp | 44 ++++---- modules/pseudoclients/global.cpp | 14 +-- modules/pseudoclients/hostserv.cpp | 14 +-- modules/pseudoclients/memoserv.cpp | 24 ++--- modules/pseudoclients/nickserv.cpp | 52 ++++----- modules/pseudoclients/operserv.cpp | 50 ++++----- modules/webcpanel/pages/chanserv/access.h | 4 +- modules/webcpanel/pages/chanserv/akick.h | 4 +- modules/webcpanel/pages/chanserv/drop.h | 2 +- modules/webcpanel/pages/chanserv/info.h | 2 +- modules/webcpanel/pages/chanserv/modes.h | 4 +- modules/webcpanel/pages/chanserv/set.h | 4 +- modules/webcpanel/pages/confirm.h | 2 +- modules/webcpanel/pages/hostserv/request.h | 2 +- modules/webcpanel/pages/index.cpp | 4 +- modules/webcpanel/pages/index.h | 2 +- modules/webcpanel/pages/logout.h | 2 +- modules/webcpanel/pages/memoserv/memos.h | 2 +- modules/webcpanel/pages/nickserv/access.h | 2 +- modules/webcpanel/pages/nickserv/alist.h | 2 +- modules/webcpanel/pages/nickserv/cert.h | 2 +- modules/webcpanel/pages/nickserv/info.h | 2 +- modules/webcpanel/pages/operserv/akill.h | 2 +- modules/webcpanel/pages/register.h | 2 +- modules/webcpanel/static_fileserver.h | 2 +- modules/webcpanel/webcpanel.cpp | 4 +- modules/webcpanel/webcpanel.h | 2 +- src/main.cpp | 4 +- 202 files changed, 1520 insertions(+), 1531 deletions(-) diff --git a/docs/EVENTS b/docs/EVENTS index 54e9c87a5..ba570289b 100644 --- a/docs/EVENTS +++ b/docs/EVENTS @@ -22,13 +22,10 @@ Anope Internal Events The full list of functions and parameters are in modules.h. In this case, you would be overriding OnJoinChannel() and OnPartChannel() like so: - void OnJoinChannel(User *u, Channel *c) anope_override { } - void OnPartChannel(User *u, Channel *c) anope_override { } + void OnJoinChannel(User *u, Channel *c) override { } + void OnPartChannel(User *u, Channel *c) override { } Some of these event overrides can be used to prevent or allow things to happen that would normally not be allowed or denied. You can also use ModuleManager (not explained here) to set control which order the modules are queried (when multiple modules hook to the same event). - - The "anope_override" identifier is for compatibility with C++11. - Its usage is highly recommended. diff --git a/include/access.h b/include/access.h index fccf8220b..32b59e655 100644 --- a/include/access.h +++ b/include/access.h @@ -95,7 +95,7 @@ class CoreExport ChanAccess : public Serializable const Anope::string &Mask() const; NickCore *GetAccount() const; - void Serialize(Serialize::Data &data) const anope_override; + void Serialize(Serialize::Data &data) const override; static Serializable* Unserialize(Serializable *obj, Serialize::Data &); static const unsigned int MAX_DEPTH = 4; diff --git a/include/account.h b/include/account.h index 1a6809d90..163d7d0c6 100644 --- a/include/account.h +++ b/include/account.h @@ -54,7 +54,7 @@ class CoreExport NickAlias : public Serializable, public Extensible NickAlias(const Anope::string &nickname, NickCore *nickcore); ~NickAlias(); - void Serialize(Serialize::Data &data) const anope_override; + void Serialize(Serialize::Data &data) const override; static Serializable* Unserialize(Serializable *obj, Serialize::Data &); /** Set a vhost for the user @@ -149,7 +149,7 @@ class CoreExport NickCore : public Serializable, public Extensible NickCore(const Anope::string &nickdisplay, uint64_t nickid = 0); ~NickCore(); - void Serialize(Serialize::Data &data) const anope_override; + void Serialize(Serialize::Data &data) const override; static Serializable* Unserialize(Serializable *obj, Serialize::Data &); /** Changes the display for this account diff --git a/include/extensible.h b/include/extensible.h index 9b8bbd853..bb7f38448 100644 --- a/include/extensible.h +++ b/include/extensible.h @@ -93,7 +93,7 @@ class BaseExtensibleItem : public ExtensibleBase return t; } - void Unset(Extensible *obj) anope_override + void Unset(Extensible *obj) override { T *value = Get(obj); items.erase(obj); @@ -128,7 +128,7 @@ template class ExtensibleItem : public BaseExtensibleItem { protected: - T* Create(Extensible *obj) anope_override + T* Create(Extensible *obj) override { return new T(obj); } @@ -140,7 +140,7 @@ template class PrimitiveExtensibleItem : public BaseExtensibleItem { protected: - T* Create(Extensible *obj) anope_override + T* Create(Extensible *obj) override { return new T(); } @@ -152,7 +152,7 @@ template<> class PrimitiveExtensibleItem : public BaseExtensibleItem { protected: - bool* Create(Extensible *) anope_override + bool* Create(Extensible *) override { return NULL; } @@ -166,13 +166,13 @@ class SerializableExtensibleItem : public PrimitiveExtensibleItem public: SerializableExtensibleItem(Module *m, const Anope::string &n) : PrimitiveExtensibleItem(m, n) { } - void ExtensibleSerialize(const Extensible *e, const Serializable *s, Serialize::Data &data) const anope_override + void ExtensibleSerialize(const Extensible *e, const Serializable *s, Serialize::Data &data) const override { T* t = this->Get(e); data[this->name] << *t; } - void ExtensibleUnserialize(Extensible *e, Serializable *s, Serialize::Data &data) anope_override + void ExtensibleUnserialize(Extensible *e, Serializable *s, Serialize::Data &data) override { T t; if (data[this->name] >> t) @@ -188,12 +188,12 @@ class SerializableExtensibleItem : public PrimitiveExtensibleItem public: SerializableExtensibleItem(Module *m, const Anope::string &n) : PrimitiveExtensibleItem(m, n) { } - void ExtensibleSerialize(const Extensible *e, const Serializable *s, Serialize::Data &data) const anope_override + void ExtensibleSerialize(const Extensible *e, const Serializable *s, Serialize::Data &data) const override { data[this->name] << true; } - void ExtensibleUnserialize(Extensible *e, Serializable *s, Serialize::Data &data) anope_override + void ExtensibleUnserialize(Extensible *e, Serializable *s, Serialize::Data &data) override { bool b = false; data[this->name] >> b; diff --git a/include/hashcomp.h b/include/hashcomp.h index 983115620..a50ab334d 100644 --- a/include/hashcomp.h +++ b/include/hashcomp.h @@ -38,7 +38,7 @@ namespace Anope class ascii_ctype : public std::ctype { public: - char_type do_toupper(char_type c) const anope_override + char_type do_toupper(char_type c) const override { if (c >= 'a' && c <= 'z') return c - 32; @@ -46,7 +46,7 @@ namespace Anope return c; } - char_type do_tolower(char_type c) const anope_override + char_type do_tolower(char_type c) const override { if (c >= 'A' && c <= 'Z') return c + 32; @@ -60,7 +60,7 @@ namespace Anope class rfc1459_ctype : public ascii_ctype { public: - char_type do_toupper(char_type c) const anope_override + char_type do_toupper(char_type c) const override { if (c == '{' || c == '}' || c == '|') return c - 32; @@ -68,7 +68,7 @@ namespace Anope return ascii_ctype::do_toupper(c); } - char_type do_tolower(char_type c) const anope_override + char_type do_tolower(char_type c) const override { if (c == '[' || c == ']' || c == '\\') return c + 32; diff --git a/include/mail.h b/include/mail.h index e46848ded..932d1a6e6 100644 --- a/include/mail.h +++ b/include/mail.h @@ -48,7 +48,7 @@ namespace Mail ~Message(); /* Called from within the thread to actually send the mail */ - void Run() anope_override; + void Run() override; }; } // namespace Mail diff --git a/include/memo.h b/include/memo.h index 277f70da6..112fd3c21 100644 --- a/include/memo.h +++ b/include/memo.h @@ -24,7 +24,7 @@ class CoreExport Memo : public Serializable Memo(); ~Memo(); - void Serialize(Serialize::Data &data) const anope_override; + void Serialize(Serialize::Data &data) const override; static Serializable* Unserialize(Serializable *obj, Serialize::Data &); Anope::string owner; diff --git a/include/messages.h b/include/messages.h index bdd3fa944..3e8be52fd 100644 --- a/include/messages.h +++ b/include/messages.h @@ -23,35 +23,35 @@ namespace Message { Away(Module *creator, const Anope::string &mname = "AWAY") : IRCDMessage(creator, mname, 0) { SetFlag(IRCDMESSAGE_REQUIRE_USER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) anope_override; + void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) override; }; struct CoreExport Capab : IRCDMessage { Capab(Module *creator, const Anope::string &mname = "CAPAB") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) anope_override; + void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) override; }; struct CoreExport Error : IRCDMessage { Error(Module *creator, const Anope::string &mname = "ERROR") : IRCDMessage(creator, mname, 1) { } - void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) anope_override; + void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) override; }; struct CoreExport Invite : IRCDMessage { Invite(Module *creator, const Anope::string &mname = "INVITE") : IRCDMessage(creator, mname, 2) { SetFlag(IRCDMESSAGE_REQUIRE_USER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) anope_override; + void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) override; }; struct CoreExport Join : IRCDMessage { Join(Module *creator, const Anope::string &mname = "JOIN") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) anope_override; + void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) override; typedef std::pair SJoinUser; @@ -69,105 +69,105 @@ namespace Message { Kick(Module *creator, const Anope::string &mname = "KICK") : IRCDMessage(creator, mname, 2) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) anope_override; + void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) override; }; struct CoreExport Kill : IRCDMessage { Kill(Module *creator, const Anope::string &mname = "KILL") : IRCDMessage(creator, mname, 2) { } - void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) anope_override; + void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) override; }; struct CoreExport Mode : IRCDMessage { Mode(Module *creator, const Anope::string &mname = "MODE") : IRCDMessage(creator, mname, 2) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) anope_override; + void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) override; }; struct CoreExport MOTD : IRCDMessage { MOTD(Module *creator, const Anope::string &mname = "MOTD") : IRCDMessage(creator, mname, 1) { } - void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) anope_override; + void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) override; }; struct CoreExport Notice : IRCDMessage { Notice(Module *creator, const Anope::string &mname = "NOTICE") : IRCDMessage(creator, mname, 2) { SetFlag(IRCDMESSAGE_REQUIRE_USER); } - void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) anope_override; + void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) override; }; struct CoreExport Part : IRCDMessage { Part(Module *creator, const Anope::string &mname = "PART") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) anope_override; + void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) override; }; struct CoreExport Ping : IRCDMessage { Ping(Module *creator, const Anope::string &mname = "PING") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) anope_override; + void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) override; }; struct CoreExport Privmsg : IRCDMessage { Privmsg(Module *creator, const Anope::string &mname = "PRIVMSG") : IRCDMessage(creator, mname, 2) { SetFlag(IRCDMESSAGE_REQUIRE_USER); } - void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) anope_override; + void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) override; }; struct CoreExport Quit : IRCDMessage { Quit(Module *creator, const Anope::string &mname = "QUIT") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); } - void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) anope_override; + void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) override; }; struct CoreExport SQuit : IRCDMessage { SQuit(Module *creator, const Anope::string &mname = "SQUIT") : IRCDMessage(creator, mname, 2) { } - void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) anope_override; + void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) override; }; struct CoreExport Stats : IRCDMessage { Stats(Module *creator, const Anope::string &mname = "STATS") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) anope_override; + void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) override; }; struct CoreExport Time : IRCDMessage { Time(Module *creator, const Anope::string &mname = "TIME") : IRCDMessage(creator, mname, 0) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) anope_override; + void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) override; }; struct CoreExport Topic : IRCDMessage { Topic(Module *creator, const Anope::string &mname = "TOPIC") : IRCDMessage(creator, mname, 2) { SetFlag(IRCDMESSAGE_REQUIRE_USER); } - void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) anope_override; + void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) override; }; struct CoreExport Version : IRCDMessage { Version(Module *creator, const Anope::string &mname = "VERSION") : IRCDMessage(creator, mname, 0) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) anope_override; + void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) override; }; struct CoreExport Whois : IRCDMessage { Whois(Module *creator, const Anope::string &mname = "WHOIS") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); } - void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) anope_override; + void Run(MessageSource &source, const std::vector ¶ms, const Anope::map &tags) override; }; } // namespace Message diff --git a/include/modes.h b/include/modes.h index 04fc97791..cbde11429 100644 --- a/include/modes.h +++ b/include/modes.h @@ -105,7 +105,7 @@ class CoreExport ChannelMode : public Mode */ ChannelMode(const Anope::string &name, char mc); - bool CanSet(User *u) const anope_override; + bool CanSet(User *u) const override; virtual void Check() { } @@ -217,11 +217,11 @@ class CoreExport ChannelModeVirtual : public T ~ChannelModeVirtual(); - void Check() anope_override; + void Check() override; - ChannelMode *Wrap(Anope::string ¶m) anope_override; + ChannelMode *Wrap(Anope::string ¶m) override; - ChannelMode *Unwrap(ChannelMode *cm, Anope::string ¶m) anope_override = 0; + ChannelMode *Unwrap(ChannelMode *cm, Anope::string ¶m) override = 0; }; /* The status a user has on a channel (+v, +h, +o) etc */ @@ -245,7 +245,7 @@ class CoreExport UserModeOperOnly : public UserMode public: UserModeOperOnly(const Anope::string &mname, char um) : UserMode(mname, um) { } - bool CanSet(User *u) const anope_override; + bool CanSet(User *u) const override; }; class CoreExport UserModeNoone : public UserMode @@ -253,7 +253,7 @@ class CoreExport UserModeNoone : public UserMode public: UserModeNoone(const Anope::string &mname, char um) : UserMode(mname, um) { } - bool CanSet(User *u) const anope_override; + bool CanSet(User *u) const override; }; /** Channel mode +k (key) @@ -263,7 +263,7 @@ class CoreExport ChannelModeKey : public ChannelModeParam public: ChannelModeKey(char mc) : ChannelModeParam("KEY", mc) { } - bool IsValid(Anope::string &value) const anope_override; + bool IsValid(Anope::string &value) const override; }; /** This class is used for oper only channel modes @@ -274,7 +274,7 @@ class CoreExport ChannelModeOperOnly : public ChannelMode ChannelModeOperOnly(const Anope::string &mname, char mc) : ChannelMode(mname, mc) { } /* Opers only */ - bool CanSet(User *u) const anope_override; + bool CanSet(User *u) const override; }; /** This class is used for channel modes only servers may set @@ -284,7 +284,7 @@ class CoreExport ChannelModeNoone : public ChannelMode public: ChannelModeNoone(const Anope::string &mname, char mc) : ChannelMode(mname, mc) { } - bool CanSet(User *u) const anope_override; + bool CanSet(User *u) const override; }; /** This is the mode manager diff --git a/include/modules/dns.h b/include/modules/dns.h index 3b90fad7a..1fe642c3b 100644 --- a/include/modules/dns.h +++ b/include/modules/dns.h @@ -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/os_session.h b/include/modules/os_session.h index b8a889b8e..0dd2cdcb4 100644 --- a/include/modules/os_session.h +++ b/include/modules/os_session.h @@ -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/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/sql.h b/include/modules/sql.h index e2e01e20e..0be5e93d0 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 KeySet() const anope_override + std::set KeySet() const override { std::set 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::const_iterator it = this->types.find(key); if (it != this->types.end()) diff --git a/include/regchannel.h b/include/regchannel.h index d0f0bf02f..bf14d82ae 100644 --- a/include/regchannel.h +++ b/include/regchannel.h @@ -38,7 +38,7 @@ class CoreExport AutoKick : public Serializable AutoKick(); ~AutoKick(); - void Serialize(Serialize::Data &data) const anope_override; + void Serialize(Serialize::Data &data) const override; static Serializable* Unserialize(Serializable *obj, Serialize::Data &); }; @@ -94,7 +94,7 @@ class CoreExport ChannelInfo : public Serializable, public Extensible ~ChannelInfo(); - void Serialize(Serialize::Data &data) const anope_override; + void Serialize(Serialize::Data &data) const override; static Serializable* Unserialize(Serializable *obj, Serialize::Data &); /** Change the founder of the channel diff --git a/include/service.h b/include/service.h index 2f7618371..1aa4034df 100644 --- a/include/service.h +++ b/include/service.h @@ -134,7 +134,7 @@ class ServiceReference : public Reference this->invalid = true; } - operator bool() anope_override + operator bool() override { if (this->invalid) { diff --git a/include/services.h b/include/services.h index 8a9551155..8fb7a0108 100644 --- a/include/services.h +++ b/include/services.h @@ -48,14 +48,6 @@ #define _(x) x -#if defined __GXX_EXPERIMENTAL_CXX0X__ || __cplusplus >= 201103L -# define anope_override override -# define anope_final final -#else -# define anope_override -# define anope_final -#endif - #ifndef _WIN32 # define DllExport # define CoreExport diff --git a/include/sockets.h b/include/sockets.h index 1a54e4fd1..aed9957b6 100644 --- a/include/sockets.h +++ b/include/sockets.h @@ -291,12 +291,12 @@ class CoreExport BufferedSocket : public virtual Socket /** Called when there is something to be received for this socket * @return true on success, false to drop this socket */ - bool ProcessRead() anope_override; + bool ProcessRead() override; /** Called when the socket is ready to be written to * @return true on success, false to drop this socket */ - bool ProcessWrite() anope_override; + bool ProcessWrite() override; /** Gets the new line from the input buffer, if any */ @@ -345,12 +345,12 @@ class CoreExport BinarySocket : public virtual Socket /** Called when there is something to be received for this socket * @return true on success, false to drop this socket */ - bool ProcessRead() anope_override; + bool ProcessRead() override; /** Called when the socket is ready to be written to * @return true on success, false to drop this socket */ - bool ProcessWrite() anope_override; + bool ProcessWrite() override; /** Write data to the socket * @param buffer The data to write @@ -408,12 +408,12 @@ class CoreExport ConnectionSocket : public virtual Socket * Used to determine whether or not this socket is connected yet. * @return true to continue to call ProcessRead/ProcessWrite, false to not continue */ - bool Process() anope_override; + bool Process() override; /** Called when there is an error for this socket * @return true on success, false to drop this socket */ - void ProcessError() anope_override; + void ProcessError() override; /** Called on a successful connect */ @@ -443,12 +443,12 @@ class CoreExport ClientSocket : public virtual Socket * Used to determine whether or not this socket is connected yet. * @return true to continue to call ProcessRead/ProcessWrite, false to not continue */ - bool Process() anope_override; + bool Process() override; /** Called when there is an error for this socket * @return true on success, false to drop this socket */ - void ProcessError() anope_override; + void ProcessError() override; /** Called when a client has been accepted() successfully. */ @@ -472,7 +472,7 @@ class CoreExport Pipe : public Socket /** Called when data is to be read, reads the data then calls OnNotify */ - bool ProcessRead() anope_override; + bool ProcessRead() override; /** Write data to this pipe * @param data The data to write diff --git a/include/uplink.h b/include/uplink.h index 6d3089137..5aac5dd2d 100644 --- a/include/uplink.h +++ b/include/uplink.h @@ -27,9 +27,9 @@ class UplinkSocket : public ConnectionSocket, public BufferedSocket bool error; UplinkSocket(); ~UplinkSocket(); - bool ProcessRead() anope_override; - void OnConnect() anope_override; - void OnError(const Anope::string &) anope_override; + bool ProcessRead() override; + void OnConnect() override; + void OnError(const Anope::string &) override; /* A message sent over the uplink socket */ class CoreExport Message diff --git a/include/users.h b/include/users.h index c96cc8145..e9bef1c4a 100644 --- a/include/users.h +++ b/include/users.h @@ -190,7 +190,7 @@ class CoreExport User : public virtual Base, public Extensible, public CommandRe * @param ... any number of parameters */ void SendMessage(BotInfo *source, const char *fmt, ...); - void SendMessage(BotInfo *source, const Anope::string &msg) anope_override; + void SendMessage(BotInfo *source, const Anope::string &msg) override; /** Identify the user to a nick. * updates last_seen, logs the user in, diff --git a/include/xline.h b/include/xline.h index 413dc3340..1b032ded9 100644 --- a/include/xline.h +++ b/include/xline.h @@ -44,7 +44,7 @@ class CoreExport XLine : public Serializable bool HasNickOrReal() const; bool IsRegex() const; - 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/modules/bs_autoassign.cpp b/modules/bs_autoassign.cpp index 27dc0097d..3686b1a2e 100644 --- a/modules/bs_autoassign.cpp +++ b/modules/bs_autoassign.cpp @@ -16,7 +16,7 @@ class BSAutoAssign : public Module { } - void OnChanRegistered(ChannelInfo *ci) anope_override + void OnChanRegistered(ChannelInfo *ci) override { const Anope::string &bot = Config->GetModule(this)->Get("bot"); if (bot.empty()) diff --git a/modules/commands/bs_assign.cpp b/modules/commands/bs_assign.cpp index 2c8404aff..2cb580b5b 100644 --- a/modules/commands/bs_assign.cpp +++ b/modules/commands/bs_assign.cpp @@ -20,7 +20,7 @@ class CommandBSAssign : public Command this->SetSyntax(_("\037channel\037 \037nick\037")); } - void Execute(CommandSource &source, const std::vector ¶ms) anope_override + void Execute(CommandSource &source, const std::vector ¶ms) override { const Anope::string &chan = params[0]; const Anope::string &nick = params[1]; @@ -71,7 +71,7 @@ class CommandBSAssign : public Command source.Reply(_("Bot \002%s\002 has been assigned to %s."), bi->nick.c_str(), ci->name.c_str()); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -91,7 +91,7 @@ class CommandBSUnassign : public Command this->SetSyntax(_("\037channel\037")); } - void Execute(CommandSource &source, const std::vector ¶ms) anope_override + void Execute(CommandSource &source, const std::vector ¶ms) override { if (Anope::ReadOnly) { @@ -132,7 +132,7 @@ class CommandBSUnassign : public Command source.Reply(_("There is no bot assigned to %s anymore."), ci->name.c_str()); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -154,7 +154,7 @@ class CommandBSSetNoBot : public Command this->SetSyntax(_("\037channel\037 {\037ON|OFF\037}")); } - void Execute(CommandSource &source, const std::vector ¶ms) anope_override + void Execute(CommandSource &source, const std::vector ¶ms) override { ChannelInfo *ci = ChannelInfo::Find(params[0]); const Anope::string &value = params[1]; @@ -191,7 +191,7 @@ class CommandBSSetNoBot : public Command this->OnSyntaxError(source, source.command); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(_(" \n" @@ -217,7 +217,7 @@ class BSAssign : public Module { } - void OnInvite(User *source, Channel *c, User *targ) anope_override + void OnInvite(User *source, Channel *c, User *targ) override { BotInfo *bi; if (Anope::ReadOnly || !c->ci || targ->server != Me || !(bi = dynamic_cast(targ))) @@ -246,7 +246,7 @@ class BSAssign : public Module targ->SendMessage(bi, _("Bot \002%s\002 has been assigned to %s."), bi->nick.c_str(), c->name.c_str()); } - void OnBotInfo(CommandSource &source, BotInfo *bi, ChannelInfo *ci, InfoFormatter &info) anope_override + void OnBotInfo(CommandSource &source, BotInfo *bi, ChannelInfo *ci, InfoFormatter &info) override { if (nobot.HasExt(ci)) info.AddOption(_("No bot")); diff --git a/modules/commands/bs_badwords.cpp b/modules/commands/bs_badwords.cpp index 31ebebf27..af2085746 100644 --- a/modules/commands/bs_badwords.cpp +++ b/modules/commands/bs_badwords.cpp @@ -17,7 +17,7 @@ struct BadWordImpl : BadWord, Serializable BadWordImpl() : Serializable("BadWord") { } ~BadWordImpl(); - void Serialize(Serialize::Data &data) const anope_override + void Serialize(Serialize::Data &data) const override { data["ci"] << this->chan; data["word"] << this->word; @@ -37,7 +37,7 @@ struct BadWordsImpl : BadWords ~BadWordsImpl(); - BadWord* AddBadWord(const Anope::string &word, BadWordType type) anope_override + BadWord* AddBadWord(const Anope::string &word, BadWordType type) override { BadWordImpl *bw = new BadWordImpl(); bw->chan = ci->name; @@ -51,7 +51,7 @@ struct BadWordsImpl : BadWords return bw; } - BadWord* GetBadWord(unsigned index) const anope_override + BadWord* GetBadWord(unsigned index) const override { if (this->badwords->empty() || index >= this->badwords->size()) return NULL; @@ -61,12 +61,12 @@ struct BadWordsImpl : BadWords return bw; } - unsigned GetBadWordCount() const anope_override + unsigned GetBadWordCount() const override { return this->badwords->size(); } - void EraseBadWord(unsigned index) anope_override + void EraseBadWord(unsigned index) override { if (this->badwords->empty() || index >= this->badwords->size()) return; @@ -76,13 +76,13 @@ struct BadWordsImpl : BadWords delete this->badwords->at(index); } - void ClearBadWords() anope_override + void ClearBadWords() override { while (!this->badwords->empty()) delete this->badwords->back(); } - void Check() anope_override + void Check() override { if (this->badwords->empty()) ci->Shrink("badwords"); @@ -170,7 +170,7 @@ class BadwordsDelCallback : public NumberList source.Reply(_("Deleted %d entries from %s bad words list."), deleted, ci->name.c_str()); } - void HandleNumber(unsigned Number) anope_override + void HandleNumber(unsigned Number) override { if (!bw || !Number || Number > bw->GetBadWordCount()) return; @@ -209,7 +209,7 @@ class CommandBSBadwords : public Command { } - void HandleNumber(unsigned Number) anope_override + void HandleNumber(unsigned Number) override { if (!Number || Number > bw->GetBadWordCount()) return; @@ -374,7 +374,7 @@ class CommandBSBadwords : public Command this->SetSyntax(_("\037channel\037 CLEAR")); } - void Execute(CommandSource &source, const std::vector ¶ms) anope_override + void Execute(CommandSource &source, const std::vector ¶ms) override { const Anope::string &cmd = params[1]; const Anope::string &word = params.size() > 2 ? params[2] : ""; @@ -417,7 +417,7 @@ class CommandBSBadwords : public Command this->OnSyntaxError(source, ""); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/bs_bot.cpp b/modules/commands/bs_bot.cpp index 4f347f6dc..78f3aa931 100644 --- a/modules/commands/bs_bot.cpp +++ b/modules/commands/bs_bot.cpp @@ -272,7 +272,7 @@ class CommandBSBot : public Command this->SetSyntax(_("\002DEL \037nick\037\002")); } - void Execute(CommandSource &source, const std::vector ¶ms) anope_override + void Execute(CommandSource &source, const std::vector ¶ms) override { const Anope::string &cmd = params[0]; @@ -345,7 +345,7 @@ class CommandBSBot : public Command return; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/bs_botlist.cpp b/modules/commands/bs_botlist.cpp index e8f979cde..ceb3bb3fc 100644 --- a/modules/commands/bs_botlist.cpp +++ b/modules/commands/bs_botlist.cpp @@ -19,7 +19,7 @@ class CommandBSBotList : public Command this->SetDesc(_("Lists available bots")); } - void Execute(CommandSource &source, const std::vector ¶ms) anope_override + void Execute(CommandSource &source, const std::vector ¶ms) override { unsigned count = 0; ListFormatter list(source.GetAccount()); @@ -57,7 +57,7 @@ class CommandBSBotList : public Command } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/bs_control.cpp b/modules/commands/bs_control.cpp index 1f4eaa48f..407912baa 100644 --- a/modules/commands/bs_control.cpp +++ b/modules/commands/bs_control.cpp @@ -20,7 +20,7 @@ class CommandBSSay : public Command this->SetSyntax(_("\037channel\037 \037text\037")); } - void Execute(CommandSource &source, const std::vector ¶ms) anope_override + void Execute(CommandSource &source, const std::vector ¶ms) override { const Anope::string &text = params[1]; @@ -62,7 +62,7 @@ class CommandBSSay : public Command Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to say: " << text; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -80,7 +80,7 @@ class CommandBSAct : public Command this->SetSyntax(_("\037channel\037 \037text\037")); } - void Execute(CommandSource &source, const std::vector ¶ms) anope_override + void Execute(CommandSource &source, const std::vector ¶ms) override { Anope::string message = params[1]; @@ -120,7 +120,7 @@ class CommandBSAct : public Command Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to say: " << message; } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); diff --git a/modules/commands/bs_info.cpp b/modules/commands/bs_info.cpp index 475a54003..dd72a973a 100644 --- a/modules/commands/bs_info.cpp +++ b/modules/commands/bs_info.cpp @@ -41,7 +41,7 @@ class CommandBSInfo : public Command this->SetSyntax(_("{\037channel\037 | \037nickname\037}")); } - void Execute(CommandSource &source, const std::vector ¶ms) anope_override + void Execute(CommandSource &source, const std::vector ¶ms) override { const Anope::string &query = params[0]; @@ -101,7 +101,7 @@ class CommandBSInfo : public Command source.Reply(_("\002%s\002 is not a valid bot or registered channel."), query.c_str()); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -113,7 +113,7 @@ class CommandBSInfo : public Command return true; } - const Anope::string GetDesc(CommandSource &source) const anope_override + const Anope::string GetDesc(CommandSource &source) const override { return Anope::printf(Language::Translate(source.GetAccount(), _("Allows you to see %s information about a channel or a bot")), source.service->nick.c_str()); } diff --git a/modules/commands/bs_kick.cpp b/modules/commands/bs_kick.cpp index 1a0ec73df..265864704 100644 --- a/modules/commands/bs_kick.cpp +++ b/modules/commands/bs_kick.cpp @@ -29,7 +29,7 @@ struct KickerDataImpl : KickerData dontkickops = dontkickvoices = false; } - void Check(ChannelInfo *ci) anope_override + void Check(ChannelInfo *ci) override { if (amsgs || badwords || bolds || caps || colors || flood || italics || repeat || reverses || underlines) return; @@ -41,7 +41,7 @@ struct KickerDataImpl : KickerData { ExtensibleItem(Module *m, const Anope::string &ename) : ::ExtensibleItem(m, ename) { } - void ExtensibleSerialize(const Extensible *e, const Serializable *s, Serialize::Data &data) const anope_override + void ExtensibleSerialize(const Extensible *e, const Serializable *s, Serialize::Data &data) const override { if (s->GetSerializableType()->GetName() != "ChannelInfo") return; @@ -71,7 +71,7 @@ struct KickerDataImpl : KickerData data["ttb"] << kd->ttb[i] << " "; } - void ExtensibleUnserialize(Extensible *e, Serializable *s, Serialize::Data &data) anope_override + void ExtensibleUnserialize(Extensible *e, Serializable *s, Serialize::Data &data) override { if (s->GetSerializableType()->GetName() != "ChannelInfo") return; @@ -120,12 +120,12 @@ class CommandBSKick : public Command this->SetSyntax(_("\037option\037 \037channel\037 {\037ON|OFF\037} [\037settings\037]")); } - void Execute(CommandSource &source, const std::vector ¶ms) anope_override + void Execute(CommandSource &source, const std::vector ¶ms) override { this->OnSyntaxError(source, ""); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -165,9 +165,9 @@ class CommandBSKickBase : public Command { } - virtual void Execute(CommandSource &source, const std::vector ¶ms) anope_override = 0; + virtual void Execute(CommandSource &source, const std::vector ¶ms) override = 0; - virtual bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override = 0; + virtual bool OnHelp(CommandSource &source, const Anope::string &subcommand) override = 0; protected: bool CheckArguments(CommandSource &source, const std::vector ¶ms, ChannelInfo* &ci) @@ -252,7 +252,7 @@ class CommandBSKickAMSG : public CommandBSKickBase this->SetSyntax(_("\037channel\037 {\037ON|OFF\037} [\037ttb\037]")); } - void Execute(CommandSource &source, const std::vector ¶ms) anope_override + void Execute(CommandSource &source, const std::vector ¶ms) override { ChannelInfo *ci; if (CheckArguments(source, params, ci)) @@ -263,7 +263,7 @@ class CommandBSKickAMSG : public CommandBSKickBase } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -288,7 +288,7 @@ class CommandBSKickBadwords : public CommandBSKickBase this->SetSyntax(_("\037channel\037 {\037ON|OFF\037} [\037ttb\037]")); } - void Execute(CommandSource &source, const std::vector ¶ms) anope_override + void Execute(CommandSource &source, const std::vector ¶ms) override { ChannelInfo *ci; if (CheckArguments(source, params, ci)) @@ -300,7 +300,7 @@ class CommandBSKickBadwords : public CommandBSKickBase } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -327,7 +327,7 @@ class CommandBSKickBolds : public CommandBSKickBase this->SetSyntax(_("\037channel\037 {\037ON|OFF\037} [\037ttb\037]")); } - void Execute(CommandSource &source, const std::vector ¶ms) anope_override + void Execute(CommandSource &source, const std::vector ¶ms) override { ChannelInfo *ci; if (CheckArguments(source, params, ci)) @@ -338,7 +338,7 @@ class CommandBSKickBolds : public CommandBSKickBase } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -361,7 +361,7 @@ class CommandBSKickCaps : public CommandBSKickBase this->SetSyntax(_("\037channel\037 {\037ON|OFF\037} [\037ttb\037 [\037min\037 [\037percent\037]]]\002")); } - void Execute(CommandSource &source, const std::vector ¶ms) anope_override + void Execute(CommandSource &source, const std::vector ¶ms) override { ChannelInfo *ci; if (!CheckArguments(source, params, ci)) @@ -429,7 +429,7 @@ class CommandBSKickCaps : public CommandBSKickBase kd->Check(ci); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -457,7 +457,7 @@ class CommandBSKickColors : public CommandBSKickBase this->SetSyntax(_("\037channel\037 {\037ON|OFF\037} [\037ttb\037]")); } - void Execute(CommandSource &source, const std::vector ¶ms) anope_override + void Execute(CommandSource &source, const std::vector ¶ms) override { ChannelInfo *ci; if (CheckArguments(source, params, ci)) @@ -468,7 +468,7 @@ class CommandBSKickColors : public CommandBSKickBase } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -491,7 +491,7 @@ class CommandBSKickFlood : public CommandBSKickBase this->SetSyntax(_("\037channel\037 {\037ON|OFF\037} [\037ttb\037 [\037ln\037 [\037secs\037]]]\002")); } - void Execute(CommandSource &source, const std::vector ¶ms) anope_override + void Execute(CommandSource &source, const std::vector ¶ms) override { ChannelInfo *ci; if (!CheckArguments(source, params, ci)) @@ -564,7 +564,7 @@ class CommandBSKickFlood : public CommandBSKickBase kd->Check(ci); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -589,7 +589,7 @@ class CommandBSKickItalics : public CommandBSKickBase this->SetSyntax(_("\037channel\037 {\037ON|OFF\037} [\037ttb\037]")); } - void Execute(CommandSource &source, const std::vector ¶ms) anope_override + void Execute(CommandSource &source, const std::vector ¶ms) override { ChannelInfo *ci; if (CheckArguments(source, params, ci)) @@ -600,7 +600,7 @@ class CommandBSKickItalics : public CommandBSKickBase } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -623,7 +623,7 @@ class CommandBSKickRepeat : public CommandBSKickBase this->SetSyntax(_("\037channel\037 {\037ON|OFF\037} [\037ttb\037 [\037num\037]]\002")); } - void Execute(CommandSource &source, const std::vector ¶ms) anope_override + void Execute(CommandSource &source, const std::vector ¶ms) override { ChannelInfo *ci; if (!CheckArguments(source, params, ci)) @@ -699,7 +699,7 @@ class CommandBSKickRepeat : public CommandBSKickBase kd->Check(ci); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -724,7 +724,7 @@ class CommandBSKickReverses : public CommandBSKickBase this->SetSyntax(_("\037channel\037 {\037ON|OFF\037} [\037ttb\037]")); } - void Execute(CommandSource &source, const std::vector ¶ms) anope_override + void Execute(CommandSource &source, const std::vector ¶ms) override { ChannelInfo *ci; if (CheckArguments(source, params, ci)) @@ -735,7 +735,7 @@ class CommandBSKickReverses : public CommandBSKickBase } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -758,7 +758,7 @@ class CommandBSKickUnderlines : public CommandBSKickBase this->SetSyntax(_("\037channel\037 {\037ON|OFF\037} [\037ttb\037]")); } - void Execute(CommandSource &source, const std::vector ¶ms) anope_override + void Execute(CommandSource &source, const std::vector ¶ms) override { ChannelInfo *ci; if (CheckArguments(source, params, ci)) @@ -769,7 +769,7 @@ class CommandBSKickUnderlines : public CommandBSKickBase } } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -792,7 +792,7 @@ class CommandBSSetDontKickOps : public Command this->SetSyntax(_("\037channel\037 {ON | OFF}")); } - void Execute(CommandSource &source, const std::vector ¶ms) anope_override + void Execute(CommandSource &source, const std::vector ¶ms) override { ChannelInfo *ci = ChannelInfo::Find(params[0]); if (ci == NULL) @@ -837,7 +837,7 @@ class CommandBSSetDontKickOps : public Command kd->Check(ci); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(_(" \n" @@ -857,7 +857,7 @@ class CommandBSSetDontKickVoices : public Command this->SetSyntax(_("\037channel\037 {ON | OFF}")); } - void Execute(CommandSource &source, const std::vector ¶ms) anope_override + void Execute(CommandSource &source, const std::vector ¶ms) override { ChannelInfo *ci = ChannelInfo::Find(params[0]); if (ci == NULL) @@ -902,7 +902,7 @@ class CommandBSSetDontKickVoices : public Command kd->Check(ci); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(_(" \n" @@ -989,7 +989,7 @@ class BanDataPurger : public Timer public: BanDataPurger(Module *o) : Timer(o, 300, Anope::CurTime, true) { } - void Tick(time_t) anope_override + void Tick(time_t) override { Log(LOG_DEBUG) << "bs_main: Running bandata purger"; @@ -1106,7 +1106,7 @@ class BSKick : public Module } - void OnBotInfo(CommandSource &source, BotInfo *bi, ChannelInfo *ci, InfoFormatter &info) anope_override + void OnBotInfo(CommandSource &source, BotInfo *bi, ChannelInfo *ci, InfoFormatter &info) override { if (!ci) return; @@ -1221,7 +1221,7 @@ class BSKick : public Module info.AddOption(_("Voices protection")); } - void OnPrivmsg(User *u, Channel *c, Anope::string &msg) anope_override + void OnPrivmsg(User *u, Channel *c, Anope::string &msg) override { /* Now we can make kicker stuff. We try to order the checks * from the fastest one to the slowest one, since there's diff --git a/modules/commands/bs_set.cpp b/modules/commands/bs_set.cpp index a14706c9d..b54543e00 100644 --- a/modules/commands/bs_set.cpp +++ b/modules/commands/bs_set.cpp @@ -20,12 +20,12 @@ class CommandBSSet : public Command this->SetSyntax(_("\037option\037 \037(channel | bot)\037 \037settings\037")); } - void Execute(CommandSource &source, const std::vector ¶ms) anope_override + void Execute(CommandSource &source, const std::vector ¶ms) override { this->OnSyntaxError(source, ""); } - bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { this->SendSyntax(source); source.Reply(" "); @@ -77,7 +77,7 @@ class CommandBSSetBanExpire : public Command public: UnbanTimer(Module *creator, const Anope::string &ch, const Anope::string &bmask, time_t t) : Timer(creator, t), chname(ch), mask(bmask) { } - void Tick(time_t) anope_override + void Tick(time_t) override { Channel *c = Channel::Find(chname); if (c) @@ -91,7 +91,7 @@ class CommandBSSetBanExpire : public Command this->SetSyntax(_("\037channel\037 \037time\037")); } - void Execute(CommandSource &source, const std::vector ¶ms) anope_override + void Execute(CommandSource &source, const std::vector ¶ms) override { const Anope::string &chan = params[0]; const Anope::string &arg = params[1]; @@ -141,7 +141,7 @@ class CommandBSSetBanExpire : public Command source.Reply(_("Bot bans will automatically expire after %s."), Anope::Duration(ci->banexpire, source.GetAccount()).c_str()); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(_(" \n" @@ -162,7 +162,7 @@ class CommandBSSetPrivate : public Command this->SetSyntax(_("\037botname\037 {\037ON|OFF\037}")); } - void Execute(CommandSource &source, const std::vector ¶ms) anope_override + void Execute(CommandSource &source, const std::vector ¶ms) override { BotInfo *bi = BotInfo::Find(params[0], true); const Anope::string &value = params[1]; @@ -193,7 +193,7 @@ class CommandBSSetPrivate : public Command this->OnSyntaxError(source, source.command); } - bool OnHelp(CommandSource &source, const Anope::string &) anope_override + bool OnHelp(CommandSource &source, const Anope::string &) override { this->SendSyntax(source); source.Reply(_(" \n" @@ -216,7 +216,7 @@ class BSSet : public Module { } - void OnBotBan(User *u, ChannelInfo *ci, const Anope::string &mask) anope_override + void OnBotBan(User *u, ChannelInfo *ci, const Anope::string &mask) override { if (!ci->banexpire) return; diff --git a/modules/commands/cs_access.cpp b/modules/commands/cs_access.cpp index 386978340..f6129cdb3 100644 --- a/modules/commands/cs_access.cpp +++ b/modules/commands/cs_access.cpp @@ -29,17 +29,17 @@ class AccessChanAccess : public ChanAccess { } - bool HasPriv(const Anope::string &name) const anope_override + bool HasPriv(const Anope::string &name) const override { return this->ci->GetLevel(name) != ACCESS_INVALID && this->level >= this->ci->GetLevel(name); } - Anope::string AccessSerialize() const anope_override + Anope::string AccessSerialize() const override { return stringify(this->level); } - void AccessUnserialize(const Anope::string &data) an