Merge pull request #1 from mendsley/issue_64bit_arithmetic

Fix 64bit pointer arithmetic warnings
This commit is contained in:
Mikko Mononen 2013-09-16 11:42:58 -07:00
commit 9f632d99fd
3 changed files with 4 additions and 4 deletions

View File

@ -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);

View File

@ -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.

View File

@ -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);
}