diff options
-rw-r--r-- | include/inspircd.h | 9 | ||||
-rw-r--r-- | include/users.h | 18 | ||||
-rw-r--r-- | src/modules/m_spanningtree.cpp | 7 | ||||
-rw-r--r-- | src/users.cpp | 11 |
4 files changed, 19 insertions, 26 deletions
diff --git a/include/inspircd.h b/include/inspircd.h index db30ca7cb..89764f1c4 100644 --- a/include/inspircd.h +++ b/include/inspircd.h @@ -37,6 +37,7 @@ #include <arpa/inet.h> #include <string> #include <deque> +#include <sstream> #include "inspircd_io.h" #include "users.h" @@ -63,6 +64,14 @@ // addition. #define IS_SINGLE(x,y) ( (*x == y) && (*(x+1) == 0) ) +template<typename T> inline std::string ConvToStr(const T &in) +{ + std::stringstream tmp; + if (!(tmp << in)) return std::string(); + return tmp.str(); +} + + class serverstats { public: diff --git a/include/users.h b/include/users.h index b6ad57c64..dfd5c5e89 100644 --- a/include/users.h +++ b/include/users.h @@ -28,16 +28,18 @@ #include "hashcomp.h" #include "cull_list.h" - -#define STATUS_OP 4 -#define STATUS_HOP 2 -#define STATUS_VOICE 1 -#define STATUS_NORMAL 0 -#define CC_ALLOW 0 -#define CC_DENY 1 +enum ChanStatus { + STATUS_OP = 4, + STATUS_HOP = 2, + STATUS_VOICE = 1, + STATUS_NORMAL = 0 +}; -template<typename T> string ConvToStr(const T &in); +enum ClassTypes { + CC_ALLOW = 0, + CC_DENY = 1 +}; /** Holds a channel name to which a user has been invited. */ diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp index 177ef2123..21fdbd6fa 100644 --- a/src/modules/m_spanningtree.cpp +++ b/src/modules/m_spanningtree.cpp @@ -468,13 +468,6 @@ class Link ConfigReader *Conf; std::vector<Link> LinkBlocks; -template<typename T> inline string ConvToStr(const T &in) -{ - stringstream tmp; - if (!(tmp << in)) return string(); - return tmp.str(); -} - /* Yay for fast searches! * This is hundreds of times faster than recursion * or even scanning a linked list, especially when diff --git a/src/users.cpp b/src/users.cpp index 985ef8707..c7f74da0b 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -88,8 +88,6 @@ bool DoType(const char* tag, char** entries, void** values, int* types) { char* TypeName = (char*)values[0]; char* Classes = (char*)values[1]; - /*Config->ConfValue("type","name",j,TypeName,&Config->config_f); - Config->ConfValue("type","classes",j,Classes,&Config->config_f);*/ opertypes[TypeName] = strdup(Classes); log(DEBUG,"Read oper TYPE '%s' with classes '%s'",TypeName,Classes); return true; @@ -99,8 +97,6 @@ bool DoClass(const char* tag, char** entries, void** values, int* types) { char* ClassName = (char*)values[0]; char* CommandList = (char*)values[1]; - /*Config->ConfValue("class","name",k,ClassName,&Config->config_f); - Config->ConfValue("class","commands",k,CommandList,&Config->config_f);*/ operclass[ClassName] = strdup(CommandList); log(DEBUG,"Read oper CLASS '%s' with commands '%s'",ClassName,CommandList); return true; @@ -111,13 +107,6 @@ bool DoneClassesAndTypes(const char* tag) return true; } -template<typename T> inline string ConvToStr(const T &in) -{ - stringstream tmp; - if (!(tmp << in)) return string(); - return tmp.str(); -} - userrec::userrec() { // the PROPER way to do it, AVOID bzero at *ALL* costs |