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 --- include/bancache.h | 2 - include/base.h | 2 - include/channels.h | 8 --- include/command_parse.h | 7 --- include/ctables.h | 9 --- include/dns.h | 14 +---- include/dynamic.h | 2 - include/filelogger.h | 6 -- include/globals.h | 5 -- include/hash_map.h | 2 - include/hashcomp.h | 17 ++---- include/inspircd.h | 12 +++- include/inspsocket.h | 7 --- include/inspstring.h | 3 +- include/mode.h | 7 --- include/snomasks.h | 6 -- include/socket.h | 1 - include/timer.h | 2 +- include/typedefs.h | 8 +-- include/u_listmode.h | 6 -- include/users.h | 89 ++++++++++++++---------------- include/wildcard.h | 2 - include/xline.h | 6 +- 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 +- 37 files changed, 97 insertions(+), 190 deletions(-) diff --git a/include/bancache.h b/include/bancache.h index b00bcbae5..3aee3cffd 100644 --- a/include/bancache.h +++ b/include/bancache.h @@ -14,8 +14,6 @@ #ifndef __BANCACHE_H #define __BANCACHE_H -#include - class CoreExport BanCacheHit : public classbase { private: diff --git a/include/base.h b/include/base.h index c0513e64d..904a1005c 100644 --- a/include/base.h +++ b/include/base.h @@ -14,8 +14,6 @@ #ifndef __BASE_H__ #define __BASE_H__ -#include "inspircd_config.h" -#include #include #include #include diff --git a/include/channels.h b/include/channels.h index 92dd9a1a3..3419e4c69 100644 --- a/include/channels.h +++ b/include/channels.h @@ -14,13 +14,6 @@ #ifndef __CHANNELS_H__ #define __CHANNELS_H__ -#include "inspircd_config.h" -#include "base.h" -#include -#include -#include -#include - /** RFC1459 channel modes */ enum ChannelModes { @@ -36,7 +29,6 @@ enum ChannelModes { /* Forward declarations - needed */ class User; -class Channel; /** Holds an entry for a ban list, exemption list, or invite list. * This class contains a single element in a channel list, such as a banlist. diff --git a/include/command_parse.h b/include/command_parse.h index c2fa78177..13b70997b 100644 --- a/include/command_parse.h +++ b/include/command_parse.h @@ -14,13 +14,6 @@ #ifndef __COMMAND_PARSE_H #define __COMMAND_PARSE_H -#include -#include "ctables.h" - -/** Required forward declaration - */ -class InspIRCd; - /** A list of dll/so files containing the command handlers for the core */ typedef std::map SharedObjectList; diff --git a/include/ctables.h b/include/ctables.h index 0bd767df0..8daddf192 100644 --- a/include/ctables.h +++ b/include/ctables.h @@ -14,15 +14,6 @@ #ifndef __CTABLES_H__ #define __CTABLES_H__ - -#include "inspircd_config.h" -#include "hash_map.h" -#include "base.h" - -/* Forward declarations - required */ -class User; -class InspIRCd; - /** Used to indicate command success codes */ enum CmdResult diff --git a/include/dns.h b/include/dns.h index 6972a1fb2..09ba10d25 100644 --- a/include/dns.h +++ b/include/dns.h @@ -32,21 +32,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #ifndef _DNS_H #define _DNS_H -#include -#include "inspircd_config.h" -#include "base.h" -#include "socketengine.h" #include "socket.h" -#include "hash_map.h" #include "hashcomp.h" -using namespace std; -using irc::sockets::insp_aton; -using irc::sockets::insp_ntoa; -using irc::sockets::insp_sockaddr; -using irc::sockets::insp_inaddr; - -class InspIRCd; class Module; /** @@ -419,7 +407,7 @@ class CoreExport DNS : public EventHandler * e.g. use ipv6 reverse lookup when built for ipv6, * or ipv4 lookup when built for ipv4. */ - int GetName(const insp_inaddr* ip); + int GetName(const irc::sockets::insp_inaddr* ip); /** * Start lookup of a hostname from an ip, but diff --git a/include/dynamic.h b/include/dynamic.h index 63229febb..4cf299c1f 100644 --- a/include/dynamic.h +++ b/include/dynamic.h @@ -14,8 +14,6 @@ #ifndef __DLL_H #define __DLL_H -#include "inspircd_config.h" - /** The DLLManager class is able to load a module file by filename, * and locate its init_module symbol. */ diff --git a/include/filelogger.h b/include/filelogger.h index 36e50b11c..1aeeb7750 100644 --- a/include/filelogger.h +++ b/include/filelogger.h @@ -14,12 +14,6 @@ #ifndef __LOG_H__ #define __LOG_H__ -#include -#include -#include -#include "socketengine.h" - - /** Debug levels for use with InspIRCd::Log() * */ enum DebugLevel diff --git a/include/globals.h b/include/globals.h index 463f85300..01a8b48e0 100644 --- a/include/globals.h +++ b/include/globals.h @@ -14,11 +14,6 @@ #ifndef __WORLD_H #define __WORLD_H -#include -#include -#include -#include - /** A cached text file stored with its contents as lines */ typedef std::deque file_cache; diff --git a/include/hash_map.h b/include/hash_map.h index 3c3703ce4..b922f6173 100644 --- a/include/hash_map.h +++ b/include/hash_map.h @@ -14,8 +14,6 @@ #ifndef INSPIRCD_HASHMAP_H #define INSPIRCD_HASHMAP_H -#include "inspircd_config.h" - /** Where hash_map is varies from compiler to compiler * as it is not standard. */ diff --git a/include/hashcomp.h b/include/hashcomp.h index dc07c190e..eafc74abf 100644 --- a/include/hashcomp.h +++ b/include/hashcomp.h @@ -14,8 +14,8 @@ #ifndef _HASHCOMP_H_ #define _HASHCOMP_H_ -#include "inspircd_config.h" -#include "socket.h" +//#include "inspircd_config.h" +//#include "socket.h" #include "hash_map.h" /******************************************************* @@ -33,15 +33,6 @@ * aware of irc::string. *******************************************************/ -/** Required namespaces and symbols */ -using namespace std; - -/** aton() */ -using irc::sockets::insp_aton; - -/** nota() */ -using irc::sockets::insp_ntoa; - #ifndef LOWERMAP #define LOWERMAP /** A mapping of uppercase to lowercase, including scandinavian @@ -133,7 +124,7 @@ namespace irc /** This typedef declares irc::string based upon irc_char_traits. */ - typedef basic_string > string; + typedef std::basic_string > string; /** irc::stringjoiner joins string lists into a string, using * the given seperator string. @@ -711,7 +702,7 @@ namespace nspace * @param s A string to hash * @return The hash value */ - size_t operator()(const string &s) const; + size_t operator()(const std::string &s) const; }; #endif diff --git a/include/inspircd.h b/include/inspircd.h index d78e25b48..71a809be9 100644 --- a/include/inspircd.h +++ b/include/inspircd.h @@ -36,17 +36,23 @@ #include "uid.h" #include "users.h" #include "channels.h" +#include "timer.h" #include "hashcomp.h" #include "typedefs.h" #include "usermanager.h" #include "socket.h" +#include "ctables.h" +#include "command_parse.h" #include "mode.h" #include "socketengine.h" -#include "command_parse.h" #include "snomasks.h" #include "cull_list.h" #include "filelogger.h" #include "caller.h" +//#include "inspsocket.h" +#include "modules.h" +#include "configreader.h" +#include "inspstring.h" /** * Used to define the maximum number of parameters a command may have. @@ -295,7 +301,7 @@ class CoreExport InspIRCd : public classbase /** Used when connecting clients */ - insp_sockaddr client, server; + irc::sockets::insp_sockaddr client, server; /** Used when connecting clients */ @@ -706,7 +712,7 @@ class CoreExport InspIRCd : public classbase * @param LinePrefix text to prefix each complete line with * @param TextStream the text to send to the user */ - void DumpText(User* User, const std::string &LinePrefix, stringstream &TextStream); + void DumpText(User* User, const std::string &LinePrefix, std::stringstream &TextStream); /** Check if the given nickmask matches too many users, send errors to the given user * @param nick A nickmask to match against diff --git a/include/inspsocket.h b/include/inspsocket.h index fd5d4dd18..77c283f7f 100644 --- a/include/inspsocket.h +++ b/include/inspsocket.h @@ -14,13 +14,6 @@ #ifndef __INSP_SOCKET_H__ #define __INSP_SOCKET_H__ -#include -#include -#include -#include "dns.h" -#include "inspircd_config.h" -#include "socket.h" -#include "inspsocket.h" #include "timer.h" /** diff --git a/include/inspstring.h b/include/inspstring.h index 714e06606..bb03bc2ed 100644 --- a/include/inspstring.h +++ b/include/inspstring.h @@ -14,9 +14,10 @@ #ifndef __IN_INSPSTRING_H #define __IN_INSPSTRING_H +// This (inspircd_config) is needed as inspstring doesn't pull in the central header #include "inspircd_config.h" #include -#include +//#include #ifndef HAS_STRLCPY /** strlcpy() implementation for systems that don't have it (linux) */ diff --git a/include/mode.h b/include/mode.h index eda18a528..716071176 100644 --- a/include/mode.h +++ b/include/mode.h @@ -14,13 +14,6 @@ #ifndef __MODE_H #define __MODE_H -#include -#include -#include -#include "ctables.h" - -class InspIRCd; - /** * Holds the values for different type of modes * that can exist, USER or CHANNEL type. diff --git a/include/snomasks.h b/include/snomasks.h index 334bbf0dc..e3318f23a 100644 --- a/include/snomasks.h +++ b/include/snomasks.h @@ -14,12 +14,6 @@ #ifndef __SNOMASKS_H__ #define __SNOMASKS_H__ -#include -#include -#include -#include "configreader.h" -#include "inspircd.h" - class Snomask { private: diff --git a/include/socket.h b/include/socket.h index 635b3ce55..53bad88f0 100644 --- a/include/socket.h +++ b/include/socket.h @@ -34,7 +34,6 @@ #endif #include -#include "inspircd_config.h" #include "socketengine.h" /* Contains irc-specific definitions */ diff --git a/include/timer.h b/include/timer.h index abe15a2b7..2c38ad88e 100644 --- a/include/timer.h +++ b/include/timer.h @@ -14,7 +14,7 @@ #ifndef INSPIRCD_TIMER_H #define INSPIRCD_TIMER_H -class InspIRCd; +//class InspIRCd; /** Timer class for one-second resolution timers * Timer provides a facility which allows module diff --git a/include/typedefs.h b/include/typedefs.h index 2a98da4ae..6395bfe39 100644 --- a/include/typedefs.h +++ b/include/typedefs.h @@ -17,17 +17,17 @@ #ifndef WIN32 /** User hash (POSIX systems with GCC) */ -typedef nspace::hash_map, irc::StrHashComp> user_hash; +typedef nspace::hash_map, irc::StrHashComp> user_hash; /** Channel hash (POSIX systems with GCC) */ -typedef nspace::hash_map, irc::StrHashComp> chan_hash; +typedef nspace::hash_map, irc::StrHashComp> chan_hash; #else /** User hash (windows systems with visual studio) */ -typedef nspace::hash_map > > user_hash; +typedef nspace::hash_map > > user_hash; /** Channel hash (windows systems with visual studio) */ -typedef nspace::hash_map > > chan_hash; +typedef nspace::hash_map > > chan_hash; #endif /** Server name cache diff --git a/include/u_listmode.h b/include/u_listmode.h index aa387ccf1..b9a11af82 100644 --- a/include/u_listmode.h +++ b/include/u_listmode.h @@ -14,12 +14,6 @@ #ifndef INSPIRCD_LISTMODE_PROVIDER #define INSPIRCD_LISTMODE_PROVIDER -#include -#include -#include -#include -#include "inspircd.h" -#include "modules.h" #include "wildcard.h" /** Get the time as a string diff --git a/include/users.h b/include/users.h index b9b23eaef..1fca831ef 100644 --- a/include/users.h +++ b/include/users.h @@ -14,13 +14,8 @@ #ifndef __USERS_H__ #define __USERS_H__ -#include -#include "inspircd_config.h" #include "socket.h" -#include "channels.h" -#include "inspstring.h" #include "connection.h" -#include "hashcomp.h" #include "dns.h" /** Channel status for a user @@ -76,47 +71,8 @@ enum RegistrationState { }; /* Required forward declaration */ -class InspIRCd; - -/** Derived from Resolver, and performs user forward/reverse lookups. - */ -class CoreExport UserResolver : public Resolver -{ - private: - /** User this class is 'attached' to. - */ - User* bound_user; - /** File descriptor teh lookup is bound to - */ - int bound_fd; - /** True if the lookup is forward, false if is a reverse lookup - */ - bool fwd; - public: - /** Create a resolver. - * @param Instance The creating instance - * @param user The user to begin lookup on - * @param to_resolve The IP or host to resolve - * @param qt The query type - * @param cache Modified by the constructor if the result was cached - */ - UserResolver(InspIRCd* Instance, User* user, std::string to_resolve, QueryType qt, bool &cache); - - /** Called on successful lookup - * @param result Result string - * @param ttl Time to live for result - * @param cached True if the result was found in the cache - * @param resultnum Result number, we are only interested in result 0 - */ - void OnLookupComplete(const std::string &result, unsigned int ttl, bool cached, int resultnum = 0); - - /** Called on failed lookup - * @param e Error code - * @param errormessage Error message string - */ - void OnError(ResolverError e, const std::string &errormessage); -}; - +class Channel; +class UserResolver; /** Holds information relevent to <connect allow> and <connect deny> tags in the config file. */ @@ -1146,8 +1102,47 @@ class CoreExport User : public connection virtual ~User(); }; +/** Derived from Resolver, and performs user forward/reverse lookups. + */ +class CoreExport UserResolver : public Resolver +{ + private: + /** User this class is 'attached' to. + */ + User* bound_user; + /** File descriptor teh lookup is bound to + */ + int bound_fd; + /** True if the lookup is forward, false if is a reverse lookup + */ + bool fwd; + public: + /** Create a resolver. + * @param Instance The creating instance + * @param user The user to begin lookup on + * @param to_resolve The IP or host to resolve + * @param qt The query type + * @param cache Modified by the constructor if the result was cached + */ + UserResolver(InspIRCd* Instance, User* user, std::string to_resolve, QueryType qt, bool &cache); + + /** Called on successful lookup + * @param result Result string + * @param ttl Time to live for result + * @param cached True if the result was found in the cache + * @param resultnum Result number, we are only interested in result 0 + */ + void OnLookupComplete(const std::string &result, unsigned int ttl, bool cached, int resultnum = 0); + + /** Called on failed lookup + * @param e Error code + * @param errormessage Error message string + */ + void OnError(ResolverError e, const std::string &errormessage); +}; + /* Configuration callbacks */ -class ServerConfig; +//class ServerConfig; #endif diff --git a/include/wildcard.h b/include/wildcard.h index dc2790b54..0d5e3e0aa 100644 --- a/include/wildcard.h +++ b/include/wildcard.h @@ -11,8 +11,6 @@ * --------------------------------------------------- */ -#include "inspircd_config.h" - /** Match a string against a mask. * @param str The string to check * @param mask the mask to check against diff --git a/include/xline.h b/include/xline.h index 348507f37..d5653f8e0 100644 --- a/include/xline.h +++ b/include/xline.h @@ -14,9 +14,9 @@ #ifndef __XLINE_H #define __XLINE_H -#include -#include -#include +//#include +//#include +//#include /** XLine is the base class for ban lines such as G lines and K lines. * Modules may derive from this, and their xlines will automatically be 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