]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/hashcomp.cpp
Fix user->host not being assigned correctly for new connections
[user/henk/code/inspircd.git] / src / hashcomp.cpp
index f672f3fb25fb06e8a3fd855c8f0657f5326343eb..a27a83f64ff89ef589b4ad540a7cf80f09be0d9f 100644 (file)
@@ -2,7 +2,7 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd: (C) 2002-2007 InspIRCd Development Team
+ *  InspIRCd: (C) 2002-2008 InspIRCd Development Team
  * See: http://www.inspircd.org/wiki/index.php/Credits
  *
  * This program is free but copyrighted software; see
@@ -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<string>::operator()(const string &s) const
+size_t nspace::hash<std::string>::operator()(const std::string &s) const
 #else
-size_t nspace::hash_compare<string, std::less<string> >::operator()(const string &s) const
+size_t nspace::hash_compare<std::string, std::less<std::string> >::operator()(const std::string &s) const
 #endif
 {
        /* XXX: NO DATA COPIES! :)
@@ -101,8 +99,8 @@ size_t nspace::hash_compare<irc::string, std::less<irc::string> >::operator()(co
 
 bool irc::StrHashComp::operator()(const std::string& s1, const std::string& s2) const
 {
-       unsigned char* n1 = (unsigned char*)s1.c_str();
-       unsigned char* n2 = (unsigned char*)s2.c_str();
+       const unsigned char* n1 = (const unsigned char*)s1.c_str();
+       const unsigned char* n2 = (const unsigned char*)s2.c_str();
        for (; *n1 && *n2; n1++, n2++)
                if (lowermap[*n1] != lowermap[*n2])
                        return false;
@@ -398,7 +396,7 @@ irc::stringjoiner::stringjoiner(const std::string &seperator, const std::deque<s
        joined.append(sequence[end]);
 }
 
-irc::stringjoiner::stringjoiner(const std::string &seperator, const char** sequence, int begin, int end)
+irc::stringjoiner::stringjoiner(const std::string &seperator, const char* const* sequence, int begin, int end)
 {
        for (int v = begin; v < end; v++)
                joined.append(sequence[v]).append(seperator);