]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/configreader.cpp
Commit patch from danieldg that makes a ton of stuff const-safe for latest warn-happy...
[user/henk/code/inspircd.git] / src / configreader.cpp
index f083f7895c2cdd8380fc467709a5ca3478d2beb2..fe02bc2bd462a33f29d1a22e3a72026fe75e5122 100644 (file)
@@ -160,7 +160,7 @@ void ServerConfig::Send005(User* user)
                user->WriteServ("005 %s %s", user->nick, line->c_str());
 }
 
-bool ServerConfig::CheckOnce(char* tag)
+bool ServerConfig::CheckOnce(const char* tag)
 {
        int count = ConfValueEnum(this->config_data, tag);
 
@@ -583,11 +583,11 @@ bool DoConnect(ServerConfig* conf, const char*, char**, ValueList &values, int*)
         */
        for (ClassVector::iterator item = conf->Classes.begin(); item != conf->Classes.end(); ++item)
        {
-               ConnectClass* c = *item;
-               if ((*name && (c->GetName() == name)) || (*allow && (c->GetHost() == allow)) || (*deny && (c->GetHost() == deny)))
+               ConnectClass* cc = *item;
+               if ((*name && (cc->GetName() == name)) || (*allow && (cc->GetHost() == allow)) || (*deny && (cc->GetHost() == deny)))
                {
                        /* reenable class so users can be shoved into it :P */
-                       c->SetDisabled(false);
+                       cc->SetDisabled(false);
                        conf->GetInstance()->Log(DEFAULT, "Not adding class, it already exists!");
                        return true;
                } 
@@ -603,11 +603,11 @@ bool DoConnect(ServerConfig* conf, const char*, char**, ValueList &values, int*)
                ClassVector::iterator item = conf->Classes.begin();
                for (; item != conf->Classes.end(); ++item)
                {
-                       ConnectClass* c = *item;
-                       conf->GetInstance()->Log(DEBUG,"Class: %s", c->GetName().c_str());
-                       if (c->GetName() == parent)
+                       ConnectClass* cc = *item;
+                       conf->GetInstance()->Log(DEBUG,"Class: %s", cc->GetName().c_str());
+                       if (cc->GetName() == parent)
                        {
-                               ConnectClass* newclass = new ConnectClass(name, c);
+                               ConnectClass* newclass = new ConnectClass(name, cc);
                                newclass->Update(timeout, flood, *allow ? allow : deny, pingfreq, password, threshold, sendq, recvq, localmax, globalmax, maxchans, port, limit);
                                conf->Classes.push_back(newclass);
                                break;
@@ -620,16 +620,16 @@ bool DoConnect(ServerConfig* conf, const char*, char**, ValueList &values, int*)
        {
                if (*allow)
                {
-                       ConnectClass* c = new ConnectClass(name, timeout, flood, allow, pingfreq, password, hashtype, threshold, sendq, recvq, localmax, globalmax, maxchans);
-                       c->limit = limit;
-                       c->SetPort(port);
-                       conf->Classes.push_back(c);
+                       ConnectClass* cc = new ConnectClass(name, timeout, flood, allow, pingfreq, password, hashtype, threshold, sendq, recvq, localmax, globalmax, maxchans);
+                       cc->limit = limit;
+                       cc->SetPort(port);
+                       conf->Classes.push_back(cc);
                }
                else
                {
-                       ConnectClass* c = new ConnectClass(name, deny);
-                       c->SetPort(port);
-                       conf->Classes.push_back(c);
+                       ConnectClass* cc = new ConnectClass(name, deny);
+                       cc->SetPort(port);
+                       conf->Classes.push_back(cc);
                }
        }
 
@@ -800,7 +800,7 @@ void ServerConfig::Read(bool bail, User* user, int pass)
        errstr.clear();
 
        /* These tags MUST occur and must ONLY occur once in the config file */
-       static char* Once[] = { "server", "admin", "files", "power", "options", NULL };
+       static const char* Once[] = { "server", "admin", "files", "power", "options", NULL };
 
        /* These tags can occur ONCE or not at all */
        InitialConfig Values[] = {
@@ -2124,12 +2124,7 @@ ValueItem::ValueItem(bool value)
        v = n.str();
 }
 
-ValueItem::ValueItem(char* value)
-{
-       v = value;
-}
-
-void ValueItem::Set(char* value)
+ValueItem::ValueItem(const char* value)
 {
        v = value;
 }