diff options
-rw-r--r-- | include/account.h | 4 | ||||
-rw-r--r-- | include/bots.h | 2 | ||||
-rw-r--r-- | include/channels.h | 6 | ||||
-rw-r--r-- | include/config.h | 4 | ||||
-rw-r--r-- | include/extern.h | 4 | ||||
-rw-r--r-- | include/operserv.h | 4 | ||||
-rw-r--r-- | include/regchannel.h | 6 | ||||
-rw-r--r-- | include/servers.h | 2 | ||||
-rw-r--r-- | include/services.h | 4 | ||||
-rw-r--r-- | include/users.h | 4 | ||||
-rw-r--r-- | src/channels.cpp | 2 | ||||
-rw-r--r-- | src/modes.cpp | 6 | ||||
-rw-r--r-- | src/operserv.cpp | 4 | ||||
-rw-r--r-- | src/servers.cpp | 2 |
14 files changed, 27 insertions, 27 deletions
diff --git a/include/account.h b/include/account.h index 0b7c95b44..7644d9d89 100644 --- a/include/account.h +++ b/include/account.h @@ -100,7 +100,7 @@ class CoreExport NickRequest : public Extensible class NickCore; -class CoreExport NickAlias : public Extensible, public Flags<NickNameFlag> +class CoreExport NickAlias : public Extensible, public Flags<NickNameFlag, NS_END> { public: /** Default constructor @@ -135,7 +135,7 @@ class CoreExport NickAlias : public Extensible, public Flags<NickNameFlag> void OnCancel(User *u); }; -class CoreExport NickCore : public Extensible, public Flags<NickCoreFlag> +class CoreExport NickCore : public Extensible, public Flags<NickCoreFlag, NI_END> { public: /** Default constructor diff --git a/include/bots.h b/include/bots.h index 9227f5c68..1b017b058 100644 --- a/include/bots.h +++ b/include/bots.h @@ -29,7 +29,7 @@ enum BotFlag BI_END }; -class CoreExport BotInfo : public Extensible, public Flags<BotFlag> +class CoreExport BotInfo : public Extensible, public Flags<BotFlag, BI_END> { public: std::string uid; /* required for UID supporting servers, as opposed to the shitty struct Uid. */ diff --git a/include/channels.h b/include/channels.h index 75f5dad3d..7cdc32de3 100644 --- a/include/channels.h +++ b/include/channels.h @@ -39,7 +39,7 @@ struct UserContainer { User *user; UserData ud; - Flags<ChannelModeName> *Status; + Flags<ChannelModeName, CMODE_END> *Status; UserContainer(User *u) : user(u) { } virtual ~UserContainer() { } @@ -55,7 +55,7 @@ enum ChannelFlags CH_SYNCING }; -class CoreExport Channel : public Extensible, public Flags<ChannelFlags> +class CoreExport Channel : public Extensible, public Flags<ChannelFlags, CMODE_END> { private: /** A map of channel modes with their parameters set on this channel @@ -63,7 +63,7 @@ class CoreExport Channel : public Extensible, public Flags<ChannelFlags> std::map<ChannelModeName, std::string> Params; /* Modes set on the channel */ - Flags<ChannelModeName> modes; + Flags<ChannelModeName, CMODE_END> modes; public: /** Default constructor diff --git a/include/config.h b/include/config.h index 9849e8c59..f6f794a33 100644 --- a/include/config.h +++ b/include/config.h @@ -576,7 +576,7 @@ class ServerConfig /* Don't allow nicks to use /ns group to regroup nicks */ bool NSNoGroupChange; /* Default flags for newly registered nicks */ - Flags<NickCoreFlag> NSDefFlags; + Flags<NickCoreFlag, NI_END> NSDefFlags; /* Default language used by services */ unsigned NSDefLanguage; /* Users must be connected this long before they can register @@ -616,7 +616,7 @@ class ServerConfig bool NSAddAccessOnReg; /* Default flags for newly registered channels */ - Flags<ChannelInfoFlag> CSDefFlags; + Flags<ChannelInfoFlag, CI_END> CSDefFlags; /* Max number of channels a user can own */ unsigned CSMaxReg; /* Time before a channel expires */ diff --git a/include/extern.h b/include/extern.h index 093def853..9e6c94de7 100644 --- a/include/extern.h +++ b/include/extern.h @@ -326,8 +326,8 @@ E int str_is_cidr(char *str, uint32 * ip, uint32 * mask, char **host); /**** 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> DefMLockOn; +E Flags<ChannelModeName, CMODE_END> DefMLockOff; E std::map<ChannelModeName, std::string> DefMLockParams; /* Modes to set on bots when they join the channel */ E std::list<ChannelModeStatus *> BotModes; diff --git a/include/operserv.h b/include/operserv.h index 35aff0dda..9dbe8e7c3 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> DefConModesOn; +extern CoreExport Flags<ChannelModeName, CMODE_END> DefConModesOff; extern CoreExport std::map<ChannelModeName, std::string> DefConModesOnParams; class XLineManager; diff --git a/include/regchannel.h b/include/regchannel.h index 947deda8c..ec04134f1 100644 --- a/include/regchannel.h +++ b/include/regchannel.h @@ -62,15 +62,15 @@ enum ChannelInfoFlag CI_END }; -class CoreExport ChannelInfo : public Extensible, public Flags<ChannelInfoFlag> +class CoreExport ChannelInfo : public Extensible, public Flags<ChannelInfoFlag, CI_END> { private: std::map<ChannelModeName, std::string> Params; /* Map of parameters by mode name for mlock */ 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> mlock_on; /* Modes mlocked on */ + Flags<ChannelModeName, CMODE_END> mlock_off; /* Modes mlocked off */ public: /** Default constructor diff --git a/include/servers.h b/include/servers.h index 2da40143e..615705052 100644 --- a/include/servers.h +++ b/include/servers.h @@ -59,7 +59,7 @@ struct CapabInfo CapabType Flag; }; -extern CoreExport Flags<CapabType> Capab; +extern CoreExport Flags<CapabType, CAPAB_END> Capab; extern CoreExport CapabInfo Capab_Info[]; /** Flags set on servers diff --git a/include/services.h b/include/services.h index c945c10d4..766137ba2 100644 --- a/include/services.h +++ b/include/services.h @@ -308,10 +308,10 @@ class DatabaseException : public CoreException /** Class with the ability to keep flags on items, they should extend from this * where T is an enum. */ -template<typename T> class Flags +template<typename T, size_t Size = 32> class Flags { protected: - std::bitset<128> Flag_Values; + std::bitset<Size> Flag_Values; public: /** Add a flag to this item diff --git a/include/users.h b/include/users.h index f5df0607c..a6e75680b 100644 --- a/include/users.h +++ b/include/users.h @@ -20,7 +20,7 @@ extern CoreExport user_uid_map UserListByUID; struct ChannelContainer { Channel *chan; - Flags<ChannelModeName> *Status; + Flags<ChannelModeName, CMODE_END> *Status; ChannelContainer(Channel *c) : chan(c) { } virtual ~ChannelContainer() { } @@ -36,7 +36,7 @@ class CoreExport User : public Extensible std::string ident; std::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> modes; /* Bitset of mode names the user has set on them */ std::map<UserModeName, std::string> Params; /* Map of user modes and the params this user has */ NickCore *nc; /* NickCore account the user is currently loggged in as */ diff --git a/src/channels.cpp b/src/channels.cpp index 1a846d1bd..e6ba3700b 100644 --- a/src/channels.cpp +++ b/src/channels.cpp @@ -97,7 +97,7 @@ void Channel::JoinUser(User *user) { Alog(LOG_DEBUG) << user->nick << " joins " << this->name; - Flags<ChannelModeName> *Status = new Flags<ChannelModeName>; + Flags<ChannelModeName, CMODE_END> *Status = new Flags<ChannelModeName, CMODE_END>; ChannelContainer *cc = new ChannelContainer(this); cc->Status = Status; user->chans.push_back(cc); diff --git a/src/modes.cpp b/src/modes.cpp index 506f9e483..65e6f0613 100644 --- a/src/modes.cpp +++ b/src/modes.cpp @@ -28,9 +28,9 @@ std::map<ChannelModeName, ChannelMode *> ModeManager::ChannelModesByName; /* Number of generic modes we support */ unsigned GenericChannelModes = 0, GenericUserModes = 0; /* Default mlocked modes on */ -Flags<ChannelModeName> DefMLockOn; +Flags<ChannelModeName, CMODE_END> DefMLockOn; /* Default mlocked modes off */ -Flags<ChannelModeName> DefMLockOff; +Flags<ChannelModeName, CMODE_END> DefMLockOff; /* Map for default mlocked mode parameters */ std::map<ChannelModeName, std::string> DefMLockParams; /* Modes to set on bots when they join the channel */ @@ -43,7 +43,7 @@ void SetDefaultMLock() DefMLockOn.ClearFlags(); DefMLockOff.ClearFlags(); DefMLockParams.clear(); - Flags<ChannelModeName> *ptr = NULL; + Flags<ChannelModeName, CMODE_END> *ptr = NULL; std::string modes, param; spacesepstream sep(Config.MLock); diff --git a/src/operserv.cpp b/src/operserv.cpp index 8c5a0f9ef..b97f66072 100644 --- a/src/operserv.cpp +++ b/src/operserv.cpp @@ -18,9 +18,9 @@ std::vector<NewsItem *> News; std::vector<std::bitset<32> > DefCon; bool DefConModesSet = false; /* Defcon modes mlocked on */ -Flags<ChannelModeName> DefConModesOn; +Flags<ChannelModeName, CMODE_END> DefConModesOn; /* Defcon modes mlocked off */ -Flags<ChannelModeName> DefConModesOff; +Flags<ChannelModeName, CMODE_END> DefConModesOff; /* Map of Modesa and Params for DefCon */ std::map<ChannelModeName, std::string> DefConModesOnParams; diff --git a/src/servers.cpp b/src/servers.cpp index f226deb1a..3a4a0233b 100644 --- a/src/servers.cpp +++ b/src/servers.cpp @@ -47,7 +47,7 @@ CapabInfo Capab_Info[] = { {"", CAPAB_END} }; -Flags<CapabType> Capab; +Flags<CapabType, CAPAB_END> Capab; /** Constructor * @param uplink The uplink this server is from, is only NULL when creating Me |