Removed STLport requirement

This commit is contained in:
Anonymous
2014-01-23 00:16:13 -07:00
parent a9ac73d4e5
commit fac1f2c5ae
173 changed files with 454 additions and 479 deletions
@@ -53,6 +53,5 @@ target_link_libraries(DataTableTool
localizationArchive
unicode
unicodeArchive
${STLPORT_LIBRARIES}
${CMAKE_DL_LIBS}
)
@@ -60,6 +60,5 @@ target_link_libraries(TemplateCompiler
localizationArchive
unicode
unicodeArchive
${STLPORT_LIBRARIES}
${CMAKE_DL_LIBS}
)
@@ -60,6 +60,5 @@ target_link_libraries(TemplateDefinitionCompiler
localizationArchive
unicode
unicodeArchive
${STLPORT_LIBRARIES}
${CMAKE_DL_LIBS}
)
@@ -913,7 +913,7 @@ void BuildConvexHull ( VertexList const & verts, VertexList & outPoly )
int count = verts.size();
BuildConvexHull( sortedVerts.begin(), count, outPoly );
BuildConvexHull( &sortedVerts.front(), count, outPoly );
}
// ----------------------------------------------------------------------
@@ -1512,7 +1512,7 @@ bool CalcAvoidancePoints3d ( Sphere const & mob, Vector const & delta, Sphere co
Vector I,J;
if(abs(K.y) > 0.95)
if(std::abs(K.y) > 0.95)
{
// line A-B is almost vertical, build orthonormal basis using X axis
@@ -1781,14 +1781,14 @@ bool testPortalVis ( CellProperty const * cellA, Vector const & pointA, CellProp
bool epsilonEqual ( Sphere const & A, Sphere const & B, float epsilon )
{
if(abs(A.getRadius() - B.getRadius()) > epsilon) return false;
if(std::abs(A.getRadius() - B.getRadius()) > epsilon) return false;
Vector cA = A.getCenter();
Vector cB = B.getCenter();
if(abs(cA.x - cB.x) > epsilon) return false;
if(abs(cA.y - cB.y) > epsilon) return false;
if(abs(cA.z - cB.z) > epsilon) return false;
if(std::abs(cA.x - cB.x) > epsilon) return false;
if(std::abs(cA.y - cB.y) > epsilon) return false;
if(std::abs(cA.z - cB.z) > epsilon) return false;
return true;
}
@@ -718,9 +718,9 @@ Range ProjectAxis ( Line3d const & L, AxialBox const & B )
Vector const & N = L.getNormal();
Vector extent = B.getDelta();
real x = abs( Collision3d::ComponentAlong( Vector::unitX, N ) ) * extent.x;
real y = abs( Collision3d::ComponentAlong( Vector::unitY, N ) ) * extent.y;
real z = abs( Collision3d::ComponentAlong( Vector::unitZ, N ) ) * extent.z;
real x = std::abs( Collision3d::ComponentAlong( Vector::unitX, N ) ) * extent.x;
real y = std::abs( Collision3d::ComponentAlong( Vector::unitY, N ) ) * extent.y;
real z = std::abs( Collision3d::ComponentAlong( Vector::unitZ, N ) ) * extent.z;
real d = x + y + z;
@@ -735,9 +735,9 @@ Range ProjectAxis ( Line3d const & L, OrientedBox const & B )
{
Vector const & N = L.getNormal();
real x = abs( Collision3d::ComponentAlong( B.getAxisX(), N ) ) * B.getExtentX();
real y = abs( Collision3d::ComponentAlong( B.getAxisY(), N ) ) * B.getExtentY();
real z = abs( Collision3d::ComponentAlong( B.getAxisZ(), N ) ) * B.getExtentZ();
real x = std::abs( Collision3d::ComponentAlong( B.getAxisX(), N ) ) * B.getExtentX();
real y = std::abs( Collision3d::ComponentAlong( B.getAxisY(), N ) ) * B.getExtentY();
real z = std::abs( Collision3d::ComponentAlong( B.getAxisZ(), N ) ) * B.getExtentZ();
real d = x + y + z;
@@ -32,6 +32,8 @@
#include "sharedObject/Portal.h"
#include "sharedObject/Tweakable.h"
#include <algorithm>
static VectorArgb gs_forceFieldColor(0.6f,0.5f,0.5f,1.0f);
// ======================================================================
@@ -1614,7 +1614,7 @@ bool FloorMesh::findFloorTri ( FloorLocator const & testLoc,
// ----------
if(abs(dist) < gs_hopTolerance)
if(std::abs(dist) < gs_hopTolerance)
{
// Floor tri is above the test point but within the hop
// tolerance and we're allowing hops - we can hop up onto it.
@@ -2911,7 +2911,7 @@ PathWalkResult FloorMesh::pathWalkCircleGetIds ( FloorLocator const & inStartLoc
{
float stepDistance = delta.magnitude();
float contactDist = abs(stepDistance * circleHitTime);
float contactDist = std::abs(stepDistance * circleHitTime);
if((circleHitTime < 0) && (contactDist > wallEpsilon))
{
@@ -3619,8 +3619,8 @@ bool FloorMesh::dropTest ( FloorLocator const & testLoc, float hopHeight, FloorL
if( findClosestPair(line,-1,closestBelow,closestAbove) )
{
float distBelow = abs(closestBelow.getOffset());
float distAbove = abs(closestAbove.getOffset());
float distBelow = std::abs(closestBelow.getOffset());
float distAbove = std::abs(closestAbove.getOffset());
closestAbove.setSurface(this);
closestBelow.setSurface(this);
@@ -3701,7 +3701,7 @@ bool FloorMesh::dropTest ( FloorLocator const & testLoc, int triID, FloorLocator
if(testIntersect(line,triID,tempLoc))
{
float absDist = abs(tempLoc.getOffset());
float absDist = std::abs(tempLoc.getOffset());
if(absDist <= ConfigSharedCollision::getHopHeight())
{
@@ -461,7 +461,7 @@ bool TestTriTri ( Triangle3d const & A, Triangle3d const & B )
bool TestSpherePlane ( Sphere const & A, Plane3d const & B )
{
float dist = abs(Distance3d::DistancePointPlane(A.getCenter(),B));
float dist = std::abs(Distance3d::DistancePointPlane(A.getCenter(),B));
return dist <= A.getRadius();
}
@@ -14,6 +14,8 @@
#include "sharedDatabaseInterface/NullEncodedUnicodeString.h"
#include "sharedLog/Log.h"
#include <climits>
using namespace DB;
// ======================================================================
@@ -11,6 +11,7 @@
#include "sharedDatabaseInterface/DbServer.h"
#include <string>
#include <climits>
// ======================================================================
@@ -14,6 +14,7 @@
#include <fcntl.h>
#include <unistd.h>
#include <dlfcn.h>
#include <cstddef>
#include <map>
#include <vector>
@@ -17,7 +17,7 @@
#include <vector>
#include <list>
#include <hash_map>
#include <tr1/unordered_map>
// ======================================================================
@@ -89,7 +89,7 @@ protected:
ReferenceCountingData *referenceData;
};
typedef std::hash_map<void *, ObjectData, ptr_hash> ObjectMap;
typedef std::tr1::unordered_map<void *, ObjectData, ptr_hash> ObjectMap;
ObjectMap liveObjects;
};
@@ -14,6 +14,7 @@
#include "sharedFoundation/ConfigSharedFoundation.h"
#include "sharedSynchronization/Mutex.h"
#include <algorithm>
#include <map>
#include <vector>
@@ -156,6 +156,8 @@ inline size_t NetworkId::getHashValue () const
// STL standard hash function
namespace std
{
namespace tr1
{
template <>
struct hash<NetworkId> // stl standard hash
@@ -163,6 +165,6 @@ struct hash<NetworkId> // stl standard hash
size_t operator()(const NetworkId &x) const { return x.getHashValue(); }
};
}
}}
#endif
@@ -31,7 +31,7 @@
// ======================================================================
// grab stlport configuration
#include "stl/config/features.h" // uncomment for newer stlport versions
//#include "stl/config/features.h" // uncomment for newer stlport versions
//#include "stl/_config.h"
namespace std
@@ -42,7 +42,7 @@ namespace std
template <class _T1> struct hash;
template <class _Tp> class allocator;
template <class _CharT, class _Traits, class _Alloc> class basic_string;
template <class _CharT> class char_traits;
template <class _CharT> struct char_traits;
template <size_t _Nb> class bitset;
template <class _Tp, class _Alloc> class deque;
@@ -52,13 +52,36 @@ namespace std
template <class _Tp, class _Sequence> class stack;
template <class _Tp, class _Container, class _Compare> class priority_queue;
template <class _Key, class _Tp, class _Compare, class _Alloc> class map;
template <class _Key, class _Tp, class _HashFcn, class _Compare, class _Alloc> class hash_map;
//template <class _Key, class _Tp, class _HashFcn, class _Compare, class _Alloc> class hash_map;
template <class _Key, class _Tp, class _Compare, class _Alloc> class multimap;
template <class _Key, class _Compare, class _Alloc> class set;
template <class _Key, class _HashFcn, class _Compare, class _Alloc> class hash_set;
//template <class _Key, class _HashFcn, class _Compare, class _Alloc> class hash_set;
template <class _Key, class _Compare, class _Alloc> class multiset;
typedef basic_string<char, char_traits<char>, allocator<char> > string;
namespace tr1
{
template <class _T1> struct hash;
template <class _Key, class _Tp, class _Hash, class _Compare, class _Alloc> class unordered_map;
template <class _Key, class _Hash, class _Compare, class _Alloc> class unordered_set;
}
template <class ForwardIterator>
bool is_sorted (ForwardIterator first, ForwardIterator last)
{
if (first==last) return true;
ForwardIterator next = first;
while (++next!=last) {
if (*next<*first) // or, if (comp(*next,*first)) for version (2)
return false;
++first;
}
return true;
}
}
template <class _Tp, class _Alloc = std::allocator<_Tp> > struct stddeque
@@ -76,9 +99,14 @@ template <class _Key, class _Tp, class _Compare = std::less<_Key>, class _Alloc
typedef std::map<_Key, _Tp, _Compare, _Alloc> fwd;
};
template <class _Key, class _Tp, class _HashFcn = std::hash<_Key>, class _Compare = std::equal_to<_Key>, class _Alloc = std::allocator< std::pair <const _Key, _Tp> > > struct stdhash_map
//template <class _Key, class _Tp, class _HashFcn = std::hash<_Key>, class _Compare = std::equal_to<_Key>, class _Alloc = std::allocator< std::pair <const _Key, _Tp> > > struct stdhash_map
//{
// typedef std::hash_map<_Key, _Tp, _HashFcn, _Compare, _Alloc> fwd;
//};
template <class _Key, class _Tp, class _HashFcn = std::tr1::hash<_Key>, class _Compare = std::equal_to<_Key>, class _Alloc = std::allocator< std::pair <const _Key, _Tp> > > struct stdunordered_map
{
typedef std::hash_map<_Key, _Tp, _HashFcn, _Compare, _Alloc> fwd;
typedef std::tr1::unordered_map<_Key, _Tp, _HashFcn, _Compare, _Alloc> fwd;
};
template <class _Key, class _Tp, class _Compare = std::less<_Key>, class _Alloc = std::allocator< std::pair <const _Key, _Tp> > > struct stdmultimap
@@ -91,9 +119,14 @@ template <class _Key, class _Compare = std::less<_Key>, class _Alloc = std::allo
typedef std::set<_Key, _Compare, _Alloc> fwd;
};
template <class _Key, class _HashFcn = std::hash<_Key>, class _Compare = std::equal_to<_Key>, class _Alloc = std::allocator<_Key> > struct stdhash_set
//template <class _Key, class _HashFcn = std::hash<_Key>, class _Compare = std::equal_to<_Key>, class _Alloc = std::allocator<_Key> > struct stdhash_set
//{
// typedef std::hash_set<_Key, _HashFcn, _Compare, _Alloc> fwd;
//};
template <class _Key, class _HashFcn = std::tr1::hash<_Key>, class _Compare = std::equal_to<_Key>, class _Alloc = std::allocator<_Key> > struct stdunordered_set
{
typedef std::hash_set<_Key, _HashFcn, _Compare, _Alloc> fwd;
typedef std::tr1::unordered_set<_Key, _HashFcn, _Compare, _Alloc> fwd;
};
template <class _Key, class _Compare = std::less<_Key>, class _Alloc = std::allocator<_Key> > struct stdmultiset
@@ -15,7 +15,7 @@
#include <string>
#include <algorithm>
#include <cctype>
#include <hash_map>
#include <tr1/unordered_map>
// ======================================================================
@@ -25,7 +25,7 @@ namespace CombatDataTableNamespace
std::string const cs_columnActionNameCrc("actionNameCrc");
int s_actionNameCrcColumn;
std::hash_map<uint32, int> s_commandsWithMinInvisLevelRequired;
std::tr1::unordered_map<uint32, int> s_commandsWithMinInvisLevelRequired;
}
using namespace CombatDataTableNamespace;
@@ -402,7 +402,7 @@ int CombatDataTable::getMinInvisLevelRequired(uint32 commandHash)
if(commandHash == 0)
return -1;
std::hash_map<uint32, int>::const_iterator it = s_commandsWithMinInvisLevelRequired.find(commandHash);
std::tr1::unordered_map<uint32, int>::const_iterator it = s_commandsWithMinInvisLevelRequired.find(commandHash);
if (it != s_commandsWithMinInvisLevelRequired.end())
return it->second;
@@ -15,6 +15,8 @@
#include "sharedObject/ObjectTemplateList.h"
#include "sharedUtility/DataTable.h"
#include "sharedUtility/DataTableManager.h"
#include <algorithm>
#include <map>
#include <vector>
@@ -16,6 +16,7 @@
#include "UnicodeUtils.h"
#include <algorithm>
#include <map>
// ======================================================================
@@ -223,7 +223,7 @@ void SharedBuildoutAreaManager::install()
int const areaCount = areaListTable.getNumRows();
for (int areaRow = 0; areaRow < areaCount; ++areaRow)
{
areasForScene.push_back();
areasForScene.push_back(BuildoutArea());
BuildoutArea &buildoutArea = areasForScene.back();
buildoutArea.areaIndex = i*100+areaRow;
buildoutArea.areaName = areaListTable.getStringValue("area", areaRow);
@@ -19,13 +19,13 @@
#include "sharedMessageDispatch/Transceiver.h"
#include "unicodeArchive/UnicodeArchive.h"
#include "UnicodeUtils.h"
#include <hash_map>
#include <tr1/unordered_map>
// ======================================================================
namespace WaypointNamespace
{
typedef std::hash_map<NetworkId, WaypointData *> WaypointMapById;
typedef std::tr1::unordered_map<NetworkId, WaypointData *> WaypointMapById;
WaypointMapById s_waypointMapById;
bool s_installed;
@@ -106,7 +106,7 @@ namespace Archive
if (networkId.isValid())
{
WaypointData *data = 0;
std::hash_map<NetworkId, WaypointData *>::iterator f = s_waypointMapById.find(networkId);
std::tr1::unordered_map<NetworkId, WaypointData *>::iterator f = s_waypointMapById.find(networkId);
if (f == s_waypointMapById.end())
data = new WaypointData(networkId);
else
@@ -331,7 +331,7 @@ std::string const &Waypoint::getColorNameById(uint8 id) // static
Waypoint const Waypoint::getWaypointById(NetworkId const &id) // static
{
Waypoint result;
std::hash_map<NetworkId, WaypointData *>::iterator f = s_waypointMapById.find(id);
std::tr1::unordered_map<NetworkId, WaypointData *>::iterator f = s_waypointMapById.find(id);
if (f != s_waypointMapById.end())
result.releaseData(f->second);
return result;
@@ -12,7 +12,7 @@
#include "Unicode.h"
#include <hash_map>
#include <tr1/unordered_map>
//======================================================================
@@ -273,7 +273,7 @@ namespace ShipChassisSlotTypeNamespace
static_cast<int>(ShipComponentType::SCT_weapon), // SCST_weapon_99
};
typedef stdhash_map<std::string, ShipChassisSlotType::Type>::fwd SlotNameTypeMap;
typedef stdunordered_map<std::string, ShipChassisSlotType::Type>::fwd SlotNameTypeMap;
SlotNameTypeMap s_slotNameTypeMap;
bool s_installed = false;
@@ -8,7 +8,7 @@
#include "sharedGame/FirstSharedGame.h"
#include "sharedGame/ShipComponentType.h"
#include <hash_map>
#include <tr1/unordered_map>
//======================================================================
@@ -48,7 +48,7 @@ namespace ShipComponentTypeNamespace
"mod_"
};
typedef stdhash_map<std::string, ShipComponentType::Type>::fwd ComponentNameTypeMap;
typedef stdunordered_map<std::string, ShipComponentType::Type>::fwd ComponentNameTypeMap;
ComponentNameTypeMap s_componentNameTypeMap;
bool s_installed = false;
@@ -260,7 +260,7 @@ void CompressedQuaternionNamespace::findClosestBase(int baseShiftCount, float mi
for (int testBaseIndex = 0; testBaseIndex < baseCount; ++testBaseIndex)
{
const float testBaseValue = -1.0f + (testBaseIndex + 1) * baseSeparation;
const float testDistance = abs(testBaseValue - midpoint);
const float testDistance = std::abs(testBaseValue - midpoint);
if (testDistance < closestBaseDistance)
{
@@ -349,7 +349,7 @@ uint32 CompressedQuaternionNamespace::doCompress(float w, float x, float y, floa
#ifdef _DEBUG
// If w is small enough, we won't be able to take the square root.
if (abs(w) >= cs_wAcceptableEpsilon)
if (std::abs(w) >= cs_wAcceptableEpsilon)
{
const float calculatedW = sqrt(1.0f - (x*x + y*y + z*z));
DEBUG_FATAL(!WithinEpsilonInclusive(calculatedW, w, cs_wAcceptableEpsilon), ("Quaternion (w=%g,x=%g,y=%g,z=%g) does not appear to be a unit quaternion.", w, x, y, z));
@@ -546,10 +546,10 @@ void CompressedQuaternion::compressRotations(const QuaternionVector &sourceRotat
sourceRotation.z = -sourceRotation.z;
}
const float deltaW = abs(expandedRotation.w - sourceRotation.w);
const float deltaX = abs(expandedRotation.x - sourceRotation.x);
const float deltaY = abs(expandedRotation.y - sourceRotation.y);
const float deltaZ = abs(expandedRotation.z - sourceRotation.z);
const float deltaW = std::abs(expandedRotation.w - sourceRotation.w);
const float deltaX = std::abs(expandedRotation.x - sourceRotation.x);
const float deltaY = std::abs(expandedRotation.y - sourceRotation.y);
const float deltaZ = std::abs(expandedRotation.z - sourceRotation.z);
if ( (deltaW > cs_wAcceptableEpsilon) ||
(deltaX > cs_xAcceptableEpsilon) ||
@@ -10,6 +10,8 @@
#include "sharedMath/MxCifQuadTree.h"
#include "sharedMath/MxCifQuadTreeBounds.h"
#include <algorithm>
//==============================================================================
@@ -12,7 +12,7 @@
#include "sharedMath/Vector.h"
#include <hash_map>
#include <tr1/unordered_map>
// ======================================================================
@@ -42,7 +42,7 @@ private:
private:
typedef std::hash_multimap<uint32 /*crc*/, int /*index*/> VertexIndexMap;
typedef std::tr1::unordered_multimap<uint32 /*crc*/, int /*index*/> VertexIndexMap;
VectorVector * m_vertices;
VertexIndexMap * m_indexMap;
@@ -97,14 +97,14 @@ inline void Rectangle2d::set (const float newX0, const float newY0, const float
inline float Rectangle2d::getWidth () const
{
return abs(x1 - x0);
return std::abs(x1 - x0);
}
//-------------------------------------------------------------------
inline float Rectangle2d::getHeight () const
{
return abs(y1 - y0);
return std::abs(y1 - y0);
}
//-------------------------------------------------------------------
@@ -11,6 +11,7 @@
#include "sharedMath/Capsule.h"
#include "sharedMath/SpatialSubdivision.h"
#include <algorithm>
#include <vector>
static const float SphereTreeEpsilon = 0.01f;
@@ -1436,7 +1437,7 @@ inline void SphereTreeNode<ObjectType, ExtentAccessor>::resizeRealSphere(const f
float BR = realSphere.getRadius();
float D = A.magnitudeBetween(B);
float O = abs(AR - (D + BR));
float O = std::abs(AR - (D + BR));
// Fatal if the error is significant, otherwise just warn.
@@ -12,6 +12,7 @@
#include "sharedRandom/Random.h"
#include <cmath>
#include <vector>
// ======================================================================
@@ -284,7 +285,7 @@ bool Vector::inPolygon(const std::vector<Vector> &convexPolygonVertices) const
*/
bool Vector::withinEpsilon(const Vector &rhs, float epsilon) const
{
return (abs(x - rhs.x) < epsilon) && (abs(y - rhs.y) < epsilon) && (abs(z - rhs.z) < epsilon);
return (std::abs(x - rhs.x) < epsilon) && (std::abs(y - rhs.y) < epsilon) && (std::abs(z - rhs.z) < epsilon);
}
@@ -297,9 +298,9 @@ bool Vector::withinEpsilon(const Vector &rhs, float epsilon) const
const Vector Vector::perpendicular(Vector const & direction)
{
// Measure the projection of "direction" onto each of the axes
float const id = abs(direction.dot(Vector::unitX));
float const jd = abs(direction.dot(Vector::unitY));
float const kd = abs(direction.dot(Vector::unitZ));
float const id = std::abs(direction.dot(Vector::unitX));
float const jd = std::abs(direction.dot(Vector::unitY));
float const kd = std::abs(direction.dot(Vector::unitZ));
Vector result;
@@ -265,9 +265,9 @@ inline real Vector::magnitudeSquared(void) const
inline real Vector::approximateMagnitude(void) const
{
real minc = abs(x);
real midc = abs(y);
real maxc = abs(z);
real minc = std::abs(x);
real midc = std::abs(y);
real maxc = std::abs(z);
// sort the vectors
// we do our own swapping to avoid heavy-weight includes in such a low-level class
@@ -221,7 +221,7 @@ float MultiShape::calcAvoidanceRadius ( void ) const
float sinTheta = m_axisY.y;
float cosTheta = sqrt( m_axisY.x * m_axisY.x + m_axisY.z * m_axisY.z );
float twoContactRadius = abs(m_extentY * sinTheta + m_extentX * cosTheta);
float twoContactRadius = std::abs(m_extentY * sinTheta + m_extentX * cosTheta);
float blah = m_extentY * sinTheta;
@@ -89,7 +89,7 @@ RangeLoop::RangeLoop ( float min, float max )
: m_min( clip(min) ),
m_max( clip(max) )
{
if(abs(max-min) >= 1.0f)
if(std::abs(max-min) >= 1.0f)
{
m_min = 0.0f;
m_max = 1.0f;
@@ -16,7 +16,7 @@
#include "sharedMessageDispatch/Message.h"
#include "sharedMessageDispatch/Receiver.h"
#include <set>
#include <hash_map>
#include <tr1/unordered_map>
// ======================================================================
@@ -7,7 +7,7 @@
#include "sharedMessageDispatch/Receiver.h"
#include <set>
#include <hash_map>
#include <tr1/unordered_map>
namespace MessageDispatch {
@@ -15,8 +15,8 @@ MessageManager MessageManager::ms_instance;
struct MessageManager::Data
{
std::hash_map<unsigned long int, std::set<Receiver *> > receivers;
std::hash_map<unsigned long int, std::set<void (*)(const Emitter &, const MessageBase &)> > staticCallbacks;
std::tr1::unordered_map<unsigned long int, std::set<Receiver *> > receivers;
std::tr1::unordered_map<unsigned long int, std::set<void (*)(const Emitter &, const MessageBase &)> > staticCallbacks;
};
//---------------------------------------------------------------------
@@ -72,7 +72,7 @@ void MessageManager::addReceiver(Receiver & target, const MessageBase & source)
void MessageManager::addReceiver(Receiver & target, const unsigned long int messageType)
{
std::hash_map<unsigned long int, std::set<Receiver *> >::iterator i = data->receivers.find(messageType);
std::tr1::unordered_map<unsigned long int, std::set<Receiver *> >::iterator i = data->receivers.find(messageType);
if(i != data->receivers.end())
{
target.setHasTargets(true);
@@ -92,7 +92,7 @@ void MessageManager::addReceiver(Receiver & target, const unsigned long int mess
void MessageManager::addStaticCallback(void (*callback)(const Emitter &, const MessageBase &), const unsigned long int messageType)
{
std::hash_map<unsigned long int, std::set<void (*)(const Emitter &, const MessageBase &)> >::iterator f = data->staticCallbacks.find(messageType);
std::tr1::unordered_map<unsigned long int, std::set<void (*)(const Emitter &, const MessageBase &)> >::iterator f = data->staticCallbacks.find(messageType);
if(f != data->staticCallbacks.end())
{
std::set<void (*)(const Emitter &, const MessageBase &)> & targets = f->second;
@@ -121,7 +121,7 @@ void MessageManager::addStaticCallback(void (*callback)(const Emitter &, const M
void MessageManager::emitMessage(const Emitter & emitter, const MessageBase & message) const
{
const unsigned long int messageType = message.getType();
std::hash_map<unsigned long int, std::set<Receiver *> >::const_iterator i = data->receivers.find(messageType);
std::tr1::unordered_map<unsigned long int, std::set<Receiver *> >::const_iterator i = data->receivers.find(messageType);
if(i != data->receivers.end())
{
const std::set<Receiver *> targets = (*i).second;
@@ -136,7 +136,7 @@ void MessageManager::emitMessage(const Emitter & emitter, const MessageBase & me
}
}
std::hash_map<unsigned long int, std::set<void (*)(const Emitter &, const MessageBase &)> >::iterator f = data->staticCallbacks.find(messageType);
std::tr1::unordered_map<unsigned long int, std::set<void (*)(const Emitter &, const MessageBase &)> >::iterator f = data->staticCallbacks.find(messageType);
if(f != data->staticCallbacks.end())
{
const std::set<void (*)(const Emitter &, const MessageBase &)> targets = f->second;
@@ -160,7 +160,7 @@ void MessageManager::receiverDestroyed(const Receiver & target)
return;
}
// find receiver
std::hash_map<unsigned long int, std::set<Receiver *> >::iterator i;
std::tr1::unordered_map<unsigned long int, std::set<Receiver *> >::iterator i;
for(i = data->receivers.begin(); i != data->receivers.end(); ++i)
{
std::set<Receiver *> & targets = (*i).second;
@@ -200,7 +200,7 @@ void MessageManager::removeReceiver(const Receiver & target, const char * const
void MessageManager::removeReceiver(const Receiver & target, const unsigned long int messageType)
{
std::hash_map<unsigned long int, std::set<Receiver *> >::iterator i = data->receivers.find(messageType);
std::tr1::unordered_map<unsigned long int, std::set<Receiver *> >::iterator i = data->receivers.find(messageType);
if(i != data->receivers.end())
{
std::set<Receiver *> & targets = (*i).second;
@@ -157,6 +157,7 @@
*/
//-----------------------------------------------------------------------
#include <algorithm>
#include <set>
#include <typeinfo>
#include <vector>
@@ -24,6 +24,7 @@
#include "TcpClient.h"
#include <algorithm>
#include <deque>
#include <map>
#include <set>
@@ -255,7 +256,7 @@ void NetworkHandler::onReceive(Connection * c, const unsigned char * d, int s)
{
if(c)
{
services.inputQueue.push_back();
services.inputQueue.push_back(IncomingData());
services.inputQueue.back().connection = c;
services.inputQueue.back().byteStream.put(d, s);
@@ -374,7 +374,7 @@ size_t Address::hashFunction() const
Example:
\code
typedef std::hash_map<Address, Connection *, Address::HashFunction, Address::EqualFunction> AddressMap;
typedef std::tr1::unordered_map<Address, Connection *, Address::HashFunction, Address::EqualFunction> AddressMap;
\endcode
@return true if the left hand side and right hand side are equal
@@ -11,6 +11,8 @@
#include "sharedMathArchive/VectorArchive.h"
#include "sharedNetworkMessages/ClientMfdStatusUpdateMessage.h"
#include <algorithm>
//-----------------------------------------------------------------------
const char * const ClientMfdStatusUpdateMessage::MESSAGE_TYPE = "ClientMfdStatusUpdateMessage";
@@ -24,8 +24,8 @@ public:
struct ExperimentInfo
{
const int attributeIndex; // which attribute is being experiemnted
const int experimentPoints; // how many experiment points are allocated
int attributeIndex; // which attribute is being experiemnted
int experimentPoints; // how many experiment points are allocated
ExperimentInfo(int attribute, int points) :
attributeIndex(attribute),
@@ -33,8 +33,8 @@ public:
{
}
private:
ExperimentInfo & operator = (const ExperimentInfo &);
//private:
// ExperimentInfo & operator = (const ExperimentInfo &);
};
public:
@@ -43,8 +43,8 @@ public:
int numParameters;
std::vector<std::string> parameters;
private:
TaskInfo & operator = (const TaskInfo &);
//private:
// TaskInfo & operator = (const TaskInfo &);
};
public:
@@ -13,7 +13,7 @@
#include "sharedFoundation/CrcString.h"
#include "sharedNetworkMessages/NetworkMessageFactory.h"
#include <algorithm>
#include <hash_map>
#include <tr1/unordered_map>
// ======================================================================
@@ -22,7 +22,7 @@ std::string const GameNetworkMessage::NetworkVersionId = "20100225-17:43";
namespace GameNetworkMessageNamespace
{
std::hash_map<unsigned long, int> gs_messageCount;
std::tr1::unordered_map<unsigned long, int> gs_messageCount;
// ----------------------------------------------------------------------
@@ -34,7 +34,7 @@ namespace GameNetworkMessageNamespace
}
};
std::hash_map<unsigned long, std::string> s_messageTypes;
std::tr1::unordered_map<unsigned long, std::string> s_messageTypes;
}
using namespace GameNetworkMessageNamespace;
@@ -105,7 +105,7 @@ std::vector<std::pair<std::string, int> > const GameNetworkMessage::getMessageCo
{
std::vector<std::pair<std::string, int> > result;
for (std::hash_map<unsigned long, int>::const_iterator i = gs_messageCount.begin(); i != gs_messageCount.end(); ++i)
for (std::tr1::unordered_map <unsigned long, int>::const_iterator i = gs_messageCount.begin(); i != gs_messageCount.end(); ++i)
result.push_back(std::make_pair(s_messageTypes[(*i).first], (*i).second));
std::sort(result.begin(), result.end(), SortPair());
@@ -15,6 +15,7 @@
#include "sharedObject/ContainedByProperty.h"
#include "sharedObject/Object.h"
#include <algorithm>
#include <cstdio>
// ======================================================================
@@ -22,6 +22,7 @@
#include "sharedObject/Object.h"
#include "UnicodeUtils.h"
#include <algorithm>
#include <map>
#include <string>
#include <vector>
@@ -10,7 +10,7 @@
#include "sharedFoundation/NetworkId.h"
#include "sharedObject/Object.h"
#include <hash_map>
#include <tr1/unordered_map>
#include <string>
//-----------------------------------------------------------------------
@@ -16,7 +16,7 @@ class NetworkIdManager
public:
~NetworkIdManager();
typedef stdhash_map<NetworkId, Object *, NetworkId::Hash>::fwd NetworkIdObjectHashMap;
typedef stdunordered_map<NetworkId, Object *, NetworkId::Hash>::fwd NetworkIdObjectHashMap;
static void addObject (Object & newObject);
static Object * getObjectById (const NetworkId & source);
@@ -559,7 +559,7 @@ void ObjectNamespace::deleteLocalTransform(Transform *transform)
void ObjectNamespace::validatePosition(Object const & object, Vector const & position)
{
if (abs(position.x) > 16000.0f || abs(position.y) > 16000.0f || abs(position.z) > 16000.0f)
if (std::abs(position.x) > 16000.0f || std::abs(position.y) > 16000.0f || std::abs(position.z) > 16000.0f)
{
Object const * parent = object.getAttachedTo();
@@ -166,7 +166,7 @@ void PortalPropertyTemplateNamespace::validateCoplanar(IndexedTriangleList const
for (uint i = 3; i < numberOfVertices; ++i)
{
float const distance = p.computeDistanceTo(vertexList[i]);
WARNING(abs(distance) > 0.001f, ("[%s]: portal is not planar, vertex %d is %8.6f from the plane", fileName, static_cast<int>(i), distance));
WARNING(std::abs(distance) > 0.001f, ("[%s]: portal is not planar, vertex %d is %8.6f from the plane", fileName, static_cast<int>(i), distance));
}
}
#endif
@@ -15,7 +15,7 @@
#include "sharedDebug/InstallTimer.h"
#include <algorithm>
#include <hash_map>
#include <tr1/unordered_map>
#include <string>
SkillManager *SkillManager::ms_instance = NULL;
@@ -16,8 +16,8 @@ class DataTable;
class SkillManager
{
public:
typedef stdhash_map<std::string, SkillObject *>::fwd SkillMap;
typedef stdhash_map<std::string, uint32>::fwd XpLimitMap;
typedef stdunordered_map<std::string, SkillObject *>::fwd SkillMap;
typedef stdunordered_map<std::string, uint32>::fwd XpLimitMap;
virtual ~SkillManager ();
@@ -17,6 +17,8 @@
#include <libgen.h>
#endif
#include <climits>
const char WIN32_PATH_SEPARATOR = '\\';
const char LINUX_PATH_SEPARATOR = '/';
@@ -12,6 +12,8 @@
#include "sharedFoundation/Tag.h"
#include "TemplateGlobals.h"
#include <climits>
class File;
class TemplateDefinitionFile;
class TpfTemplate;
@@ -33,6 +33,7 @@
#include "sharedRandom/RandomGenerator.h"
#include "sharedRandom/FastRandomGenerator.h"
#include <algorithm>
#include <map>
#include <vector>
@@ -95,9 +95,9 @@ private:
float m_haloScale;
bool m_infiniteDistance;
private:
//private:
DistantAppearanceData operator=(DistantAppearanceData const & rhs);
// DistantAppearanceData operator=(DistantAppearanceData const & rhs);
};
struct CelestialData
@@ -108,9 +108,9 @@ private:
float m_frontSize;
Vector m_direction_w;
private:
//private:
CelestialData operator=(CelestialData const & rhs);
// CelestialData operator=(CelestialData const & rhs);
};
private:
@@ -740,11 +740,11 @@ bool TerrainObject::isWithinTerrainBoundaries (Vector const &position_w) const
{
//-- check x and z
float const maxCoordinate = getMapWidthInMeters () * 0.5f;
if ((abs (position_w.x) > maxCoordinate) || (abs (position_w.z) > maxCoordinate))
if ((std::abs (position_w.x) > maxCoordinate) || (std::abs (position_w.z) > maxCoordinate))
return false;
//-- check y
if (abs (position_w.y) > getMaximumValidHeightInMeters ())
if (std::abs (position_w.y) > getMaximumValidHeightInMeters ())
return false;
return true;
@@ -13,7 +13,7 @@
#include "sharedUtility/DataTableCell.h"
#include <map>
#include <hash_map>
#include <tr1/unordered_map>
//----------------------------------------------------------------------------
@@ -15,6 +15,7 @@
#include <string>
#include <vector>
#include <tr1/unordered_map>
class Iff;
@@ -83,7 +84,7 @@ private:
void buildColumnIndexMap();
typedef std::vector<const DataTableColumnType *> DataTableColumnTypeVector;
typedef stdhash_map<std::string /*column name*/, int /*column index*/>::fwd ColumnIndexMap;
typedef std::tr1::unordered_map<std::string /*column name*/, int /*column index*/> ColumnIndexMap;
int m_numRows;
int m_numCols;
@@ -24,7 +24,7 @@
#include <algorithm>
#include <map>
#include <vector>
#include <hash_map>
#include <tr1/unordered_map>
//===================================================================
@@ -710,7 +710,7 @@ WorldSnapshotReaderWriter::Node const *WorldSnapshotReaderWriter::addObject (
//-- find objectTemplateNameIndex
uint objectTemplateNameIndex = 0;
std::hash_map<uint32, uint>::const_iterator i = m_objectTemplateCrcMap->find(objectTemplateName.getCrc());
ObjectTemplateCrcMap::const_iterator i = m_objectTemplateCrcMap->find(objectTemplateName.getCrc());
if (i != m_objectTemplateCrcMap->end())
objectTemplateNameIndex = (*i).second;
else
@@ -175,7 +175,7 @@ private:
typedef stdvector<char*>::fwd ObjectTemplateNameList;
ObjectTemplateNameList* const m_objectTemplateNameList;
typedef stdhash_map<uint32, uint>::fwd ObjectTemplateCrcMap;
typedef stdunordered_map<uint32, uint>::fwd ObjectTemplateCrcMap;
ObjectTemplateCrcMap* const m_objectTemplateCrcMap; // map from crc to index in name list
typedef stdmap<int64, Node*>::fwd NetworkIdNodeMap;