diff options
Diffstat (limited to 'src')
142 files changed, 254 insertions, 254 deletions
diff --git a/src/channelmanager.cpp b/src/channelmanager.cpp index 9562d2077..d572065fb 100644 --- a/src/channelmanager.cpp +++ b/src/channelmanager.cpp @@ -27,7 +27,7 @@ bool ChannelManager::DefaultIsChannel(const std::string_view& channel) if (!ServerInstance->Channels.IsPrefix(channel[0])) return false; - for (const auto& chr : insp::iterator_range(channel.begin() + 1, channel.end())) + for (const auto chr : insp::iterator_range(channel.begin() + 1, channel.end())) { switch (chr) { diff --git a/src/channels.cpp b/src/channels.cpp index 58b04202b..37b487c28 100644 --- a/src/channels.cpp +++ b/src/channels.cpp @@ -140,7 +140,7 @@ void Channel::SetDefaultModes() list.GetToken(modeseq); - for (const auto& modechr : modeseq) + for (const auto modechr : modeseq) { ModeHandler* mode = ServerInstance->Modes.FindMode(modechr, MODETYPE_CHANNEL); if (mode) @@ -201,7 +201,7 @@ Channel* Channel::JoinUser(LocalUser* user, std::string cname, bool override, co if (cname.length() > ServerInstance->Config->Limits.MaxChannel) cname.resize(ServerInstance->Config->Limits.MaxChannel); - auto chan = ServerInstance->Channels.Find(cname); + auto* chan = ServerInstance->Channels.Find(cname); bool created_by_local = !chan; // Flag that will be passed to ForceJoin later std::string privs; // Prefix mode(letter)s to give to the joining user @@ -258,7 +258,7 @@ Membership* Channel::ForceJoin(User* user, const std::string* privs, bool bursti { // If the user was granted prefix modes (in the OnUserPreJoin hook, or they're a // remote user and their own server set the modes), then set them internally now - for (const auto& priv : *privs) + for (const auto priv : *privs) { PrefixMode* mh = ServerInstance->Modes.FindPrefixMode(priv); if (mh) @@ -447,7 +447,7 @@ char Membership::GetPrefixChar() const char pf = 0; ModeHandler::Rank bestrank = 0; - for (const auto& mh : modes) + for (const auto* mh : modes) { if (mh->GetPrefixRank() > bestrank && mh->GetPrefix()) { @@ -462,7 +462,7 @@ std::string Membership::GetAllPrefixChars() const { std::string ret; ret.reserve(modes.size()); - for (const auto& mh : modes) + for (const auto* mh : modes) { if (mh->GetPrefix()) ret.push_back(mh->GetPrefix()); @@ -474,7 +474,7 @@ std::string Membership::GetAllPrefixModes() const { std::string ret; ret.reserve(modes.size()); - for (const auto& mh : modes) + for (const auto* mh : modes) { if (mh->GetModeChar()) ret.push_back(mh->GetModeChar()); diff --git a/src/clientprotocol.cpp b/src/clientprotocol.cpp index 6ed2deb0e..a57489208 100644 --- a/src/clientprotocol.cpp +++ b/src/clientprotocol.cpp @@ -32,7 +32,7 @@ bool ClientProtocol::Serializer::HandleTag(LocalUser* user, const std::string& t if (tagname.empty()) return false; - for (const auto& subscriber : evprov.GetSubscribers()) + for (auto* subscriber : evprov.GetSubscribers()) { MessageTagProvider* const tagprov = static_cast<MessageTagProvider*>(subscriber); const ModResult res = tagprov->OnProcessTag(user, tagname, tagvalue); @@ -72,7 +72,7 @@ std::string ClientProtocol::Message::EscapeTag(const std::string& value) { std::string ret; ret.reserve(value.size()); - for (const char& chr : value) + for (const auto chr : value) { switch (chr) { diff --git a/src/command_parse.cpp b/src/command_parse.cpp index d9de9c37a..98002f6f9 100644 --- a/src/command_parse.cpp +++ b/src/command_parse.cpp @@ -400,7 +400,7 @@ void CommandParser::TranslateSingleParam(TranslateType to, const std::string& it case TR_NICK: { /* Translate single nickname */ - auto user = ServerInstance->Users.Find(item); + auto* user = ServerInstance->Users.Find(item); if (user) dest.append(user->uuid); else diff --git a/src/commands.cpp b/src/commands.cpp index 53c901398..ebd94dec5 100644 --- a/src/commands.cpp +++ b/src/commands.cpp @@ -71,7 +71,7 @@ void Command::TellNotEnoughParameters(LocalUser* user, const Params& parameters) user->WriteNumeric(ERR_NEEDMOREPARAMS, name, "Not enough parameters."); if (ServerInstance->Config->SyntaxHints && user->IsFullyConnected()) { - for (const std::string& syntaxline : this->syntax) + for (const auto& syntaxline : this->syntax) user->WriteNumeric(RPL_SYNTAX, name, syntaxline); } } diff --git a/src/configreader.cpp b/src/configreader.cpp index 97a483411..1c414a27b 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -440,7 +440,7 @@ void ServerConfig::Apply(ServerConfig* old, const std::string& useruid) } } - auto user = ServerInstance->Users.FindUUID(useruid); + auto* user = ServerInstance->Users.FindUUID(useruid); if (!valid) { @@ -576,7 +576,7 @@ ServerConfig::TagList ServerConfig::ConfTags(const std::string& tag, std::option std::string ServerConfig::Escape(const std::string& str) { std::stringstream escaped; - for (const auto& chr : str) + for (const auto chr : str) { switch (chr) { @@ -656,7 +656,7 @@ void ConfigReaderThread::OnStop() */ ServerInstance->Users.RehashCloneCounts(); - auto user = ServerInstance->Users.FindUUID(UUID); + auto* user = ServerInstance->Users.FindUUID(UUID); ConfigStatus status(user); for (const auto& [modname, mod] : ServerInstance->Modules.GetModules()) diff --git a/src/coremods/core_channel/cmd_invite.cpp b/src/coremods/core_channel/cmd_invite.cpp index fad1bbbf4..b287c9736 100644 --- a/src/coremods/core_channel/cmd_invite.cpp +++ b/src/coremods/core_channel/cmd_invite.cpp @@ -64,7 +64,7 @@ CmdResult CommandInvite::Handle(User* user, const Params& parameters) else u = ServerInstance->Users.Find(parameters[0], true); - auto c = ServerInstance->Channels.Find(parameters[1]); + auto* c = ServerInstance->Channels.Find(parameters[1]); time_t timeout = 0; if (parameters.size() >= 3) { diff --git a/src/coremods/core_channel/cmd_kick.cpp b/src/coremods/core_channel/cmd_kick.cpp index c89bd8185..e6061190a 100644 --- a/src/coremods/core_channel/cmd_kick.cpp +++ b/src/coremods/core_channel/cmd_kick.cpp @@ -45,7 +45,7 @@ CommandKick::CommandKick(Module* parent) CmdResult CommandKick::Handle(User* user, const Params& parameters) { - auto c = ServerInstance->Channels.Find(parameters[0]); + auto* c = ServerInstance->Channels.Find(parameters[0]); User* u; if (CommandParser::LoopCall(user, this, parameters, 1)) @@ -114,7 +114,7 @@ CmdResult CommandKick::Handle(User* user, const Params& parameters) { ModeHandler::Rank them = srcmemb->GetRank(); ModeHandler::Rank req = HALFOP_VALUE; - for (const auto& mh : memb->modes) + for (const auto* mh : memb->modes) { if (mh->GetLevelRequired(true) > req) req = mh->GetLevelRequired(true); diff --git a/src/coremods/core_channel/cmd_topic.cpp b/src/coremods/core_channel/cmd_topic.cpp index 1288b6173..8fae6a057 100644 --- a/src/coremods/core_channel/cmd_topic.cpp +++ b/src/coremods/core_channel/cmd_topic.cpp @@ -53,7 +53,7 @@ CommandTopic::CommandTopic(Module* parent) CmdResult CommandTopic::HandleLocal(LocalUser* user, const Params& parameters) { - auto c = ServerInstance->Channels.Find(parameters[0]); + auto* c = ServerInstance->Channels.Find(parameters[0]); if (!c) { user->WriteNumeric(Numerics::NoSuchChannel(parameters[0])); diff --git a/src/coremods/core_channel/core_channel.cpp b/src/coremods/core_channel/core_channel.cpp index 6c0c83e28..cb66c5e1c 100644 --- a/src/coremods/core_channel/core_channel.cpp +++ b/src/coremods/core_channel/core_channel.cpp @@ -224,7 +224,7 @@ public: std::vector<std::string> limits; std::string vlist; - for (const auto& lm : ServerInstance->Modes.GetListModes()) + for (auto* lm : ServerInstance->Modes.GetListModes()) { limits.push_back(InspIRCd::Format("%c:%lu", lm->GetModeChar(), lm->GetLowerLimit())); if (lm->HasVariableLength()) diff --git a/src/coremods/core_channel/extban.cpp b/src/coremods/core_channel/extban.cpp index 2e36cf6d9..39a892523 100644 --- a/src/coremods/core_channel/extban.cpp +++ b/src/coremods/core_channel/extban.cpp @@ -69,7 +69,7 @@ bool ExtBanManager::Canonicalize(std::string& text) const void ExtBanManager::BuildISupport(std::string& out) { - for (const LetterMap::value_type& extban : byletter) + for (const auto& extban : byletter) out.push_back(extban.first); std::sort(out.begin(), out.end()); @@ -86,7 +86,7 @@ ModResult ExtBanManager::GetStatus(ExtBan::Acting* extban, User* user, Channel* if (!list) return MOD_RES_PASSTHRU; - for (const ListModeBase::ListItem& ban : *list) + for (const auto& ban : *list) { bool inverted; std::string xbname; diff --git a/src/coremods/core_channel/invite.cpp b/src/coremods/core_channel/invite.cpp index 084c71e37..5e10c8548 100644 --- a/src/coremods/core_channel/invite.cpp +++ b/src/coremods/core_channel/invite.cpp @@ -163,7 +163,7 @@ void Invite::APIImpl::Unserialize(LocalUser* user, const std::string& value) irc::spacesepstream ss(value); for (std::string channame, exptime; (ss.GetToken(channame) && ss.GetToken(exptime)); ) { - auto chan = ServerInstance->Channels.Find(channame); + auto* chan = ServerInstance->Channels.Find(channame); if (chan) Create(user, chan, ConvToNum<time_t>(exptime)); } diff --git a/src/coremods/core_hostname_lookup.cpp b/src/coremods/core_hostname_lookup.cpp index 0d23f7fc8..756236897 100644 --- a/src/coremods/core_hostname_lookup.cpp +++ b/src/coremods/core_hostname_lookup.cpp @@ -180,7 +180,7 @@ public: } LogLookup(*rr, query->cached); - auto res_forward = new UserIPResolver(this->manager, this->creator, user, rr->rdata); + auto* res_forward = new UserIPResolver(this->manager, this->creator, user, rr->rdata); try { this->manager->Process(res_forward); @@ -224,7 +224,7 @@ public: user->WriteNotice("*** Looking up your hostname..."); - auto res_reverse = new UserHostResolver(*this->DNS, this, user); + auto* res_reverse = new UserHostResolver(*this->DNS, this, user); try { /* If both the reverse and forward queries are cached, the user will be able to pass DNS completely diff --git a/src/coremods/core_info/isupport.cpp b/src/coremods/core_info/isupport.cpp index 822af8b6b..ec237c017 100644 --- a/src/coremods/core_info/isupport.cpp +++ b/src/coremods/core_info/isupport.cpp @@ -59,7 +59,7 @@ void ISupportManager::AppendValue(std::string& buffer, const std::string& value) // This function implements value escaping according to the rules of the ISUPPORT draft: // https://tools.ietf.org/html/draft-brocklesby-irc-isupport-03 buffer.push_back('='); - for (const auto& chr : value) + for (const auto chr : value) { // The value must be escaped if: // (1) It is a banned character in an IRC <middle> parameter (NUL, LF, CR, SPACE). diff --git a/src/coremods/core_message.cpp b/src/coremods/core_message.cpp index ed68f3613..49fd58e6b 100644 --- a/src/coremods/core_message.cpp +++ b/src/coremods/core_message.cpp @@ -141,7 +141,7 @@ private: CmdResult HandleChannelTarget(User* source, const Params& parameters, const char* target, PrefixMode* pm) { - auto chan = ServerInstance->Channels.Find(target); + auto* chan = ServerInstance->Channels.Find(target); if (!chan) { // The target channel does not exist. diff --git a/src/coremods/core_mode.cpp b/src/coremods/core_mode.cpp index 5329b64ef..beee1c708 100644 --- a/src/coremods/core_mode.cpp +++ b/src/coremods/core_mode.cpp @@ -100,7 +100,7 @@ CommandMode::CommandMode(Module* parent) CmdResult CommandMode::Handle(User* user, const Params& parameters) { const std::string& target = parameters[0]; - auto targetchannel = ServerInstance->Channels.Find(target); + auto* targetchannel = ServerInstance->Channels.Find(target); User* targetuser = nullptr; if (!targetchannel) { @@ -179,7 +179,7 @@ void CommandMode::DisplayListModes(User* user, Channel* chan, const std::string& { seq++; - for (const auto& mletter : mode_sequence) + for (const auto mletter : mode_sequence) { if (mletter == '+') continue; @@ -354,7 +354,7 @@ private: static std::string GeneratePrefixList(bool includemodechars) { std::vector<PrefixMode*> prefixes; - for (const auto& pm : ServerInstance->Modes.GetPrefixModes()) + for (auto* pm : ServerInstance->Modes.GetPrefixModes()) { if (pm->GetPrefix()) prefixes.push_back(pm); @@ -366,7 +366,7 @@ private: std::string modechars; std::string prefixchars; - for (const auto& pm : insp::iterator_range(prefixes.rbegin(), prefixes.rend())) + for (const auto* pm : insp::iterator_range(prefixes.rbegin(), prefixes.rend())) { modechars += pm->GetModeChar(); prefixchars += pm->GetPrefix(); diff --git a/src/coremods/core_oper/cmd_kill.cpp b/src/coremods/core_oper/cmd_kill.cpp index f3faf38cc..cd9dee907 100644 --- a/src/coremods/core_oper/cmd_kill.cpp +++ b/src/coremods/core_oper/cmd_kill.cpp @@ -65,7 +65,7 @@ CmdResult CommandKill::Handle(User* user, const Params& parameters) return CmdResult::FAILURE; } - auto target = ServerInstance->Users.Find(parameters[0]); + auto* target = ServerInstance->Users.Find(parameters[0]); if (!target) { user->WriteNumeric(Numerics::NoSuchNick(parameters[0])); diff --git a/src/coremods/core_oper/core_oper.cpp b/src/coremods/core_oper/core_oper.cpp index 58335f344..e511f04c8 100644 --- a/src/coremods/core_oper/core_oper.cpp +++ b/src/coremods/core_oper/core_oper.cpp @@ -193,7 +193,7 @@ public: { // Online server operators. size_t opers = 0; - for (const auto& oper : ServerInstance->Users.all_opers) + for (auto* oper : ServerInstance->Users.all_opers) { if (oper->server->IsService()) continue; @@ -208,7 +208,7 @@ public: awaytime.c_str(), oper->awaymsg.c_str()); } - auto loper = IS_LOCAL(oper); + auto* loper = IS_LOCAL(oper); if (loper) { const std::string idleperiod = InspIRCd::DurationString(ServerInstance->Time() - loper->idle_lastmsg); diff --git a/src/coremods/core_oper/umode_s.cpp b/src/coremods/core_oper/umode_s.cpp index 8e8c7701c..b6534f0a8 100644 --- a/src/coremods/core_oper/umode_s.cpp +++ b/src/coremods/core_oper/umode_s.cpp @@ -76,7 +76,7 @@ std::string ModeUserServerNoticeMask::ProcessNoticeMasks(User* user, const std:: bool adding = true; std::bitset<64> curr = user->snomasks; - for (const auto& snomask : input) + for (const auto snomask : input) { switch (snomask) { diff --git a/src/coremods/core_reloadmodule.cpp b/src/coremods/core_reloadmodule.cpp index 112a1ced2..1c00ed390 100644 --- a/src/coremods/core_reloadmodule.cpp +++ b/src/coremods/core_reloadmodule.cpp @@ -706,7 +706,7 @@ public: ServerInstance->SNO.WriteGlobalSno('a', "Failed to reload the %s module.", passedname.c_str()); } - auto user = ServerInstance->Users.FindUUID(uuid); + auto* user = ServerInstance->Users.FindUUID(uuid); if (user) { if (result) diff --git a/src/coremods/core_stats.cpp b/src/coremods/core_stats.cpp index ffed4a669..0c575d544 100644 --- a/src/coremods/core_stats.cpp +++ b/src/coremods/core_stats.cpp @@ -127,7 +127,7 @@ void CommandStats::DoStats(Stats::Context& stats) /* stats p (show listening ports) */ case 'p': { - for (const auto& ls : ServerInstance->ports) + for (const auto* ls : ServerInstance->ports) { std::stringstream portentry; diff --git a/src/coremods/core_user/cmd_part.cpp b/src/coremods/core_user/cmd_part.cpp index 206e956d9..75d713863 100644 --- a/src/coremods/core_user/cmd_part.cpp +++ b/src/coremods/core_user/cmd_part.cpp @@ -52,7 +52,7 @@ CmdResult CommandPart::Handle(User* user, const Params& parameters) if (CommandParser::LoopCall(user, this, parameters, 0)) return CmdResult::SUCCESS; - auto c = ServerInstance->Channels.Find(parameters[0]); + auto* c = ServerInstance->Channels.Find(parameters[0]); if (!c) { diff --git a/src/coremods/core_user/cmd_userhost.cpp b/src/coremods/core_user/cmd_userhost.cpp index fa90c3560..ced65bc21 100644 --- a/src/coremods/core_user/cmd_userhost.cpp +++ b/src/coremods/core_user/cmd_userhost.cpp @@ -41,7 +41,7 @@ CmdResult CommandUserhost::Handle(User* user, const Params& parameters) size_t paramcount = std::min<size_t>(parameters.size(), 5); for (size_t i = 0; i < paramcount; ++i) { - auto u = ServerInstance->Users.FindNick(parameters[i], true); + auto* u = ServerInstance->Users.FindNick(parameters[i], true); if (u) { retbuf += u->nick; diff --git a/src/coremods/core_who.cpp b/src/coremods/core_who.cpp index 81678e95a..2dc751ddd 100644 --- a/src/coremods/core_who.cpp +++ b/src/coremods/core_who.cpp @@ -129,7 +129,7 @@ private: { // Build a map of prefixes ordered descending by their rank. std::multimap<ModeHandler::Rank, const PrefixMode*, std::greater<>> ranks; - for (const auto& pm : ServerInstance->Modes.GetPrefixModes()) + for (const auto* pm : ServerInstance->Modes.GetPrefixModes()) ranks.insert(std::make_pair(pm->GetPrefixRank(), pm)); // Now we have the ranks ordered we can assign them levels. @@ -316,7 +316,7 @@ bool CommandWho::MatchUser(LocalUser* source, User* user, WhoData& data) if (source_can_see_target) { bool set = true; - for (const auto& chr : data.matchtext) + for (const auto chr : data.matchtext) { switch (chr) { diff --git a/src/coremods/core_whois.cpp b/src/coremods/core_whois.cpp index 6981a5f16..8ee7969fc 100644 --- a/src/coremods/core_whois.cpp +++ b/src/coremods/core_whois.cpp @@ -261,7 +261,7 @@ CmdResult CommandWhois::HandleRemote(RemoteUser* target, const Params& parameter if (parameters.size() < 2) return CmdResult::FAILURE; - auto user = ServerInstance->Users.FindUUID(parameters[0]); + auto* user = ServerInstance->Users.FindUUID(parameters[0]); if (!user) return CmdResult::FAILURE; diff --git a/src/coremods/core_whowas.cpp b/src/coremods/core_whowas.cpp index be7997612..342bbffd5 100644 --- a/src/coremods/core_whowas.cpp +++ b/src/coremods/core_whowas.cpp @@ -222,7 +222,7 @@ CmdResult CommandWhowas::Handle(User* user, const Params& parameters) last = nick->entries.rbegin() + count; } - for (const auto& u : insp::iterator_range(nick->entries.rbegin(), last)) + for (const auto* u : insp::iterator_range(nick->entries.rbegin(), last)) { user->WriteNumeric(RPL_WHOWASUSER, parameters[0], u->ident, u->dhost, '*', u->real); @@ -270,7 +270,7 @@ void WhoWas::Manager::Add(User* user) if (ret.second) // If inserted { // This nick is new, create a list for it and add the first record to it - auto nick = new WhoWas::Nick(ret.first->first); + auto* nick = new WhoWas::Nick(ret.first->first); nick->entries.push_back(new Entry(user)); ret.first->second = nick; diff --git a/src/coremods/core_xline/cmd_eline.cpp b/src/coremods/core_xline/cmd_eline.cpp index 2f4ec2a36..0fe7b2e07 100644 --- a/src/coremods/core_xline/cmd_eline.cpp +++ b/src/coremods/core_xline/cmd_eline.cpp @@ -45,7 +45,7 @@ CmdResult CommandEline::Handle(User* user, const Params& parameters) if (parameters.size() >= 3) { IdentHostPair ih; - auto find = ServerInstance->Users.Find(target, true); + auto* find = ServerInstance->Users.Find(target, true); if (find) { ih.first = find->GetBanIdent(); @@ -72,7 +72,7 @@ CmdResult CommandEline::Handle(User* user, const Params& parameters) return CmdResult::FAILURE; } - auto el = new ELine(ServerInstance->Time(), duration, user->nick, parameters[2], ih.first, ih.second); + auto* el = new ELine(ServerInstance->Time(), duration, user->nick, parameters[2], ih.first, ih.second); if (ServerInstance->XLines->AddLine(el, user)) { if (!duration) diff --git a/src/coremods/core_xline/cmd_gline.cpp b/src/coremods/core_xline/cmd_gline.cpp index 8efa94d5d..ecca89cd3 100644 --- a/src/coremods/core_xline/cmd_gline.cpp +++ b/src/coremods/core_xline/cmd_gline.cpp @@ -46,7 +46,7 @@ CmdResult CommandGline::Handle(User* user, const Params& parameters) if (parameters.size() >= 3) { IdentHostPair ih; - auto find = ServerInstance->Users.Find(target, true); + auto* find = ServerInstance->Users.Find(target, true); if (find) { ih.first = find->GetBanIdent(); @@ -79,7 +79,7 @@ CmdResult CommandGline::Handle(User* user, const Params& parameters) return CmdResult::FAILURE; } - auto gl = new GLine(ServerInstance->Time(), duration, user->nick, parameters[2], ih.first, ih.second); + auto* gl = new GLine(ServerInstance->Time(), duration, user->nick, parameters[2], ih.first, ih.second); if (ServerInstance->XLines->AddLine(gl, user)) { if (!duration) diff --git a/src/coremods/core_xline/cmd_kline.cpp b/src/coremods/core_xline/cmd_kline.cpp index 345cdd9f4..cf76b8763 100644 --- a/src/coremods/core_xline/cmd_kline.cpp +++ b/src/coremods/core_xline/cmd_kline.cpp @@ -46,7 +46,7 @@ CmdResult CommandKline::Handle(User* user, const Params& parameters) if (parameters.size() >= 3) { IdentHostPair ih; - auto find = ServerInstance->Users.Find(target, true); + auto* find = ServerInstance->Users.Find(target, true); if (find) { ih.first = find->GetBanIdent(); @@ -79,7 +79,7 @@ CmdResult CommandKline::Handle(User* user, const Params& parameters) return CmdResult::FAILURE; } - auto kl = new KLine(ServerInstance->Time(), duration, user->nick, parameters[2], ih.first, ih.second); + auto* kl = new KLine(ServerInstance->Time(), duration, user->nick, parameters[2], ih.first, ih.second); if (ServerInstance->XLines->AddLine(kl, user)) { if (!duration) diff --git a/src/coremods/core_xline/cmd_qline.cpp b/src/coremods/core_xline/cmd_qline.cpp index c6df5acd2..6956edc03 100644 --- a/src/coremods/core_xline/cmd_qline.cpp +++ b/src/coremods/core_xline/cmd_qline.cpp @@ -61,7 +61,7 @@ CmdResult CommandQline::Handle(User* user, const Params& parameters) return CmdResult::FAILURE; } - auto ql = new QLine(ServerInstance->Time(), duration, user->nick, parameters[2], parameters[0]); + auto* ql = new QLine(ServerInstance->Time(), duration, user->nick, parameters[2], parameters[0]); if (ServerInstance->XLines->AddLine(ql, user)) { if (!duration) diff --git a/src/coremods/core_xline/cmd_zline.cpp b/src/coremods/core_xline/cmd_zline.cpp index 1b736036f..a4bb979fb 100644 --- a/src/coremods/core_xline/cmd_zline.cpp +++ b/src/coremods/core_xline/cmd_zline.cpp @@ -52,7 +52,7 @@ CmdResult CommandZline::Handle(User* user, const Params& parameters) return CmdResult::FAILURE; } - auto u = ServerInstance->Users.Find(target, true); + auto* u = ServerInstance->Users.Find(target, true); if (u) { target = u->GetIPString(); @@ -78,7 +78,7 @@ CmdResult CommandZline::Handle(User* user, const Params& parameters) return CmdResult::FAILURE; } - auto zl = new ZLine(ServerInstance->Time(), duration, user->nick, parameters[2], ipaddr); + auto* zl = new ZLine(ServerInstance->Time(), duration, user->nick, parameters[2], ipaddr); if (ServerInstance->XLines->AddLine(zl, user)) { if (!duration) diff --git a/src/cull.cpp b/src/cull.cpp index 165fe94ce..c4bb4ab84 100644 --- a/src/cull.cpp +++ b/src/cull.cpp @@ -68,7 +68,7 @@ void CullList::Apply() while (!SQlist.empty()) { working.swap(SQlist); - for (const auto& u : working) + for (auto* u : working) { ServerInstance->SNO.WriteGlobalSno('a', "User %s SendQ exceeds connect class maximum of %lu", u->nick.c_str(), u->GetClass()->hardsendqmax); @@ -80,7 +80,7 @@ void CullList::Apply() std::set<Cullable*> gone; std::vector<Cullable*> queue; queue.reserve(list.size() + 32); - for (auto& c : list) + for (auto* c : list) { if (gone.insert(c).second) { @@ -106,7 +106,7 @@ void CullList::Apply() } list.clear(); - for (auto& c : queue) + for (auto* c : queue) delete c; if (!list.empty()) @@ -118,7 +118,7 @@ void CullList::Apply() void ActionList::Run() { - for (auto& action : list) + for (auto* action : list) action->Call(); list.clear(); } diff --git a/src/extensible.cpp b/src/extensible.cpp index cc9dd11bf..e3698eca6 100644 --- a/src/extensible.cpp +++ b/src/extensible.cpp @@ -79,7 +79,7 @@ void Extensible::FreeAllExtItems() void Extensible::UnhookExtensions(const std::vector<ExtensionItem*>& items) { - for (const auto& item : items) + for (auto* item : items) { ExtensibleStore::iterator iter = extensions.find(item); if (iter != extensions.end()) diff --git a/src/hashcomp.cpp b/src/hashcomp.cpp index c792f68df..592485124 100644 --- a/src/hashcomp.cpp +++ b/src/hashcomp.cpp @@ -162,7 +162,7 @@ size_t irc::insensitive::operator()(const std::string& s) const * This avoids a copy to use hash<const char*> */ size_t t = 0; - for (const auto& c : s) + for (const auto c : s) t = 5 * t + national_case_insensitive_map[static_cast<unsigned char>(c)]; return t; } diff --git a/src/helperfuncs.cpp b/src/helperfuncs.cpp index 7650e245f..da2a6362b 100644 --- a/src/helperfuncs.cpp +++ b/src/helperfuncs.cpp @@ -190,7 +190,7 @@ bool InspIRCd::DefaultIsIdent(const std::string_view& n) if (n.empty()) return false; - for (const auto& chr : n) + for (const auto chr : n) { if (chr >= 'A' && chr <= '}') continue; @@ -304,7 +304,7 @@ bool InspIRCd::Duration(const std::string& str, unsigned long& duration) unsigned long subtotal = 0; /* Iterate each item in the string, looking for number or multiplier */ - for (const auto& chr : str) + for (const auto chr : str) { /* Found a number, queue it onto the current number */ if (chr >= '0' && chr <= '9') @@ -341,7 +341,7 @@ unsigned long InspIRCd::Duration(const std::string& str) bool InspIRCd::IsValidDuration(const std::string& duration) { - for (const auto& c : duration) + for (const auto c : duration) { if (((c >= '0') && (c <= '9'))) continue; diff --git a/src/inspircd.cpp b/src/inspircd.cpp index 0dce19f6a..7774965fc 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -400,7 +400,7 @@ namespace void InspIRCd::Cleanup() { // Close all listening sockets - for (auto& port : ports) + for (auto* port : ports) { port->Cull(); delete port; diff --git a/src/logging.cpp b/src/logging.cpp index e89157309..37cb0c815 100644 --- a/src/logging.cpp +++ b/src/logging.cpp @@ -118,7 +118,7 @@ Log::MethodPtr Log::FileEngine::Create(const std::shared_ptr<ConfigTag>& tag) throw CoreException("<log:target> must be specified for file logger at " + tag->source.str()); const std::string fulltarget = ServerInstance->Config->Paths.PrependLog(InspIRCd::TimeString(ServerInstance->Time(), target.c_str())); - auto fh = fopen(fulltarget.c_str(), "a"); + auto* fh = fopen(fulltarget.c_str(), "a"); if (!fh) { throw CoreException(InspIRCd::Format("Unable to open %s for file logger at %s: %s", diff --git a/src/mode.cpp b/src/mode.cpp index d1cf12f48..f5b9f479d 100644 --- a/src/mode.cpp +++ b/src/mode.cpp @@ -340,7 +340,7 @@ void ModeParser::ModeParamsToChangeList(User* user, ModeType type, const std::ve bool adding = true; size_t param_at = beginindex+1; - for (const auto& modechar : parameters[beginindex]) + for (const auto modechar : parameters[beginindex]) { if (modechar == '+' || modechar == '-') { @@ -715,7 +715,7 @@ PrefixMode* ModeParser::FindPrefixMode(unsigned char modeletter) PrefixMode* ModeParser::FindNearestPrefixMode(ModeHandler::Rank rank) const { PrefixMode* pm = nullptr; - for (const auto& thispm : GetPrefixModes()) + for (auto* thispm : GetPrefixModes()) { if (thispm->GetPrefixRank() < rank) continue; // Not ranked high enough. @@ -730,7 +730,7 @@ PrefixMode* ModeParser::FindNearestPrefixMode(ModeHandler::Rank rank) const PrefixMode* ModeParser::FindPrefix(unsigned char pfxletter) const { - for (const auto& pm : GetPrefixModes()) + for (auto* pm : GetPrefixModes()) { if (pm->GetPrefix() == pfxletter) return pm; diff --git a/src/modulemanager.cpp b/src/modulemanager.cpp index 23c4d51d9..c9e60e5e8 100644 --- a/src/modulemanager.cpp +++ b/src/modulemanager.cpp @@ -59,7 +59,7 @@ bool ModuleManager::Load(const std::string& modname, bool defer) } Module* newmod = nullptr; - auto newhandle = new DLLManager(moduleFile); + auto* newhandle = new DLLManager(moduleFile); ServiceList newservices; if (!defer) this->NewServices = &newservices; diff --git a/src/modules.cpp b/src/modules.cpp index 39ae6f2e3..d6fff30c2 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -583,7 +583,7 @@ std::string& ModuleManager::LastError() void ModuleManager::AddServices(const ServiceList& list) { - for (const auto& service : list) + for (auto* service : list) AddService(*service); } diff --git a/src/modules/extra/m_geo_maxmind.cpp b/src/modules/extra/m_geo_maxmind.cpp index 03dcc852f..3cc6ac5f4 100644 --- a/src/modules/extra/m_geo_maxmind.cpp +++ b/src/modules/extra/m_geo_maxmind.cpp @@ -139,7 +139,7 @@ public: // Create a Location object and cache it. const std::string cname(country_name.utf8_string, country_name.data_size); - auto location = new Geolocation::Location(code, cname); + auto* location = new Geolocation::Location(code, cname); locations[code] = location; return location; } diff --git a/src/modules/extra/m_ldap.cpp b/src/modules/extra/m_ldap.cpp index 99ba8dcd7..08e5f44bd 100644 --- a/src/modules/extra/m_ldap.cpp +++ b/src/modules/extra/m_ldap.cpp @@ -273,7 +273,7 @@ public: for (unsigned int x = 0; x < attributes.size(); ++x) { const LDAPModification& l = attributes[x]; - auto mod = new LDAPMod(); + auto* mod = new LDAPMod(); mods[x] = mod; if (l.op == LDAPModification::LDAP_ADD) @@ -369,7 +369,7 @@ public: { this->LockQueue(); - for (auto& req : this->queries) + for (auto* req : this->queries) { /* queries have no results yet */ req->result = new LDAPResult(); @@ -381,7 +381,7 @@ public: } this->queries.clear(); - for (auto& req : this->results) + for (auto* req : this->results) { /* even though this may have already finished successfully we return that it didn't */ req->result->error = "LDAP Interface is going away"; @@ -522,7 +522,7 @@ private: return; } - for (auto& req : q) + for (auto* req : q) { int ret = req->run(); @@ -574,7 +574,7 @@ public: this->results.swap(r); this->UnlockQueue(); - for (auto& req : r) + for (auto* req : r) { LDAPInterface* li = req->inter; LDAPResult* res = req->result; @@ -615,7 +615,7 @@ public: ServiceMap::iterator curr = LDAPServices.find(id); if (curr == LDAPServices.end()) { - auto conn = new LDAPService(this, tag); + auto* conn = new LDAPService(this, tag); conns[id] = conn; ServerInstance->Modules.AddService(*conn); diff --git a/src/modules/extra/m_log_json.cpp b/src/modules/extra/m_log_json.cpp index 3408fc82f..15320607a 100644 --- a/src/modules/extra/m_log_json.cpp +++ b/src/modules/extra/m_log_json.cpp @@ -138,7 +138,7 @@ public: throw CoreException("<log:target> must be specified for JSON logger at " + tag->source.str()); const std::string fulltarget = ServerInstance->Config->Paths.PrependLog(InspIRCd::TimeString(ServerInstance->Time(), target.c_str())); - auto fh = fopen(fulltarget.c_str(), "a"); + auto* fh = fopen(fulltarget.c_str(), "a"); if (!fh) { throw CoreException(InspIRCd::Format("Unable to open %s for JSON logger at %s: %s", diff --git a/src/modules/extra/m_mysql.cpp b/src/modules/extra/m_mysql.cpp index 698a0aae8..cb24555f7 100644 --- a/src/modules/extra/m_mysql.cpp +++ b/src/modules/extra/m_mysql.cpp @@ -483,7 +483,7 @@ void ModuleSQL::ReadConfig(ConfigStatus& status) ConnMap::iterator curr = connections.find(id); if (curr == connections.end()) { - auto conn = new SQLConnection(this, tag); + auto* conn = new SQLConnection(this, tag); conns.emplace(id, conn); ServerInstance->Modules.AddService(*conn); } diff --git a/src/modules/extra/m_pgsql.cpp b/src/modules/extra/m_pgsql.cpp index d7cbf1308..50a9e428b 100644 --- a/src/modules/extra/m_pgsql.cpp +++ b/src/modules/extra/m_pgsql.cpp @@ -566,7 +566,7 @@ public: ConnMap::iterator curr = connections.find(id); if (curr == connections.end()) { - auto conn = new SQLConn(this, tag); + auto* conn = new SQLConn(this, tag); if (conn->status != DEAD) { conns.emplace(id, conn); diff --git a/src/modules/extra/m_sqlite3.cpp b/src/modules/extra/m_sqlite3.cpp index 132e0dc64..2e1f4ae74 100644 --- a/src/modules/extra/m_sqlite3.cpp +++ b/src/modules/extra/m_sqlite3.cpp @@ -264,7 +264,7 @@ public: if (!stdalgo::string::equalsci(tag->getString("module"), "sqlite")) continue; - auto conn = new SQLConn(this, tag); + auto* conn = new SQLConn(this, tag); conns.emplace(tag->getString("id"), conn); ServerInstance->Modules.AddService(*conn); } diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp index a0dc20561..175d6f92e 100644 --- a/src/modules/extra/m_ssl_gnutls.cpp +++ b/src/modules/extra/m_ssl_gnutls.cpp @@ -222,7 +222,7 @@ namespace GnuTLS ~X509CertList() { - for (const auto& cert : certs) + for (auto* cert : certs) gnutls_x509_crt_deinit(cert); } @@ -660,7 +660,7 @@ private: void VerifyCertificate() { - auto certinfo = new ssl_cert(); + auto* certinfo = new ssl_cert(); this->certificate = certinfo; unsigned int certstatus; diff --git a/src/modules/extra/m_ssl_openssl.cpp b/src/modules/extra/m_ssl_openssl.cpp index b03bf9f7f..df426850a 100644 --- a/src/modules/extra/m_ssl_openssl.cpp +++ b/src/modules/extra/m_ssl_openssl.cpp @@ -576,7 +576,7 @@ private: void VerifyCertificate() { X509* cert; - auto certinfo = new ssl_cert(); + auto* certinfo = new ssl_cert(); this->certificate = certinfo; unsigned int n; unsigned char md[EVP_MAX_MD_SIZE]; diff --git a/src/modules/m_alias.cpp b/src/modules/m_alias.cpp index ba088bb10..c16c613a5 100644 --- a/src/modules/m_alias.cpp +++ b/src/modules/m_alias.cpp @@ -283,7 +283,7 @@ public: if (!a.RequiredNick.empty()) { int numeric = a.ServiceOnly ? ERR_NOSUCHSERVICE : ERR_NOSUCHNICK; - auto u = ServerInstance->Users.FindNick(a.RequiredNick); + auto* u = ServerInstance->Users.FindNick(a.RequiredNick); if (!u) { user->WriteNumeric(numeric, a.RequiredNick, "is currently unavailable. Please try again later."); diff --git a/src/modules/m_anticaps.cpp b/src/modules/m_anticaps.cpp index d4dce8e16..b1bd477cf 100644 --- a/src/modules/m_anticaps.cpp +++ b/src/modules/m_anticaps.cpp @@ -196,11 +196,11 @@ public: const auto& tag = ServerInstance->Config->ConfValue("anticaps"); uppercase.reset(); - for (const auto& chr : tag->getString("uppercase", "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 1)) + for (const auto chr : tag->getString("uppercase", "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 1)) uppercase.set(static_cast<unsigned char>(chr)); lowercase.reset(); - for (const auto& chr : tag->getString("lowercase", "abcdefghijklmnopqrstuvwxyz", 1)) + for (const auto chr : tag->getString("lowercase", "abcdefghijklmnopqrstuvwxyz", 1)) lowercase.set(static_cast<unsigned char>(chr)); } @@ -251,7 +251,7 @@ public: // Count the characters to see how many upper case and // ignored (non upper or lower) characters there are. size_t upper = 0; - for (const auto& chr : msgbody) + for (const auto chr : msgbody) { if (uppercase.test(static_cast<unsigned char>(chr))) upper += 1; diff --git a/src/modules/m_banexception.cpp b/src/modules/m_banexception.cpp index b9bfab626..6bf6e1348 100644 --- a/src/modules/m_banexception.cpp +++ b/src/modules/m_banexception.cpp @@ -86,7 +86,7 @@ public: if (!list) return MOD_RES_PASSTHRU; - for (const ListModeBase::ListItem& ban : *list) + for (const auto& ban : *list) { bool inverted; std::string name; diff --git a/src/modules/m_banredirect.cpp b/src/modules/m_banredirect.cpp index 10e045899..a20fbe26f 100644 --- a/src/modules/m_banredirect.cpp +++ b/src/modules/m_banredirect.cpp @@ -168,7 +168,7 @@ public: return false; } - auto c = ServerInstance->Channels.Find(mask[CHAN]); + auto* c = ServerInstance->Channels.Find(mask[CHAN]); if (!c) { source->WriteNumeric(690, InspIRCd::Format("Target channel %s must exist to be set as a redirect.", mask[CHAN].c_str())); @@ -332,7 +332,7 @@ public: return MOD_RES_DENY; /* tell them they're banned and are being transferred */ - auto destchan = ServerInstance->Channels.Find(redirect.targetchan); + auto* destchan = ServerInstance->Channels.Find(redirect.targetchan); std::string destlimit; if (destchan) diff --git a/src/modules/m_blockcolor.cpp b/src/modules/m_blockcolor.cpp index d14568ccb..d04e87902 100644 --- a/src/modules/m_blockcolor.cpp +++ b/src/modules/m_blockcolor.cpp @@ -67,7 +67,7 @@ public: if (!details.IsCTCP(ctcpname, message)) message = details.text; - for (const auto& chr : message) + for (const auto chr : message) { if (static_cast<unsigned char>(chr) < 32) { diff --git a/src/modules/m_callerid.cpp b/src/modules/m_callerid.cpp index 8ee4d8d2f..4b392ae93 100644 --- a/src/modules/m_callerid.cpp +++ b/src/modules/m_callerid.cpp @@ -63,7 +63,7 @@ public: { std::ostringstream oss; oss << lastnotify; - for (const auto& u : accepting) + for (const auto* u : accepting) { if (human) oss << ' ' << u->nick; @@ -102,7 +102,7 @@ struct CallerIDExtInfo final void* old = GetRaw(container); if (old) this->Delete(nullptr, old); - auto dat = new callerid_data(); + auto* dat = new callerid_data(); SetRaw(container, dat); irc::commasepstream s(value); @@ -112,7 +112,7 @@ struct CallerIDExtInfo final while (s.GetToken(tok)) { - auto u = ServerInstance->Users.Find(tok, true); + auto* u = ServerInstance->Users.Find(tok, true); if (u && !u->quitting) { if (dat->accepting.insert(u).second) @@ -140,7 +140,7 @@ struct CallerIDExtInfo final callerid_data* dat = static_cast<callerid_data*>(item); // We need to walk the list of users on our accept list, and remove ourselves from their wholistsme. - for (const auto& user : dat->accepting) + for (auto* user : dat->accepting) { callerid_data* target = this->Get(user, false); if (!target) @@ -272,7 +272,7 @@ public: callerid_data* dat = extInfo.Get(user, false); if (dat) { - for (const auto& accepted : dat->accepting) + for (const auto* accepted : dat->accepting) user->WriteNumeric(RPL_ACCEPTLIST, accepted->nick); } user->WriteNumeric(RPL_ENDOFACCEPT, "End of ACCEPT list"); @@ -378,7 +378,7 @@ private: return; // Iterate over the list of people who accept me, and remove all entries - for (const auto& dat : userdata->wholistsme) + for (auto* dat : userdata->wholistsme) { // Find me on their callerid list if (!dat->accepting.erase(who)) diff --git a/src/modules/m_cap.cpp b/src/modules/m_cap.cpp index 8df16e34f..25b09b4b5 100644 --- a/src/modules/m_cap.cpp +++ b/src/modules/m_cap.cpp @@ -92,7 +92,7 @@ class Cap::ManagerImpl final if (mod == creator) return; - auto capmoddata = new CapModData(); + auto* capmoddata = new CapModData(); cd.add(this, capmoddata); for (const auto& [_, cap] : caps) @@ -129,7 +129,7 @@ class Cap::ManagerImpl final // Set back the cap for all users who were using it before the reload for (const auto& uuid : capdata.users) { - auto user = ServerInstance->Users.FindUUID(uuid); + auto* user = ServerInstance->Users.FindUUID(uuid); if (!user) { ServerInstance->Logs.Debug(MODNAME, "User %s is gone when trying to restore cap %s", uuid.c_str(), capdata.name.c_str()); diff --git a/src/modules/m_cban.cpp b/src/modules/m_cban.cpp index 7d1e00d3e..4ee4ff48b 100644 --- a/src/modules/m_cban.cpp +++ b/src/modules/m_cban.cpp @@ -132,7 +132,7 @@ public: } const char* reason = (parameters.size() > 2) ? parameters[2].c_str() : "No reason supplied"; - auto r = new CBan(ServerInstance->Time(), duration, user->nick, reason, parameters[0]); + auto* r = new CBan(ServerInstance->Time(), duration, user->nick, reason, parameters[0]); if (ServerInstance->XLines->AddLine(r, user)) { if (!duration) diff --git a/src/modules/m_chanhistory.cpp b/src/modules/m_chanhistory.cpp index 9907a555b..9e058c629 100644 --- a/src/modules/m_chanhistory.cpp +++ b/src/modules/m_chanhistory.cpp @@ -157,7 +157,7 @@ private: void AddTag(ClientProtocol::Message& msg, const std::string& tagkey, std::string& tagval) { - for (const auto& subscriber : tagevent.GetSubscribers()) + for (auto* subscriber : tagevent.GetSubscribers()) { ClientProtocol::MessageTagProvider* const tagprov = static_cast<ClientProtocol::MessageTagProvider*>(subscriber); const ModResult res = tagprov->OnProcessTag(ServerInstance->FakeClient, tagkey, tagval); diff --git a/src/modules/m_chanlog.cpp b/src/modules/m_chanlog.cpp index 0d7c38960..46cf98205 100644 --- a/src/modules/m_chanlog.cpp +++ b/src/modules/m_chanlog.cpp @@ -54,7 +54,7 @@ public: if (snomasks.empty()) throw ModuleException(this, "<chanlog:snomasks> must not be empty, at " + tag->source.str()); - for (const auto& snomask : snomasks) + for (const auto snomask : snomasks) { newlogs.emplace(snomask, channel); ServerInstance->Logs.Normal(MODNAME, "Logging %c to %s", snomask, channel.c_str()); @@ -72,7 +72,7 @@ public: const std::string snotice = "\002" + desc + "\002: " + msg; for (const auto& [_, channel] : channels) { - auto c = ServerInstance->Channels.Find(channel); + auto* c = ServerInstance->Channels.Find(channel); if (c) { ClientProtocol::Messages::Privmsg privmsg(ClientProtocol::Messages::Privmsg::nocopy, ServerInstance->Config->ServerName, c, snotice); diff --git a/src/modules/m_channames.cpp b/src/modules/m_channames.cpp index dacde702e..debd22489 100644 --- a/src/modules/m_channames.cpp +++ b/src/modules/m_channames.cpp @@ -36,7 +36,7 @@ bool NewIsChannelHandler::Call(const std::string_view& channame) if (channame.empty() || channame.length() > ServerInstance->Config->Limits.MaxChannel || !ServerInstance->Channels.IsPrefix(channame[0])) return false; - for (const auto& chr : channame) + for (const auto chr : channame) { if (!allowedmap[static_cast<unsigned char>(chr)]) return false; diff --git a/src/modules/m_check.cpp b/src/modules/m_check.cpp index 5988b353d..bc7f1c253 100644 --- a/src/modules/m_check.cpp +++ b/src/modules/m_check.cpp @@ -149,8 +149,8 @@ public: if (parameters.size() > 1 && !irc::equals(parameters[1], ServerInstance->Config->ServerName)) return CmdResult::SUCCESS; - auto targetuser = ServerInstance->Users.FindNick(parameters[0]); - auto targetchan = ServerInstance->Channels.Find(parameters[0]); + auto* targetuser = ServerInstance->Users.FindNick(parameters[0]); + auto* targetchan = ServerInstance->Channels.Find(parameters[0]); /* * Syntax of a /check reply: @@ -248,7 +248,7 @@ public: u->GetRealName().c_str())); } - for (const auto& lm : ServerInstance->Modes.GetListModes()) + for (auto* lm : ServerInstance->Modes.GetListModes()) context.DumpListMode(lm, targetchan); context.DumpExt(targetchan); diff --git a/src/modules/m_chghost.cpp b/src/modules/m_chghost.cpp index fb4d6ade0..b2a8b8b59 100644 --- a/src/modules/m_chghost.cpp +++ b/src/modules/m_chghost.cpp @@ -48,7 +48,7 @@ public: return CmdResult::FAILURE; } - for (const auto& chr : parameters[1]) + for (const auto chr : parameters[1]) { if (!hostmap.test(static_cast<unsigned char>(chr))) { @@ -57,7 +57,7 @@ public: } } - auto dest = ServerInstance->Users.Find(parameters[0]); + auto* dest = ServerInstance->Users.Find(parameters[0]); // Allow services to change the host of partially connected users. if (!dest || (!dest->IsFullyConnected() && !user->server->IsService())) @@ -102,7 +102,7 @@ public: const std::string hmap = tag->getString("charmap", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.-_/0123456789", 1); CharState newhostmap; - for (const auto& chr : hmap) + for (const auto chr : hmap) { // A hostname can not contain NUL, LF, CR, or SPACE. if (chr == 0x00 || chr == 0x0A || chr == 0x0D || chr == 0x20) diff --git a/src/modules/m_chgident.cpp b/src/modules/m_chgident.cpp index 6f8d16f2f..dd1b8bcaf 100644 --- a/src/modules/m_chgident.cpp +++ b/src/modules/m_chgident.cpp @@ -42,7 +42,7 @@ public: CmdResult Handle(User* user, const Params& parameters) override { - auto dest = ServerInstance->Users.Find(parameters[0], true); + auto* dest = ServerInstance->Users.Find(parameters[0], true); if (!dest) { user->WriteNumeric(Numerics::NoSuchNick(parameters[0])); diff --git a/src/modules/m_chgname.cpp b/src/modules/m_chgname.cpp index 2a42ab16f..0c45b5202 100644 --- a/src/modules/m_chgname.cpp +++ b/src/modules/m_chgname.cpp @@ -40,7 +40,7 @@ public: CmdResult Handle(User* user, const Params& parameters) override { - auto dest = ServerInstance->Users.Find(parameters[0], true); + auto* dest = ServerInstance->Users.Find(parameters[0], true); if (!dest) { user->WriteNumeric(Numerics::NoSuchNick(parameters[0])); diff --git a/src/modules/m_connectban.cpp b/src/modules/m_connectban.cpp index bde29a9ba..a3b72061b 100644 --- a/src/modules/m_connectban.cpp +++ b/src/modules/m_connectban.cpp @@ -146,7 +146,7 @@ public: if (i->second >= threshold) { // Create Z-line for set duration. - auto zl = new ZLine(ServerInstance->Time(), banduration, MODNAME "@" + ServerInstance->Config->ServerName, banmessage, mask.str()); + auto* zl = new ZLine(ServerInstance->Time(), banduration, MODNAME "@" + ServerInstance->Config->ServerName, banmessage, mask.str()); if (!ServerInstance->XLines->AddLine(zl, nullptr)) { delete zl; diff --git a/src/modules/m_customprefix.cpp b/src/modules/m_customprefix.cpp index 45a518245..34241d6bd 100644 --- a/src/modules/m_customprefix.cpp +++ b/src/modules/m_customprefix.cpp @@ -99,7 +99,7 @@ public: try { - auto mh = new CustomPrefixMode(this, name, letter[0], prefix[0], tag); + auto* mh = new CustomPrefixMode(this, name, letter[0], prefix[0], tag); modes.push_back(mh); ServerInstance->Modules.AddService(*mh); } diff --git a/src/modules/m_cycle.cpp b/src/modules/m_cycle.cpp index 64f80abc4..57fc5e141 100644 --- a/src/modules/m_cycle.cpp +++ b/src/modules/m_cycle.cpp @@ -42,7 +42,7 @@ public: CmdResult HandleLocal(LocalUser* user, const Params& parameters) override { - auto channel = ServerInstance->Channels.Find(parameters[0]); + auto* channel = ServerInstance->Channels.Find(parameters[0]); std::string reason = "Cycling"; if (parameters.size() > 1) diff --git a/src/modules/m_dccallow.cpp b/src/modules/m_dccallow.cpp index a50ab5722..0b315652b 100644 --- a/src/modules/m_dccallow.cpp +++ b/src/modules/m_dccallow.cpp @@ -129,7 +129,7 @@ public: // Remove the old list and create a new one. Unset(user, false); - auto list = new dccallowlist(); + auto* list = new dccallowlist(); irc::spacesepstream ts(value); while (!ts.StreamEnd()) @@ -235,7 +235,7 @@ public: } std::string nick(parameters[0], 1); - auto target = ServerInstance->Users.FindNick(nick, true); + auto* target = ServerInstance->Users.FindNick(nick, true); if (target && !target->quitting) { if (action == '-') @@ -478,7 +478,7 @@ public: std::string filename = buf.substr(first, s); bool found = false; - for (auto& bf : bfl) + for (const auto& bf : bfl) { if (InspIRCd::Match(filename, bf.filemask, ascii_case_insensitive_map)) { diff --git a/src/modules/m_disable.cpp b/src/modules/m_disable.cpp index 9f0c0dfa2..a264642ec 100644 --- a/src/modules/m_disable.cpp +++ b/src/modules/m_disable.cpp @@ -44,7 +44,7 @@ private: void ReadModes(const std::shared_ptr<ConfigTag>& tag, const std::string& field, ModeType type, ModeParser::ModeStatus& status) { - for (const auto& chr : tag->getString(field)) + for (const auto chr : tag->getString(field)) { // Check that the character is a valid mode letter. if (!ModeParser::IsModeChar(chr)) diff --git a/src/modules/m_dnsbl.cpp b/src/modules/m_dnsbl.cpp index 600d21572..71023da37 100644 --- a/src/modules/m_dnsbl.cpp +++ b/src/modules/m_dnsbl.cpp @@ -467,7 +467,7 @@ public: const unsigned char* ip = user->client_sa.in6.sin6_addr.s6_addr; const std::string buf = Hex::Encode(ip, 16); - for (const auto& chr : insp::reverse_range(buf)) + for (const auto chr : insp::reverse_range(buf)) { reversedip.push_back(chr); reversedip.push_back('.'); @@ -488,7 +488,7 @@ public: std::string hostname = reversedip + "." + dnsbl->domain; /* now we'd need to fire off lookups for `hostname'. */ - auto r = new DNSBLResolver(this, data, hostname, user, dnsbl); + auto* r = new DNSBLResolver(this, data, hostname, user, dnsbl); try { data.dns->Process(r); diff --git a/src/modules/m_filter.cpp b/src/modules/m_filter.cpp index a48db0fa5..30fd88622 100644 --- a/src/modules/m_filter.cpp +++ b/src/modules/m_filter.cpp @@ -101,7 +101,7 @@ public: flag_no_opers = flag_part_message = flag_quit_message = flag_privmsg = flag_notice = flag_strip_color = flag_no_registered = false; - for (const auto& flag : flags) + for (const auto flag : flags) { switch (flag) { @@ -465,7 +465,7 @@ ModResult ModuleFilter::OnUserPreMessage(User* user, const MessageTarget& msgtar } else if (f->action == FA_SHUN && (ServerInstance->XLines->GetFactory("SHUN"))) { - auto sh = new Shun(ServerInstance->Time(), f->duration, ServerInstance->Config->ServerName, f->reason, user->GetIPString()); + auto* sh = new Shun(ServerInstance->Time(), f->duration, ServerInstance->Config->ServerName, f->reason, user->GetIPString()); ServerInstance->SNO.WriteGlobalSno('f', InspIRCd::Format("%s (%s) was shunned for %s (expires on %s) because their message to %s matched %s (%s)", user->nick.c_str(), sh->Displayable().c_str(), InspIRCd::DurationString(f->duration).c_str(), InspIRCd::TimeString(ServerInstance->Time() + f->duration).c_str(), @@ -479,7 +479,7 @@ ModResult ModuleFilter::OnUserPreMessage(User* user, const MessageTarget& msgtar } else if (f->action == FA_GLINE) { - auto gl = new GLine(ServerInstance->Time(), f->duration, ServerInstance->Config->ServerName, f->reason, "*", user->GetIPString()); + auto* gl = new GLine(ServerInstance->Time(), f->duration, ServerInstance->Config->ServerName, f->reason, "*", user->GetIPString()); ServerInstance->SNO.WriteGlobalSno('f', InspIRCd::Format("%s (%s) was G-lined for %s (expires on %s) because their message to %s matched %s (%s)", user->nick.c_str(), gl->Displayable().c_str(), InspIRCd::DurationString(f->duration).c_str(), InspIRCd::TimeString(ServerInstance->Time() + f->duration).c_str(), @@ -493,7 +493,7 @@ ModResult ModuleFilter::OnUserPreMessage(User* user, const MessageTarget& msgtar } else if (f->action == FA_ZLINE) { - auto zl = new ZLine(ServerInstance->Time(), f->duration, ServerInstance->Config->ServerName, f->reason, user->GetIPString()); + auto* zl = new ZLine(ServerInstance->Time(), f->duration, ServerInstance->Config->ServerName, f->reason, user->GetIPString()); ServerInstance->SNO.WriteGlobalSno('f', InspIRCd::Format("%s (%s) was Z-lined for %s (expires on %s) because their message to %s matched %s (%s)", user->nick.c_str(), zl->Displayable().c_str(), InspIRCd::DurationString(f->duration).c_str(), InspIRCd::TimeString(ServerInstance->Time() + f->duration).c_str(), @@ -570,7 +570,7 @@ ModResult ModuleFilter::OnPreCommand(std::string& command, CommandBase::Params& if (f->action == FA_GLINE) { /* Note: We G-line *@IP so that if their host doesn't resolve the G-line still applies. */ - auto gl = new GLine(ServerInstance->Time(), f->duration, ServerInstance->Config->ServerName, f->reason, "*", user->GetIPString()); + auto* gl = new GLine(ServerInstance->Time(), f->duration, ServerInstance->Config->ServerName, f->reason, "*", user->GetIPString()); ServerInstance->SNO.WriteGlobalSno('f', InspIRCd::Format("%s (%s) was G-lined for %s (expires on %s) because their %s message matched %s (%s)", user->nick.c_str(), gl->Displayable().c_str(), InspIRCd::DurationString(f->duration).c_str(), @@ -586,7 +586,7 @@ ModResult ModuleFilter::OnPreCommand(std::string& command, CommandBase::Params& } if (f->action == FA_ZLINE) { - auto zl = new ZLine(ServerInstance->Time(), f->duration, ServerInstance->Config->ServerName, f->reason, user->GetIPString()); + auto* zl = new ZLine(ServerInstance->Time(), f->duration, ServerInstance->Config->ServerName, f->reason, user->GetIPString()); ServerInstance->SNO.WriteGlobalSno('f', InspIRCd::Format("%s (%s) was Z-lined for %s (expires on %s) because their %s message matched %s (%s)", user->nick.c_str(), zl->Displayable().c_str(), InspIRCd::DurationString(f->duration).c_str(), @@ -603,7 +603,7 @@ ModResult ModuleFilter::OnPreCommand(std::string& command, CommandBase::Params& else if (f->action == FA_SHUN && (ServerInstance->XLines->GetFactory("SHUN"))) { /* Note: We shun *!*@IP so that if their host doesnt resolve the shun still applies. */ - auto sh = new Shun(ServerInstance->Time(), f->duration, ServerInstance->Config->ServerName, f->reason, user->GetIPString()); + auto* sh = new Shun(ServerInstance->Time(), f->duration, ServerInstance->Config->ServerName, f->reason, user->GetIPString()); ServerInstance->SNO.WriteGlobalSno('f', InspIRCd::Format("%s (%s) was shunned for %s (expires on %s) because their %s message matched %s (%s)", user->nick.c_str(), sh->Displayable().c_str(), InspIRCd::DurationString(f->duration).c_str(), diff --git a/src/modules/m_haproxy.cpp b/src/modules/m_haproxy.cpp index 70866ac3b..c9b6187d9 100644 --- a/src/modules/m_haproxy.cpp +++ b/src/modules/m_haproxy.cpp @@ -210,7 +210,7 @@ private: // Create a fake ssl_cert for the user. Ideally we should use the user's // TLS client certificate here but as of 2018-10-16 this is not forwarded // by HAProxy. - auto cert = new ssl_cert(); + auto* cert = new ssl_cert(); cert->error = "HAProxy does not forward client TLS certificates"; cert->invalid = true; cert->revoked = true; diff --git a/src/modules/m_hideoper.cpp b/src/modules/m_hideoper.cpp index 63a3796fb..884e1c2b4 100644 --- a/src/modules/m_hideoper.cpp +++ b/src/modules/m_hideoper.cpp @@ -149,7 +149,7 @@ public: size_t opers = 0; bool source_has_priv = stats.GetSource()->HasPrivPermission("users/auspex"); - for (const auto& oper : ServerInstance->Users.all_opers) + for (auto* oper : ServerInstance->Users.all_opers) { if (oper->server->IsService() || (oper->IsModeSet(hm) && !source_has_priv)) continue; @@ -164,7 +164,7 @@ public: awaytime.c_str(), oper->awaymsg.c_str()); } - auto loper = IS_LOCAL(oper); + auto* loper = IS_LOCAL(oper); if (loper) { const std::string idleperiod = InspIRCd::DurationString(ServerInstance->Time() - loper->idle_lastmsg); diff --git a/src/modules/m_hostchange.cpp b/src/modules/m_hostchange.cpp index 4f656f04a..0c6ee7744 100644 --- a/src/modules/m_hostchange.cpp +++ b/src/modules/m_hostchange.cpp @@ -137,7 +137,7 @@ private: { std::string buffer; buffer.reserve(name.length()); - for (const auto& chr : name) + for (const auto chr : name) { if (hostmap.test(static_cast<unsigned char>(chr))) buffer.push_back(chr); @@ -196,7 +196,7 @@ public: const std::string hmap = tag->getString("charmap", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.-_/0123456789", 1); CharState newhostmap; - for (const auto& chr : hmap) + for (const auto chr : hmap) { // A hostname can not contain NUL, LF, CR, or SPACE. if (chr == 0x00 || chr == 0x0A || chr == 0x0D || chr == 0x20) diff --git a/src/modules/m_httpd_stats.cpp b/src/modules/m_httpd_stats.cpp index 1cf537510..0be3f09d4 100644 --- a/src/modules/m_httpd_stats.cpp +++ b/src/modules/m_httpd_stats.cpp @@ -53,7 +53,7 @@ namespace Stats std::string ret; ret.reserve(str.length() * 2); - for (const auto& chr : str) + for (const auto chr : str) { insp::flat_map<char, char const*>::const_iterator it = xmlentities.find(chr); if (it != xmlentities.end()) diff --git a/src/modules/m_ident.cpp b/src/modules/m_ident.cpp index 178c611b5..a3b77010b 100644 --- a/src/modules/m_ident.cpp +++ b/src/modules/m_ident.cpp @@ -236,7 +236,7 @@ public: std::string::size_type lastcolon = buf.rfind(':'); /* Truncate the ident at any characters we don't like, skip leading spaces */ - for (const auto& chr : insp::iterator_range(buf.begin() + lastcolon + 1, buf.end())) + for (const auto chr : insp::iterator_range(buf.begin() + lastcolon + 1, buf.end())) { if (result.size() == ServerInstance->Config->Limits.MaxUser) /* Ident is getting too long */ diff --git a/src/modules/m_ircv3_ctctags.cpp b/src/modules/m_ircv3_ctctags.cpp index ea9f9a389..0e808d2c8 100644 --- a/src/modules/m_ircv3_ctctags.cpp +++ b/src/modules/m_ircv3_ctctags.cpp @@ -69,7 +69,7 @@ private: CmdResult HandleChannelTarget(User* source, const Params& parameters, const char* target, PrefixMode* pm) { - auto chan = ServerInstance->Channels.Find(target); + auto* chan = ServerInstance->Channels.Find(target); if (!chan) { // The target channel does not exist. diff --git a/src/modules/m_ircv3_sts.cpp b/src/modules/m_ircv3_sts.cpp index ad4d17804..76e4a8647 100644 --- a/src/modules/m_ircv3_sts.cpp +++ b/src/modules/m_ircv3_sts.cpp @@ -142,7 +142,7 @@ private: // The IRCv3 STS specification requires that the server is listening using TLS using a valid certificate. static bool HasValidSSLPort(in_port_t port) { - for (const auto& ls : ServerInstance->ports) + for (const auto* ls : ServerInstance->ports) { // Is this listener marked as providing SSL over HAProxy? if (!ls->bind_tag->getString("hook").empty() && ls->bind_tag->getBool("sslhook")) diff --git a/src/modules/m_knock.cpp b/src/modules/m_knock.cpp index 09ce41824..a901b7721 100644 --- a/src/modules/m_knock.cpp +++ b/src/modules/m_knock.cpp @@ -80,7 +80,7 @@ public: CmdResult Handle(User* user, const Params& parameters) override { - auto c = ServerInstance->Channels.Find(parameters[0]); + auto* c = ServerInstance->Channels.Find(parameters[0]); if (!c) { user->WriteNumeric(Numerics::NoSuchChannel(parameters[0])); diff --git a/src/modules/m_ldapauth.cpp b/src/modules/m_ldapauth.cpp index 263edc2bf..792925c89 100644 --- a/src/modules/m_ldapauth.cpp +++ b/src/modules/m_ldapauth.cpp @@ -111,7 +111,7 @@ public: void OnResult(const LDAPResult& r) override { - auto user = ServerInstance->Users.FindUUID(uid); + auto* user = ServerInstance->Users.FindUUID(uid); dynamic_reference<LDAPProvider> LDAP(me, provider); if (!user || !LDAP) @@ -196,7 +196,7 @@ public: return; } - auto user = ServerInstance->Users.FindUUID(uid); + auto* user = ServerInstance->Users.FindUUID(uid); if (user) { if (verbose) @@ -257,7 +257,7 @@ public: void OnError(const LDAPResult& err) override { ServerInstance->SNO.WriteToSnoMask('a', "Error searching LDAP server: %s", err.getError().c_str()); - auto user = ServerInstance->Users.FindUUID(uid); + auto* user = ServerInstance->Users.FindUUID(uid); if (user) ServerInstance->Users.QuitUser(user, killreason); delete this; diff --git a/src/modules/m_ldapoper.cpp b/src/modules/m_ldapoper.cpp index ce2549387..8b60bba00 100644 --- a/src/modules/m_ldapoper.cpp +++ b/src/modules/m_ldapoper.cpp @@ -54,7 +54,7 @@ protected: void Fallback() { - auto user = ServerInstance->Users.FindUUID(uid); + auto* user = ServerInstance->Users.FindUUID(uid); Fallback(user); } @@ -86,7 +86,7 @@ public: void OnResult(const LDAPResult& r) override { - auto user = ServerInstance->Users.FindUUID(uid); + auto* user = ServerInstance->Users.FindUUID(uid); auto iter = ServerInstance->Config->OperAccounts.find(opername); if (!user || iter == ServerInstance->Config->OperAccounts.end()) diff --git a/src/modules/m_monitor.cpp b/src/modules/m_monitor.cpp index d9baff359..e5cbedc29 100644 --- a/src/modules/m_monitor.cpp +++ b/src/modules/m_monitor.cpp @@ -91,7 +91,7 @@ class IRCv3::Monitor::Manager final { std::string ret; const ExtData* extdata = static_cast<ExtData*>(item); - for (const auto& entry : extdata->list) + for (const auto* entry : extdata->list) ret.append(entry->GetNick()).push_back(' '); if (!ret.empty()) ret.pop_back(); @@ -331,7 +331,7 @@ public: user->CommandFloodPenalty += ListPenalty; const IRCv3::Monitor::WatchedList& list = manager.GetWatched(user); ReplyBuilder out(user, RPL_MONLIST); - for (const auto& entry : list) + for (const auto* entry : list) out.Add(entry->GetNick()); out.Flush(); user->WriteNumeric(RPL_ENDOFMONLIST, "End of MONITOR list"); @@ -343,7 +343,7 @@ public: ReplyBuilder online(user, RPL_MONONLINE); ReplyBuilder offline(user, RPL_MONOFFLINE); - for (const auto& entry : manager.GetWatched(user)) + for (const auto* entry : manager.GetWatched(user)) { ReplyBuilder& out = (ServerInstance->Users.FindNick(entry->GetNick(), true) ? online : offline); out.Add(entry->GetNick()); diff --git a/src/modules/m_namesx.cpp b/src/modules/m_namesx.cpp index 7e5c2fe80..8d19d38cb 100644 --- a/src/modules/m_namesx.cpp +++ b/src/modules/m_namesx.cpp @@ -98,7 +98,7 @@ public: continue; } - auto chan = ServerInstance->Channels.Find(channel.substr(hashpos)); + auto* chan = ServerInstance->Channels.Find(channel.substr(hashpos)); if (!chan) { // Should never happen. diff --git a/src/modules/m_nicklock.cpp b/src/modules/m_nicklock.cpp index 96ccee94a..d73801031 100644 --- a/src/modules/m_nicklock.cpp +++ b/src/modules/m_nicklock.cpp @@ -50,7 +50,7 @@ public: CmdResult Handle(User* user, const Params& parameters) override { - auto target = ServerInstance->Users.Find(parameters[0], true); + auto* target = ServerInstance->Users.Find(parameters[0], true); if (!target) { user->WriteNotice("*** No such nickname: '" + parameters[0] + "'"); @@ -109,7 +109,7 @@ public: CmdResult Handle(User* user, const Params& parameters) override { - auto target = ServerInstance->Users.Find(parameters[0]); + auto* target = ServerInstance->Users.Find(parameters[0]); if (!target) { diff --git a/src/modules/m_ojoin.cpp b/src/modules/m_ojoin.cpp index 57ec803a2..f12dd8b5e 100644 --- a/src/modules/m_ojoin.cpp +++ b/src/modules/m_ojoin.cpp @@ -96,7 +96,7 @@ public: ModResult AccessCheck(User* source, Channel* channel, Modes::Change& change) override { - auto theuser = ServerInstance->Users.Find(change.param); + auto* theuser = ServerInstance->Users.Find(change.param); // remove own privs? if (source == theuser && !change.adding) return MOD_RES_ALLOW; diff --git a/src/modules/m_passforward.cpp b/src/modules/m_passforward.cpp index 68ddd0784..14c0aaae8 100644 --- a/src/modules/m_passforward.cpp +++ b/src/modules/m_passforward.cpp @@ -88,7 +88,7 @@ public: if (!nickrequired.empty()) { /* Check if nick exists and is on a services server. */ - auto u = ServerInstance->Users.Find(nickrequired); + auto* u = ServerInstance->Users.Find(nickrequired); if (!u || !u->server->IsService()) return; } diff --git a/src/modules/m_pbkdf2.cpp b/src/modules/m_pbkdf2.cpp index 0f454cdd0..c0063671b 100644 --- a/src/modules/m_pbkdf2.cpp +++ b/src/modules/m_pbkdf2.cpp @@ -172,7 +172,7 @@ class ModulePBKDF2 final void ConfigureProviders() { - for (const auto& pi : providers) + for (auto* pi : providers) { ProviderConfig config = GetConfigForProvider(pi->name); pi->iterations = config.iterations; @@ -233,7 +233,7 @@ public: if (hp->IsKDF()) return; - auto prov = new PBKDF2Provider(this, hp); + auto* prov = new PBKDF2Provider(this, hp); providers.push_back(prov); ServerInstance->Modules.AddService(*prov); diff --git a/src/modules/m_permchannels.cpp b/src/modules/m_permchannels.cpp index d11e0a6e3..4482795e3 100644 --- a/src/modules/m_permchannels.cpp +++ b/src/modules/m_permchannels.cpp @@ -98,7 +98,7 @@ static bool WriteDatabase(PermChannel& permchanmode, bool save_listmodes) std::string modes; std::string params; - for (const auto& lm : ServerInstance->Modes.GetListModes()) + for (auto* lm : ServerInstance->Modes.GetListModes()) { ListModeBase::ModeList* list = lm->GetList(chan); if (!list || list->empty()) @@ -215,7 +215,7 @@ public: continue; } - auto c = ServerInstance->Channels.Find(channel); + auto* c = ServerInstance->Channels.Find(channel); if (!c) { time_t TS = tag->getInt("ts", ServerInstance->Time(), 1); @@ -247,7 +247,7 @@ public: list.GetToken(modeseq); // XXX bleh, should we pass this to the mode parser instead? ugly. --w00t - for (const auto& modechr : modeseq) + for (const auto modechr : modeseq) { ModeHandler* mode = ServerInstance->Modes.FindMode(modechr, MODETYPE_CHANNEL); if (mode) diff --git a/src/modules/m_redirect.cpp b/src/modules/m_redirect.cpp index 94c723872..8f89836c6 100644 --- a/src/modules/m_redirect.cpp +++ b/src/modules/m_redirect.cpp @@ -54,7 +54,7 @@ public: if (IS_LOCAL(source) && !source->IsOper()) { - auto c = ServerInstance->Channels.Find(parameter); + auto* c = ServerInstance->Channels.Find(parameter); if (!c) { source->WriteNumeric(690, InspIRCd::Format("Target channel %s must exist to be set as a redirect.", parameter.c_str())); @@ -109,7 +109,7 @@ public: const std::string& channel = *re.ext.Get(chan); /* sometimes broken services can make circular or chained +L, avoid this */ - auto destchan = ServerInstance->Channels.Find(channel); + auto* destchan = ServerInstance->Channels.Find(channel); if (destchan && destchan->IsModeSet(re)) { user->WriteNumeric(470, cname, '*', "You may not join this channel. A redirect is set, but you may not be redirected as it is a circular loop."); diff --git a/src/modules/m_remove.cpp b/src/modules/m_remove.cpp index 2e5151848..482477eb7 100644 --- a/src/modules/m_remove.cpp +++ b/src/modules/m_remove.cpp @@ -67,7 +67,7 @@ public: target = ServerInstance->Users.Find(username, true); /* And the channel we're meant to be removing them from */ - auto channel = ServerInstance->Channels.Find(channame); + auto* channel = ServerInstance->Channels.Find(channame); /* Fix by brain - someone needs to learn to validate their input! */ if (!channel) diff --git a/src/modules/m_rline.cpp b/src/modules/m_rline.cpp index fdb57a256..afa901832 100644 --- a/src/modules/m_rline.cpp +++ b/src/modules/m_rline.cpp @@ -67,7 +67,7 @@ public: { if (ZlineOnMatch) { - auto zl = new ZLine(ServerInstance->Time(), duration ? expiry - ServerInstance->Time() : 0, MODNAME "@" + ServerInstance->Config->ServerName, reason, u->GetIPString()); + auto* zl = new ZLine(ServerInstance->Time(), duration ? expiry - ServerInstance->Time() : 0, MODNAME "@" + ServerInstance->Config->ServerName, reason, u->GetIPString()); if (ServerInstance->XLines->AddLine(zl, nullptr)) { if (!duration) diff --git a/src/modules/m_rmode.cpp b/src/modules/m_rmode.cpp index 628715668..dc1546ccc 100644 --- a/src/modules/m_rmode.cpp +++ b/src/modules/m_rmode.cpp @@ -36,7 +36,7 @@ public: CmdResult Handle(User* user, const Params& parameters) override { - auto chan = ServerInstance->Channels.Find(parameters[0]); + auto* chan = ServerInstance->Channels.Find(parameters[0]); if (!chan) { user->WriteNumeric(Numerics::NoSuchChannel(parameters[0])); diff --git a/src/modules/m_sajoin.cpp b/src/modules/m_sajoin.cpp index a094b220e..100cf7186 100644 --- a/src/modules/m_sajoin.cpp +++ b/src/modules/m_sajoin.cpp @@ -52,7 +52,7 @@ public: const std::string& channel = parameters[channelindex]; const std::string& nickname = parameters.size() > 1 ? parameters[0] : user->nick; - auto dest = ServerInstance->Users.Find(nickname, true); + auto* dest = ServerInstance->Users.Find(nickname, true); if (dest) { if (user != dest && !user->HasPrivPermission("users/sajoin-others")) @@ -73,7 +73,7 @@ public: return CmdResult::FAILURE; } - auto chan = ServerInstance->Channels.Find(channel); + auto* chan = ServerInstance->Channels.Find(channel); if ((chan) && (chan->HasUser(dest))) { user->WriteRemoteNotice("*** " + dest->nick + " is already on " + channel); diff --git a/src/modules/m_sakick.cpp b/src/modules/m_sakick.cpp index 636d1b176..a93e65bba 100644 --- a/src/modules/m_sakick.cpp +++ b/src/modules/m_sakick.cpp @@ -42,8 +42,8 @@ public: CmdResult Handle(User* user, const Params& parameters) override { - auto channel = ServerInstance->Channels.Find(parameters[0]); - auto dest = ServerInstance->Users.Find(parameters[1], true); + auto* channel = ServerInstance->Channels.Find(parameters[0]); + auto* dest = ServerInstance->Users.Find(parameters[1], true); if (channel && dest) { const std::string& reason = (parameters.size() > 2) ? parameters[2] : dest->nick; diff --git a/src/modules/m_samode.cpp b/src/modules/m_samode.cpp index 0b20485a3..72d1f602f 100644 --- a/src/modules/m_samode.cpp +++ b/src/modules/m_samode.cpp @@ -47,7 +47,7 @@ public: { if (!ServerInstance->Channels.IsPrefix(parameters[0][0])) { - auto target = ServerInstance->Users.FindNick(parameters[0], true); + auto* target = ServerInstance->Users.FindNick(parameters[0], true); if (!target) { user->WriteNumeric(Numerics::NoSuchNick(parameters[0])); diff --git a/src/modules/m_sanick.cpp b/src/modules/m_sanick.cpp index f7e4e5cb5..6327204f9 100644 --- a/src/modules/m_sanick.cpp +++ b/src/modules/m_sanick.cpp @@ -43,7 +43,7 @@ public: CmdResult Handle(User* user, const Params& parameters) override { - auto target = ServerInstance->Users.Find(parameters[0], true); + auto* target = ServerInstance->Users.Find(parameters[0], true); /* Do local sanity checks and bails */ if (IS_LOCAL(user)) diff --git a/src/modules/m_sapart.cpp b/src/modules/m_sapart.cpp index 97637d5e6..08fd35921 100644 --- a/src/modules/m_sapart.cpp +++ b/src/modules/m_sapart.cpp @@ -47,8 +47,8 @@ public: if (CommandParser::LoopCall(user, this, parameters, 1)) return CmdResult::FAILURE; - auto dest = ServerInstance->Users.Find(parameters[0], true); - auto channel = ServerInstance->Channels.Find(parameters[1]); + auto* dest = ServerInstance->Users.Find(parameters[0], true); + auto* channel = ServerInstance->Channels.Find(parameters[1]); if (dest && channel) { std::string reason; diff --git a/src/modules/m_saquit.cpp b/src/modules/m_saquit.cpp index d51dcba37..4974921be 100644 --- a/src/modules/m_saquit.cpp +++ b/src/modules/m_saquit.cpp @@ -45,7 +45,7 @@ public: CmdResult Handle(User* user, const Params& parameters) override { - auto dest = ServerInstance->Users.Find(parameters[0], true); + auto* dest = ServerInstance->Users.Find(parameters[0], true); if (dest) { if (dest->IsModeSet(servprotectmode)) diff --git a/src/modules/m_sasl.cpp b/src/modules/m_sasl.cpp index f4a0ef2ff..6946ec9ae 100644 --- a/src/modules/m_sasl.cpp +++ b/src/modules/m_sasl.cpp @@ -374,7 +374,7 @@ public: CmdResult Handle(User* user, const Params& parameters) override { - auto target = ServerInstance->Users.FindUUID(parameters[1]); + auto* target = ServerInstance->Users.FindUUID(parameters[1]); if (!target) { ServerInstance->Logs.Debug(MODNAME, "User not found in sasl ENCAP event: %s", parameters[1].c_str()); diff --git a/src/modules/m_satopic.cpp b/src/modules/m_satopic.cpp index f7d0faa7f..88beb9274 100644 --- a/src/modules/m_satopic.cpp +++ b/src/modules/m_satopic.cpp @@ -44,7 +44,7 @@ public: /* * Handles a SATOPIC request. Notifies all +s users. */ - auto target = ServerInstance->Channels.Find(parameters[0]); + auto* target = ServerInstance->Channels.Find(parameters[0]); if(target) { diff --git a/src/modules/m_servprotect.cpp b/src/modules/m_servprotect.cpp index 3f745a925..05e9de178 100644 --- a/src/modules/m_servprotect.cpp +++ b/src/modules/m_servprotect.cpp @@ -82,7 +82,7 @@ public: /* Check if the parameter is a valid nick/uuid */ - auto u = ServerInstance->Users.Find(change.param); + auto* u = ServerInstance->Users.Find(change.param); if (u) { Membership* memb = chan->GetUser(u); diff --git a/src/modules/m_sethost.cpp b/src/modules/m_sethost.cpp index bd671049b..e1534f8dd 100644 --- a/src/modules/m_sethost.cpp +++ b/src/modules/m_sethost.cpp @@ -46,7 +46,7 @@ public: return CmdResult::FAILURE; } - for (const auto& chr : parameters[0]) + for (const auto chr : parameters[0]) { if (!hostmap.test(static_cast<unsigned char>(chr))) { @@ -84,7 +84,7 @@ public: const std::string hmap = tag->getString("charmap", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.-_/0123456789", 1); CharState newhostmap; - for (const auto& chr : hmap) + for (const auto chr : hmap) { // A hostname can not contain NUL, LF, CR, or SPACE. if (chr == 0x00 || chr == 0x0A || chr == 0x0D || chr == 0x20) diff --git a/src/modules/m_showwhois.cpp b/src/modules/m_showwhois.cpp index 3918f7c33..6392a402f 100644 --- a/src/modules/m_showwhois.cpp +++ b/src/modules/m_showwhois.cpp @@ -61,11 +61,11 @@ public: CmdResult Handle(User* user, const Params& parameters) override { - auto dest = ServerInstance->Users.Find(parameters[0]); + auto* dest = ServerInstance->Users.Find(parameters[0]); if (!dest) return CmdResult::FAILURE; - auto source = ServerInstance->Users.Find(parameters[1]); + auto* source = ServerInstance->Users.Find(parameters[1]); if (IS_LOCAL(dest) && source) HandleFast(dest, source); diff --git a/src/modules/m_shun.cpp b/src/modules/m_shun.cpp index 6f66a6ac6..339345e5d 100644 --- a/src/modules/m_shun.cpp +++ b/src/modules/m_shun.cpp @@ -74,7 +74,7 @@ public: std::string target = parameters[0]; - auto find = ServerInstance->Users.Find(target, true); + auto* find = ServerInstance->Users.Find(target, true); if (find) target = "*!" + find->GetBanIdent() + "@" + find->GetIPString(); @@ -116,7 +116,7 @@ public: expr = parameters[1]; } - auto r = new Shun(ServerInstance->Time(), duration, user->nick, expr, target); + auto* r = new Shun(ServerInstance->Time(), duration, user->nick, expr, target); if (ServerInstance->XLines->AddLine(r, user)) { if (!duration) diff --git a/src/modules/m_silence.cpp b/src/modules/m_silence.cpp index 3fc130b66..dd2f764b5 100644 --- a/src/modules/m_silence.cpp +++ b/src/modules/m_silence.cpp @@ -109,7 +109,7 @@ public: static bool FlagsToBits(const std::string& flags, uint32_t& out, bool strict) { out = SF_NONE; - for (const auto& flag : flags) + for (const auto flag : flags) { switch (flag) { @@ -208,7 +208,7 @@ public: // Remove the old list and create a new one. Unset(user, false); - auto list = new SilenceList(); + auto* list = new SilenceList(); irc::spacesepstream ts(value); while (!ts.StreamEnd()) diff --git a/src/modules/m_spanningtree/fjoin.cpp b/src/modules/m_spanningtree/fjoin.cpp index 0b208509f..c2152cf54 100644 --- a/src/modules/m_spanningtree/fjoin.cpp +++ b/src/modules/m_spanningtree/fjoin.cpp @@ -117,7 +117,7 @@ CmdResult CommandFJoin::Handle(User* srcuser, Params& params) time_t TS = ServerCommand::ExtractTS(params[1]); const std::string& channel = params[0]; - auto chan = ServerInstance->Channels.Find(channel); + auto* chan = ServerInstance->Channels.Find(channel); bool apply_other_sides_modes = true; TreeServer* const sourceserver = TreeServer::Get(srcuser); @@ -201,7 +201,7 @@ void CommandFJoin::ProcessModeUUIDPair(const std::string& item, TreeServer* sour // Comma not required anymore if the user has no modes const std::string::size_type ubegin = (comma == std::string::npos ? 0 : comma+1); std::string uuid(item, ubegin, UIDGenerator::UUID_LENGTH); - auto who = ServerInstance->Users.FindUUID(uuid); + auto* who = ServerInstance->Users.FindUUID(uuid); if (!who) { // Probably KILLed, ignore diff --git a/src/modules/m_spanningtree/ftopic.cpp b/src/modules/m_spanningtree/ftopic.cpp index ddbfe9f3e..19c2e36ea 100644 --- a/src/modules/m_spanningtree/ftopic.cpp +++ b/src/modules/m_spanningtree/ftopic.cpp @@ -28,7 +28,7 @@ /** FTOPIC command */ CmdResult CommandFTopic::Handle(User* user, Params& params) { - auto c = ServerInstance->Channels.Find(params[0]); + auto* c = ServerInstance->Channels.Find(params[0]); if (!c) return CmdResult::FAILURE; diff --git a/src/modules/m_spanningtree/idle.cpp b/src/modules/m_spanningtree/idle.cpp index fa7e87548..b6888f16d 100644 --- a/src/modules/m_spanningtree/idle.cpp +++ b/src/modules/m_spanningtree/idle.cpp @@ -39,7 +39,7 @@ CmdResult CommandIdle::HandleRemote(RemoteUser* issuer, Params& params) * the number of seconds 'issuer' has been idle. */ - auto target = ServerInstance->Users.FindUUID(params[0], true); + auto* target = ServerInstance->Users.FindUUID(params[0], true); if (!target) return CmdResult::FAILURE; diff --git a/src/modules/m_spanningtree/ijoin.cpp b/src/modules/m_spanningtree/ijoin.cpp index c781ba17d..ca082061d 100644 --- a/src/modules/m_spanningtree/ijoin.cpp +++ b/src/modules/m_spanningtree/ijoin.cpp @@ -27,7 +27,7 @@ CmdResult CommandIJoin::HandleRemote(RemoteUser* user, Params& params) { - auto chan = ServerInstance->Channels.Find(params[0]); + auto* chan = ServerInstance->Channels.Find(params[0]); if (!chan) { // Desync detected, recover @@ -60,7 +60,7 @@ CmdResult CommandIJoin::HandleRemote(RemoteUser* user, Params& params) CmdResult CommandResync::HandleServer(TreeServer* server, CommandBase::Params& params) { ServerInstance->Logs.Debug(MODNAME, "Resyncing " + params[0]); - auto chan = ServerInstance->Channels.Find(params[0]); + auto* chan = ServerInstance->Channels.Find(params[0]); if (!chan) { // This can happen for a number of reasons, safe to ignore diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp index d7406aeb0..5617a7aea 100644 --- a/src/modules/m_spanningtree/main.cpp +++ b/src/modules/m_spanningtree/main.cpp @@ -143,7 +143,7 @@ void ModuleSpanningTree::ShowLinks(TreeServer* Current, User* user, int hops) Parent = Current->GetParent()->GetName(); } - for (const auto& server : Current->GetChildren()) + for (auto* server : Current->GetChildren()) { if ((server->Hidden) || ((Utils->HideServices) && (server->IsService()))) { @@ -242,7 +242,7 @@ void ModuleSpanningTree::ConnectServer(const std::shared_ptr<Link>& x, const std if (sa.family() != AF_UNSPEC) { // Create a TreeServer object that will start connecting immediately in the background - auto newsocket = new TreeSocket(x, y, sa); + auto* newsocket = new TreeSocket(x, y, sa); if (!newsocket->HasFd()) { ServerInstance->SNO.WriteToSnoMask('l', "CONNECT: Error connecting \002%s\002: %s.", @@ -265,7 +265,7 @@ void ModuleSpanningTree::ConnectServer(const std::shared_ptr<Link>& x, const std start_type = DNS::QUERY_A; } - auto snr = new ServerNameResolver(*DNS, x->IPAddr, x, start_type, y); + auto* snr = new ServerNameResolver(*DNS, x->IPAddr, x, start_type, y); try { DNS->Process(snr); @@ -714,7 +714,7 @@ namespace compatbuffer << '=' << compatlinkstring; } - for (const auto& child : Utils->TreeRoot->GetChildren()) + for (const auto* child : Utils->TreeRoot->GetChildren()) { if (!child->GetSocket()) continue; // Should never happen? @@ -753,7 +753,7 @@ void ModuleSpanningTree::OnUnloadModule(Module* mod) restart: // Close all connections which use an IO hook provided by this module - for (const auto& child : Utils->TreeRoot->GetChildren()) + for (const auto* child : Utils->TreeRoot->GetChildren()) { TreeSocket* sock = child->GetSocket(); if (sock->GetModHook(mod)) @@ -870,7 +870,7 @@ ModuleSpanningTree::~ModuleSpanningTree() { ServerInstance->PI = &ServerInstance->DefaultProtocolInterface; - auto newsrv = new Server(ServerInstance->Config->GetSID(), ServerInstance->Config->ServerName, ServerInstance->Config->ServerDesc); + auto* newsrv = new Server(ServerInstance->Config->GetSID(), ServerInstance->Config->ServerName, ServerInstance->Config->ServerDesc); SetLocalUsersServer(newsrv); delete Utils; diff --git a/src/modules/m_spanningtree/metadata.cpp b/src/modules/m_spanningtree/metadata.cpp index e1514a54b..df51148cd 100644 --- a/src/modules/m_spanningtree/metadata.cpp +++ b/src/modules/m_spanningtree/metadata.cpp @@ -49,11 +49,11 @@ CmdResult CommandMetadata::Handle(User* srcuser, Params& params) if (params.size() < 6) throw ProtocolException("Insufficient parameters for channel METADATA"); - auto u = ServerInstance->Users.FindUUID(params[1]); + auto* u = ServerInstance->Users.FindUUID(params[1]); if (!u) return CmdResult::FAILURE; // User does not exist. - auto c = ServerInstance->Channels.Find(params[2]); + auto* c = ServerInstance->Channels.Find(params[2]); if (!c) return CmdResult::FAILURE; // Channel does not exist. @@ -79,7 +79,7 @@ CmdResult CommandMetadata::Handle(User* srcuser, Params& params) if (params.size() < 3) throw ProtocolException("Insufficient parameters for channel METADATA"); - auto c = ServerInstance->Channels.Find(params[0]); + auto* c = ServerInstance->Channels.Find(params[0]); if (!c) return CmdResult::FAILURE; @@ -97,7 +97,7 @@ CmdResult CommandMetadata::Handle(User* srcuser, Params& params) } else { - auto u = ServerInstance->Users.FindUUID(params[0]); + auto* u = ServerInstance->Users.FindUUID(params[0]); if (u) { ExtensionItem* item = ServerInstance->Extensions.GetItem(params[1]); diff --git a/src/modules/m_spanningtree/netburst.cpp b/src/modules/m_spanningtree/netburst.cpp index b5c30f782..00bad9b97 100644 --- a/src/modules/m_spanningtree/netburst.cpp +++ b/src/modules/m_spanningtree/netburst.cpp @@ -150,7 +150,7 @@ void TreeSocket::SendServers(TreeServer* Current, TreeServer* s) { SendServerInfo(Current); - for (const auto& recursive_server : Current->GetChildren()) + for (auto* recursive_server : Current->GetChildren()) { if (recursive_server != s) { @@ -202,7 +202,7 @@ void TreeSocket::SendListModes(Channel* chan) return; } - for (const auto& mode : ServerInstance->Modes.GetListModes()) + for (auto* mode : ServerInstance->Modes.GetListModes()) { ListModeBase::ModeList* list = mode->GetList(chan); if (!list || list->empty()) @@ -221,7 +221,7 @@ void TreeSocket::SendListModes(Channel* chan) void TreeSocket::SendLegacyListModes(Channel* chan) { FModeBuilder fmode(chan); - for (const auto& mode : ServerInstance->Modes.GetListModes()) + for (auto* mode : ServerInstance->Modes.GetListModes()) { ListModeBase::ModeList* list = mode->GetList(chan); if (!list) diff --git a/src/modules/m_spanningtree/nick.cpp b/src/modules/m_spanningtree/nick.cpp index 4663a5df2..ae021d0ab 100644 --- a/src/modules/m_spanningtree/nick.cpp +++ b/src/modules/m_spanningtree/nick.cpp @@ -37,7 +37,7 @@ CmdResult CommandNick::HandleRemote(::RemoteUser* user, Params& params) * On nick messages, check that the nick doesn't already exist here. * If it does, perform collision logic. */ - auto x = ServerInstance->Users.FindNick(params[0], true); + auto* x = ServerInstance->Users.FindNick(params[0], true); if (x && x != user) { // 'x' is the already existing user using the same nick as params[0] diff --git a/src/modules/m_spanningtree/opertype.cpp b/src/modules/m_spanningtree/opertype.cpp index 0911891dd..f5cacc0df 100644 --- a/src/modules/m_spanningtree/opertype.cpp +++ b/src/modules/m_spanningtree/opertype.cpp @@ -36,7 +36,7 @@ private: auto it = tags.find(tag); if (it != tags.end()) { - for (const char& chr : ClientProtocol::Message::UnescapeTag(it->second.value)) + for (const auto chr : ClientProtocol::Message::UnescapeTag(it->second.value)) { size_t idx = ModeParser::GetModeIndex(chr); if (idx != ModeParser::MODEID_MAX) diff --git a/src/modules/m_spanningtree/override_map.cpp b/src/modules/m_spanningtree/override_map.cpp index f98d79c8e..7bbe72b13 100644 --- a/src/modules/m_spanningtree/override_map.cpp +++ b/src/modules/m_spanningtree/override_map.cpp @@ -64,7 +64,7 @@ static void GetDepthAndLen(TreeServer* current, unsigned int depth, unsigned int if (current->rawversion.length() > max_version) max_version = current->rawversion.length(); - for (const auto& child : current->GetChildren()) + for (auto* child : current->GetChildren()) GetDepthAndLen(child, depth + 1, max_depth, max_len, max_version); } diff --git a/src/modules/m_spanningtree/override_whois.cpp b/src/modules/m_spanningtree/override_whois.cpp index 70c711f02..b0d1abe6a 100644 --- a/src/modules/m_spanningtree/override_whois.cpp +++ b/src/modules/m_spanningtree/override_whois.cpp @@ -30,7 +30,7 @@ ModResult ModuleSpanningTree::HandleRemoteWhois(const CommandBase::Params& parameters, User* user) { - auto remote = ServerInstance->Users.FindNick(parameters[1]); + auto* remote = ServerInstance->Users.FindNick(parameters[1]); if (remote && !IS_LOCAL(remote)) { CmdBuilder(user, "IDLE").push(remote->uuid).Unicast(remote); diff --git a/src/modules/m_spanningtree/postcommand.cpp b/src/modules/m_spanningtree/postcommand.cpp index e9d568010..bb0c0d922 100644 --- a/src/modules/m_spanningtree/postcommand.cpp +++ b/src/modules/m_spanningtree/postcommand.cpp @@ -97,7 +97,7 @@ void SpanningTreeUtilities::RouteCommand(TreeServer* origin, CommandBase* thiscm } if (ServerInstance->Channels.IsPrefix(dest[0])) { - auto c = ServerInstance->Channels.Find(dest); + auto* c = ServerInstance->Channels.Find(dest); if (!c) return; // TODO OnBuildExemptList hook was here @@ -114,7 +114,7 @@ void SpanningTreeUtilities::RouteCommand(TreeServer* origin, CommandBase* thiscm else { // user target? - auto d = ServerInstance->Users.Find(dest); + auto* d = ServerInstance->Users.Find(dest); if (!d || IS_LOCAL(d)) return; TreeServer* tsd = TreeServer::Get(d)->GetRoute(); diff --git a/src/modules/m_spanningtree/resolvers.cpp b/src/modules/m_spanningtree/resolvers.cpp index 4d83c642c..e6dd2a54a 100644 --- a/src/modules/m_spanningtree/resolvers.cpp +++ b/src/modules/m_spanningtree/resolvers.cpp @@ -65,7 +65,7 @@ void ServerNameResolver::OnLookupComplete(const DNS::Query* r) TreeServer* CheckDupe = Utils->FindServer(link->Name); if (!CheckDupe) /* Check that nobody tried to connect it successfully while we were resolving */ { - auto newsocket = new TreeSocket(link, autoconnect, sa); + auto* newsocket = new TreeSocket(link, autoconnect, sa); if (!newsocket->HasFd()) { /* Something barfed, show the opers */ @@ -86,7 +86,7 @@ void ServerNameResolver::OnError(const DNS::Query* r) if (question.type == DNS::QUERY_AAAA) { - auto snr = new ServerNameResolver(this->manager, question.name, link, DNS::QUERY_A, autoconnect); + auto* snr = new ServerNameResolver(this->manager, question.name, link, DNS::QUERY_A, autoconnect); try { this->manager->Process(snr); @@ -115,7 +115,7 @@ bool SecurityIPResolver::CheckIPv4() if (question.type != DNS::QUERY_AAAA) return false; - auto res = new SecurityIPResolver(creator, manager, question.name, link, DNS::QUERY_A); + auto* res = new SecurityIPResolver(creator, manager, question.name, link, DNS::QUERY_A); try { this->manager->Process(res); diff --git a/src/modules/m_spanningtree/save.cpp b/src/modules/m_spanningtree/save.cpp index 71c4f8f80..0d8640dbf 100644 --- a/src/modules/m_spanningtree/save.cpp +++ b/src/modules/m_spanningtree/save.cpp @@ -31,7 +31,7 @@ */ CmdResult CommandSave::Handle(User* user, Params& params) { - auto u = ServerInstance->Users.FindUUID(params[0]); + auto* u = ServerInstance->Users.FindUUID(params[0]); if (!u) return CmdResult::FAILURE; diff --git a/src/modules/m_spanningtree/server.cpp b/src/modules/m_spanningtree/server.cpp index 9a8a76449..7804ee096 100644 --- a/src/modules/m_spanningtree/server.cpp +++ b/src/modules/m_spanningtree/server.cpp @@ -66,7 +66,7 @@ CmdResult CommandServer::HandleServer(TreeServer* ParentOfThis, Params& params) TreeServer* route = ParentOfThis->GetRoute(); std::shared_ptr<Link> lnk = Utils->FindLink(route->GetName()); - auto Node = new TreeServer(servername, description, sid, ParentOfThis, ParentOfThis->GetSocket(), lnk ? lnk->Hidden : false); + auto* Node = new TreeServer(servername, description, sid, ParentOfThis, ParentOfThis->GetSocket(), lnk ? lnk->Hidden : false); HandleExtra(Node, params); diff --git a/src/modules/m_spanningtree/svsjoin.cpp b/src/modules/m_spanningtree/svsjoin.cpp index d774ec5b2..db55b4cb9 100644 --- a/src/modules/m_spanningtree/svsjoin.cpp +++ b/src/modules/m_spanningtree/svsjoin.cpp @@ -32,7 +32,7 @@ CmdResult CommandSVSJoin::Handle(User* user, Params& parameters) return CmdResult::FAILURE; // Check target exists - auto u = ServerInstance->Users.FindUUID(parameters[0]); + auto* u = ServerInstance->Users.FindUUID(parameters[0]); if (!u) return CmdResult::FAILURE; diff --git a/src/modules/m_spanningtree/svsnick.cpp b/src/modules/m_spanningtree/svsnick.cpp index 0ad393796..6423a8437 100644 --- a/src/modules/m_spanningtree/svsnick.cpp +++ b/src/modules/m_spanningtree/svsnick.cpp @@ -29,7 +29,7 @@ CmdResult CommandSVSNick::Handle(User* user, Params& parameters) { - auto u = ServerInstance->Users.Find(parameters[0]); + auto* u = ServerInstance->Users.Find(parameters[0]); if (u && IS_LOCAL(u)) { diff --git a/src/modules/m_spanningtree/svspart.cpp b/src/modules/m_spanningtree/svspart.cpp index 18ebfc797..cff40141a 100644 --- a/src/modules/m_spanningtree/svspart.cpp +++ b/src/modules/m_spanningtree/svspart.cpp @@ -28,11 +28,11 @@ CmdResult CommandSVSPart::Handle(User* user, Params& parameters) { - auto u = ServerInstance->Users.FindUUID(parameters[0]); + auto* u = ServerInstance->Users.FindUUID(parameters[0]); if (!u) return CmdResult::FAILURE; - auto c = ServerInstance->Channels.Find(parameters[1]); + auto* c = ServerInstance->Channels.Find(parameters[1]); if (!c) return CmdResult::FAILURE; diff --git a/src/modules/m_spanningtree/translate.cpp b/src/modules/m_spanningtree/translate.cpp index 203b3c264..bbf33d82e 100644 --- a/src/modules/m_spanningtree/translate.cpp +++ b/src/modules/m_spanningtree/translate.cpp @@ -33,7 +33,7 @@ std::string Translate::ModeChangeListToParams(const Modes::ChangeList::List& mod if (mh->IsPrefixMode()) { - auto target = ServerInstance->Users.Find(item.param); + auto* target = ServerInstance->Users.Find(item.param); if (target) { ret.append(target->uuid); diff --git a/src/modules/m_spanningtree/treeserver.cpp b/src/modules/m_spanningtree/treeserver.cpp index efd422986..ed84ca70f 100644 --- a/src/modules/m_spanningtree/treeserver.cpp +++ b/src/modules/m_spanningtree/treeserver.cpp @@ -144,7 +144,7 @@ void TreeServer::FinishBurstInternal() behind_bursting--; ServerInstance->Logs.Debug(MODNAME, "FinishBurstInternal() %s behind_bursting %u", GetName().c_str(), behind_bursting); - for (const auto& child : Children) + for (auto* child : Children) child->FinishBurstInternal(); } @@ -201,7 +201,7 @@ void TreeServer::SQuitInternal(unsigned int& num_lost_servers, bool error) ServerInstance->Logs.Debug(MODNAME, "Server %s lost in split", GetName().c_str()); - for (const auto& server : Children) + for (auto* server : Children) server->SQuitInternal(num_lost_servers, error); // Mark server as dead @@ -266,7 +266,7 @@ void TreeServer::AddHashEntry() Cullable::Result TreeServer::Cull() { // Recursively cull all servers that are under us in the tree - for (const auto& server : Children) + for (auto* server : Children) server->Cull(); if (!IsRoot()) @@ -277,7 +277,7 @@ Cullable::Result TreeServer::Cull() TreeServer::~TreeServer() { // Recursively delete all servers that are under us in the tree first - for (const auto& child : Children) + for (const auto* child : Children) delete child; // Delete server user unless it's us diff --git a/src/modules/m_spanningtree/treesocket2.cpp b/src/modules/m_spanningtree/treesocket2.cpp index 5ab5778b1..8d1f39e02 100644 --- a/src/modules/m_spanningtree/treesocket2.cpp +++ b/src/modules/m_spanningtree/treesocket2.cpp @@ -242,7 +242,7 @@ User* TreeSocket::FindSource(const std::string& prefix, const std::string& comma else { // If the prefix string is a uuid FindUUID() returns the appropriate User object - auto user = ServerInstance->Users.FindUUID(prefix); + auto* user = ServerInstance->Users.FindUUID(prefix); if (user) return user; } @@ -291,7 +291,7 @@ void TreeSocket::ProcessTag(User* source, const std::string& tag, ClientProtocol tagkey.assign(tag); } - for (const auto& subscriber : Utils->Creator->tagevprov.GetSubscribers()) + for (auto* subscriber : Utils->Creator->tagevprov.GetSubscribers()) { ClientProtocol::MessageTagProvider* const tagprov = static_cast<ClientProtocol::MessageTagProvider*>(subscriber); const ModResult res = tagprov->OnProcessTag(source, tagkey, tagval); diff --git a/src/modules/m_spanningtree/uid.cpp b/src/modules/m_spanningtree/uid.cpp index 62e1c421f..24477acc8 100644 --- a/src/modules/m_spanningtree/uid.cpp +++ b/src/modules/m_spanningtree/uid.cpp @@ -48,7 +48,7 @@ CmdResult CommandUID::HandleServer(TreeServer* remoteserver, CommandBase::Params throw ProtocolException("Invalid mode string"); // See if there is a nick collision - auto collideswith = ServerInstance->Users.FindNick(params[2]); + auto* collideswith = ServerInstance->Users.FindNick(params[2]); if (collideswith && !collideswith->IsFullyConnected()) { // User that the incoming user is colliding with is not fully connected, we force nick change the @@ -77,7 +77,7 @@ CmdResult CommandUID::HandleServer(TreeServer* remoteserver, CommandBase::Params /* For remote users, we pass the UUID they sent to the constructor. * If the UUID already exists User::User() throws an exception which causes this connection to be closed. */ - auto _new = new SpanningTree::RemoteUser(params[0], remoteserver); + auto* _new = new SpanningTree::RemoteUser(params[0], remoteserver); ServerInstance->Users.clientlist[params[2]] = _new; _new->nick = params[2]; _new->ChangeRealHost(params[3], false); diff --git a/src/modules/m_spanningtree/utils.cpp b/src/modules/m_spanningtree/utils.cpp index 06804c0ec..6fd1d165e 100644 --- a/src/modules/m_spanningtree/utils.cpp +++ b/src/modules/m_spanningtree/utils.cpp @@ -167,7 +167,7 @@ void SpanningTreeUtilities::GetListOfServersForChannel(const Channel* c, TreeSoc // Check whether the servers which do not have users in the channel might need this message. This // is used to keep the chanhistory module synchronised between servers. - for (const auto& child : children) + for (const auto* child : children) { ModResult result = Creator->broadcasteventprov.FirstResult(&ServerProtocol::BroadcastEventListener::OnBroadcastMessage, c, child); if (result == MOD_RES_ALLOW) @@ -179,7 +179,7 @@ void SpanningTreeUtilities::DoOneToAllButSender(const CmdBuilder& params, const { const std::string& FullLine = params.str(); - for (const auto& Route : TreeRoot->GetChildren()) + for (const auto* Route : TreeRoot->GetChildren()) { // Send the line if the route isn't the path to the one to be omitted if (Route != omitroute) @@ -218,7 +218,7 @@ void SpanningTreeUtilities::RefreshIPCache() ValidIPs.push_back(L->IPAddr); else if (this->Creator->DNS) { - auto sr = new SecurityIPResolver(Creator, *this->Creator->DNS, L->IPAddr, L, DNS::QUERY_AAAA); + auto* sr = new SecurityIPResolver(Creator, *this->Creator->DNS, L->IPAddr, L, DNS::QUERY_AAAA); try { this->Creator->DNS->Process(sr); @@ -367,7 +367,7 @@ void SpanningTreeUtilities::SendChannelMessage(const User* source, const Channel TreeSocketSet list; this->GetListOfServersForChannel(target, list, status, exempt_list); - for (const auto& Sock : list) + for (auto* Sock : list) { if (Sock != omit) Sock->WriteLine(msg); @@ -397,7 +397,7 @@ std::string SpanningTreeUtilities::BuildLinkString(uint16_t proto, Module* mod) void SpanningTreeUtilities::SendListLimits(Channel* chan, TreeSocket* sock) { std::stringstream buffer; - for (const auto& lm : ServerInstance->Modes.GetListModes()) + for (auto* lm : ServerInstance->Modes.GetListModes()) buffer << lm->GetModeChar() << " " << lm->GetLimit(chan) << " "; std::string bufferstr = buffer.str(); diff --git a/src/modules/m_sqlauth.cpp b/src/modules/m_sqlauth.cpp index e7055e5a5..d18617d46 100644 --- a/src/modules/m_sqlauth.cpp +++ b/src/modules/m_sqlauth.cpp @@ -112,7 +112,7 @@ public: void OnError(const SQL::Error& error) override { - auto user = ServerInstance->Users.Find(uid); + auto* user = ServerInstance->Users.Find(uid); if (!user) return; pendingExt.Set(user, AUTH_STATE_FAIL); diff --git a/src/modules/m_sqloper.cpp b/src/modules/m_sqloper.cpp index 15b133eb1..526a9bd11 100644 --- a/src/modules/m_sqloper.cpp +++ b/src/modules/m_sqloper.cpp @@ -119,7 +119,7 @@ public: // Call /oper after placing all blocks from the SQL table into the Config->OperAccounts list. void OperExec() { - auto user = ServerInstance->Users.Find<LocalUser>(uid); + auto* user = ServerInstance->Users.Find<LocalUser>(uid); if (!user) return; // The user disconnected before the SQL query returned. diff --git a/src/modules/m_sslinfo.cpp b/src/modules/m_sslinfo.cpp index 522cb8ef1..a30da84c8 100644 --- a/src/modules/m_sslinfo.cpp +++ b/src/modules/m_sslinfo.cpp @@ -99,7 +99,7 @@ public: if (container->extype != this->extype) return; - auto cert = new ssl_cert(); + auto* cert = new ssl_cert(); Set(static_cast<User*>(container), cert, false); std::stringstream s(value); @@ -203,7 +203,7 @@ private: CmdResult HandleUser(LocalUser* source, const std::string& nick) { - auto target = ServerInstance->Users.FindNick(nick, true); + auto* target = ServerInstance->Users.FindNick(nick, true); if (!target) { source->WriteNumeric(Numerics::NoSuchNick(nick)); @@ -222,7 +222,7 @@ private: CmdResult HandleChannel(LocalUser* source, const std::string& channel) { - auto chan = ServerInstance->Channels.Find(channel); + auto* chan = ServerInstance->Channels.Find(channel); if (!chan) { source->WriteNumeric(Numerics::NoSuchChannel(channel)); @@ -336,7 +336,7 @@ public: ModResult OnPreOperLogin(LocalUser* user, const std::shared_ptr<OperAccount>& oper, bool automatic) override { - auto cert = cmd.sslapi.GetCertificate(user); + auto* cert = cmd.sslapi.GetCertificate(user); if (oper->GetConfig()->getBool("sslonly") && !cert) { if (!automatic) @@ -433,7 +433,7 @@ public: } // Create a fake ssl_cert for the user. - auto cert = new ssl_cert(); + auto* cert = new ssl_cert(); if (!hash.empty()) { iter = flags->find("certfp-" + hash); diff --git a/src/modules/m_svshold.cpp b/src/modules/m_svshold.cpp index 0c694cd79..91dc75be0 100644 --- a/src/modules/m_svshold.cpp +++ b/src/modules/m_svshold.cpp @@ -141,7 +141,7 @@ public: return CmdResult::FAILURE; } - auto r = new SVSHold(ServerInstance->Time(), duration, user->nick, parameters[2], parameters[0]); + auto* r = new SVSHold(ServerInstance->Time(), duration, user->nick, parameters[2], parameters[0]); if (ServerInstance->XLines->AddLine(r, user)) { if (silent) diff --git a/src/modules/m_swhois.cpp b/src/modules/m_swhois.cpp index 27b092f66..1b54ace49 100644 --- a/src/modules/m_swhois.cpp +++ b/src/modules/m_swhois.cpp @@ -48,7 +48,7 @@ public: CmdResult Handle(User* user, const Params& parameters) override { - auto dest = ServerInstance->Users.Find(parameters[0]); + auto* dest = ServerInstance->Users.Find(parameters[0]); if (!dest) // allow setting swhois using SWHOIS before reg { diff --git a/src/modules/m_timedbans.cpp b/src/modules/m_timedbans.cpp index 9ea6d981d..e405d7584 100644 --- a/src/modules/m_timedbans.cpp +++ b/src/modules/m_timedbans.cpp @@ -86,7 +86,7 @@ public: CmdResult Handle(User* user, const Params& parameters) override { - auto channel = ServerInstance->Channels.Find(parameters[0]); + auto* channel = ServerInstance->Channels.Find(parameters[0]); if (!channel) { user->WriteNumeric(Numerics::NoSuchChannel(parameters[0])); diff --git a/src/modules/m_topiclock.cpp b/src/modules/m_topiclock.cpp index 59268be4c..7eb7f4754 100644 --- a/src/modules/m_topiclock.cpp +++ b/src/modules/m_topiclock.cpp @@ -45,7 +45,7 @@ public: return CmdResult::FAILURE; } - auto chan = ServerInstance->Channels.Find(parameters[0]); + auto* chan = ServerInstance->Channels.Find(parameters[0]); if (!chan) return CmdResult::FAILURE; diff --git a/src/modules/m_uninvite.cpp b/src/modules/m_uninvite.cpp index df693a90f..6071e30bf 100644 --- a/src/modules/m_uninvite.cpp +++ b/src/modules/m_uninvite.cpp @@ -57,7 +57,7 @@ public: else u = ServerInstance->Users.Find(parameters[0]); - auto c = ServerInstance->Channels.Find(parameters[1]); + auto* c = ServerInstance->Channels.Find(parameters[1]); if (!c || !u) { diff --git a/src/modules/m_watch.cpp b/src/modules/m_watch.cpp index c7774cabd..6299bdc17 100644 --- a/src/modules/m_watch.cpp +++ b/src/modules/m_watch.cpp @@ -102,7 +102,7 @@ class CommandWatch final void HandleList(LocalUser* user, bool show_offline) { user->CommandFloodPenalty += ListPenalty; - for (const auto& entry : manager.GetWatched(user)) + for (const auto* entry : manager.GetWatched(user)) SendOnlineOffline(user, entry->GetNick(), show_offline); user->WriteNumeric(RPL_ENDOFWATCHLIST, "End of WATCH list"); } @@ -116,7 +116,7 @@ class CommandWatch final user->WriteNumeric(RPL_WATCHSTAT, InspIRCd::Format("You have %lu and are on 0 WATCH entries", (unsigned long)list.size())); Numeric::Builder<' '> out(user, RPL_WATCHLIST); - for (const auto& entry : list) + for (const auto* entry : list) out.Add(entry->GetNick()); out.Flush(); user->WriteNumeric(RPL_ENDOFWATCHLIST, "End of WATCH S"); diff --git a/src/modules/m_websocket.cpp b/src/modules/m_websocket.cpp index b7db4cdbd..298aa5f8d 100644 --- a/src/modules/m_websocket.cpp +++ b/src/modules/m_websocket.cpp @@ -306,7 +306,7 @@ class WebSocketHook final return result; // Strip out any CR+LF which may have been erroneously sent. - for (const auto& chr : appdata) + for (const auto chr : appdata) { if (chr != '\r' && chr != '\n') destrecvq.push_back(chr); @@ -522,7 +522,7 @@ public: std::string message; for (const auto& elem : uppersendq) { - for (const auto& chr : elem) + for (const auto chr : elem) { if (chr == '\n') { diff --git a/src/server.cpp b/src/server.cpp index 757f85025..d9612ae74 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -80,10 +80,10 @@ std::string UIDGenerator::GenerateSID(const std::string& servername, const std:: { unsigned int sid = 0; - for (const auto& chr : servername) + for (const auto chr : servername) sid = 5 * sid + chr; - for (const auto& chr : serverdesc) + for (const auto chr : serverdesc) sid = 5 * sid + chr; std::string sidstr = ConvToStr(sid % 1000); diff --git a/src/snomasks.cpp b/src/snomasks.cpp index ea11388f3..9d3097710 100644 --- a/src/snomasks.cpp +++ b/src/snomasks.cpp @@ -132,7 +132,7 @@ void Snomask::Send(char letter, const std::string& desc, const std::string& msg) const std::string finalmsg = InspIRCd::Format("*** %s: %s", desc.c_str(), msg.c_str()); /* Only opers can receive snotices, so we iterate the oper list */ - for (const auto& user : ServerInstance->Users.all_opers) + for (auto* user : ServerInstance->Users.all_opers) { // IsNoticeMaskSet() returns false for opers who aren't +s, no need to check for it separately if (IS_LOCAL(user) && user->IsNoticeMaskSet(letter)) diff --git a/src/socket.cpp b/src/socket.cpp index 2ffe82370..67c66d618 100644 --- a/src/socket.cpp +++ b/src/socket.cpp @@ -49,7 +49,7 @@ bool InspIRCd::BindPort(const std::shared_ptr<ConfigTag>& tag, const irc::socket } } - auto ll = new ListenSocket(tag, sa); + auto* ll = new ListenSocket(tag, sa); if (!ll->HasFd()) { ServerInstance->Logs.Normal("SOCKET", "Failed to listen on %s from tag at %s: %s", @@ -135,7 +135,7 @@ size_t InspIRCd::BindPorts(FailedPortList& failed_ports) } std::vector<ListenSocket*>::iterator n = ports.begin(); - for (auto& old_port : old_ports) + for (auto* old_port : old_ports) { while (n != ports.end() && *n != old_port) n++; diff --git a/src/users.cpp b/src/users.cpp index 9933895dc..ed2d00112 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -324,7 +324,7 @@ bool User::OperLogin(const std::shared_ptr<OperAccount>& account, bool automatic // 2. Set user mode o (oper) *WITHOUT* calling the mode handler. // 3. Add the user to the operator list. oper = account; - auto opermh = ServerInstance->Modes.FindMode('o', MODETYPE_USER); + auto* opermh = ServerInstance->Modes.FindMode('o', MODETYPE_USER); if (opermh) { SetMode(opermh, true); @@ -369,7 +369,7 @@ void User::OperLogout() } ServerInstance->Modes.Process(this, nullptr, this, changelist); - auto opermh = ServerInstance->Modes.FindMode('o', MODETYPE_USER); + auto* opermh = ServerInstance->Modes.FindMode('o', MODETYPE_USER); if (opermh) SetMode(opermh, false); } @@ -724,7 +724,7 @@ void LocalUser::Send(ClientProtocol::Event& protoev, ClientProtocol::MessageList { // Modules can personalize the messages sent per user for the event protoev.GetMessagesForUser(this, msglist); - for (const auto& msg : msglist) + for (auto* msg : msglist) { ClientProtocol::Message& curr = *msg; ModResult res; @@ -1115,7 +1115,7 @@ void OperType::Configure(const std::shared_ptr<ConfigTag>& tag, bool merge) auto modefn = [&tag](ModeParser::ModeStatus& modes, const std::string& key) { bool adding = true; - for (const auto& chr : tag->getString(key)) + for (const auto chr : tag->getString(key)) { if (chr == '+' || chr == '-') adding = (chr == '+'); diff --git a/src/xline.cpp b/src/xline.cpp index a67c01bde..2799e99a1 100644 --- a/src/xline.cpp +++ b/src/xline.cpp @@ -473,7 +473,7 @@ void XLineManager::ApplyLines() if (u->exempt) continue; - for (const auto& x : pending_lines) + for (auto* x : pending_lines) { if (x->Matches(u)) { |
