From 45e56e5ee1bdb9e169be957e21a4f7b536e417ff Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Thu, 1 Dec 2022 05:14:58 +0000 Subject: Yet more stylistic fixes. --- include/hashcomp.h | 6 ++++-- include/iohook.h | 6 +++++- include/listmode.h | 17 ++++++++++++----- include/modules.h | 2 +- include/modules/dns.h | 5 ++++- include/modules/hash.h | 4 +++- include/modules/httpd.h | 11 +++++++---- include/modules/ldap.h | 15 ++++++--------- include/modules/reload.h | 6 +++++- include/xline.h | 23 +++++++++++++++++------ 10 files changed, 64 insertions(+), 31 deletions(-) (limited to 'include') diff --git a/include/hashcomp.h b/include/hashcomp.h index b17be3648..8933b3e24 100644 --- a/include/hashcomp.h +++ b/include/hashcomp.h @@ -171,7 +171,8 @@ namespace irc public: /** Initialize with comma separator */ - commasepstream(const std::string& source, bool allowempty = false) : sepstream(source, ',', allowempty) + commasepstream(const std::string& source, bool allowempty = false) + : sepstream(source, ',', allowempty) { } }; @@ -183,7 +184,8 @@ namespace irc public: /** Initialize with space separator */ - spacesepstream(const std::string& source, bool allowempty = false) : sepstream(source, ' ', allowempty) + spacesepstream(const std::string& source, bool allowempty = false) + : sepstream(source, ' ', allowempty) { } }; diff --git a/include/iohook.h b/include/iohook.h index a5f6f5819..1e0e6c72b 100644 --- a/include/iohook.h +++ b/include/iohook.h @@ -45,7 +45,11 @@ public: * @param middle True if the IOHook instances created by this hook are subclasses of IOHookMiddle, false otherwise */ IOHookProvider(Module* mod, const std::string& Name, Type hooktype = IOH_UNKNOWN, bool middle = false) - : ServiceProvider(mod, Name, SERVICE_IOHOOK), middlehook(middle), type(hooktype) { } + : ServiceProvider(mod, Name, SERVICE_IOHOOK) + , middlehook(middle) + , type(hooktype) + { + } /** Check if the IOHook provided can appear in the non-last position of a hook chain. * That is the case if and only if the IOHook instances created are subclasses of IOHookMiddle. diff --git a/include/listmode.h b/include/listmode.h index b3a67d86c..9bd252530 100644 --- a/include/listmode.h +++ b/include/listmode.h @@ -35,7 +35,11 @@ public: std::string mask; time_t time; ListItem(const std::string& Mask, const std::string& Setter, time_t Time) - : setter(Setter), mask(Mask), time(Time) { } + : setter(Setter) + , mask(Mask) + , time(Time) + { + } }; /** Items stored in the channel's list @@ -47,9 +51,7 @@ private: { public: ModeList list; - long maxitems; - - ChanData() : maxitems(-1) { } + long maxitems = -1; }; /** The number of items a listmode's list may contain @@ -58,7 +60,12 @@ private: { std::string mask; unsigned long limit; - ListLimit(const std::string& Mask, unsigned long Limit) : mask(Mask), limit(Limit) { } + ListLimit(const std::string& Mask, unsigned long Limit) + : mask(Mask) + , limit(Limit) + { + } + bool operator==(const ListLimit& other) const { return (this->mask == other.mask && this->limit == other.limit); } }; diff --git a/include/modules.h b/include/modules.h index 926d2f38e..7ba228196 100644 --- a/include/modules.h +++ b/include/modules.h @@ -452,7 +452,7 @@ public: * @param timeout The time the invite will expire (0 == never) * @return 1 to deny the invite, 0 to check whether or not the user has permission to invite, -1 to explicitly allow the invite */ - virtual ModResult OnUserPreInvite(User* source,User* dest,Channel* channel, time_t timeout); + virtual ModResult OnUserPreInvite(User* source, User* dest, Channel* channel, time_t timeout); /** Called after a user has been successfully invited to a channel. * You cannot prevent the invite from occurring using this function, to do that, diff --git a/include/modules/dns.h b/include/modules/dns.h index 95685eae7..73c59b2de 100644 --- a/include/modules/dns.h +++ b/include/modules/dns.h @@ -173,7 +173,10 @@ namespace DNS class Manager : public DataProvider { public: - Manager(Module* mod) : DataProvider(mod, "DNS") { } + Manager(Module* mod) + : DataProvider(mod, "DNS") + { + } virtual void Process(Request* req) = 0; virtual void RemoveRequest(Request* req) = 0; diff --git a/include/modules/hash.h b/include/modules/hash.h index 9c5370366..5b8dfe625 100644 --- a/include/modules/hash.h +++ b/include/modules/hash.h @@ -31,7 +31,9 @@ public: const unsigned int out_size; const unsigned int block_size; HashProvider(Module* mod, const std::string& Name, unsigned int osiz = 0, unsigned int bsiz = 0) - : DataProvider(mod, "hash/" + Name), out_size(osiz), block_size(bsiz) + : DataProvider(mod, "hash/" + Name) + , out_size(osiz) + , block_size(bsiz) { } diff --git a/include/modules/httpd.h b/include/modules/httpd.h index ea01de16a..fe325341a 100644 --- a/include/modules/httpd.h +++ b/include/modules/httpd.h @@ -86,7 +86,7 @@ struct HTTPRequestURI final class HTTPHeaders final { protected: - std::map headers; + std::map headers; public: /** Set the value of a header @@ -125,7 +125,7 @@ public: */ std::string GetHeader(const std::string& name) { - std::map::iterator it = headers.find(name); + std::map::iterator it = headers.find(name); if (it == headers.end()) return std::string(); @@ -137,7 +137,7 @@ public: */ bool IsSet(const std::string& name) { - std::map::iterator it = headers.find(name); + std::map::iterator it = headers.find(name); return (it != headers.end()); } @@ -263,7 +263,10 @@ public: * based upon the response code. */ HTTPDocumentResponse(Module* mod, HTTPRequest& req, std::stringstream* doc, unsigned int response) - : module(mod), document(doc), responsecode(response), src(req) + : module(mod) + , document(doc) + , responsecode(response) + , src(req) { } }; diff --git a/include/modules/ldap.h b/include/modules/ldap.h index f3cc15b4a..9f07f0455 100644 --- a/include/modules/ldap.h +++ b/include/modules/ldap.h @@ -97,13 +97,8 @@ struct LDAPResult final std::vector messages; std::string error; - QueryType type; - LDAPQuery id; - - LDAPResult() - : type(QUERY_UNKNOWN), id(-1) - { - } + QueryType type = QUERY_UNKNOWN; + LDAPQuery id = -1; size_t size() const { @@ -133,9 +128,11 @@ class LDAPInterface public: ModuleRef creator; - LDAPInterface(Module* m) : creator(m) { } + LDAPInterface(Module* m) + : creator(m) + { + } virtual ~LDAPInterface() = default; - virtual void OnResult(const LDAPResult& r) = 0; virtual void OnError(const LDAPResult& err) = 0; }; diff --git a/include/modules/reload.h b/include/modules/reload.h index e70782f54..34f731722 100644 --- a/include/modules/reload.h +++ b/include/modules/reload.h @@ -32,7 +32,11 @@ namespace ReloadModule { EventListener* handler; void* data; - Data(EventListener* Handler, void* moddata) : handler(Handler), data(moddata) { } + Data(EventListener* Handler, void* moddata) + : handler(Handler) + , data(moddata) + { + } }; typedef std::vector List; List list; diff --git a/include/xline.h b/include/xline.h index f2360a3d5..b922f58a4 100644 --- a/include/xline.h +++ b/include/xline.h @@ -193,7 +193,9 @@ public: * @param host Host to match */ KLine(time_t s_time, unsigned long d, const std::string& src, const std::string& re, const std::string& ident, const std::string& host) - : XLine(s_time, d, src, re, "K"), identmask(ident), hostmask(host) + : XLine(s_time, d, src, re, "K") + , identmask(ident) + , hostmask(host) { matchtext = this->identmask; matchtext.append("@").append(this->hostmask); @@ -234,7 +236,9 @@ public: * @param host Host to match */ GLine(time_t s_time, unsigned long d, const std::string& src, const std::string& re, const std::string& ident, const std::string& host) - : XLine(s_time, d, src, re, "G"), identmask(ident), hostmask(host) + : XLine(s_time, d, src, re, "G") + , identmask(ident) + , hostmask(host) { matchtext = this->identmask; matchtext.append("@").append(this->hostmask); @@ -273,7 +277,9 @@ public: * @param host Host to match */ ELine(time_t s_time, unsigned long d, const std::string& src, const std::string& re, const std::string& ident, const std::string& host) - : XLine(s_time, d, src, re, "E"), identmask(ident), hostmask(host) + : XLine(s_time, d, src, re, "E") + , identmask(ident) + , hostmask(host) { matchtext = this->identmask; matchtext.append("@").append(this->hostmask); @@ -313,7 +319,8 @@ public: * @param ip IP to match */ ZLine(time_t s_time, unsigned long d, const std::string& src, const std::string& re, const std::string& ip) - : XLine(s_time, d, src, re, "Z"), ipaddr(ip) + : XLine(s_time, d, src, re, "Z") + , ipaddr(ip) { } @@ -344,7 +351,8 @@ public: * @param nickname Nickname to match */ QLine(time_t s_time, unsigned long d, const std::string& src, const std::string& re, const std::string& nickname) - : XLine(s_time, d, src, re, "Q"), nick(nickname) + : XLine(s_time, d, src, re, "Q") + , nick(nickname) { } @@ -379,7 +387,10 @@ public: /** Create an XLine factory * @param t Type of XLine this factory generates */ - XLineFactory(const std::string& t) : type(t) { } + XLineFactory(const std::string& t) + : type(t) + { + } /** Return the type of XLine this factory generates * @return The type of XLine this factory generates -- cgit v1.3.1-10-gc9f91