diff options
-rw-r--r-- | src/channels.c | 30 | ||||
-rw-r--r-- | src/chanserv.c | 4 | ||||
-rw-r--r-- | src/core/cs_set.c | 2 | ||||
-rw-r--r-- | src/core/os_defcon.c | 2 | ||||
-rw-r--r-- | src/modes.cpp | 2 | ||||
-rw-r--r-- | src/protocol/ratbox.c | 6 |
6 files changed, 23 insertions, 23 deletions
diff --git a/src/channels.c b/src/channels.c index bb4b04cff..85028b584 100644 --- a/src/channels.c +++ b/src/channels.c @@ -167,7 +167,7 @@ void Channel::SetModeInternal(ChannelMode *cm, const std::string ¶m, bool En if (debug) alog("debug: Setting +%c on %s for %s", cm->ModeChar, this->name, u->nick); - ChannelModeStatus *cms = static_cast<ChannelModeStatus *>(cm); + ChannelModeStatus *cms = dynamic_cast<ChannelModeStatus *>(cm); /* Set the new status on the user */ chan_set_user_status(this, u, cms->Status); /* Enforce secureops, etc */ @@ -183,7 +183,7 @@ void Channel::SetModeInternal(ChannelMode *cm, const std::string ¶m, bool En return; } - ChannelModeList *cml = static_cast<ChannelModeList *>(cm); + ChannelModeList *cml = dynamic_cast<ChannelModeList *>(cm); cml->AddMask(this, param.c_str()); return; } @@ -228,7 +228,7 @@ void Channel::SetModeInternal(ChannelMode *cm, const std::string ¶m, bool En /* Remove the mode */ if (cm->Type == MODE_PARAM) { - ChannelModeParam *cmp = static_cast<ChannelModeParam *>(cmp); + ChannelModeParam *cmp = dynamic_cast<ChannelModeParam *>(cmp); if (!cmp->MinusNoArg) { @@ -246,7 +246,7 @@ void Channel::SetModeInternal(ChannelMode *cm, const std::string ¶m, bool En /* If this is a param mode and its mlocked +, check to ensure someone didn't reset it with the wrong param */ else if (cm->Type == MODE_PARAM && ci->HasMLock(cm->Name, true)) { - ChannelModeParam *cmp = static_cast<ChannelModeParam *>(cm); + ChannelModeParam *cmp = dynamic_cast<ChannelModeParam *>(cm); std::string cparam, ciparam; /* Get the param currently set on this channel */ GetParam(cmp->Name, &cparam); @@ -295,7 +295,7 @@ void Channel::RemoveModeInternal(ChannelMode *cm, const std::string ¶m, bool if (debug) alog("debug: Setting +%c on %s for %s", cm->ModeChar, this->name, u->nick); - ChannelModeStatus *cms = static_cast<ChannelModeStatus *>(cm); + ChannelModeStatus *cms = dynamic_cast<ChannelModeStatus *>(cm); chan_remove_user_status(this, u, cms->Status); return; } @@ -308,7 +308,7 @@ void Channel::RemoveModeInternal(ChannelMode *cm, const std::string ¶m, bool return; } - ChannelModeList *cml = static_cast<ChannelModeList *>(cm); + ChannelModeList *cml = dynamic_cast<ChannelModeList *>(cm); cml->DelMask(this, param.c_str()); return; } @@ -495,7 +495,7 @@ void Channel::ClearModes(BotInfo *bi) } else if (cm->Type == MODE_PARAM) { - cmp = static_cast<ChannelModeParam *>(cm); + cmp = dynamic_cast<ChannelModeParam *>(cm); if (!cmp->MinusNoArg) { @@ -522,7 +522,7 @@ void Channel::ClearBans(BotInfo *bi) Entry *entry, *nexte; ChannelModeList *cml; - cml = static_cast<ChannelModeList *>(ModeManager::FindChannelModeByName(CMODE_BAN)); + cml = dynamic_cast<ChannelModeList *>(ModeManager::FindChannelModeByName(CMODE_BAN)); if (cml && this->bans && this->bans->count) { @@ -543,7 +543,7 @@ void Channel::ClearExcepts(BotInfo *bi) Entry *entry, *nexte; ChannelModeList *cml; - cml = static_cast<ChannelModeList *>(ModeManager::FindChannelModeByName(CMODE_EXCEPT)); + cml = dynamic_cast<ChannelModeList *>(ModeManager::FindChannelModeByName(CMODE_EXCEPT)); if (cml && this->excepts && this->excepts->count) { @@ -564,7 +564,7 @@ void Channel::ClearInvites(BotInfo *bi) Entry *entry, *nexte; ChannelModeList *cml; - cml = static_cast<ChannelModeList *>(ModeManager::FindChannelModeByName(CMODE_INVITEOVERRIDE)); + cml = dynamic_cast<ChannelModeList *>(ModeManager::FindChannelModeByName(CMODE_INVITEOVERRIDE)); if (cml && this->invites && this->invites->count) { @@ -674,7 +674,7 @@ void ChanSetInternalModes(Channel *c, int ac, const char **av) } else if (cm->Type == MODE_PARAM) { - ChannelModeParam *cmp = static_cast<ChannelModeParam *>(cm); + ChannelModeParam *cmp = dynamic_cast<ChannelModeParam *>(cm); if (!add && cmp->MinusNoArg) { @@ -771,7 +771,7 @@ char *chan_get_modes(Channel * chan, int complete, int plus) { if (cm->Type == MODE_PARAM) { - cmp = static_cast<ChannelModeParam *>(cm); + cmp = dynamic_cast<ChannelModeParam *>(cm); if (plus || !cmp->MinusNoArg) { @@ -1358,7 +1358,7 @@ void do_sjoin(const char *source, int ac, const char **av) if (*s == ircd->sjoinbanchar && keep_their_modes) { buf = myStrGetToken(s, ircd->sjoinbanchar, 1); - cml = static_cast<ChannelModeList *>(ModeManager::FindChannelModeByName(CMODE_BAN)); + cml = dynamic_cast<ChannelModeList *>(ModeManager::FindChannelModeByName(CMODE_BAN)); if (cml->IsValid(buf)) cml->AddMask(c, buf); @@ -1373,7 +1373,7 @@ void do_sjoin(const char *source, int ac, const char **av) if (*s == ircd->sjoinexchar && keep_their_modes) { buf = myStrGetToken(s, ircd->sjoinexchar, 1); - cml = static_cast<ChannelModeList *>(ModeManager::FindChannelModeByName(CMODE_EXCEPT)); + cml = dynamic_cast<ChannelModeList *>(ModeManager::FindChannelModeByName(CMODE_EXCEPT)); if (cml->IsValid(buf)) cml->AddMask(c, buf); @@ -1389,7 +1389,7 @@ void do_sjoin(const char *source, int ac, const char **av) if (*s == ircd->sjoininvchar && keep_their_modes) { buf = myStrGetToken(s, ircd->sjoininvchar, 1); - cml = static_cast<ChannelModeList *>(ModeManager::FindChannelModeByName(CMODE_INVITEOVERRIDE)); + cml = dynamic_cast<ChannelModeList *>(ModeManager::FindChannelModeByName(CMODE_INVITEOVERRIDE)); if (cml->IsValid(buf)) cml->AddMask(c, buf); diff --git a/src/chanserv.c b/src/chanserv.c index 941925b1b..dc5345ed6 100644 --- a/src/chanserv.c +++ b/src/chanserv.c @@ -193,7 +193,7 @@ char *get_mlock_modes(ChannelInfo * ci, int complete) if (cm->Type == MODE_PARAM) { - cmp = static_cast<ChannelModeParam *>(cm); + cmp = dynamic_cast<ChannelModeParam *>(cm); ci->GetParam(cmp->Name, ¶m); @@ -395,7 +395,7 @@ void check_modes(Channel *c) /* Add the eventual parameter */ if (cm->Type == MODE_PARAM) { - cmp = static_cast<ChannelModeParam *>(cm); + cmp = dynamic_cast<ChannelModeParam *>(cm); if (!cmp->MinusNoArg) { diff --git a/src/core/cs_set.c b/src/core/cs_set.c index 1ac511e17..3d2876f38 100644 --- a/src/core/cs_set.c +++ b/src/core/cs_set.c @@ -212,7 +212,7 @@ class CommandCSSet : public Command if (cm->Type == MODE_PARAM) { - cmp = static_cast<ChannelModeParam *>(cm); + cmp = dynamic_cast<ChannelModeParam *>(cm); if (!modeparams.GetToken(param)) continue; diff --git a/src/core/os_defcon.c b/src/core/os_defcon.c index 4b427d602..804839bf8 100644 --- a/src/core/os_defcon.c +++ b/src/core/os_defcon.c @@ -445,7 +445,7 @@ void defconParseModeString(const char *str) if (cm->Type == MODE_PARAM) { - cmp = static_cast<ChannelModeParam *>(cm); + cmp = dynamic_cast<ChannelModeParam *>(cm); if (!ss.GetToken(param)) { diff --git a/src/modes.cpp b/src/modes.cpp index 90a3a648c..9fed6da55 100644 --- a/src/modes.cpp +++ b/src/modes.cpp @@ -713,7 +713,7 @@ char ModeManager::GetStatusChar(char Value) cm = it->second; if (cm->Type == MODE_STATUS) { - cms = static_cast<ChannelModeStatus *>(cm); + cms = dynamic_cast<ChannelModeStatus *>(cm); if (Value == cms->Symbol) { diff --git a/src/protocol/ratbox.c b/src/protocol/ratbox.c index f10a4abcd..3b9f982aa 100644 --- a/src/protocol/ratbox.c +++ b/src/protocol/ratbox.c @@ -735,15 +735,15 @@ int anope_event_bmask(const char *source, int ac, const char **av) for (i = 0; i <= count - 1; i++) { b = myStrGetToken(bans, ' ', i); if (!stricmp(av[2], "b")) { - cms = static_cast<ChannelModeList *>(ModeManager::FindChannelModeByChar('b')); + cms = dynamic_cast<ChannelModeList *>(ModeManager::FindChannelModeByChar('b')); cms->AddMask(c, b); } if (!stricmp(av[2], "e")) { - cms = static_cast<ChannelModeList *>(ModeManager::FindChannelModeByChar('e')); + cms = dynamic_cast<ChannelModeList *>(ModeManager::FindChannelModeByChar('e')); cms->AddMask(c, b); } if (!stricmp(av[2], "I")) { - cms = static_cast<ChannelModeList *>(ModeManager::FindChannelModeByChar('I')); + cms = dynamic_cast<ChannelModeList *>(ModeManager::FindChannelModeByChar('I')); cms->AddMask(c, b); } if (b) |