From a6a0f6c44780c839b2269f4f29a26ecfdbd95544 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Tue, 23 Jan 2024 15:28:23 +0000 Subject: Improve the layout of types that inherit from another type. --- include/access.h | 6 +- include/account.h | 8 +- include/anope.h | 15 ++-- include/base.h | 3 +- include/bots.h | 4 +- include/channels.h | 7 +- include/commands.h | 3 +- include/config.h | 6 +- include/extensible.h | 18 +++-- include/hashcomp.h | 9 ++- include/mail.h | 3 +- include/memo.h | 3 +- include/messages.h | 60 ++++++++++----- include/modes.h | 39 ++++++---- include/modules.h | 8 +- include/modules/cs_entrymsg.h | 3 +- include/modules/cs_log.h | 3 +- include/modules/dns.h | 10 ++- include/modules/encryption.h | 3 +- include/modules/httpd.h | 12 ++- include/modules/ldap.h | 6 +- include/modules/ns_cert.h | 3 +- include/modules/os_forbid.h | 3 +- include/modules/os_ignore.h | 3 +- include/modules/os_news.h | 6 +- include/modules/os_session.h | 6 +- include/modules/pseudoclients/chanserv.h | 3 +- include/modules/pseudoclients/global.h | 3 +- include/modules/pseudoclients/memoserv.h | 3 +- include/modules/pseudoclients/nickserv.h | 3 +- include/modules/redis.h | 3 +- include/modules/sasl.h | 9 ++- include/modules/sql.h | 6 +- include/modules/ssl.h | 3 +- include/modules/xmlrpc.h | 3 +- include/protocol.h | 6 +- include/regchannel.h | 7 +- include/regexpr.h | 6 +- include/serialize.h | 9 ++- include/servers.h | 3 +- include/service.h | 6 +- include/sockets.h | 21 ++++-- include/threadengine.h | 7 +- include/uplink.h | 4 +- include/users.h | 5 +- include/xline.h | 6 +- modules/bs_autoassign.cpp | 3 +- modules/commands/bs_assign.cpp | 12 ++- modules/commands/bs_badwords.cpp | 19 +++-- modules/commands/bs_bot.cpp | 6 +- modules/commands/bs_botlist.cpp | 6 +- modules/commands/bs_control.cpp | 9 ++- modules/commands/bs_info.cpp | 6 +- modules/commands/bs_kick.cpp | 54 ++++++++----- modules/commands/bs_set.cpp | 15 ++-- modules/commands/cs_access.cpp | 21 ++++-- modules/commands/cs_akick.cpp | 12 ++- modules/commands/cs_ban.cpp | 9 ++- modules/commands/cs_clone.cpp | 6 +- modules/commands/cs_drop.cpp | 6 +- modules/commands/cs_enforce.cpp | 6 +- modules/commands/cs_entrymsg.cpp | 13 +++- modules/commands/cs_flags.cpp | 12 ++- modules/commands/cs_getkey.cpp | 6 +- modules/commands/cs_info.cpp | 6 +- modules/commands/cs_invite.cpp | 6 +- modules/commands/cs_kick.cpp | 6 +- modules/commands/cs_list.cpp | 9 ++- modules/commands/cs_log.cpp | 13 +++- modules/commands/cs_mode.cpp | 16 ++-- modules/commands/cs_register.cpp | 6 +- modules/commands/cs_seen.cpp | 12 ++- modules/commands/cs_set.cpp | 51 ++++++++----- modules/commands/cs_set_misc.cpp | 10 ++- modules/commands/cs_status.cpp | 6 +- modules/commands/cs_suspend.cpp | 13 +++- modules/commands/cs_sync.cpp | 6 +- modules/commands/cs_topic.cpp | 9 ++- modules/commands/cs_unban.cpp | 6 +- modules/commands/cs_updown.cpp | 9 ++- modules/commands/cs_xop.cpp | 18 +++-- modules/commands/gl_global.cpp | 6 +- modules/commands/greet.cpp | 12 ++- modules/commands/help.cpp | 6 +- modules/commands/hs_del.cpp | 9 ++- modules/commands/hs_group.cpp | 6 +- modules/commands/hs_list.cpp | 6 +- modules/commands/hs_off.cpp | 6 +- modules/commands/hs_on.cpp | 6 +- modules/commands/hs_request.cpp | 18 +++-- modules/commands/hs_set.cpp | 9 ++- modules/commands/ms_cancel.cpp | 6 +- modules/commands/ms_check.cpp | 6 +- modules/commands/ms_del.cpp | 9 ++- modules/commands/ms_ignore.cpp | 6 +- modules/commands/ms_info.cpp | 6 +- modules/commands/ms_list.cpp | 9 ++- modules/commands/ms_read.cpp | 9 ++- modules/commands/ms_rsend.cpp | 6 +- modules/commands/ms_send.cpp | 6 +- modules/commands/ms_sendall.cpp | 6 +- modules/commands/ms_set.cpp | 6 +- modules/commands/ms_staff.cpp | 6 +- modules/commands/ns_access.cpp | 6 +- modules/commands/ns_ajoin.cpp | 12 ++- modules/commands/ns_alist.cpp | 6 +- modules/commands/ns_cert.cpp | 15 ++-- modules/commands/ns_drop.cpp | 6 +- modules/commands/ns_getemail.cpp | 6 +- modules/commands/ns_group.cpp | 15 ++-- modules/commands/ns_identify.cpp | 9 ++- modules/commands/ns_info.cpp | 12 ++- modules/commands/ns_list.cpp | 12 ++- modules/commands/ns_logout.cpp | 6 +- modules/commands/ns_recover.cpp | 9 ++- modules/commands/ns_register.cpp | 12 ++- modules/commands/ns_resetpass.cpp | 6 +- modules/commands/ns_set.cpp | 75 ++++++++++++------ modules/commands/ns_set_misc.cpp | 13 +++- modules/commands/ns_status.cpp | 6 +- modules/commands/ns_suspend.cpp | 13 +++- modules/commands/ns_update.cpp | 6 +- modules/commands/os_akill.cpp | 12 ++- modules/commands/os_chankill.cpp | 6 +- modules/commands/os_config.cpp | 6 +- modules/commands/os_defcon.cpp | 9 ++- modules/commands/os_dns.cpp | 12 ++- modules/commands/os_forbid.cpp | 13 +++- modules/commands/os_ignore.cpp | 13 +++- modules/commands/os_info.cpp | 12 ++- modules/commands/os_jupe.cpp | 6 +- modules/commands/os_kick.cpp | 6 +- modules/commands/os_kill.cpp | 6 +- modules/commands/os_list.cpp | 9 ++- modules/commands/os_login.cpp | 9 ++- modules/commands/os_logsearch.cpp | 6 +- modules/commands/os_mode.cpp | 9 ++- modules/commands/os_modinfo.cpp | 9 ++- modules/commands/os_module.cpp | 12 ++- modules/commands/os_news.cpp | 21 ++++-- modules/commands/os_noop.cpp | 6 +- modules/commands/os_oper.cpp | 10 ++- modules/commands/os_reload.cpp | 6 +- modules/commands/os_session.cpp | 18 +++-- modules/commands/os_set.cpp | 6 +- modules/commands/os_shutdown.cpp | 12 ++- modules/commands/os_stats.cpp | 9 ++- modules/commands/os_svs.cpp | 12 ++- modules/commands/os_sxline.cpp | 18 +++-- modules/commands/os_update.cpp | 6 +- modules/cs_statusupdate.cpp | 3 +- modules/database/db_flatfile.cpp | 10 ++- modules/database/db_old.cpp | 3 +- modules/database/db_redis.cpp | 28 ++++--- modules/database/db_sql.cpp | 10 ++- modules/database/db_sql_live.cpp | 4 +- modules/encryption/enc_bcrypt.cpp | 3 +- modules/encryption/enc_md5.cpp | 9 ++- modules/encryption/enc_none.cpp | 3 +- modules/encryption/enc_old.cpp | 6 +- modules/encryption/enc_sha1.cpp | 9 ++- modules/encryption/enc_sha256.cpp | 9 ++- modules/extra/m_ldap.cpp | 24 ++++-- modules/extra/m_ldap_authentication.cpp | 12 ++- modules/extra/m_ldap_oper.cpp | 6 +- modules/extra/m_mysql.cpp | 15 +++- modules/extra/m_regex_pcre2.cpp | 9 ++- modules/extra/m_regex_posix.cpp | 9 ++- modules/extra/m_regex_tre.cpp | 9 ++- modules/extra/m_sql_authentication.cpp | 6 +- modules/extra/m_sql_log.cpp | 3 +- modules/extra/m_sql_oper.cpp | 9 ++- modules/extra/m_sqlite.cpp | 9 ++- modules/extra/m_ssl_gnutls.cpp | 9 ++- modules/extra/m_ssl_openssl.cpp | 9 ++- modules/fantasy.cpp | 6 +- modules/m_dns.cpp | 27 +++++-- modules/m_dnsbl.cpp | 6 +- modules/m_helpchan.cpp | 3 +- modules/m_httpd.cpp | 10 ++- modules/m_proxyscan.cpp | 24 ++++-- modules/m_redis.cpp | 13 +++- modules/m_rewrite.cpp | 6 +- modules/m_sasl.cpp | 19 +++-- modules/m_xmlrpc.cpp | 7 +- modules/m_xmlrpc_main.cpp | 12 ++- modules/ns_maxemail.cpp | 3 +- modules/protocol/bahamut.cpp | 27 ++++--- modules/protocol/hybrid.cpp | 54 ++++++++----- modules/protocol/inspircd.cpp | 117 +++++++++++++++++++---------- modules/protocol/ngircd.cpp | 39 ++++++---- modules/protocol/plexus.cpp | 18 +++-- modules/protocol/ratbox.cpp | 24 ++++-- modules/protocol/solanum.cpp | 27 ++++--- modules/protocol/unrealircd.cpp | 108 +++++++++++++++++--------- modules/pseudoclients/botserv.cpp | 3 +- modules/pseudoclients/chanserv.cpp | 7 +- modules/pseudoclients/global.cpp | 4 +- modules/pseudoclients/hostserv.cpp | 3 +- modules/pseudoclients/memoserv.cpp | 4 +- modules/pseudoclients/nickserv.cpp | 14 +++- modules/pseudoclients/operserv.cpp | 12 ++- modules/stats/cs_fantasy_stats.cpp | 12 ++- modules/stats/cs_fantasy_top.cpp | 18 +++-- modules/stats/irc2sql/irc2sql.h | 6 +- modules/stats/m_chanstats.cpp | 15 ++-- modules/webcpanel/pages/chanserv/access.h | 3 +- modules/webcpanel/pages/chanserv/akick.h | 3 +- modules/webcpanel/pages/chanserv/drop.h | 3 +- modules/webcpanel/pages/chanserv/info.h | 3 +- modules/webcpanel/pages/chanserv/modes.h | 3 +- modules/webcpanel/pages/chanserv/set.h | 3 +- modules/webcpanel/pages/confirm.h | 3 +- modules/webcpanel/pages/hostserv/request.h | 3 +- modules/webcpanel/pages/index.cpp | 3 +- modules/webcpanel/pages/index.h | 3 +- modules/webcpanel/pages/logout.h | 3 +- modules/webcpanel/pages/memoserv/memos.h | 3 +- modules/webcpanel/pages/nickserv/access.h | 3 +- modules/webcpanel/pages/nickserv/alist.h | 3 +- modules/webcpanel/pages/nickserv/cert.h | 3 +- modules/webcpanel/pages/nickserv/confirm.h | 3 +- modules/webcpanel/pages/nickserv/info.h | 3 +- modules/webcpanel/pages/operserv/akill.h | 3 +- modules/webcpanel/pages/register.h | 3 +- modules/webcpanel/static_fileserver.h | 3 +- modules/webcpanel/template_fileserver.h | 3 +- modules/webcpanel/webcpanel.cpp | 9 ++- modules/webcpanel/webcpanel.h | 10 ++- src/main.cpp | 6 +- src/modes.cpp | 3 +- src/uplink.cpp | 3 +- 232 files changed, 1648 insertions(+), 798 deletions(-) diff --git a/include/access.h b/include/access.h index 4a20a8c90..4242509aa 100644 --- a/include/access.h +++ b/include/access.h @@ -52,7 +52,8 @@ public: /* A provider of access. Only used for creating ChanAccesses, as * they contain pure virtual functions. */ -class CoreExport AccessProvider : public Service +class CoreExport AccessProvider + : public Service { public: AccessProvider(Module *owner, const Anope::string &name); @@ -70,7 +71,8 @@ public: }; /* Represents one entry of an access list on a channel. */ -class CoreExport ChanAccess : public Serializable +class CoreExport ChanAccess + : public Serializable { Anope::string mask; /* account this access entry is for, if any */ diff --git a/include/account.h b/include/account.h index 160b0a260..1062b67bf 100644 --- a/include/account.h +++ b/include/account.h @@ -28,7 +28,9 @@ extern CoreExport nickcoreid_map NickCoreIdList; /* A registered nickname. * It matters that Base is here before Extensible (it is inherited by Serializable) */ -class CoreExport NickAlias : public Serializable, public Extensible +class CoreExport NickAlias + : public Serializable + , public Extensible { Anope::string vhost_ident, vhost_host, vhost_creator; time_t vhost_created; @@ -104,7 +106,9 @@ public: * account's display. * It matters that Base is here before Extensible (it is inherited by Serializable) */ -class CoreExport NickCore : public Serializable, public Extensible +class CoreExport NickCore + : public Serializable + , public Extensible { /* Channels which reference this core in some way (this is on their access list, akick list, is founder, successor, etc) */ Serialize::Checker > chanaccess; diff --git a/include/anope.h b/include/anope.h index fc8d01fba..976c69702 100644 --- a/include/anope.h +++ b/include/anope.h @@ -628,7 +628,8 @@ public: /** A derived form of sepstream, which separates on commas */ -class commasepstream : public sepstream +class commasepstream + : public sepstream { public: /** Initialize with comma separator @@ -638,7 +639,8 @@ public: /** A derived form of sepstream, which separates on spaces */ -class spacesepstream : public sepstream +class spacesepstream + : public sepstream { public: /** Initialize with space separator @@ -652,7 +654,8 @@ public: * be loaded. If this happens, the error message returned by ModuleException::GetReason will be displayed to the user * attempting to load the module, or dumped to the console if the ircd is currently loading for the first time. */ -class CoreExport CoreException : public std::exception +class CoreExport CoreException + : public std::exception { protected: /** Holds the error message to be displayed @@ -691,7 +694,8 @@ public: } }; -class CoreExport ModuleException : public CoreException +class CoreExport ModuleException + : public CoreException { public: /** Default constructor, just uses the error message 'Module threw an exception'. @@ -708,7 +712,8 @@ public: virtual ~ModuleException() noexcept = default; }; -class CoreExport ConvertException : public CoreException +class CoreExport ConvertException + : public CoreException { public: ConvertException(const Anope::string &reason = "") : CoreException(reason) { } diff --git a/include/base.h b/include/base.h index 99b16fed7..07b3bdf89 100644 --- a/include/base.h +++ b/include/base.h @@ -43,7 +43,8 @@ public: * no longer be valid once the object it refers is destructed. */ template -class Reference : public ReferenceBase +class Reference + : public ReferenceBase { protected: T *ref = nullptr; diff --git a/include/bots.h b/include/bots.h index 68bfd9318..35ec7cd50 100644 --- a/include/bots.h +++ b/include/bots.h @@ -19,7 +19,9 @@ typedef Anope::map botinfo_map; extern CoreExport Serialize::Checker BotListByNick, BotListByUID; /* A service bot (NickServ, ChanServ, a BotServ bot, etc). */ -class CoreExport BotInfo : public User, public Serializable +class CoreExport BotInfo + : public User + , public Serializable { /* Channels this bot is assigned to */ Serialize::Checker > channels; diff --git a/include/channels.h b/include/channels.h index 1e7531ab2..0230cc566 100644 --- a/include/channels.h +++ b/include/channels.h @@ -18,7 +18,8 @@ typedef Anope::hash_map channel_map; extern CoreExport channel_map ChannelList; /* A user container, there is one of these per user per channel. */ -struct ChanUserContainer : public Extensible +struct ChanUserContainer + : public Extensible { User *user; Channel *chan; @@ -28,7 +29,9 @@ struct ChanUserContainer : public Extensible ChanUserContainer(User *u, Channel *c) : user(u), chan(c) { } }; -class CoreExport Channel : public Base, public Extensible +class CoreExport Channel + : public Base + , public Extensible { static std::vector deleting; diff --git a/include/commands.h b/include/commands.h index cb53cf017..5f15da345 100644 --- a/include/commands.h +++ b/include/commands.h @@ -88,7 +88,8 @@ public: /** Every services command is a class, inheriting from Command. */ -class CoreExport Command : public Service +class CoreExport Command + : public Service { Anope::string desc; std::vector syntax; diff --git a/include/config.h b/include/config.h index 7a032d7e9..cb8de7c55 100644 --- a/include/config.h +++ b/include/config.h @@ -98,7 +98,8 @@ namespace Configuration struct Uplink; - struct CoreExport Conf : Block + struct CoreExport Conf + : Block { /* options:readtimeout */ time_t ReadTimeout; @@ -171,7 +172,8 @@ namespace Configuration * be loaded. If this happens, the error message returned by ModuleException::GetReason will be displayed to the user * attempting to load the module, or dumped to the console if the ircd is currently loading for the first time. */ -class CoreExport ConfigException : public CoreException +class CoreExport ConfigException + : public CoreException { public: /** Default constructor, just uses the error message 'Config threw an exception'. diff --git a/include/extensible.h b/include/extensible.h index 7388651d8..a83d9e81f 100644 --- a/include/extensible.h +++ b/include/extensible.h @@ -15,7 +15,8 @@ class Extensible; -class CoreExport ExtensibleBase : public Service +class CoreExport ExtensibleBase + : public Service { protected: std::map items; @@ -53,7 +54,8 @@ public: }; template -class BaseExtensibleItem : public ExtensibleBase +class BaseExtensibleItem + : public ExtensibleBase { protected: virtual T *Create(Extensible *) = 0; @@ -124,7 +126,8 @@ public: }; template -class ExtensibleItem : public BaseExtensibleItem +class ExtensibleItem + : public BaseExtensibleItem { protected: T* Create(Extensible *obj) override @@ -136,7 +139,8 @@ public: }; template -class PrimitiveExtensibleItem : public BaseExtensibleItem +class PrimitiveExtensibleItem + : public BaseExtensibleItem { protected: T* Create(Extensible *obj) override @@ -160,7 +164,8 @@ public: }; template -class SerializableExtensibleItem : public PrimitiveExtensibleItem +class SerializableExtensibleItem + : public PrimitiveExtensibleItem { public: SerializableExtensibleItem(Module *m, const Anope::string &n) : PrimitiveExtensibleItem(m, n) { } @@ -204,7 +209,8 @@ public: }; template -struct ExtensibleRef : ServiceReference > +struct ExtensibleRef + : ServiceReference > { ExtensibleRef(const Anope::string &n) : ServiceReference >("Extensible", n) { } }; diff --git a/include/hashcomp.h b/include/hashcomp.h index 13dc3ca10..91ccc3391 100644 --- a/include/hashcomp.h +++ b/include/hashcomp.h @@ -27,7 +27,8 @@ namespace Anope /* ASCII case insensitive ctype. */ template - class ascii_ctype : public std::ctype + class ascii_ctype + : public std::ctype { public: char_type do_toupper(char_type c) const override @@ -49,7 +50,8 @@ namespace Anope /* rfc1459 case insensitive ctype, { = [, } = ], and | = \ */ template - class rfc1459_ctype : public ascii_ctype + class rfc1459_ctype + : public ascii_ctype { public: char_type do_toupper(char_type c) const override @@ -78,7 +80,8 @@ namespace ci * This class is used to implement ci::string, a case-insensitive, ASCII- * comparing string class. */ - struct CoreExport ci_char_traits : std::char_traits + struct CoreExport ci_char_traits + : std::char_traits { /** Check if two chars match. * @param c1st First character diff --git a/include/mail.h b/include/mail.h index f0bb6d10d..1a0ce88cc 100644 --- a/include/mail.h +++ b/include/mail.h @@ -22,7 +22,8 @@ namespace Mail extern CoreExport bool Validate(const Anope::string &email); /* A email message being sent */ - class Message : public Thread + class Message + : public Thread { private: Anope::string sendmail_path; diff --git a/include/memo.h b/include/memo.h index 0eac6859e..5e7c1a5c9 100644 --- a/include/memo.h +++ b/include/memo.h @@ -14,7 +14,8 @@ #include "anope.h" #include "serialize.h" -class CoreExport Memo : public Serializable +class CoreExport Memo + : public Serializable { public: MemoInfo *mi; diff --git a/include/messages.h b/include/messages.h index 7782aa665..206570940 100644 --- a/include/messages.h +++ b/include/messages.h @@ -21,35 +21,40 @@ namespace Message { - struct CoreExport Away : IRCDMessage + struct CoreExport Away + : IRCDMessage { 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) override; }; - struct CoreExport Capab : IRCDMessage + 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) override; }; - struct CoreExport Error : IRCDMessage + 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) override; }; - struct CoreExport Invite : IRCDMessage + 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) override; }; - struct CoreExport Join : IRCDMessage + struct CoreExport Join + : IRCDMessage { Join(Module *creator, const Anope::string &mname = "JOIN") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); } @@ -67,105 +72,120 @@ namespace Message static void SJoin(MessageSource &source, const Anope::string &chan, time_t ts, const Anope::string &modes, const std::list &users); }; - struct CoreExport Kick : IRCDMessage + struct CoreExport Kick + : IRCDMessage { 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) override; }; - struct CoreExport Kill : IRCDMessage + 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) override; }; - struct CoreExport Mode : IRCDMessage + 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) override; }; - struct CoreExport MOTD : IRCDMessage + 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) override; }; - struct CoreExport Notice : IRCDMessage + 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) override; }; - struct CoreExport Part : IRCDMessage + 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) override; }; - struct CoreExport Ping : IRCDMessage + 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) override; }; - struct CoreExport Privmsg : IRCDMessage + 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) override; }; - struct CoreExport Quit : IRCDMessage + 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) override; }; - struct CoreExport SQuit : IRCDMessage + 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) override; }; - struct CoreExport Stats : IRCDMessage + 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) override; }; - struct CoreExport Time : IRCDMessage + 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) override; }; - struct CoreExport Topic : IRCDMessage + 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) override; }; - struct CoreExport Version : IRCDMessage + 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) override; }; - struct CoreExport Whois : IRCDMessage + struct CoreExport Whois + : IRCDMessage { Whois(Module *creator, const Anope::string &mname = "WHOIS") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); } diff --git a/include/modes.h b/include/modes.h index 02aef2ebf..b87d1e5b5 100644 --- a/include/modes.h +++ b/include/modes.h @@ -35,7 +35,8 @@ enum ModeClass /** This class is the basis of all modes in Anope */ -class CoreExport Mode : public Base +class CoreExport Mode + : public Base { public: /* Mode name */ @@ -64,7 +65,8 @@ public: /** This class is a user mode, all user modes use this/inherit from this */ -class CoreExport UserMode : public Mode +class CoreExport UserMode + : public Mode { public: /** constructor @@ -74,7 +76,8 @@ public: UserMode(const Anope::string &name, char mc); }; -class CoreExport UserModeParam : public UserMode +class CoreExport UserModeParam + : public UserMode { public: /** constructor @@ -92,7 +95,8 @@ public: /** This class is a channel mode, all channel modes use this/inherit from this */ -class CoreExport ChannelMode : public Mode +class CoreExport ChannelMode + : public Mode { public: /* channel modes that can possibly unwrap this mode */ @@ -123,7 +127,8 @@ public: /** This is a mode for lists, eg b/e/I. These modes should inherit from this */ -class CoreExport ChannelModeList : public ChannelMode +class CoreExport ChannelModeList + : public ChannelMode { public: /** constructor @@ -161,7 +166,8 @@ public: /** This is a mode with a parameter, eg +k/l. These modes should use/inherit from this */ -class CoreExport ChannelModeParam : public ChannelMode +class CoreExport ChannelModeParam + : public ChannelMode { public: /** constructor @@ -183,7 +189,8 @@ public: /** This is a mode that is a channel status, eg +v/h/o/a/q. */ -class CoreExport ChannelModeStatus : public ChannelMode +class CoreExport ChannelModeStatus + : public ChannelMode { public: /* The symbol, eg @ % + */ @@ -206,7 +213,8 @@ public: * but we still have a representation for it. */ template -class CoreExport ChannelModeVirtual : public T +class CoreExport ChannelModeVirtual + : public T { Anope::string base; ChannelMode *basech; @@ -239,7 +247,8 @@ public: Anope::string BuildModePrefixList() const; }; -class CoreExport UserModeOperOnly : public UserMode +class CoreExport UserModeOperOnly + : public UserMode { public: UserModeOperOnly(const Anope::string &mname, char um) : UserMode(mname, um) { } @@ -247,7 +256,8 @@ public: bool CanSet(User *u) const override; }; -class CoreExport UserModeNoone : public UserMode +class CoreExport UserModeNoone + : public UserMode { public: UserModeNoone(const Anope::string &mname, char um) : UserMode(mname, um) { } @@ -257,7 +267,8 @@ public: /** Channel mode +k (key) */ -class CoreExport ChannelModeKey : public ChannelModeParam +class CoreExport ChannelModeKey + : public ChannelModeParam { public: ChannelModeKey(char mc) : ChannelModeParam("KEY", mc) { } @@ -267,7 +278,8 @@ public: /** This class is used for oper only channel modes */ -class CoreExport ChannelModeOperOnly : public ChannelMode +class CoreExport ChannelModeOperOnly + : public ChannelMode { public: ChannelModeOperOnly(const Anope::string &mname, char mc) : ChannelMode(mname, mc) { } @@ -278,7 +290,8 @@ public: /** This class is used for channel modes only servers may set */ -class CoreExport ChannelModeNoone : public ChannelMode +class CoreExport ChannelModeNoone + : public ChannelMode { public: ChannelModeNoone(const Anope::string &mname, char mc) : ChannelMode(mname, mc) { } diff --git a/include/modules.h b/include/modules.h index 94bde45aa..de8d560fe 100644 --- a/include/modules.h +++ b/include/modules.h @@ -196,11 +196,15 @@ public: int GetPatch() const; }; -class CoreExport NotImplementedException : public CoreException { }; +class CoreExport NotImplementedException + : public CoreException +{ +}; /** Every module in Anope is actually a class. */ -class CoreExport Module : public Extensible +class CoreExport Module + : public Extensible { private: bool permanent; diff --git a/include/modules/cs_entrymsg.h b/include/modules/cs_entrymsg.h index 95f571f43..8259adf49 100644 --- a/include/modules/cs_entrymsg.h +++ b/include/modules/cs_entrymsg.h @@ -20,7 +20,8 @@ protected: EntryMsg() = default; }; -struct EntryMessageList : Serialize::Checker > +struct EntryMessageList + : Serialize::Checker > { protected: EntryMessageList() : Serialize::Checker >("EntryMsg") { } diff --git a/include/modules/cs_log.h b/include/modules/cs_log.h index 12bc3fcaf..077ee70ed 100644 --- a/include/modules/cs_log.h +++ b/include/modules/cs_log.h @@ -29,7 +29,8 @@ protected: LogSetting() = default; }; -struct LogSettings : Serialize::Checker > +struct LogSettings + : Serialize::Checker > { typedef std::vector::iterator iterator; diff --git a/include/modules/dns.h b/include/modules/dns.h index a1e5eb71f..25123a504 100644 --- a/include/modules/dns.h +++ b/include/modules/dns.h @@ -88,7 +88,8 @@ namespace DNS }; }; - struct ResourceRecord : Question + struct ResourceRecord + : Question { unsigned int ttl = 0; Anope::string rdata; @@ -113,7 +114,8 @@ namespace DNS /** DNS manager */ - class Manager : public Service + class Manager + : public Service { public: Manager(Module *creator) : Service(creator, "DNS::Manager", "dns/manager") { } @@ -131,7 +133,9 @@ namespace DNS /** A DNS query. */ - class Request : public Timer, public Question + class Request + : public Timer + , public Question { Manager *manager; public: diff --git a/include/modules/encryption.h b/include/modules/encryption.h index 92385d94a..39eab638b 100644 --- a/include/modules/encryption.h +++ b/include/modules/encryption.h @@ -25,7 +25,8 @@ namespace Encryption virtual Hash GetFinalizedHash() = 0; }; - class Provider : public Service + class Provider + : public Service { public: Provider(Module *creator, const Anope::string &sname) : Service(creator, "Encryption::Provider", sname) { } diff --git a/include/modules/httpd.h b/include/modules/httpd.h index 430336236..c755e9dd2 100644 --- a/include/modules/httpd.h +++ b/include/modules/httpd.h @@ -93,7 +93,8 @@ struct HTTPMessage class HTTPClient; class HTTPProvider; -class HTTPPage : public virtual Base +class HTTPPage + : public virtual Base { Anope::string url; Anope::string content_type; @@ -115,7 +116,10 @@ public: virtual bool OnRequest(HTTPProvider *, const Anope::string &, HTTPClient *, HTTPMessage &, HTTPReply &) = 0; }; -class HTTPClient : public ClientSocket, public BinarySocket, public Base +class HTTPClient + : public ClientSocket + , public BinarySocket + , public Base { protected: void WriteClient(const Anope::string &message) @@ -135,7 +139,9 @@ public: virtual void SendReply(HTTPReply *) = 0; }; -class HTTPProvider : public ListenSocket, public Service +class HTTPProvider + : public ListenSocket + , public Service { Anope::string ip; unsigned short port; diff --git a/include/modules/ldap.h b/include/modules/ldap.h index 166e85fe9..37087198d 100644 --- a/include/modules/ldap.h +++ b/include/modules/ldap.h @@ -31,7 +31,8 @@ struct LDAPModification }; typedef std::vector LDAPMods; -struct LDAPAttributes : public std::map > +struct LDAPAttributes + : public std::map> { size_t size(const Anope::string &attr) const { @@ -122,7 +123,8 @@ public: virtual void OnDelete() { } }; -class LDAPProvider : public Service +class LDAPProvider + : public Service { public: LDAPProvider(Module *c, const Anope::string &n) : Service(c, "LDAPProvider", n) { } diff --git a/include/modules/ns_cert.h b/include/modules/ns_cert.h index 09857ffd5..2d24cfeae 100644 --- a/include/modules/ns_cert.h +++ b/include/modules/ns_cert.h @@ -63,7 +63,8 @@ public: virtual void Check() = 0; }; -class CertService : public Service +class CertService + : public Service { public: CertService(Module *c) : Service(c, "CertService", "certs") { } diff --git a/include/modules/os_forbid.h b/include/modules/os_forbid.h index 12eeedbf9..19b34a1e6 100644 --- a/include/modules/os_forbid.h +++ b/include/modules/os_forbid.h @@ -31,7 +31,8 @@ protected: ForbidData() = default; }; -class ForbidService : public Service +class ForbidService + : public Service { public: ForbidService(Module *m) : Service(m, "ForbidService", "forbid") { } diff --git a/include/modules/os_ignore.h b/include/modules/os_ignore.h index 1cd24b670..448fa4354 100644 --- a/include/modules/os_ignore.h +++ b/include/modules/os_ignore.h @@ -23,7 +23,8 @@ protected: IgnoreData() = default; }; -class IgnoreService : public Service +class IgnoreService + : public Service { protected: IgnoreService(Module *c) : Service(c, "IgnoreService", "ignore") { } diff --git a/include/modules/os_news.h b/include/modules/os_news.h index 6a7732269..af7619e56 100644 --- a/include/modules/os_news.h +++ b/include/modules/os_news.h @@ -22,7 +22,8 @@ struct NewsMessages const char *msgs[10]; }; -struct NewsItem : Serializable +struct NewsItem + : Serializable { NewsType type; Anope::string text; @@ -32,7 +33,8 @@ struct NewsItem : Serializable NewsItem() : Serializable("NewsItem") { } }; -class NewsService : public Service +class NewsService + : public Service { public: NewsService(Module *m) : Service(m, "NewsService", "news") { } diff --git a/include/modules/os_session.h b/include/modules/os_session.h index f72e6b8b2..5341b4fe0 100644 --- a/include/modules/os_session.h +++ b/include/modules/os_session.h @@ -17,7 +17,8 @@ struct Session Session(const sockaddrs &ip, int len) : addr(ip, len) { } }; -struct Exception : Serializable +struct Exception + : Serializable { Anope::string mask; /* Hosts to which this exception applies */ unsigned limit; /* Session limit for exception */ @@ -31,7 +32,8 @@ struct Exception : Serializable static Serializable* Unserialize(Serializable *obj, Serialize::Data &data); }; -class SessionService : public Service +class SessionService + : public Service { public: typedef std::unordered_map SessionMap; diff --git a/include/modules/pseudoclients/chanserv.h b/include/modules/pseudoclients/chanserv.h index baf5cafce..c9e11185c 100644 --- a/include/modules/pseudoclients/chanserv.h +++ b/include/modules/pseudoclients/chanserv.h @@ -8,7 +8,8 @@ #pragma once -class ChanServService : public Service +class ChanServService + : public Service { public: ChanServService(Module *m) : Service(m, "ChanServService", "ChanServ") diff --git a/include/modules/pseudoclients/global.h b/include/modules/pseudoclients/global.h index e0b138e8e..73283605d 100644 --- a/include/modules/pseudoclients/global.h +++ b/include/modules/pseudoclients/global.h @@ -8,7 +8,8 @@ #pragma once -class GlobalService : public Service +class GlobalService + : public Service { public: GlobalService(Module *m) : Service(m, "GlobalService", "Global") diff --git a/include/modules/pseudoclients/memoserv.h b/include/modules/pseudoclients/memoserv.h index 8529c775e..845a19f00 100644 --- a/include/modules/pseudoclients/memoserv.h +++ b/include/modules/pseudoclients/memoserv.h @@ -8,7 +8,8 @@ #pragma once -class MemoServService : public Service +class MemoServService + : public Service { public: enum MemoResult diff --git a/include/modules/pseudoclients/nickserv.h b/include/modules/pseudoclients/nickserv.h index a4f2a89b2..58cf93bd9 100644 --- a/include/modules/pseudoclients/nickserv.h +++ b/include/modules/pseudoclients/nickserv.h @@ -8,7 +8,8 @@ #pragma once -class NickServService : public Service +class NickServService + : public Service { public: NickServService(Module *m) : Service(m, "NickServService", "NickServ") diff --git a/include/modules/redis.h b/include/modules/redis.h index 0007922a2..ec990823e 100644 --- a/include/modules/redis.h +++ b/include/modules/redis.h @@ -55,7 +55,8 @@ namespace Redis virtual void OnError(const Anope::string &error) { Log(owner) << error; } }; - class Provider : public Service + class Provider + : public Service { public: Provider(Module *c, const Anope::string &n) : Service(c, "Redis::Provider", n) { } diff --git a/include/modules/sasl.h b/include/modules/sasl.h index 64994a7f8..2b1c6a30d 100644 --- a/include/modules/sasl.h +++ b/include/modules/sasl.h @@ -22,7 +22,8 @@ namespace SASL class Mechanism; struct Session; - class Service : public ::Service + class Service + : public ::Service { public: Service(Module *o) : ::Service(o, "SASL::Service", "sasl") { } @@ -60,7 +61,8 @@ namespace SASL }; /* PLAIN, EXTERNAL, etc */ - class Mechanism : public ::Service + class Mechanism + : public ::Service { public: Mechanism(Module *o, const Anope::string &sname) : Service(o, "SASL::Mechanism", sname) { } @@ -76,7 +78,8 @@ namespace SASL } }; - class IdentifyRequest : public ::IdentifyRequest + class IdentifyRequest + : public ::IdentifyRequest { Anope::string uid; Anope::string hostname, ip; diff --git a/include/modules/sql.h b/include/modules/sql.h index 0f2abc812..59cc7a24b 100644 --- a/include/modules/sql.h +++ b/include/modules/sql.h @@ -11,7 +11,8 @@ namespace SQL { - class Data : public Serialize::Data + class Data + : public Serialize::Data { public: typedef std::map Map; @@ -199,7 +200,8 @@ namespace SQL /** Class providing the SQL service, modules call this to execute queries */ - class Provider : public Service + class Provider + : public Service { public: Provider(Module *c, const Anope::string &n) : Service(c, "SQL::Provider", n) { } diff --git a/include/modules/ssl.h b/include/modules/ssl.h index c56212f03..32bcdb73a 100644 --- a/include/modules/ssl.h +++ b/include/modules/ssl.h @@ -8,7 +8,8 @@ #pragma once -class SSLService : public Service +class SSLService + : public Service { public: SSLService(Module *o, const Anope::string &n) : Service(o, "SSLService", n) { } diff --git a/include/modules/xmlrpc.h b/include/modules/xmlrpc.h index e57f00004..a12a23c9e 100644 --- a/include/modules/xmlrpc.h +++ b/include/modules/xmlrpc.h @@ -34,7 +34,8 @@ public: virtual bool Run(XMLRPCServiceInterface *iface, HTTPClient *client, XMLRPCRequest &request) = 0; }; -class XMLRPCServiceInterface : public Service +class XMLRPCServiceInterface + : public Service { public: XMLRPCServiceInterface(Module *creator, const Anope::string &sname) : Service(creator, "XMLRPCServiceInterface", sname) { } diff --git a/include/protocol.h b/include/protocol.h index 86c1528b4..e2bee5317 100644 --- a/include/protocol.h +++ b/include/protocol.h @@ -17,7 +17,8 @@ #include "modes.h" /* Encapsulates the IRCd protocol we are speaking. */ -class CoreExport IRCDProto : public Service +class CoreExport IRCDProto + : public Service { Anope::string proto_name; @@ -268,7 +269,8 @@ enum IRCDMessageFlag IRCDMESSAGE_REQUIRE_USER }; -class CoreExport IRCDMessage : public Service +class CoreExport IRCDMessage + : public Service { Anope::string name; unsigned param_count; diff --git a/include/regchannel.h b/include/regchannel.h index a3315a5e1..29c203cf3 100644 --- a/include/regchannel.h +++ b/include/regchannel.h @@ -21,7 +21,8 @@ typedef Anope::hash_map registered_channel_map; extern CoreExport Serialize::Checker RegisteredChannelList; /* AutoKick data. */ -class CoreExport AutoKick : public Serializable +class CoreExport AutoKick + : public Serializable { public: /* Channel this autokick is on */ @@ -43,7 +44,9 @@ public: /* It matters that Base is here before Extensible (it is inherited by Serializable) */ -class CoreExport ChannelInfo : public Serializable, public Extensible +class CoreExport ChannelInfo + : public Serializable + , public Extensible { /* channels who reference this one */ Anope::map references; diff --git a/include/regexpr.h b/include/regexpr.h index fdb0cce50..536c891c1 100644 --- a/include/regexpr.h +++ b/include/regexpr.h @@ -15,7 +15,8 @@ #include "anope.h" #include "service.h" -class CoreExport RegexException : public CoreException +class CoreExport RegexException + : public CoreException { public: RegexException(const Anope::string &reason = "") : CoreException(reason) { } @@ -34,7 +35,8 @@ public: virtual bool Matches(const Anope::string &str) = 0; }; -class CoreExport RegexProvider : public Service +class CoreExport RegexProvider + : public Service { public: RegexProvider(Module *o, const Anope::string &n) : Service(o, "Regex", n) { } diff --git a/include/serialize.h b/include/serialize.h index bd6a311a0..b0739e683 100644 --- a/include/serialize.h +++ b/include/serialize.h @@ -49,7 +49,8 @@ namespace Serialize * abstract data types (Serialize::Data), and then reconstructed or * updated later at any time. */ -class CoreExport Serializable : public virtual Base +class CoreExport Serializable + : public virtual Base { private: /* A list of every serializable item in Anope. @@ -107,7 +108,8 @@ public: * of class that inherits from Serializable. Used for unserializing objects * of this type, as it requires a function pointer to a static member function. */ -class CoreExport Serialize::Type : public Base +class CoreExport Serialize::Type + : public Base { typedef Serializable* (*unserialize_func)(Serializable *obj, Serialize::Data &); @@ -240,7 +242,8 @@ public: * destructed. */ template -class Serialize::Reference : public ReferenceBase +class Serialize::Reference + : public ReferenceBase { protected: T *ref = nullptr; diff --git a/include/servers.h b/include/servers.h index e83a5ac55..a2a0bfdfb 100644 --- a/include/servers.h +++ b/include/servers.h @@ -37,7 +37,8 @@ namespace Servers /** Class representing a server */ -class CoreExport Server : public Extensible +class CoreExport Server + : public Extensible { private: /* Server name */ diff --git a/include/service.h b/include/service.h index c84cb7bb9..5a59fa303 100644 --- a/include/service.h +++ b/include/service.h @@ -20,7 +20,8 @@ * such as commands, use this. This is also used for modules * that publish a service (m_ssl_openssl, etc). */ -class CoreExport Service : public virtual Base +class CoreExport Service + : public virtual Base { static std::map > Services; static std::map > Aliases; @@ -115,7 +116,8 @@ public: /** Like Reference, but used to refer to a Service. */ template -class ServiceReference : public Reference +class ServiceReference + : public Reference { Anope::string type; Anope::string name; diff --git a/include/sockets.h b/include/sockets.h index fc10fec4e..e7311e727 100644 --- a/include/sockets.h +++ b/include/sockets.h @@ -126,7 +126,8 @@ public: }; }; -class CoreExport SocketException : public CoreException +class CoreExport SocketException + : public CoreException { public: /** Constructor for socket exceptions @@ -286,7 +287,8 @@ public: virtual void ProcessError(); }; -class CoreExport BufferedSocket : public virtual Socket +class CoreExport BufferedSocket + : public virtual Socket { protected: /* Things read from the socket */ @@ -333,7 +335,8 @@ public: int WriteBufferLen() const; }; -class CoreExport BinarySocket : public virtual Socket +class CoreExport BinarySocket + : public virtual Socket { protected: struct DataBlock @@ -378,7 +381,8 @@ public: virtual bool Read(const char *buffer, size_t l); }; -class CoreExport ListenSocket : public virtual Socket +class CoreExport ListenSocket + : public virtual Socket { public: /** Constructor @@ -402,7 +406,8 @@ public: virtual ClientSocket *OnAccept(int fd, const sockaddrs &addr) = 0; }; -class CoreExport ConnectionSocket : public virtual Socket +class CoreExport ConnectionSocket + : public virtual Socket { public: /* Sockaddrs for connection ip/port */ @@ -435,7 +440,8 @@ public: virtual void OnError(const Anope::string &error); }; -class CoreExport ClientSocket : public virtual Socket +class CoreExport ClientSocket + : public virtual Socket { public: /* Listen socket this connection came from */ @@ -469,7 +475,8 @@ public: virtual void OnError(const Anope::string &error); }; -class CoreExport Pipe : public Socket +class CoreExport Pipe + : public Socket { public: /** The FD of the write pipe diff --git a/include/threadengine.h b/include/threadengine.h index 7b7b88c9f..79e545166 100644 --- a/include/threadengine.h +++ b/include/threadengine.h @@ -14,7 +14,9 @@ #include "sockets.h" #include "extensible.h" -class CoreExport Thread : public Pipe, public Extensible +class CoreExport Thread + : public Pipe + , public Extensible { private: /* Set to true to tell the thread to finish and we are waiting for it */ @@ -88,7 +90,8 @@ public: bool TryLock(); }; -class CoreExport Condition : public Mutex +class CoreExport Condition + : public Mutex { private: /* A condition */ diff --git a/include/uplink.h b/include/uplink.h index a6982b41b..6646f58cb 100644 --- a/include/uplink.h +++ b/include/uplink.h @@ -20,7 +20,9 @@ namespace Uplink } /* This is the socket to our uplink */ -class UplinkSocket : public ConnectionSocket, public BufferedSocket +class UplinkSocket + : public ConnectionSocket + , public BufferedSocket { public: bool error; diff --git a/include/users.h b/include/users.h index 02fb48b60..2c9779ea3 100644 --- a/include/users.h +++ b/include/users.h @@ -28,7 +28,10 @@ extern CoreExport unsigned MaxUserCount; extern CoreExport time_t MaxUserTime; /* Online user and channel data. */ -class CoreExport User : public virtual Base, public Extensible, public CommandReply +class CoreExport User + : public virtual Base + , public Extensible + , public CommandReply { /* true if the user was quit or killed */ bool quit; diff --git a/include/xline.h b/include/xline.h index 526831d06..19dd0a5c0 100644 --- a/include/xline.h +++ b/include/xline.h @@ -13,7 +13,8 @@ #include "sockets.h" /* An Xline, eg, anything added with operserv/akill, or any of the operserv/sxline commands */ -class CoreExport XLine : public Serializable +class CoreExport XLine + : public Serializable { void Init(); Anope::string nick, user, host, real; @@ -48,7 +49,8 @@ public: }; /* Managers XLines. There is one XLineManager per type of XLine. */ -class CoreExport XLineManager : public Service +class CoreExport XLineManager + : public Service { char type; /* List of XLines in this XLineManager */ diff --git a/modules/bs_autoassign.cpp b/modules/bs_autoassign.cpp index 9fc5ca7ce..91a65d70a 100644 --- a/modules/bs_autoassign.cpp +++ b/modules/bs_autoassign.cpp @@ -9,7 +9,8 @@ #include "module.h" -class BSAutoAssign : public Module +class BSAutoAssign + : public Module { public: BSAutoAssign(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) diff --git a/modules/commands/bs_assign.cpp b/modules/commands/bs_assign.cpp index ccce7571a..e1e744842 100644 --- a/modules/commands/bs_assign.cpp +++ b/modules/commands/bs_assign.cpp @@ -11,7 +11,8 @@ #include "module.h" -class CommandBSAssign : public Command +class CommandBSAssign + : public Command { public: CommandBSAssign(Module *creator) : Command(creator, "botserv/assign", 2, 2) @@ -82,7 +83,8 @@ public: } }; -class CommandBSUnassign : public Command +class CommandBSUnassign + : public Command { public: CommandBSUnassign(Module *creator) : Command(creator, "botserv/unassign", 1, 1) @@ -145,7 +147,8 @@ public: } }; -class CommandBSSetNoBot : public Command +class CommandBSSetNoBot + : public Command { public: CommandBSSetNoBot(Module *creator, const Anope::string &sname = "botserv/set/nobot") : Command(creator, sname, 2, 2) @@ -202,7 +205,8 @@ public: } }; -class BSAssign : public Module +class BSAssign + : public Module { ExtensibleItem nobot; diff --git a/modules/commands/bs_badwords.cpp b/modules/commands/bs_badwords.cpp index 82e4e20b3..cf863e442 100644 --- a/modules/commands/bs_badwords.cpp +++ b/modules/commands/bs_badwords.cpp @@ -12,7 +12,9 @@ #include "module.h" #include "modules/bs_badwords.h" -struct BadWordImpl : BadWord, Serializable +struct BadWordImpl + : BadWord + , Serializable { BadWordImpl() : Serializable("BadWord") { } ~BadWordImpl() override; @@ -27,7 +29,8 @@ struct BadWordImpl : BadWord, Serializable static Serializable* Unserialize(Serializable *obj, Serialize::Data &); }; -struct BadWordsImpl : BadWords +struct BadWordsImpl + : BadWords { Serialize::Reference ci; typedef std::vector list; @@ -144,7 +147,8 @@ Serializable* BadWordImpl::Unserialize(Serializable *obj, Serialize::Data &data) return bw; } -class BadwordsDelCallback : public NumberList +class BadwordsDelCallback + : public NumberList { CommandSource &source; ChannelInfo *ci; @@ -181,7 +185,8 @@ public: } }; -class CommandBSBadwords : public Command +class CommandBSBadwords + : public Command { private: void DoList(CommandSource &source, ChannelInfo *ci, const Anope::string &word) @@ -200,7 +205,8 @@ private: } else if (!word.empty() && word.find_first_not_of("1234567890,-") == Anope::string::npos) { - class BadwordsListCallback : public NumberList + class BadwordsListCallback + : public NumberList { ListFormatter &list; BadWords *bw; @@ -453,7 +459,8 @@ public: } }; -class BSBadwords : public Module +class BSBadwords + : public Module { CommandBSBadwords commandbsbadwords; ExtensibleItem badwords; diff --git a/modules/commands/bs_bot.cpp b/modules/commands/bs_bot.cpp index 6499e3baa..e882d3e04 100644 --- a/modules/commands/bs_bot.cpp +++ b/modules/commands/bs_bot.cpp @@ -11,7 +11,8 @@ #include "module.h" -class CommandBSBot : public Command +class CommandBSBot + : public Command { private: void DoAdd(CommandSource &source, const std::vector ¶ms) @@ -370,7 +371,8 @@ public: } }; -class BSBot : public Module +class BSBot + : public Module { CommandBSBot commandbsbot; diff --git a/modules/commands/bs_botlist.cpp b/modules/commands/bs_botlist.cpp index a62cfe174..828b5af99 100644 --- a/modules/commands/bs_botlist.cpp +++ b/modules/commands/bs_botlist.cpp @@ -11,7 +11,8 @@ #include "module.h" -class CommandBSBotList : public Command +class CommandBSBotList + : public Command { public: CommandBSBotList(Module *creator) : Command(creator, "botserv/botlist", 0, 0) @@ -65,7 +66,8 @@ public: } }; -class BSBotList : public Module +class BSBotList + : public Module { CommandBSBotList commandbsbotlist; diff --git a/modules/commands/bs_control.cpp b/modules/commands/bs_control.cpp index 1c7f0ddb4..1230f03e1 100644 --- a/modules/commands/bs_control.cpp +++ b/modules/commands/bs_control.cpp @@ -11,7 +11,8 @@ #include "module.h" -class CommandBSSay : public Command +class CommandBSSay + : public Command { public: CommandBSSay(Module *creator) : Command(creator, "botserv/say", 2, 2) @@ -71,7 +72,8 @@ public: } }; -class CommandBSAct : public Command +class CommandBSAct + : public Command { public: CommandBSAct(Module *creator) : Command(creator, "botserv/act", 2, 2) @@ -130,7 +132,8 @@ public: } }; -class BSControl : public Module +class BSControl + : public Module { CommandBSSay commandbssay; CommandBSAct commandbsact; diff --git a/modules/commands/bs_info.cpp b/modules/commands/bs_info.cpp index 4c2b1d4e9..f8381836d 100644 --- a/modules/commands/bs_info.cpp +++ b/modules/commands/bs_info.cpp @@ -11,7 +11,8 @@ #include "module.h" -class CommandBSInfo : public Command +class CommandBSInfo + : public Command { private: void send_bot_channels(std::vector &buffers, const BotInfo *bi) @@ -117,7 +118,8 @@ public: } }; -class BSInfo : public Module +class BSInfo + : public Module { CommandBSInfo commandbsinfo; diff --git a/modules/commands/bs_kick.cpp b/modules/commands/bs_kick.cpp index e1919e241..e02c6cab8 100644 --- a/modules/commands/bs_kick.cpp +++ b/modules/commands/bs_kick.cpp @@ -15,7 +15,8 @@ static Module *me; -struct KickerDataImpl : KickerData +struct KickerDataImpl + : KickerData { KickerDataImpl(Extensible *obj) { @@ -37,7 +38,8 @@ struct KickerDataImpl : KickerData ci->Shrink("kickerdata"); } - struct ExtensibleItem : ::ExtensibleItem + struct ExtensibleItem + : ::ExtensibleItem { ExtensibleItem(Module *m, const Anope::string &ename) : ::ExtensibleItem(m, ename) { } @@ -115,7 +117,8 @@ struct KickerDataImpl : KickerData }; }; -class CommandBSKick : public Command +class CommandBSKick + : public Command { public: CommandBSKick(Module *creator) : Command(creator, "botserv/kick", 0) @@ -159,7 +162,8 @@ public: } }; -class CommandBSKickBase : public Command +class CommandBSKickBase + : public Command { public: CommandBSKickBase(Module *creator, const Anope::string &cname, int minarg, int maxarg) : Command(creator, cname, minarg, maxarg) @@ -244,7 +248,8 @@ protected: } }; -class CommandBSKickAMSG : public CommandBSKickBase +class CommandBSKickAMSG + : public CommandBSKickBase { public: CommandBSKickAMSG(Module *creator) : CommandBSKickBase(creator, "botserv/kick/amsg", 2, 3) @@ -280,7 +285,8 @@ public: } }; -class CommandBSKickBadwords : public CommandBSKickBase +class CommandBSKickBadwords + : public CommandBSKickBase { public: CommandBSKickBadwords(Module *creator) : CommandBSKickBase(creator, "botserv/kick/badwords", 2, 3) @@ -319,7 +325,8 @@ public: } }; -class CommandBSKickBolds : public CommandBSKickBase +class CommandBSKickBolds + : public CommandBSKickBase { public: CommandBSKickBolds(Module *creator) : CommandBSKickBase(creator, "botserv/kick/bolds", 2, 3) @@ -353,7 +360,8 @@ public: } }; -class CommandBSKickCaps : public CommandBSKickBase +class CommandBSKickCaps + : public CommandBSKickBase { public: CommandBSKickCaps(Module *creator) : CommandBSKickBase(creator, "botserv/kick/caps", 2, 5) @@ -449,7 +457,8 @@ public: } }; -class CommandBSKickColors : public CommandBSKickBase +class CommandBSKickColors + : public CommandBSKickBase { public: CommandBSKickColors(Module *creator) : CommandBSKickBase(creator, "botserv/kick/colors", 2, 3) @@ -483,7 +492,8 @@ public: } }; -class CommandBSKickFlood : public CommandBSKickBase +class CommandBSKickFlood + : public CommandBSKickBase { public: CommandBSKickFlood(Module *creator) : CommandBSKickBase(creator, "botserv/kick/flood", 2, 5) @@ -581,7 +591,8 @@ public: } }; -class CommandBSKickItalics : public CommandBSKickBase +class CommandBSKickItalics + : public CommandBSKickBase { public: CommandBSKickItalics(Module *creator) : CommandBSKickBase(creator, "botserv/kick/italics", 2, 3) @@ -615,7 +626,8 @@ public: } }; -class CommandBSKickRepeat : public CommandBSKickBase +class CommandBSKickRepeat + : public CommandBSKickBase { public: CommandBSKickRepeat(Module *creator) : CommandBSKickBase(creator, "botserv/kick/repeat", 2, 4) @@ -716,7 +728,8 @@ public: } }; -class CommandBSKickReverses : public CommandBSKickBase +class CommandBSKickReverses + : public CommandBSKickBase { public: CommandBSKickReverses(Module *creator) : CommandBSKickBase(creator, "botserv/kick/reverses", 2, 3) @@ -750,7 +763,8 @@ public: } }; -class CommandBSKickUnderlines : public CommandBSKickBase +class CommandBSKickUnderlines + : public CommandBSKickBase { public: CommandBSKickUnderlines(Module *creator) : CommandBSKickBase(creator, "botserv/kick/underlines", 2, 3) @@ -784,7 +798,8 @@ public: } }; -class CommandBSSetDontKickOps : public Command +class CommandBSSetDontKickOps + : public Command { public: CommandBSSetDontKickOps(Module *creator, const Anope::string &sname = "botserv/set/dontkickops") : Command(creator, sname, 2, 2) @@ -849,7 +864,8 @@ public: } }; -class CommandBSSetDontKickVoices : public Command +class CommandBSSetDontKickVoices + : public Command { public: CommandBSSetDontKickVoices(Module *creator, const Anope::string &sname = "botserv/set/dontkickvoices") : Command(creator, sname, 2, 2) @@ -985,7 +1001,8 @@ struct UserData Anope::string lastline; }; -class BanDataPurger : public Timer +class BanDataPurger + : public Timer { public: BanDataPurger(Module *o) : Timer(o, 300, Anope::CurTime, true) { } @@ -1007,7 +1024,8 @@ public: } }; -class BSKick : public Module +class BSKick + : public Module { ExtensibleItem bandata; ExtensibleItem userdata; diff --git a/modules/commands/bs_set.cpp b/modules/commands/bs_set.cpp index 17d3eac1e..b2ffa24cb 100644 --- a/modules/commands/bs_set.cpp +++ b/modules/commands/bs_set.cpp @@ -11,7 +11,8 @@ #include "module.h" -class CommandBSSet : public Command +class CommandBSSet + : public Command { public: CommandBSSet(Module *creator) : Command(creator, "botserv/set", 3, 3) @@ -64,10 +65,12 @@ public: } }; -class CommandBSSetBanExpire : public Command +class CommandBSSetBanExpire + : public Command { public: - class UnbanTimer : public Timer + class UnbanTimer + : public Timer { Anope::string chname; Anope::string mask; @@ -151,7 +154,8 @@ public: } }; -class CommandBSSetPrivate : public Command +class CommandBSSetPrivate + : public Command { public: CommandBSSetPrivate(Module *creator, const Anope::string &sname = "botserv/set/private") : Command(creator, sname, 2, 2) @@ -201,7 +205,8 @@ public: } }; -class BSSet : public Module +class BSSet + : public Module { CommandBSSet commandbsset; CommandBSSetBanExpire commandbssetbanexpire; diff --git a/modules/commands/cs_access.cpp b/modules/commands/cs_access.cpp index 566d98889..939cc9ad4 100644 --- a/modules/commands/cs_access.cpp +++ b/modules/commands/cs_access.cpp @@ -20,7 +20,8 @@ static inline void reset_levels(ChannelInfo *ci) ci->SetLevel(priv, level); } -class AccessChanAccess : public ChanAccess +class AccessChanAccess + : public ChanAccess { public: int level = 0; @@ -67,7 +68,8 @@ public: } }; -class AccessAccessProvider : public AccessProvider +class AccessAccessProvider + : public AccessProvider { public: static AccessAccessProvider *me; @@ -84,7 +86,8 @@ public: }; AccessAccessProvider* AccessAccessProvider::me; -class CommandCSAccess : public Command +class CommandCSAccess + : public Command { void DoAdd(CommandSource &source, ChannelInfo *ci, const std::vector ¶ms) { @@ -257,7 +260,8 @@ class CommandCSAccess : public Command source.Reply(_("%s access list is empty."), ci->name.c_str()); else if (isdigit(mask[0]) && mask.find_first_not_of("1234567890,-") == Anope::string::npos) { - class AccessDelCallback : public NumberList + class AccessDelCallback + : public NumberList { CommandSource &source; ChannelInfo *ci; @@ -361,7 +365,8 @@ class CommandCSAccess : public Command source.Reply(_("%s access list is empty."), ci->name.c_str()); else if (!nick.empty() && nick.find_first_not_of("1234567890,-") == Anope::string::npos) { - cl