diff options
author | Adam <Adam@anope.org> | 2017-05-29 17:38:39 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2017-05-29 17:38:39 -0400 |
commit | ff81c9bab8e1eddf044d7cb5d06d44b4a43c95d8 (patch) | |
tree | bfed822d690999f2c4458a30a65c232210b1e9cc /src | |
parent | 3f143633541a5361bf5b02b0d69b65447aea7b79 (diff) |
Fixup some compilation warnings
Diffstat (limited to 'src')
-rw-r--r-- | src/command.cpp | 4 | ||||
-rw-r--r-- | src/config.cpp | 20 | ||||
-rw-r--r-- | src/logger.cpp | 8 | ||||
-rw-r--r-- | src/process.cpp | 2 | ||||
-rw-r--r-- | src/users.cpp | 6 | ||||
-rw-r--r-- | src/xline.cpp | 36 |
6 files changed, 41 insertions, 35 deletions
diff --git a/src/command.cpp b/src/command.cpp index 7d5b9e46c..57203aba2 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -73,9 +73,9 @@ const Anope::string &CommandSource::GetCommand() const return this->command.cname; } -void CommandSource::SetCommand(const Anope::string &command) +void CommandSource::SetCommand(const Anope::string &com) { - this->command.cname = command; + this->command.cname = com; } const Anope::string &CommandSource::GetPermission() const diff --git a/src/config.cpp b/src/config.cpp index 0222f0e97..302127b97 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -224,13 +224,13 @@ Conf::Conf() : Block("") this->TimeoutCheck = options->Get<time_t>("timeoutcheck"); this->NickChars = networkinfo->Get<Anope::string>("nick_chars"); - Anope::string locale = options->Get<Anope::string>("locale"); + Anope::string localename = options->Get<Anope::string>("locale"); Anope::string casemap = options->Get<Anope::string>("casemap"); - if (locale.empty() == casemap.empty()) + if (localename.empty() == casemap.empty()) throw ConfigException("One of options:locale and options:casemap must be set"); - if (locale.empty()) + if (localename.empty()) { // load locale conf File f(casemap + ".conf", false); @@ -239,9 +239,9 @@ Conf::Conf() : Block("") else { #if Boost_FOUND - this->locale = new std::locale(Anope::locale::generate(locale.str())); + this->locale = new std::locale(Anope::locale::generate(localename.str())); #else - throw ConfigException("Boost.Locale is not enabled, cannot use locale " + locale); + throw ConfigException("Boost.Locale is not enabled, cannot use locale " + localename); #endif } @@ -481,21 +481,21 @@ Conf::Conf() : Block("") for (int i = 0; i < this->CountBlock("casemap"); ++i) { - Block *casemap = this->GetBlock("casemap", i); + Block *casemapb = this->GetBlock("casemap", i); - unsigned char upper = casemap->Get<unsigned int>("upper"), - lower = casemap->Get<unsigned int>("lower"); + unsigned char upper = casemapb->Get<unsigned int>("upper"), + lower = casemapb->Get<unsigned int>("lower"); if (!upper) { - Anope::string s = casemap->Get<Anope::string>("upper"); + Anope::string s = casemapb->Get<Anope::string>("upper"); if (s.length() == 1) upper = s[0]; } if (!lower) { - Anope::string s = casemap->Get<Anope::string>("lower"); + Anope::string s = casemapb->Get<Anope::string>("lower"); if (s.length() == 1) lower = s[0]; } diff --git a/src/logger.cpp b/src/logger.cpp index 6bd226880..ec2cf2f67 100644 --- a/src/logger.cpp +++ b/src/logger.cpp @@ -488,15 +488,15 @@ Logger Logger::Source(CommandSource *s) const return l; } -Logger Logger::Bot(ServiceBot *bot) const +Logger Logger::Bot(ServiceBot *b) const { Logger l = *this; - l.bot = bot; + l.bot = b; return l; } -Logger Logger::Bot(const Anope::string &bot) const +Logger Logger::Bot(const Anope::string &botname) const { - return Bot(Config ? Config->GetClient(bot) : nullptr); + return Bot(Config ? Config->GetClient(botname) : nullptr); } diff --git a/src/process.cpp b/src/process.cpp index 67c5cbf14..7b8bd18e6 100644 --- a/src/process.cpp +++ b/src/process.cpp @@ -58,6 +58,8 @@ void Anope::Process(const Anope::string &buffer) MessageSource src(source); EventReturn MOD_RESULT = EventManager::Get()->Dispatch(&Event::Message::OnMessage, src, command, params); + if (MOD_RESULT == EVENT_STOP) + return; ProcessCommand(src, command, params); } diff --git a/src/users.cpp b/src/users.cpp index 3561e9ea9..fa130204c 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -40,7 +40,11 @@ int OperCount = 0; std::list<User *> User::quitting_users; -User::User(const Anope::string &snick, const Anope::string &sident, const Anope::string &shost, const Anope::string &svhost, const Anope::string &uip, Server *sserver, const Anope::string &srealname, time_t ts, const Anope::string &smodes, const Anope::string &suid, NickServ::Account *account) : ip(uip), logger(this) +User::User(const Anope::string &snick, const Anope::string &sident, const Anope::string &shost, const Anope::string &svhost, + const Anope::string &uip, Server *sserver, const Anope::string &srealname, time_t ts, const Anope::string &smodes, + const Anope::string &suid, NickServ::Account *account) + : logger(this) + , ip(uip) { if (snick.empty() || sident.empty() || shost.empty()) throw CoreException("Bad args passed to User::User"); diff --git a/src/xline.cpp b/src/xline.cpp index ca297a49f..c64761297 100644 --- a/src/xline.cpp +++ b/src/xline.cpp @@ -37,10 +37,10 @@ void XLine::Recache() delete c; c = nullptr; - Anope::string mask = GetMask(); - if (mask.length() >= 2 && mask[0] == '/' && mask[mask.length() - 1] == '/' && Config->regex_flags) + Anope::string xlmask = GetMask(); + if (xlmask.length() >= 2 && xlmask[0] == '/' && xlmask[xlmask.length() - 1] == '/' && Config->regex_flags) { - Anope::string stripped_mask = mask.substr(1, mask.length() - 2); + Anope::string stripped_mask = xlmask.substr(1, xlmask.length() - 2); try { @@ -52,37 +52,37 @@ void XLine::Recache() } } - size_t nick_t = mask.find('!'); + size_t nick_t = xlmask.find('!'); if (nick_t != Anope::string::npos) - nick = mask.substr(0, nick_t); + nick = xlmask.substr(0, nick_t); - size_t user_t = mask.find('!'), host_t = mask.find('@'); + size_t user_t = xlmask.find('!'), host_t = xlmask.find('@'); if (host_t != Anope::string::npos) { if (user_t != Anope::string::npos && host_t > user_t) - user = mask.substr(user_t + 1, host_t - user_t - 1); + user = xlmask.substr(user_t + 1, host_t - user_t - 1); else - user = mask.substr(0, host_t); + user = xlmask.substr(0, host_t); } - size_t real_t = mask.find('#'); + size_t real_t = xlmask.find('#'); if (host_t != Anope::string::npos) { if (real_t != Anope::string::npos && real_t > host_t) - host = mask.substr(host_t + 1, real_t - host_t - 1); + host = xlmask.substr(host_t + 1, real_t - host_t - 1); else - host = mask.substr(host_t + 1); + host = xlmask.substr(host_t + 1); } else { if (real_t != Anope::string::npos) - host = mask.substr(0, real_t); + host = xlmask.substr(0, real_t); else - host = mask; + host = xlmask; } if (real_t != Anope::string::npos) - real = mask.substr(real_t + 1); + real = xlmask.substr(real_t + 1); if (host.find('/') != Anope::string::npos) { @@ -141,9 +141,9 @@ Anope::string XLine::GetReason() return Get(&XLineType::reason); } -void XLine::SetID(const Anope::string &id) +void XLine::SetID(const Anope::string &i) { - Set(&XLineType::id, id); + Set(&XLineType::id, i); } Anope::string XLine::GetID() @@ -206,8 +206,8 @@ bool XLine::HasNickOrReal() const bool XLine::IsRegex() { - Anope::string mask = GetMask(); - return mask.length() > 2 && mask[0] == '/' && mask[mask.length() - 1] == '/'; + Anope::string m = GetMask(); + return m.length() > 2 && m[0] == '/' && m[m.length() - 1] == '/'; } XLineManager *XLine::GetManager() |