summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/channels.h2
-rw-r--r--include/extern.h4
-rw-r--r--include/operserv.h4
-rw-r--r--include/regchannel.h4
-rw-r--r--include/services.h4
-rw-r--r--include/users.h4
6 files changed, 11 insertions, 11 deletions
diff --git a/include/channels.h b/include/channels.h
index d1e82fa8d..ec886c9ca 100644
--- a/include/channels.h
+++ b/include/channels.h
@@ -70,7 +70,7 @@ class CoreExport Channel : public Extensible, public Flags<ChannelFlags>
std::map<ChannelModeName, Anope::string> Params;
/* Modes set on the channel */
- Flags<ChannelModeName> modes;
+ Flags<ChannelModeName, CMODE_END * 2> modes;
public:
/** Default constructor
diff --git a/include/extern.h b/include/extern.h
index 05e43a980..9f2071a88 100644
--- a/include/extern.h
+++ b/include/extern.h
@@ -282,8 +282,8 @@ E bool str_is_cidr(const Anope::string &str, uint32 &ip, uint32 &mask, Anope::st
/**** modes.cpp ****/
/* Number of generic modes we support */
E unsigned GenericChannelModes, GenericUserModes;
-E Flags<ChannelModeName> DefMLockOn;
-E Flags<ChannelModeName> DefMLockOff;
+E Flags<ChannelModeName, CMODE_END * 2> DefMLockOn;
+E Flags<ChannelModeName, CMODE_END * 2> DefMLockOff;
E std::map<ChannelModeName, Anope::string> DefMLockParams;
E void SetDefaultMLock(ServerConfig *config);
diff --git a/include/operserv.h b/include/operserv.h
index 679a066a0..2711520cd 100644
--- a/include/operserv.h
+++ b/include/operserv.h
@@ -12,8 +12,8 @@
extern CoreExport std::vector<NewsItem *> News;
extern CoreExport std::vector<std::bitset<32> > DefCon;
extern CoreExport bool DefConModesSet;
-extern CoreExport Flags<ChannelModeName> DefConModesOn;
-extern CoreExport Flags<ChannelModeName> DefConModesOff;
+extern CoreExport Flags<ChannelModeName, CMODE_END * 2> DefConModesOn;
+extern CoreExport Flags<ChannelModeName, CMODE_END * 2> DefConModesOff;
extern CoreExport std::map<ChannelModeName, Anope::string> DefConModesOnParams;
class XLineManager;
diff --git a/include/regchannel.h b/include/regchannel.h
index e19b07f5e..80b25abfb 100644
--- a/include/regchannel.h
+++ b/include/regchannel.h
@@ -69,8 +69,8 @@ class CoreExport ChannelInfo : public Extensible, public Flags<ChannelInfoFlag,
std::vector<ChanAccess *> access; /* List of authorized users */
std::vector<AutoKick *> akick; /* List of users to kickban */
std::vector<BadWord *> badwords; /* List of badwords */
- Flags<ChannelModeName> mlock_on; /* Modes mlocked on */
- Flags<ChannelModeName> mlock_off; /* Modes mlocked off */
+ Flags<ChannelModeName, CMODE_END * 2> mlock_on; /* Modes mlocked on */
+ Flags<ChannelModeName, CMODE_END * 2> mlock_off; /* Modes mlocked off */
public:
/** Default constructor
diff --git a/include/services.h b/include/services.h
index f8f37be6e..4702dcff1 100644
--- a/include/services.h
+++ b/include/services.h
@@ -301,7 +301,7 @@ template<typename T, typename O> inline T debug_cast(O ptr)
{
#ifdef DEBUG_BUILD
T ret = dynamic_cast<T>(ptr);
- if (ret == NULL)
+ if (ptr != NULL && ret == NULL)
throw CoreException(Anope::string("debug_cast<") + typeid(T).name() + ">(" + typeid(O).name() + ") fail");
return ret;
#else
@@ -342,7 +342,7 @@ template<typename T, size_t Size = 32> class Flags
*/
bool HasFlag(T Value) const
{
- return Flag_Values[Value];
+ return Flag_Values.test(Value);
}
/** Check how many flags are set
diff --git a/include/users.h b/include/users.h
index e65068f33..596f5ee39 100644
--- a/include/users.h
+++ b/include/users.h
@@ -17,7 +17,7 @@ typedef unordered_map_namespace::unordered_map<Anope::string, User *, Anope::has
extern CoreExport user_map UserListByNick;
extern CoreExport user_uid_map UserListByUID;
-class ChannelStatus : public Flags<ChannelModeName>
+class ChannelStatus : public Flags<ChannelModeName, CMODE_END * 2>
{
public:
Anope::string BuildCharPrefixList() const;
@@ -43,7 +43,7 @@ class CoreExport User : public Extensible
Anope::string ident;
Anope::string uid;
bool OnAccess; /* If the user is on the access list of the nick theyre on */
- Flags<UserModeName> modes; /* Bitset of mode names the user has set on them */
+ Flags<UserModeName, UMODE_END * 2> modes; /* Bitset of mode names the user has set on them */
std::map<UserModeName, Anope::string> Params; /* Map of user modes and the params this user has */
NickCore *nc; /* NickCore account the user is currently loggged in as */