diff options
| author | Sadie Powell <sadie@witchery.services> | 2024-02-26 15:27:01 +0000 |
|---|---|---|
| committer | Sadie Powell <sadie@witchery.services> | 2024-02-26 15:34:17 +0000 |
| commit | c6cb4ba159a8916243d7ac5a5c4e8d13942baf99 (patch) | |
| tree | 5183b6cb982dadb2b91987ff7b69486ea8d811df | |
| parent | e341cac8d6565044f7390852afb40c5e388121df (diff) | |
Fix some coding style issues.
78 files changed, 195 insertions, 195 deletions
diff --git a/include/access.h b/include/access.h index b1587f0c7..a2e65b153 100644 --- a/include/access.h +++ b/include/access.h @@ -98,7 +98,7 @@ public: NickCore *GetAccount() const; void Serialize(Serialize::Data &data) const override; - static Serializable* Unserialize(Serializable *obj, Serialize::Data &); + static Serializable *Unserialize(Serializable *obj, Serialize::Data &); static const unsigned int MAX_DEPTH = 4; @@ -107,7 +107,7 @@ public: * @param nc The account * @param next Next channel to check if any */ - virtual bool Matches(const User *u, const NickCore *nc, ChannelInfo* &next) const; + virtual bool Matches(const User *u, const NickCore *nc, ChannelInfo *&next) const; /** Check if this access entry has the given privilege. * @param name The privilege name diff --git a/include/account.h b/include/account.h index 3d6e0e846..ea65af9d4 100644 --- a/include/account.h +++ b/include/account.h @@ -56,7 +56,7 @@ public: ~NickAlias(); void Serialize(Serialize::Data &data) const override; - static Serializable* Unserialize(Serializable *obj, Serialize::Data &); + static Serializable *Unserialize(Serializable *obj, Serialize::Data &); /** Set a vhost for the user * @param ident The ident @@ -153,7 +153,7 @@ public: ~NickCore(); void Serialize(Serialize::Data &data) const override; - static Serializable* Unserialize(Serializable *obj, Serialize::Data &); + static Serializable *Unserialize(Serializable *obj, Serialize::Data &); /** Changes the display for this account * @param na The new display, must be grouped to this account. @@ -224,7 +224,7 @@ public: * @param nick The account name to find * @return The account, if it exists */ - static NickCore* Find(const Anope::string &nick); + static NickCore *Find(const Anope::string &nick); void AddChannelReference(ChannelInfo *ci); void RemoveChannelReference(ChannelInfo *ci); diff --git a/include/anope.h b/include/anope.h index 0f181c87f..b71f84f19 100644 --- a/include/anope.h +++ b/include/anope.h @@ -140,8 +140,8 @@ namespace Anope */ inline void push_back(char c) { return this->_string.push_back(c); } - inline string& append(const string &s) { this->_string.append(s.str()); return *this; } - inline string& append(const char *s, size_t n) { this->_string.append(s, n); return *this; } + inline string &append(const string &s) { this->_string.append(s.str()); return *this; } + inline string &append(const char *s, size_t n) { this->_string.append(s, n); return *this; } /** * Resizes the string content to n characters. @@ -159,21 +159,21 @@ namespace Anope * Trim leading and trailing white spaces from the string. */ - inline string& ltrim(const Anope::string &what = " \t\r\n") + inline string <rim(const Anope::string &what = " \t\r\n") { while (!this->_string.empty() && what.find(this->_string[0]) != Anope::string::npos) this->_string.erase(this->_string.begin()); return *this; } - inline string& rtrim(const Anope::string &what = " \t\r\n") + inline string &rtrim(const Anope::string &what = " \t\r\n") { while (!this->_string.empty() && what.find(this->_string[this->_string.length() - 1]) != Anope::string::npos) this->_string.erase(this->_string.length() - 1); return *this; } - inline string& trim(const Anope::string &what = " \t\r\n") + inline string &trim(const Anope::string &what = " \t\r\n") { this->ltrim(what); this->rtrim(what); @@ -210,9 +210,9 @@ namespace Anope inline size_type find_last_not_of(const string &_str, size_type pos = npos) const { return this->_string.find_last_not_of(_str._string, pos); } inline size_type find_last_not_of_ci(const string &_str, size_type pos = npos) const { return ci::string(this->_string.c_str()).find_last_not_of(ci::string(_str._string.c_str()), pos); } - inline int compare(size_t pos, size_t len, const string& str) const { return ci::string(this->_string.c_str()).compare(pos, len, ci::string(str.c_str())); } - inline int compare(size_t pos, size_t len, const string& str, size_t subpos, size_type sublen = npos) const { return ci::string(this->_string.c_str()).compare(pos, len, ci::string(str.c_str()), subpos, sublen); } - inline int compare(size_t pos, size_t len, const char* s, size_type n = npos) const { return ci::string(this->_string.c_str()).compare(pos, len, s, n); } + inline int compare(size_t pos, size_t len, const string &str) const { return ci::string(this->_string.c_str()).compare(pos, len, ci::string(str.c_str())); } + inline int compare(size_t pos, size_t len, const string &str, size_t subpos, size_type sublen = npos) const { return ci::string(this->_string.c_str()).compare(pos, len, ci::string(str.c_str()), subpos, sublen); } + inline int compare(size_t pos, size_t len, const char *s, size_type n = npos) const { return ci::string(this->_string.c_str()).compare(pos, len, s, n); } /** * Determine if string consists of only numbers. @@ -600,7 +600,7 @@ public: /** Gets every token from this stream * @param token Tokens are pushed back here */ - template<typename T> void GetTokens(T& token) + template<typename T> void GetTokens(T &token) { token.clear(); Anope::string t; diff --git a/include/base.h b/include/base.h index 07b3bdf89..f8d508b7e 100644 --- a/include/base.h +++ b/include/base.h @@ -103,14 +103,14 @@ public: return NULL; } - inline T* operator->() + inline T *operator->() { if (operator bool()) return this->ref; return NULL; } - inline T* operator*() + inline T *operator*() { if (operator bool()) return this->ref; diff --git a/include/bots.h b/include/bots.h index 8917621d6..711e306b5 100644 --- a/include/bots.h +++ b/include/bots.h @@ -56,7 +56,7 @@ public: virtual ~BotInfo(); void Serialize(Serialize::Data &data) const; - static Serializable* Unserialize(Serializable *obj, Serialize::Data &); + static Serializable *Unserialize(Serializable *obj, Serialize::Data &); void GenerateUID(); @@ -118,7 +118,7 @@ public: * @param permission Permission required to execute the command, if any * @return The commandinfo for the newly created command */ - CommandInfo& SetCommand(const Anope::string &cname, const Anope::string &sname, const Anope::string &permission = ""); + CommandInfo &SetCommand(const Anope::string &cname, const Anope::string &sname, const Anope::string &permission = ""); /** Get command info for a command * @param cname The command name @@ -131,5 +131,5 @@ public: * @param nick_only True to only look by nick, and not by UID * @return The bot, if it exists */ - static BotInfo* Find(const Anope::string &nick, bool nick_only = false); + static BotInfo *Find(const Anope::string &nick, bool nick_only = false); }; diff --git a/include/channels.h b/include/channels.h index d918f4a52..4fecd9fc8 100644 --- a/include/channels.h +++ b/include/channels.h @@ -110,7 +110,7 @@ public: * @param status The status to give the user, if any * @return The UserContainer for the user */ - ChanUserContainer* JoinUser(User *u, const ChannelStatus *status); + ChanUserContainer *JoinUser(User *u, const ChannelStatus *status); /** Remove a user internally from the channel * @param u The user @@ -302,7 +302,7 @@ public: * @param name The channel to find * @return The channel, if found */ - static Channel* Find(const Anope::string &name); + static Channel *Find(const Anope::string &name); /** Finds or creates a channel * @param name The channel name diff --git a/include/commands.h b/include/commands.h index ed318e60a..583f02da1 100644 --- a/include/commands.h +++ b/include/commands.h @@ -44,7 +44,7 @@ struct CoreExport CommandReply { virtual ~CommandReply() = default; virtual void SendMessage(BotInfo *source, const Anope::string &msg) = 0; - virtual void SendMessage(CommandSource& source, const Anope::string &msg); + virtual void SendMessage(CommandSource &source, const Anope::string &msg); }; /* The source for a command */ @@ -182,5 +182,5 @@ public: * @param name If found, is set to the command name, eg REGISTER * @return true if the given command service exists */ - static bool FindCommandFromService(const Anope::string &command_service, BotInfo* &bi, Anope::string &name); + static bool FindCommandFromService(const Anope::string &command_service, BotInfo *&bi, Anope::string &name); }; diff --git a/include/config.h b/include/config.h index c71625ac9..f787f60b0 100644 --- a/include/config.h +++ b/include/config.h @@ -42,8 +42,8 @@ namespace Configuration Block(const Anope::string &); const Anope::string &GetName() const; int CountBlock(const Anope::string &name) const; - const Block* GetBlock(const Anope::string &name, int num = 0) const; - Block* GetMutableBlock(const Anope::string &name, int num = 0); + const Block *GetBlock(const Anope::string &name, int num = 0) const; + Block *GetMutableBlock(const Anope::string &name, int num = 0); template<typename T> T Get(const Anope::string &tag, const Anope::string &def = "") const { @@ -61,7 +61,7 @@ namespace Configuration const item_map &GetItems() const; }; - template<> CoreExport const Anope::string Block::Get(const Anope::string &tag, const Anope::string& def) const; + template<> CoreExport const Anope::string Block::Get(const Anope::string &tag, const Anope::string &def) const; template<> CoreExport time_t Block::Get(const Anope::string &tag, const Anope::string &def) const; template<> CoreExport bool Block::Get(const Anope::string &tag, const Anope::string &def) const; } // namespace Internal diff --git a/include/extensible.h b/include/extensible.h index df76be036..0444e8226 100644 --- a/include/extensible.h +++ b/include/extensible.h @@ -41,12 +41,12 @@ public: void UnsetExtensibles(); - template<typename T> T* GetExt(const Anope::string &name) const; + template<typename T> T *GetExt(const Anope::string &name) const; bool HasExt(const Anope::string &name) const; - template<typename T> T* Extend(const Anope::string &name, const T &what); - template<typename T> T* Extend(const Anope::string &name); - template<typename T> T* Require(const Anope::string &name); + template<typename T> T *Extend(const Anope::string &name, const T &what); + template<typename T> T *Extend(const Anope::string &name); + template<typename T> T *Require(const Anope::string &name); template<typename T> void Shrink(const Anope::string &name); static void ExtensibleSerialize(const Extensible *, const Serializable *, Serialize::Data &data); @@ -77,17 +77,17 @@ public: } } - T* Set(Extensible *obj, const T &value) + T *Set(Extensible *obj, const T &value) { - T* t = Set(obj); + T *t = Set(obj); if (t) *t = value; return t; } - T* Set(Extensible *obj) + T *Set(Extensible *obj) { - T* t = Create(obj); + T *t = Create(obj); Unset(obj); items[obj] = t; obj->extension_items.insert(this); @@ -102,7 +102,7 @@ public: delete value; } - T* Get(const Extensible *obj) const + T *Get(const Extensible *obj) const { std::map<Extensible *, void *>::const_iterator it = items.find(const_cast<Extensible *>(obj)); if (it != items.end()) @@ -115,9 +115,9 @@ public: return items.find(const_cast<Extensible *>(obj)) != items.end(); } - T* Require(Extensible *obj) + T *Require(Extensible *obj) { - T* t = Get(obj); + T *t = Get(obj); if (t) return t; @@ -130,7 +130,7 @@ class ExtensibleItem : public BaseExtensibleItem<T> { protected: - T* Create(Extensible *obj) override + T *Create(Extensible *obj) override { return new T(obj); } @@ -143,7 +143,7 @@ class PrimitiveExtensibleItem : public BaseExtensibleItem<T> { protected: - T* Create(Extensible *obj) override + T *Create(Extensible *obj) override { return new T(); } @@ -155,7 +155,7 @@ template<> class PrimitiveExtensibleItem<bool> : public BaseExtensibleItem<bool> { protected: - bool* Create(Extensible *) override + bool *Create(Extensible *) override { return NULL; } @@ -172,7 +172,7 @@ public: void ExtensibleSerialize(const Extensible *e, const Serializable *s, Serialize::Data &data) const override { - T* t = this->Get(e); + T *t = this->Get(e); data[this->name] << *t; } @@ -216,7 +216,7 @@ struct ExtensibleRef final }; template<typename T> -T* Extensible::GetExt(const Anope::string &name) const +T *Extensible::GetExt(const Anope::string &name) const { ExtensibleRef<T> ref(name); if (ref) @@ -227,16 +227,16 @@ T* Extensible::GetExt(const Anope::string &name) const } template<typename T> -T* Extensible::Extend(const Anope::string &name, const T &what) +T *Extensible::Extend(const Anope::string &name, const T &what) { - T* t = Extend<T>(name); + T *t = Extend<T>(name); if (t) *t = what; return t; } template<typename T> -T* Extensible::Extend(const Anope::string &name) +T *Extensible::Extend(const Anope::string &name) { ExtensibleRef<T> ref(name); if (ref) @@ -247,7 +247,7 @@ T* Extensible::Extend(const Anope::string &name) } template<typename T> -T* Extensible::Require(const Anope::string &name) +T *Extensible::Require(const Anope::string &name) { if (HasExt(name)) return GetExt<T>(name); diff --git a/include/memo.h b/include/memo.h index 70d8d63b7..233c1c065 100644 --- a/include/memo.h +++ b/include/memo.h @@ -25,7 +25,7 @@ public: ~Memo(); void Serialize(Serialize::Data &data) const override; - static Serializable* Unserialize(Serializable *obj, Serialize::Data &); + static Serializable *Unserialize(Serializable *obj, Serialize::Data &); Anope::string owner; /* When it was sent */ diff --git a/include/modules/bs_badwords.h b/include/modules/bs_badwords.h index c20b4e87a..e4866d250 100644 --- a/include/modules/bs_badwords.h +++ b/include/modules/bs_badwords.h @@ -46,13 +46,13 @@ struct BadWords * @param type The type (SINGLE START END) * @return The badword */ - virtual BadWord* AddBadWord(const Anope::string &word, BadWordType type) = 0; + virtual BadWord *AddBadWord(const Anope::string &word, BadWordType type) = 0; /** Get a badword structure by index * @param index The index * @return The badword */ - virtual BadWord* GetBadWord(unsigned index) const = 0; + virtual BadWord *GetBadWord(unsigned index) const = 0; /** Get how many badwords are on this channel * @return The number of badwords in the vector diff --git a/include/modules/cs_entrymsg.h b/include/modules/cs_entrymsg.h index 8259adf49..219c598a6 100644 --- a/include/modules/cs_entrymsg.h +++ b/include/modules/cs_entrymsg.h @@ -33,5 +33,5 @@ public: delete (*this)->at(i - 1); } - virtual EntryMsg* Create() = 0; + virtual EntryMsg *Create() = 0; }; diff --git a/include/modules/httpd.h b/include/modules/httpd.h index b08ca8bf4..d78de4a02 100644 --- a/include/modules/httpd.h +++ b/include/modules/httpd.h @@ -27,9 +27,9 @@ struct HTTPReply final std::vector<cookie> cookies; HTTPReply() = default; - HTTPReply& operator=(const HTTPReply &) = default; + HTTPReply &operator=(const HTTPReply &) = default; |
