1
0
mirror of https://github.com/anope/anope.git synced 2026-06-12 19:14:47 +02:00

Made Base not virtual, prevents us from having to dynamic cast in the mode stacker on release builds

This commit is contained in:
Adam
2010-11-04 00:36:53 -04:00
parent 4fb4858952
commit cbd0f52eff
8 changed files with 15 additions and 15 deletions
+1 -1
View File
@@ -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;
+1 -1
View File
@@ -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;
+1 -1
View File
@@ -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 */
+2 -2
View File
@@ -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;
+1 -1
View File
@@ -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".
+1 -1
View File
@@ -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 */
+1 -1
View File
@@ -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 */
+7 -7
View File
@@ -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");