diff options
| author | Adam <Adam@anope.org> | 2010-07-27 21:31:13 -0400 |
|---|---|---|
| committer | Adam <Adam@anope.org> | 2010-07-27 21:31:13 -0400 |
| commit | 4b870cc5f9671201dfad6fa836847cdd40aef519 (patch) | |
| tree | 34aec3d880a22a8a828e5f5a7917e583cee92023 /modules/core | |
| parent | 66c0e280ee9d4940fe5a477d3e933ba4221e35db (diff) | |
Added debug_cast which uses dynamic_cast on debug builds, and static_cast on release builds
Diffstat (limited to 'modules/core')
| -rw-r--r-- | modules/core/cs_set_mlock.cpp | 2 | ||||
| -rw-r--r-- | modules/core/db_plain.cpp | 6 | ||||
| -rw-r--r-- | modules/core/os_defcon.cpp | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/modules/core/cs_set_mlock.cpp b/modules/core/cs_set_mlock.cpp index 2dc1ef2a7..166f6f71c 100644 --- a/modules/core/cs_set_mlock.cpp +++ b/modules/core/cs_set_mlock.cpp @@ -66,7 +66,7 @@ class CommandCSSetMLock : public Command Anope::string param = params[paramcount]; - ChannelModeParam *cmp = dynamic_cast<ChannelModeParam *>(cm); + ChannelModeParam *cmp = debug_cast<ChannelModeParam *>(cm); if (!cmp || !cmp->IsValid(param)) continue; diff --git a/modules/core/db_plain.cpp b/modules/core/db_plain.cpp index 331901f86..a9d87fab7 100644 --- a/modules/core/db_plain.cpp +++ b/modules/core/db_plain.cpp @@ -1014,7 +1014,7 @@ class DBPlain : public Module { if ((*it)->Class == MC_CHANNEL) { - ChannelMode *cm = dynamic_cast<ChannelMode *>(*it); + ChannelMode *cm = debug_cast<ChannelMode *>(*it); if (ci->HasMLock(cm->Name, true)) db << " " << cm->NameAsString; @@ -1029,7 +1029,7 @@ class DBPlain : public Module { if ((*it)->Class == MC_CHANNEL) { - ChannelMode *cm = dynamic_cast<ChannelMode *>(*it); + ChannelMode *cm = debug_cast<ChannelMode *>(*it); if (ci->HasMLock(cm->Name, false)) db << " " << cm->NameAsString; @@ -1042,7 +1042,7 @@ class DBPlain : public Module { if ((*it)->Class == MC_CHANNEL) { - ChannelMode *cm = dynamic_cast<ChannelMode *>(*it); + ChannelMode *cm = debug_cast<ChannelMode *>(*it); if (ci->GetParam(cm->Name, Param)) db << "MD MLP " << cm->NameAsString << " " << Param << endl; diff --git a/modules/core/os_defcon.cpp b/modules/core/os_defcon.cpp index 155937753..cb25b50bf 100644 --- a/modules/core/os_defcon.cpp +++ b/modules/core/os_defcon.cpp @@ -428,7 +428,7 @@ void defconParseModeString(const Anope::string &str) if (cm->Type == MODE_PARAM) { - cmp = dynamic_cast<ChannelModeParam *>(cm); + cmp = debug_cast<ChannelModeParam *>(cm); if (!ss.GetToken(param)) { |
