From 6db01869479c878753fc6da49f2fb0bc44511359 Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 20 Jul 2013 02:55:25 -0400 Subject: Fix not setting the correct compile flags on modules and fix the resulting warnings --- modules/commands/cs_mode.cpp | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'modules/commands/cs_mode.cpp') diff --git a/modules/commands/cs_mode.cpp b/modules/commands/cs_mode.cpp index b0a2e2b91..f38333265 100644 --- a/modules/commands/cs_mode.cpp +++ b/modules/commands/cs_mode.cpp @@ -864,14 +864,14 @@ class CSMode : public Module } } - EventReturn OnCheckModes(Channel *c) anope_override + void OnCheckModes(Channel *c) anope_override { if (!c->ci) - return EVENT_CONTINUE; + return; - ModeLocks *ml = modelocks.Get(c->ci); - if (ml) - for (ModeLocks::ModeList::const_iterator it = ml->GetMLock().begin(), it_end = ml->GetMLock().end(); it != it_end; ++it) + ModeLocks *locks = modelocks.Get(c->ci); + if (locks) + for (ModeLocks::ModeList::const_iterator it = locks->GetMLock().begin(), it_end = locks->GetMLock().end(); it != it_end; ++it) { const ModeLock *ml = *it; ChannelMode *cm = ModeManager::FindChannelModeByName(ml->name); @@ -924,6 +924,8 @@ class CSMode : public Module if (ml->HasMLock(mode, param, false)) c->RemoveMode(c->ci->WhoSends(), mode, param); + + return EVENT_CONTINUE; } EventReturn OnChannelModeUnset(Channel *c, MessageSource &setter, ChannelMode *mode, const Anope::string ¶m) anope_override @@ -937,25 +939,27 @@ class CSMode : public Module if (ml->HasMLock(mode, param, true)) c->SetMode(c->ci->WhoSends(), mode, param); + + return EVENT_CONTINUE; } void OnCreateChan(ChannelInfo *ci) anope_override { ModeLocks *ml = modelocks.Require(ci); - Anope::string modes; + Anope::string mlock; spacesepstream sep(Config->GetModule(this)->Get("mlock", "+nrt")); - if (sep.GetToken(modes)) + if (sep.GetToken(mlock)) { bool add = true; - for (unsigned i = 0; i < modes.length(); ++i) + for (unsigned i = 0; i < mlock.length(); ++i) { - if (modes[i] == '+') + if (mlock[i] == '+') add = true; - else if (modes[i] == '-') + else if (mlock[i] == '-') add = false; else { - ChannelMode *cm = ModeManager::FindChannelModeByChar(modes[i]); + ChannelMode *cm = ModeManager::FindChannelModeByChar(mlock[i]); Anope::string param; if (cm && (cm->type == MODE_REGULAR || sep.GetToken(param))) ml->SetMLock(cm, add, param); -- cgit