Fix warnings; initialise all uninitialised class members

This commit is contained in:
Ben Hymers 2016-02-26 08:40:53 +00:00
parent 511eeabe9f
commit a2730f9fdd
6 changed files with 24 additions and 2 deletions

View File

@ -207,6 +207,9 @@ void dtFreeObstacleAvoidanceQuery(dtObstacleAvoidanceQuery* ptr)
dtObstacleAvoidanceQuery::dtObstacleAvoidanceQuery() :
m_invHorizTime(0),
m_vmax(0),
m_invVmax(0),
m_maxCircles(0),
m_circles(0),
m_ncircles(0),

View File

@ -48,6 +48,7 @@ inline int hashPos2(int x, int y, int n)
dtProximityGrid::dtProximityGrid() :
m_cellSize(0),
m_invCellSize(0),
m_pool(0),
m_poolHead(0),
m_poolSize(0),

View File

@ -29,7 +29,7 @@ struct rcChunkyTriMeshNode
struct rcChunkyTriMesh
{
inline rcChunkyTriMesh() : nodes(0), tris(0) {};
inline rcChunkyTriMesh() : nodes(0), nnodes(0), tris(0), ntris(0), maxTrisPerChunk(0) {};
inline ~rcChunkyTriMesh() { delete [] nodes; delete [] tris; }
rcChunkyTriMeshNode* nodes;

View File

@ -32,7 +32,23 @@ class TestCase
struct Test
{
Test() : straight(0), nstraight(0), polys(0), npolys(0) {};
Test() :
type(),
radius(0),
includeFlags(0),
excludeFlags(0),
expand(false),
straight(0),
nstraight(0),
polys(0),
npolys(0),
findNearestPolyTime(0),
findPathTime(0),
findStraightPathTime(0),
next(0)
{
}
~Test()
{
delete [] straight;

View File

@ -220,6 +220,7 @@ static void disableUnvisitedPolys(dtNavMesh* nav, NavmeshFlags* flags)
}
NavMeshPruneTool::NavMeshPruneTool() :
m_sample(0),
m_flags(0),
m_hitPosSet(false)
{

View File

@ -233,6 +233,7 @@ NavMeshTesterTool::NavMeshTesterTool() :
m_sposSet(false),
m_eposSet(false),
m_pathIterNum(0),
m_pathIterPolyCount(0),
m_steerPointCount(0)
{
m_filter.setIncludeFlags(SAMPLE_POLYFLAGS_ALL ^ SAMPLE_POLYFLAGS_DISABLED);