From f1271614679843191bb247c0db2716acb5ac0e4b Mon Sep 17 00:00:00 2001 From: w00t Date: Sun, 3 Feb 2008 23:20:20 +0000 Subject: Clear up header insanity git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8808 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/configreader.cpp | 2 +- src/hashcomp.cpp | 6 ++---- src/modules.cpp | 2 +- src/modules/m_alltime.cpp | 4 ++-- src/modules/m_conn_join.cpp | 8 ++++---- src/modules/m_conn_umodes.cpp | 4 ++-- src/modules/m_deaf.cpp | 4 ++-- src/modules/m_filter.h | 2 +- src/modules/m_http_client.cpp | 10 +++++----- src/modules/m_operjoin.cpp | 8 ++++---- src/modules/m_opermodes.cpp | 4 ++-- src/modules/m_spanningtree/treesocket2.cpp | 2 +- src/modules/m_spanningtree/utils.h | 4 ++-- src/server.cpp | 4 ++-- 14 files changed, 31 insertions(+), 33 deletions(-) (limited to 'src') diff --git a/src/configreader.cpp b/src/configreader.cpp index 945780a54..f083f7895 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -335,7 +335,7 @@ bool ValidateDnsServer(ServerConfig* conf, const char*, const char*, ValueItem & std::string nameserver; // attempt to look up their nameserver from /etc/resolv.conf conf->GetInstance()->Log(DEFAULT,"WARNING: not defined, attempting to find working server in /etc/resolv.conf..."); - ifstream resolv("/etc/resolv.conf"); + std::ifstream resolv("/etc/resolv.conf"); bool found_server = false; if (resolv.is_open()) diff --git a/src/hashcomp.cpp b/src/hashcomp.cpp index 15be92bd7..f73a6f1c1 100644 --- a/src/hashcomp.cpp +++ b/src/hashcomp.cpp @@ -49,8 +49,6 @@ using stdext::hash_map; * ******************************************************/ -using namespace irc::sockets; - /* convert a string to lowercase. Note following special circumstances * taken from RFC 1459. Many "official" server branches still hold to this * rule so i will too; @@ -70,9 +68,9 @@ void nspace::strlower(char *n) } #ifndef WIN32 -size_t nspace::hash::operator()(const string &s) const +size_t nspace::hash::operator()(const std::string &s) const #else -size_t nspace::hash_compare >::operator()(const string &s) const +size_t nspace::hash_compare >::operator()(const std::string &s) const #endif { /* XXX: NO DATA COPIES! :) diff --git a/src/modules.cpp b/src/modules.cpp index 6cc1a3450..0142749cf 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -744,7 +744,7 @@ void InspIRCd::SendMode(const char** parameters, int pcnt, User *user) this->Modes->Process(parameters,pcnt,user,true); } -void InspIRCd::DumpText(User* User, const std::string &LinePrefix, stringstream &TextStream) +void InspIRCd::DumpText(User* User, const std::string &LinePrefix, std::stringstream &TextStream) { std::string CompleteLine = LinePrefix; std::string Word; diff --git a/src/modules/m_alltime.cpp b/src/modules/m_alltime.cpp index aa244b45d..602646ebd 100644 --- a/src/modules/m_alltime.cpp +++ b/src/modules/m_alltime.cpp @@ -36,7 +36,7 @@ class CommandAlltime : public Command int delta = ServerInstance->GetTimeDelta(); - string msg = ":" + string(ServerInstance->Config->ServerName) + " NOTICE " + user->nick + " :System time for " + + std::string msg = ":" + std::string(ServerInstance->Config->ServerName) + " NOTICE " + user->nick + " :System time for " + ServerInstance->Config->ServerName + " is: " + fmtdate + " (delta " + ConvToStr(delta) + " seconds): Time with delta: "+ fmtdate2; if (IS_LOCAL(user)) @@ -45,7 +45,7 @@ class CommandAlltime : public Command } else { - deque params; + std::deque params; params.push_back(user->nick); params.push_back(msg); Event ev((char *) ¶ms, NULL, "send_push"); diff --git a/src/modules/m_conn_join.cpp b/src/modules/m_conn_join.cpp index bdd8f43ea..b3be3932b 100644 --- a/src/modules/m_conn_join.cpp +++ b/src/modules/m_conn_join.cpp @@ -22,14 +22,14 @@ class ModuleConnJoin : public Module std::vector Joinchans; - int tokenize(const string &str, std::vector &tokens) + int tokenize(const std::string &str, std::vector &tokens) { // skip delimiters at beginning. - string::size_type lastPos = str.find_first_not_of(",", 0); + std::string::size_type lastPos = str.find_first_not_of(",", 0); // find first "non-delimiter". - string::size_type pos = str.find_first_of(",", lastPos); + std::string::size_type pos = str.find_first_of(",", lastPos); - while (string::npos != pos || string::npos != lastPos) + while (std::string::npos != pos || std::string::npos != lastPos) { // found a token, add it to the vector. tokens.push_back(str.substr(lastPos, pos - lastPos)); diff --git a/src/modules/m_conn_umodes.cpp b/src/modules/m_conn_umodes.cpp index 6ba965d61..bfae76f1b 100644 --- a/src/modules/m_conn_umodes.cpp +++ b/src/modules/m_conn_umodes.cpp @@ -63,9 +63,9 @@ class ModuleModesOnConnect : public Module if (!ThisModes.empty()) { std::string buf; - stringstream ss(ThisModes); + std::stringstream ss(ThisModes); - vector tokens; + std::vector tokens; // split ThisUserModes into modes and mode params while (ss >> buf) diff --git a/src/modules/m_deaf.cpp b/src/modules/m_deaf.cpp index 5d648cff9..ed110d6c9 100644 --- a/src/modules/m_deaf.cpp +++ b/src/modules/m_deaf.cpp @@ -118,13 +118,13 @@ class ModuleDeaf : public Module if (!deaf_bypasschars.empty()) { is_bypasschar_avail = 1; - if (deaf_bypasschars.find(text[0], 0) != string::npos) + if (deaf_bypasschars.find(text[0], 0) != std::string::npos) is_bypasschar = 1; } if (!deaf_bypasschars_uline.empty()) { is_bypasschar_uline_avail = 1; - if (deaf_bypasschars_uline.find(text[0], 0) != string::npos) + if (deaf_bypasschars_uline.find(text[0], 0) != std::string::npos) is_bypasschar_uline = 1; } diff --git a/src/modules/m_filter.h b/src/modules/m_filter.h index c4d2e71ef..5bc41b136 100644 --- a/src/modules/m_filter.h +++ b/src/modules/m_filter.h @@ -388,7 +388,7 @@ int FilterBase::OnPreCommand(const std::string &command, const char** parameters void FilterBase::OnRehash(User* user, const std::string ¶meter) { ConfigReader* MyConf = new ConfigReader(ServerInstance); - vector().swap(exemptfromfilter); + std::vector().swap(exemptfromfilter); for (int index = 0; index < MyConf->Enumerate("exemptfromfilter"); ++index) { std::string chan = MyConf->ReadValue("exemptfromfilter", "channel", index); diff --git a/src/modules/m_http_client.cpp b/src/modules/m_http_client.cpp index a2a6d9014..1ca762b12 100644 --- a/src/modules/m_http_client.cpp +++ b/src/modules/m_http_client.cpp @@ -54,13 +54,13 @@ class HTTPResolver : public Resolver HTTPSocket *socket; std::string orig; public: - HTTPResolver(HTTPSocket *s, InspIRCd *Instance, const string &hostname, bool &cached, Module* me) : Resolver(Instance, hostname, DNS_QUERY_FORWARD, cached, me), socket(s) + HTTPResolver(HTTPSocket *s, InspIRCd *Instance, const std::string &hostname, bool &cached, Module* me) : Resolver(Instance, hostname, DNS_QUERY_FORWARD, cached, me), socket(s) { ServerInstance->Log(DEBUG,">>>>>>>>>>>>>>>>>> HTTPResolver::HTTPResolver <<<<<<<<<<<<<<<"); orig = hostname; } - void OnLookupComplete(const string &result, unsigned int ttl, bool cached, int resultnum = 0) + void OnLookupComplete(const std::string &result, unsigned int ttl, bool cached, int resultnum = 0) { ServerInstance->Log(DEBUG,"************* HTTPResolver::OnLookupComplete ***************"); if (!resultnum) @@ -69,14 +69,14 @@ class HTTPResolver : public Resolver socket->OnClose(); } - void OnError(ResolverError e, const string &errmsg) + void OnError(ResolverError e, const std::string &errmsg) { ServerInstance->Log(DEBUG,"!!!!!!!!!!!!!!!! HTTPResolver::OnError: %s", errmsg.c_str()); socket->OnClose(); } }; -typedef vector HTTPList; +typedef std::vector HTTPList; class ModuleHTTPClient : public Module { @@ -256,7 +256,7 @@ bool HTTPSocket::ParseURL(const std::string &iurl) return true; } -void HTTPSocket::Connect(const string &ip) +void HTTPSocket::Connect(const std::string &ip) { this->response = new HTTPClientResponse((Module*)Mod, req.GetSource() , url.url, 0, ""); diff --git a/src/modules/m_operjoin.cpp b/src/modules/m_operjoin.cpp index be12b6be1..60796fd3f 100644 --- a/src/modules/m_operjoin.cpp +++ b/src/modules/m_operjoin.cpp @@ -21,14 +21,14 @@ class ModuleOperjoin : public Module std::string operChan; std::vector operChans; - int tokenize(const string &str, std::vector &tokens) + int tokenize(const std::string &str, std::vector &tokens) { // skip delimiters at beginning. - string::size_type lastPos = str.find_first_not_of(",", 0); + std::string::size_type lastPos = str.find_first_not_of(",", 0); // find first "non-delimiter". - string::size_type pos = str.find_first_of(",", lastPos); + std::string::size_type pos = str.find_first_of(",", lastPos); - while (string::npos != pos || string::npos != lastPos) + while (std::string::npos != pos || std::string::npos != lastPos) { // found a token, add it to the vector. tokens.push_back(str.substr(lastPos, pos - lastPos)); diff --git a/src/modules/m_opermodes.cpp b/src/modules/m_opermodes.cpp index 7e96c86d7..cdd59c7b6 100644 --- a/src/modules/m_opermodes.cpp +++ b/src/modules/m_opermodes.cpp @@ -92,8 +92,8 @@ class ModuleModesOnOper : public Module smodes = "+" + smodes; std::string buf; - stringstream ss(smodes); - vector tokens; + std::stringstream ss(smodes); + std::vector tokens; // split into modes and mode params while (ss >> buf) diff --git a/src/modules/m_spanningtree/treesocket2.cpp b/src/modules/m_spanningtree/treesocket2.cpp index f3eff8d74..f668b9061 100644 --- a/src/modules/m_spanningtree/treesocket2.cpp +++ b/src/modules/m_spanningtree/treesocket2.cpp @@ -1661,7 +1661,7 @@ int TreeSocket::OnIncomingConnection(int newsock, char* ip) found = (std::find(Utils->ValidIPs.begin(), Utils->ValidIPs.end(), ip) != Utils->ValidIPs.end()); if (!found) { - for (vector::iterator i = Utils->ValidIPs.begin(); i != Utils->ValidIPs.end(); i++) + for (std::vector::iterator i = Utils->ValidIPs.begin(); i != Utils->ValidIPs.end(); i++) if (irc::sockets::MatchCIDR(ip, (*i).c_str())) found = true; diff --git a/src/modules/m_spanningtree/utils.h b/src/modules/m_spanningtree/utils.h index 0dbf06ec9..a77c1d27d 100644 --- a/src/modules/m_spanningtree/utils.h +++ b/src/modules/m_spanningtree/utils.h @@ -26,9 +26,9 @@ class ModuleSpanningTree; * tree, used for rapid linear lookups. */ #ifdef WINDOWS -typedef nspace::hash_map > > server_hash; +typedef nspace::hash_map > > server_hash; #else -typedef nspace::hash_map, irc::StrHashComp> server_hash; +typedef nspace::hash_map, irc::StrHashComp> server_hash; #endif typedef std::map TreeServerList; diff --git a/src/server.cpp b/src/server.cpp index a73abcac2..2a30f3a37 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -106,7 +106,7 @@ void InspIRCd::AddServerName(const std::string &servername) if(**itr == servername) return; - string * ns = new string(servername); + std::string * ns = new std::string(servername); servernames.push_back(ns); } @@ -117,7 +117,7 @@ const char* InspIRCd::FindServerNamePtr(const std::string &servername) if(**itr == servername) return (*itr)->c_str(); - servernames.push_back(new string(servername)); + servernames.push_back(new std::string(servername)); itr = --servernames.end(); return (*itr)->c_str(); } -- cgit v1.2.3