Merge with develop

--HG--
branch : opengl3
hg/feature/opengl3
kaetemi 10 years ago
commit 94bd3b66bb

@ -580,7 +580,11 @@ struct CEntityIdHashMapTraits
size_t operator() (const NLMISC::CEntityId &id ) const
{
uint64 hash64 = id.getUniqueId();
return size_t(hash64) ^ size_t( hash64 >> 32 );
#if (HAVE_X86_64)
return (size_t)hash64;
#else
return (size_t)hash64 ^ (size_t)(hash64 >> 32);
#endif
//return size_t(id.getShortId());
}
bool operator() (const NLMISC::CEntityId &id1, const NLMISC::CEntityId &id2) const

@ -417,12 +417,12 @@ extern void operator delete[](void *p) throw();
# define CHashMap stdext::hash_map
# define CHashSet stdext::hash_set
# define CHashMultiMap stdext::hash_multimap
#elif defined(NL_COMP_VC) && (NL_COMP_VC_VERSION >= 120)
# include <hash_map>
# include <hash_set>
# define CHashMap ::std::hash_map
# define CHashSet ::std::hash_set
# define CHashMultiMap ::std::hash_multimap
#elif defined(NL_COMP_VC) && (NL_COMP_VC_VERSION >= 100)
# include <unordered_map>
# include <unordered_set>
# define CHashMap ::std::unordered_map
# define CHashSet ::std::unordered_set
# define CHashMultiMap ::std::unordered_multimap
#elif defined(NL_COMP_GCC) // GCC4
# include <ext/hash_map>
# include <ext/hash_set>

@ -363,7 +363,7 @@ struct CUCStringHashMapTraits
}
bool operator() (const ucstring &id1, const ucstring &id2) const
{
return id1.size() < id2.size();
return id1 < id2;
}
};

@ -71,6 +71,19 @@ struct CContextMatcher
return memcmp(JokersValues, other.JokersValues, sizeof(uint32)*NbJoker) == 0;
}
bool operator<(const CContextMatcher &other) const
{
if (UseRandom)
if (RandomValue != other.RandomValue)
return RandomValue < other.RandomValue;
int cmp = memcmp(JokersValues, other.JokersValues, sizeof(uint32) * NbJoker);
if (cmp != 0)
return cmp < 0;
return false;
}
size_t getHashValue() const
{
return size_t(HashValue);
@ -89,10 +102,9 @@ struct CContextMatcher
}
bool operator() (const CContextMatcher &patternMatcher1, const CContextMatcher &patternMatcher2) const
{
return patternMatcher1.getHashValue() < patternMatcher2.getHashValue();
return patternMatcher1 < patternMatcher2;
}
};
};

@ -242,7 +242,7 @@ public:
size_t operator () ( const TDataSetRow &index ) const { return index.getHashCode(); }
bool operator() (const TDataSetRow &index1, const TDataSetRow &index2) const { return index1.getHashCode() < index2.getHashCode(); }
bool operator() (const TDataSetRow &index1, const TDataSetRow &index2) const { return index1 < index2; }
};
/// Warning: method to avoid (use it only when using rows as a static array)

@ -17,6 +17,7 @@
#include "stdpch.h"
#include <functional>
#include "fg_prospection_phrase.h"
#include "nel/misc/common.h"
#include "nel/misc/fast_floor.h"

@ -8028,7 +8028,7 @@ void CCharacter::setStartStatistics( const CCreateCharMsg& createCharMsg )
}
// create character start skills, skill point and money
string s = CreateCharacterStartSkillsValue;
string s = CreateCharacterStartSkillsValue.get();
if( s.size() > 0 )
{
CSString skillValue = s;

@ -48,6 +48,15 @@ class CDBStringUpdater : public NLMISC::CSingleton<CDBStringUpdater>
{
return ClientDB == other.ClientDB && Node == other.Node;
}
bool operator <(const TBDStringLeaf &other) const
{
if (ClientDB != other.ClientDB)
return ClientDB < other.ClientDB;
if (Node != other.Node)
return Node < other.Node;
return false;
}
};
// hasher for the identifier
@ -58,6 +67,10 @@ class CDBStringUpdater : public NLMISC::CSingleton<CDBStringUpdater>
{
return ((size_t)stringLeaf.ClientDB>>4) ^ ((size_t)stringLeaf.Node>>4);
}
bool operator()(const TBDStringLeaf &left, const TBDStringLeaf &right) const
{
return left < right;
}
};
// info for each string leaf

@ -52,6 +52,7 @@ struct CServiceIdHash
{
enum { bucket_size = 4, min_buckets = 8, };
size_t operator () ( const NLNET::TServiceId &sid ) const { return sid.get(); }
bool operator()(const NLNET::TServiceId &left, const NLNET::TServiceId &right) const { return left < right; }
};
class CCharIdReplaced

@ -44,7 +44,8 @@ public:
struct CUint32Hash
{
enum { bucket_size = 4, min_buckets = 8, };
size_t operator () ( const uint32 &i ) const { return i; }
size_t operator () (const uint32 &i) const { return i; }
bool operator()(const uint32 left, const uint32 right) const { return left < right; }
};
typedef uint32 TUserId;

@ -785,7 +785,7 @@ NLNET::CMessage& CDbManager::addTask(const std::string& msg, ITaskEventListener*
// add listener to task listeners
if (listener != NULL)
_TaskListeners[id] = std::make_pair<ITaskEventListener*, void*>(listener, arg);
_TaskListeners[id] = std::pair<ITaskEventListener*, void*>(listener, arg);
return *msgrbs;
}

Loading…
Cancel
Save