From 604aae43bd807c87b99baf03fe4dccdbe7c5816d Mon Sep 17 00:00:00 2001 From: Matthew Endsley Date: Tue, 13 Sep 2011 20:07:10 +0000 Subject: [PATCH] Fix 64bit pointer arithmetic warnings --- DetourCrowd/Include/DetourCrowd.h | 2 +- DetourCrowd/Source/DetourCrowd.cpp | 2 +- DetourTileCache/Source/DetourTileCache.cpp | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/DetourCrowd/Include/DetourCrowd.h b/DetourCrowd/Include/DetourCrowd.h index e789fd3..0e5cc36 100644 --- a/DetourCrowd/Include/DetourCrowd.h +++ b/DetourCrowd/Include/DetourCrowd.h @@ -218,7 +218,7 @@ class dtCrowd void updateMoveRequest(const float dt); void checkPathValidity(dtCrowdAgent** agents, const int nagents, const float dt); - inline int getAgentIndex(const dtCrowdAgent* agent) const { return agent - m_agents; } + inline int getAgentIndex(const dtCrowdAgent* agent) const { return (int)(agent - m_agents); } bool requestMoveTargetReplan(const int idx, dtPolyRef ref, const float* pos); diff --git a/DetourCrowd/Source/DetourCrowd.cpp b/DetourCrowd/Source/DetourCrowd.cpp index e7312ef..99d2f74 100644 --- a/DetourCrowd/Source/DetourCrowd.cpp +++ b/DetourCrowd/Source/DetourCrowd.cpp @@ -1118,7 +1118,7 @@ void dtCrowd::update(const float dt, dtCrowdAgentDebugInfo* debug) if (overOffmeshConnection(ag, triggerRadius)) { // Prepare to off-mesh connection. - const int idx = ag - m_agents; + const int idx = (int)(ag - m_agents); dtCrowdAgentAnimation* anim = &m_agentAnims[idx]; // Adjust the path over the off-mesh connection. diff --git a/DetourTileCache/Source/DetourTileCache.cpp b/DetourTileCache/Source/DetourTileCache.cpp index 8933f69..2ff792f 100644 --- a/DetourTileCache/Source/DetourTileCache.cpp +++ b/DetourTileCache/Source/DetourTileCache.cpp @@ -213,14 +213,14 @@ dtCompressedTile* dtTileCache::getTileAt(const int tx, const int ty, const int t dtCompressedTileRef dtTileCache::getTileRef(const dtCompressedTile* tile) const { if (!tile) return 0; - const unsigned int it = tile - m_tiles; + const unsigned int it = (unsigned int)(tile - m_tiles); return (dtCompressedTileRef)encodeTileId(tile->salt, it); } dtObstacleRef dtTileCache::getObstacleRef(const dtTileCacheObstacle* ob) const { if (!ob) return 0; - const unsigned int idx = ob - m_obstacles; + const unsigned int idx = (unsigned int)(ob - m_obstacles); return encodeObstacleId(ob->salt, idx); }