summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2010-11-04 00:36:53 -0400
committerAdam <Adam@anope.org>2010-11-04 00:36:53 -0400
commitcbd0f52eff232c1304658049ef9f2a64fc980a6c (patch)
treeade41601535941b0f106e30d1e1786abd1044eef
parent4fb485895204f051ad37fa9cb716e37497fc9652 (diff)
Made Base not virtual, prevents us from having to dynamic cast in the mode stacker on release builds
-rw-r--r--include/anope.h2
-rw-r--r--include/extensible.h2
-rw-r--r--include/modes.h2
-rw-r--r--include/modules.h4
-rw-r--r--include/opertype.h2
-rw-r--r--include/servers.h2
-rw-r--r--include/sockets.h2
-rw-r--r--src/modes.cpp14
8 files changed, 15 insertions, 15 deletions
diff --git a/include/anope.h b/include/anope.h
index 64efacc82..7b9e9ccd1 100644
--- a/include/anope.h
+++ b/include/anope.h
@@ -407,7 +407,7 @@ class CoreExport Base
void DelReference(dynamic_reference_base *r);
};
-class dynamic_reference_base : public virtual Base
+class dynamic_reference_base : public Base
{
protected:
bool invalid;
diff --git a/include/extensible.h b/include/extensible.h
index 29ac0504c..d795237ae 100644
--- a/include/extensible.h
+++ b/include/extensible.h
@@ -57,7 +57,7 @@ template<typename T> class ExtensibleItemPointerArray : public ExtensibleItemBas
T *GetItem() const { return Item; }
};
-class CoreExport Extensible : public virtual Base
+class CoreExport Extensible : public Base
{
private:
typedef std::map<Anope::string, ExtensibleItemBase *> extensible_map;
diff --git a/include/modes.h b/include/modes.h
index 0611306e9..f771c6e91 100644
--- a/include/modes.h
+++ b/include/modes.h
@@ -74,7 +74,7 @@ enum ModeClass
/** This class is the basis of all modes in Anope
*/
-class CoreExport Mode : public virtual Base
+class CoreExport Mode : public Base
{
public:
/* Class of mode this is */
diff --git a/include/modules.h b/include/modules.h
index efe2441a5..f39757489 100644
--- a/include/modules.h
+++ b/include/modules.h
@@ -202,7 +202,7 @@ class CallBack;
/** Every module in Anope is actually a class.
*/
-class CoreExport Module : public virtual Base
+class CoreExport Module : public Extensible
{
private:
bool permanent;
@@ -1223,7 +1223,7 @@ class CallBack : public Timer
}
};
-class CoreExport Service : public virtual Base
+class CoreExport Service : public Base
{
public:
Module *owner;
diff --git a/include/opertype.h b/include/opertype.h
index faf074bf8..40607b39f 100644
--- a/include/opertype.h
+++ b/include/opertype.h
@@ -10,7 +10,7 @@
#include "hashcomp.h"
-class CoreExport OperType : public virtual Base
+class CoreExport OperType
{
private:
/** The name of this opertype, e.g. "sra".
diff --git a/include/servers.h b/include/servers.h
index 2ba9510ba..43f3dc659 100644
--- a/include/servers.h
+++ b/include/servers.h
@@ -75,7 +75,7 @@ enum ServerFlag
/** Class representing a server
*/
-class CoreExport Server : public virtual Base, public Flags<ServerFlag>
+class CoreExport Server : public Flags<ServerFlag>
{
private:
/* Server name */
diff --git a/include/sockets.h b/include/sockets.h
index 2c3ddb94d..2f1b3c8d7 100644
--- a/include/sockets.h
+++ b/include/sockets.h
@@ -150,7 +150,7 @@ class CoreExport SocketIO
virtual void Destroy() { }
};
-class CoreExport Socket : public Flags<SocketFlag, 2>, public virtual Base
+class CoreExport Socket : public Flags<SocketFlag, 2>
{
protected:
/* Socket FD */
diff --git a/src/modes.cpp b/src/modes.cpp
index e8ee076fc..23cd0e402 100644
--- a/src/modes.cpp
+++ b/src/modes.cpp
@@ -549,12 +549,12 @@ std::list<Anope::string> ModeManager::BuildModeStrings(StackerInfo *info)
if (info->Type == ST_CHANNEL)
{
- cm = dynamic_cast<ChannelMode *>(it->first);
+ cm = debug_cast<ChannelMode *>(it->first);
buf += cm->ModeChar;
}
else if (info->Type == ST_USER)
{
- um = dynamic_cast<UserMode *>(it->first);
+ um = debug_cast<UserMode *>(it->first);
buf += um->ModeChar;
}
@@ -578,12 +578,12 @@ std::list<Anope::string> ModeManager::BuildModeStrings(StackerInfo *info)
if (info->Type == ST_CHANNEL)
{
- cm = dynamic_cast<ChannelMode *>(it->first);
+ cm = debug_cast<ChannelMode *>(it->first);
buf += cm->ModeChar;
}
else if (info->Type == ST_USER)
{
- um = dynamic_cast<UserMode *>(it->first);
+ um = debug_cast<UserMode *>(it->first);
buf += um->ModeChar;
}
@@ -616,7 +616,7 @@ void ModeManager::StackerAddInternal(BotInfo *bi, Base *Object, Mode *mode, bool
if (bi)
s->bi = bi;
else if (Type == ST_CHANNEL)
- s->bi = whosends(dynamic_cast<Channel *>(Object)->ci);
+ s->bi = whosends(debug_cast<Channel *>(Object)->ci);
else if (Type == ST_USER)
s->bi = NULL;
}
@@ -803,9 +803,9 @@ void ModeManager::ProcessModes()
Channel *c = NULL;
if (s->Type == ST_USER)
- u = dynamic_cast<User *>(it->first);
+ u = debug_cast<User *>(it->first);
else if (s->Type == ST_CHANNEL)
- c = dynamic_cast<Channel *>(it->first);
+ c = debug_cast<Channel *>(it->first);
else
throw CoreException("ModeManager::ProcessModes got invalid Stacker Info type");