Visual Studio 2013 compilation support for Ryzom Server
This commit is contained in:
parent
881bf2354e
commit
e64791ce55
24 changed files with 30 additions and 57 deletions
|
@ -285,8 +285,7 @@ namespace NLGUI
|
||||||
class CLuaHashMapTraits
|
class CLuaHashMapTraits
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static const size_t bucket_size = 4;
|
enum { bucket_size = 4, min_buckets = 8, };
|
||||||
static const size_t min_buckets = 8;
|
|
||||||
CLuaHashMapTraits()
|
CLuaHashMapTraits()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
|
@ -61,8 +61,7 @@ public:
|
||||||
class CClassIdHashMapTraits
|
class CClassIdHashMapTraits
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static const size_t bucket_size = 4;
|
enum { bucket_size = 4, min_buckets = 8, };
|
||||||
static const size_t min_buckets = 8;
|
|
||||||
inline size_t operator() ( const CClassId& classId ) const
|
inline size_t operator() ( const CClassId& classId ) const
|
||||||
{
|
{
|
||||||
return ((((uint64)classId >> 32)|0xFFFFFFFF) ^ (((uint64)classId|0xFFFFFFFF) & 0xFFFFFFFF));
|
return ((((uint64)classId >> 32)|0xFFFFFFFF) ^ (((uint64)classId|0xFFFFFFFF) & 0xFFFFFFFF));
|
||||||
|
|
|
@ -575,8 +575,7 @@ public:
|
||||||
// Traits for hash_map using CEntityId
|
// Traits for hash_map using CEntityId
|
||||||
struct CEntityIdHashMapTraits
|
struct CEntityIdHashMapTraits
|
||||||
{
|
{
|
||||||
static const size_t bucket_size = 4;
|
enum { bucket_size = 4, min_buckets = 8, };
|
||||||
static const size_t min_buckets = 8;
|
|
||||||
CEntityIdHashMapTraits() { }
|
CEntityIdHashMapTraits() { }
|
||||||
size_t operator() (const NLMISC::CEntityId &id ) const
|
size_t operator() (const NLMISC::CEntityId &id ) const
|
||||||
{
|
{
|
||||||
|
|
|
@ -248,8 +248,7 @@ private :
|
||||||
class CSheetIdHashMapTraits
|
class CSheetIdHashMapTraits
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static const size_t bucket_size = 4;
|
enum { bucket_size = 4, min_buckets = 8, };
|
||||||
static const size_t min_buckets = 8;
|
|
||||||
inline size_t operator() ( const CSheetId& sheetId ) const
|
inline size_t operator() ( const CSheetId& sheetId ) const
|
||||||
{
|
{
|
||||||
return sheetId.asInt() >> 5;
|
return sheetId.asInt() >> 5;
|
||||||
|
|
|
@ -39,8 +39,7 @@ typedef const std::string *TStringId;
|
||||||
// Traits for hash_map using CStringId
|
// Traits for hash_map using CStringId
|
||||||
struct CStringIdHashMapTraits
|
struct CStringIdHashMapTraits
|
||||||
{
|
{
|
||||||
static const size_t bucket_size = 4;
|
enum { bucket_size = 4, min_buckets = 8, };
|
||||||
static const size_t min_buckets = 8;
|
|
||||||
CStringIdHashMapTraits() { }
|
CStringIdHashMapTraits() { }
|
||||||
size_t operator() (const NLMISC::TStringId &stringId) const
|
size_t operator() (const NLMISC::TStringId &stringId) const
|
||||||
{
|
{
|
||||||
|
|
|
@ -355,8 +355,7 @@ namespace NLMISC
|
||||||
// Traits for hash_map using CEntityId
|
// Traits for hash_map using CEntityId
|
||||||
struct CUCStringHashMapTraits
|
struct CUCStringHashMapTraits
|
||||||
{
|
{
|
||||||
static const size_t bucket_size = 4;
|
enum { bucket_size = 4, min_buckets = 8, };
|
||||||
static const size_t min_buckets = 8;
|
|
||||||
CUCStringHashMapTraits() { }
|
CUCStringHashMapTraits() { }
|
||||||
size_t operator() (const ucstring &id ) const
|
size_t operator() (const ucstring &id ) const
|
||||||
{
|
{
|
||||||
|
|
|
@ -42,8 +42,7 @@ namespace NLSOUND {
|
||||||
template <class Pointer>
|
template <class Pointer>
|
||||||
struct THashPtr : public std::unary_function<const Pointer &, size_t>
|
struct THashPtr : public std::unary_function<const Pointer &, size_t>
|
||||||
{
|
{
|
||||||
static const size_t bucket_size = 4;
|
enum { bucket_size = 4, min_buckets = 8, };
|
||||||
static const size_t min_buckets = 8;
|
|
||||||
size_t operator () (const Pointer &ptr) const
|
size_t operator () (const Pointer &ptr) const
|
||||||
{
|
{
|
||||||
//CHashSet<uint>::hasher h;
|
//CHashSet<uint>::hasher h;
|
||||||
|
|
|
@ -82,8 +82,7 @@ struct CContextMatcher
|
||||||
|
|
||||||
struct CHash : public std::unary_function<CContextMatcher, size_t>
|
struct CHash : public std::unary_function<CContextMatcher, size_t>
|
||||||
{
|
{
|
||||||
static const size_t bucket_size = 4;
|
enum { bucket_size = 4, min_buckets = 8, };
|
||||||
static const size_t min_buckets = 8;
|
|
||||||
size_t operator () (const CContextMatcher &patternMatcher) const
|
size_t operator () (const CContextMatcher &patternMatcher) const
|
||||||
{
|
{
|
||||||
return patternMatcher.getHashValue();
|
return patternMatcher.getHashValue();
|
||||||
|
|
|
@ -98,8 +98,7 @@ struct CClient
|
||||||
|
|
||||||
struct TInetAddressHash
|
struct TInetAddressHash
|
||||||
{
|
{
|
||||||
static const size_t bucket_size = 4;
|
enum { bucket_size = 4, min_buckets = 8, };
|
||||||
static const size_t min_buckets = 8;
|
|
||||||
|
|
||||||
inline bool operator() (const NLNET::CInetAddress &x1, const NLNET::CInetAddress &x2) const
|
inline bool operator() (const NLNET::CInetAddress &x1, const NLNET::CInetAddress &x2) const
|
||||||
{
|
{
|
||||||
|
|
|
@ -201,8 +201,7 @@ template<class A>
|
||||||
class CHashPtr
|
class CHashPtr
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static const size_t bucket_size = 4;
|
enum { bucket_size = 4, min_buckets = 8, };
|
||||||
static const size_t min_buckets = 8;
|
|
||||||
|
|
||||||
typedef A *ptrA;
|
typedef A *ptrA;
|
||||||
size_t operator() (const ptrA &a) const
|
size_t operator() (const ptrA &a) const
|
||||||
|
|
|
@ -281,8 +281,7 @@ public:
|
||||||
// HashMapTraits for NLMISC::TKey
|
// HashMapTraits for NLMISC::TKey
|
||||||
struct CTKeyHashMapTraits
|
struct CTKeyHashMapTraits
|
||||||
{
|
{
|
||||||
static const size_t bucket_size = 4;
|
enum { bucket_size = 4, min_buckets = 8, };
|
||||||
static const size_t min_buckets = 8;
|
|
||||||
CTKeyHashMapTraits() { }
|
CTKeyHashMapTraits() { }
|
||||||
size_t operator() (NLMISC::TKey key) const
|
size_t operator() (NLMISC::TKey key) const
|
||||||
{
|
{
|
||||||
|
|
|
@ -776,16 +776,10 @@ protected:
|
||||||
|
|
||||||
/// @name NLMISC::CEntityId handling (for gamedev)
|
/// @name NLMISC::CEntityId handling (for gamedev)
|
||||||
//@{
|
//@{
|
||||||
class CHash
|
struct CHash
|
||||||
{
|
{
|
||||||
public:
|
enum { bucket_size = 4, min_buckets = 8, };
|
||||||
static const size_t bucket_size = 4;
|
|
||||||
static const size_t min_buckets = 8;
|
|
||||||
|
|
||||||
CHash() {}
|
|
||||||
|
|
||||||
size_t operator () (const CLFECOMMON::TSheetId &id) const { return id; }
|
size_t operator () (const CLFECOMMON::TSheetId &id) const { return id; }
|
||||||
|
|
||||||
inline bool operator() (const CLFECOMMON::TSheetId &id1, const CLFECOMMON::TSheetId &id2) const { return (size_t)id1 < (size_t)id2; }
|
inline bool operator() (const CLFECOMMON::TSheetId &id1, const CLFECOMMON::TSheetId &id2) const { return (size_t)id1 < (size_t)id2; }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -238,8 +238,7 @@ public:
|
||||||
|
|
||||||
CHashCode() {}
|
CHashCode() {}
|
||||||
|
|
||||||
static const size_t bucket_size = 4;
|
enum { bucket_size = 4, min_buckets = 8, };
|
||||||
static const size_t min_buckets = 8;
|
|
||||||
|
|
||||||
size_t operator () ( const TDataSetRow &index ) const { return index.getHashCode(); }
|
size_t operator () ( const TDataSetRow &index ) const { return index.getHashCode(); }
|
||||||
|
|
||||||
|
|
|
@ -53,8 +53,7 @@ class CDBStringUpdater : public NLMISC::CSingleton<CDBStringUpdater>
|
||||||
// hasher for the identifier
|
// hasher for the identifier
|
||||||
struct THashDBStringLeaf
|
struct THashDBStringLeaf
|
||||||
{
|
{
|
||||||
static const size_t bucket_size = 4;
|
enum { bucket_size = 4, min_buckets = 8, };
|
||||||
static const size_t min_buckets = 8;
|
|
||||||
size_t operator()(const TBDStringLeaf &stringLeaf) const
|
size_t operator()(const TBDStringLeaf &stringLeaf) const
|
||||||
{
|
{
|
||||||
return ((size_t)stringLeaf.ClientDB>>4) ^ ((size_t)stringLeaf.Node>>4);
|
return ((size_t)stringLeaf.ClientDB>>4) ^ ((size_t)stringLeaf.Node>>4);
|
||||||
|
|
|
@ -50,8 +50,7 @@ extern CGenericXmlMsgHeaderManager GenericMsgManager;
|
||||||
|
|
||||||
struct CServiceIdHash
|
struct CServiceIdHash
|
||||||
{
|
{
|
||||||
static const size_t bucket_size = 4;
|
enum { bucket_size = 4, min_buckets = 8, };
|
||||||
static const size_t min_buckets = 8;
|
|
||||||
size_t operator () ( const NLNET::TServiceId &sid ) const { return sid.get(); }
|
size_t operator () ( const NLNET::TServiceId &sid ) const { return sid.get(); }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -43,8 +43,7 @@ public:
|
||||||
|
|
||||||
struct CUint32Hash
|
struct CUint32Hash
|
||||||
{
|
{
|
||||||
static const size_t bucket_size = 4;
|
enum { bucket_size = 4, min_buckets = 8, };
|
||||||
static const size_t min_buckets = 8;
|
|
||||||
size_t operator () ( const uint32 &i ) const { return i; }
|
size_t operator () ( const uint32 &i ) const { return i; }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -91,8 +91,7 @@ private:
|
||||||
|
|
||||||
struct CHash
|
struct CHash
|
||||||
{
|
{
|
||||||
static const size_t bucket_size = 4;
|
enum { bucket_size = 4, min_buckets = 8, };
|
||||||
static const size_t min_buckets = 8;
|
|
||||||
size_t operator () ( const TEntityIndex& index ) const { return index.getIndex(); }
|
size_t operator () ( const TEntityIndex& index ) const { return index.getIndex(); }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -114,10 +114,9 @@ private:
|
||||||
|
|
||||||
typedef std::vector<TClientId> TEntityIndexToClient;
|
typedef std::vector<TClientId> TEntityIndexToClient;
|
||||||
|
|
||||||
class CIdHash
|
struct CIdHash
|
||||||
{
|
{
|
||||||
public:
|
enum { bucket_size = 4, min_buckets = 8, };
|
||||||
|
|
||||||
size_t operator () ( NLMISC::CEntityId id ) const { return (uint32)id.getShortId(); }
|
size_t operator () ( NLMISC::CEntityId id ) const { return (uint32)id.getShortId(); }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -69,11 +69,9 @@ typedef uint32 TUid;
|
||||||
/**
|
/**
|
||||||
* CInetAddress hash function
|
* CInetAddress hash function
|
||||||
*/
|
*/
|
||||||
class CInetAddressHashMapTraits
|
struct CInetAddressHashMapTraits
|
||||||
{
|
{
|
||||||
public:
|
enum { bucket_size = 4, min_buckets = 8, };
|
||||||
static const size_t bucket_size = 4;
|
|
||||||
static const size_t min_buckets = 8;
|
|
||||||
inline size_t operator() ( const NLNET::CInetAddress& x ) const
|
inline size_t operator() ( const NLNET::CInetAddress& x ) const
|
||||||
{
|
{
|
||||||
//return x.port();
|
//return x.port();
|
||||||
|
|
|
@ -504,7 +504,7 @@ void CWorldPositionManager::triggerSubscribe(NLNET::TServiceId serviceId, const
|
||||||
STOP_IF(IsRingShard,"Illegal use of CWorldPositionManager on ring shard");
|
STOP_IF(IsRingShard,"Illegal use of CWorldPositionManager on ring shard");
|
||||||
if (_PatatSubscribeManager.exist(name))
|
if (_PatatSubscribeManager.exist(name))
|
||||||
{
|
{
|
||||||
_PatatSubscribeManager.subscribe(serviceId, make_pair<string,uint16>(name, id));
|
_PatatSubscribeManager.subscribe(serviceId, std::pair<string,uint16>(name, id));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2113,7 +2113,7 @@ void CWorldPositionManager::movePlayer(CWorldEntity *entity, sint32 x, sint32 y,
|
||||||
{
|
{
|
||||||
if (entity->PlayerInfos->DistanceHistory.size() >= 20)
|
if (entity->PlayerInfos->DistanceHistory.size() >= 20)
|
||||||
entity->PlayerInfos->DistanceHistory.pop_back();
|
entity->PlayerInfos->DistanceHistory.pop_back();
|
||||||
entity->PlayerInfos->DistanceHistory.push_front(make_pair<CVectorD, uint>(CVectorD(x*0.001, y*0.001, z*0.001), tick));
|
entity->PlayerInfos->DistanceHistory.push_front(std::pair<CVectorD, uint>(CVectorD(x*0.001, y*0.001, z*0.001), tick));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -3227,7 +3227,7 @@ void CWorldPositionManager::visionRequest(sint32 x, sint32 y, sint32 range, vect
|
||||||
if (abs(x - entity->X) < range && abs(y - entity->Y) < range &&
|
if (abs(x - entity->X) < range && abs(y - entity->Y) < range &&
|
||||||
(rrange = sqrt(sqr((x - entity->X)*0.001) + sqr((y - entity->Y)*0.001))) < frange)
|
(rrange = sqrt(sqr((x - entity->X)*0.001) + sqr((y - entity->Y)*0.001))) < frange)
|
||||||
{
|
{
|
||||||
entities.push_back(make_pair<CEntityId, sint32>(entity->Id, (sint32)(rrange*1000)));
|
entities.push_back(std::pair<CEntityId, sint32>(entity->Id, (sint32)(rrange * 1000)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3240,7 +3240,7 @@ void CWorldPositionManager::visionRequest(sint32 x, sint32 y, sint32 range, vect
|
||||||
if (abs(x - entity->X) < range && abs(y - entity->Y) < range &&
|
if (abs(x - entity->X) < range && abs(y - entity->Y) < range &&
|
||||||
(rrange = sqrt(sqr((x - entity->X)*0.001) + sqr((y - entity->Y)*0.001))) < frange)
|
(rrange = sqrt(sqr((x - entity->X)*0.001) + sqr((y - entity->Y)*0.001))) < frange)
|
||||||
{
|
{
|
||||||
entities.push_back(make_pair<CEntityId, sint32>(entity->Id, (sint32)(rrange*1000)));
|
entities.push_back(std::pair<CEntityId, sint32>(entity->Id, (sint32)(rrange * 1000)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -139,8 +139,7 @@ public:
|
||||||
|
|
||||||
struct CEntityIdHash
|
struct CEntityIdHash
|
||||||
{
|
{
|
||||||
static const size_t bucket_size = 4;
|
enum { bucket_size = 4, min_buckets = 8, };
|
||||||
static const size_t min_buckets = 8;
|
|
||||||
size_t operator () ( const NLMISC::CEntityId &id ) const { return (uint32)id.getShortId(); }
|
size_t operator () ( const NLMISC::CEntityId &id ) const { return (uint32)id.getShortId(); }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1356,7 +1356,7 @@ void CStringManager::mergeEntityWords(CEntityWords& dest, const CEntityWords& so
|
||||||
std::map<std::string, uint32>::const_iterator iti;
|
std::map<std::string, uint32>::const_iterator iti;
|
||||||
for (iti=source._ColumnInfo.begin(); iti!=source._ColumnInfo.end(); ++iti)
|
for (iti=source._ColumnInfo.begin(); iti!=source._ColumnInfo.end(); ++iti)
|
||||||
if (dest._ColumnInfo.find((*iti).first) == dest._ColumnInfo.end())
|
if (dest._ColumnInfo.find((*iti).first) == dest._ColumnInfo.end())
|
||||||
extraColumns.push_back(std::make_pair<std::string, uint32>((*iti).first, osz+(uint32)extraColumns.size()));
|
extraColumns.push_back(std::pair<std::string, uint32>((*iti).first, osz + (uint32)extraColumns.size()));
|
||||||
|
|
||||||
for (iti=source._RowInfo.begin(); iti!=source._RowInfo.end(); ++iti)
|
for (iti=source._RowInfo.begin(); iti!=source._RowInfo.end(); ++iti)
|
||||||
if (dest._RowInfo.find((*iti).first) == dest._RowInfo.end())
|
if (dest._RowInfo.find((*iti).first) == dest._RowInfo.end())
|
||||||
|
|
|
@ -273,7 +273,7 @@ void CMonitorClient::update ()
|
||||||
TYPE_NAME_STRING_ID id = Str[i];
|
TYPE_NAME_STRING_ID id = Str[i];
|
||||||
std::map<TYPE_NAME_STRING_ID, std::string>::iterator ite = StringMap.find (id);
|
std::map<TYPE_NAME_STRING_ID, std::string>::iterator ite = StringMap.find (id);
|
||||||
nlassert (ite != StringMap.end());
|
nlassert (ite != StringMap.end());
|
||||||
strToSend.push_back( make_pair<TYPE_NAME_STRING_ID, string*>(id, &((*ite).second)) );
|
strToSend.push_back(std::pair<TYPE_NAME_STRING_ID, string*>(id, &((*ite).second)));
|
||||||
strTotalSize += 4+4+(uint)(*ite).second.size();
|
strTotalSize += 4+4+(uint)(*ite).second.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -490,8 +490,7 @@ typedef std::vector<CObjectIndex> TIndexList;
|
||||||
|
|
||||||
struct CColumnIndexHashMapTraits
|
struct CColumnIndexHashMapTraits
|
||||||
{
|
{
|
||||||
static const size_t bucket_size = 4;
|
enum { bucket_size = 4, min_buckets = 8, };
|
||||||
static const size_t min_buckets = 8;
|
|
||||||
CColumnIndexHashMapTraits() { }
|
CColumnIndexHashMapTraits() { }
|
||||||
size_t operator() (const CColumnIndex &id) const
|
size_t operator() (const CColumnIndex &id) const
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue