X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fhashcomp.cpp;h=19f2d601c410e7c6585c688b35003a8a02ef0345;hb=fc3a83831b8348f34dbf2009e379a5423b4738b9;hp=49befd634bcd4df023bd117728cc3a59b96a2643;hpb=deb85740798d3438563628736c0e83edb6966b6e;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/hashcomp.cpp b/src/hashcomp.cpp index 49befd634..19f2d601c 100644 --- a/src/hashcomp.cpp +++ b/src/hashcomp.cpp @@ -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 @@ -11,6 +11,8 @@ * --------------------------------------------------- */ +/* $Core: libIRCDhash */ + #include "inspircd.h" #include "hashcomp.h" #ifndef WIN32 @@ -47,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; @@ -68,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! :) @@ -99,8 +99,8 @@ size_t nspace::hash_compare >::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; @@ -318,7 +318,7 @@ CoreExport const char* irc::Spacify(const char* n) } -irc::modestacker::modestacker(bool add) : adding(add) +irc::modestacker::modestacker(InspIRCd* Instance, bool add) : ServerInstance(Instance), adding(add) { sequence.clear(); sequence.push_back(""); @@ -362,7 +362,7 @@ int irc::modestacker::GetStackedLine(std::deque &result, int max_li if (sequence.size() > 1) nextsize = sequence[1].length() + 2; - while (!sequence[0].empty() && (sequence.size() > 1) && (result.size() < MAXMODES) && ((size + nextsize) < max_line_size)) + while (!sequence[0].empty() && (sequence.size() > 1) && (result.size() < ServerInstance->Config->Limits.MaxModes) && ((size + nextsize) < max_line_size)) { result[0] += *(sequence[0].begin()); if (!sequence[1].empty()) @@ -396,7 +396,7 @@ irc::stringjoiner::stringjoiner(const std::string &seperator, const std::deque