]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/hashcomp.cpp
Fix for bug #541: /taxonomy reporting metadata for incorrect user. Can someone please...
[user/henk/code/inspircd.git] / src / hashcomp.cpp
index a27a83f64ff89ef589b4ad540a7cf80f09be0d9f..1bcb538f6f499e37ba71788be1a9e9b7164f4cb7 100644 (file)
 
 #include "inspircd.h"
 #include "hashcomp.h"
-#ifndef WIN32
-#include <ext/hash_map>
-#define nspace __gnu_cxx
-#else
-#include <hash_map>
-#define nspace stdext
-using stdext::hash_map;
-#endif
+#include "hash_map.h"
 
 /******************************************************
  *
@@ -68,9 +61,13 @@ void nspace::strlower(char *n)
 }
 
 #ifndef WIN32
-size_t nspace::hash<std::string>::operator()(const std::string &s) const
+       #ifdef HASHMAP_DEPRECATED
+               size_t nspace::insensitive::operator()(const std::string &s) const
+       #else
+               size_t nspace::hash<std::string>::operator()(const std::string &s) const
+       #endif
 #else
-size_t nspace::hash_compare<std::string, std::less<std::string> >::operator()(const std::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! :)
@@ -85,6 +82,7 @@ size_t nspace::hash_compare<std::string, std::less<std::string> >::operator()(co
        return t;
 }
 
+
 #ifndef WIN32
 size_t nspace::hash<irc::string>::operator()(const irc::string &s) const
 #else
@@ -318,7 +316,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 +360,7 @@ int irc::modestacker::GetStackedLine(std::deque<std::string> &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())