From b7a83e0afbed5643600bad2b93febbad323333d1 Mon Sep 17 00:00:00 2001 From: Graham Pentheny Date: Tue, 19 Jan 2016 13:46:28 -0500 Subject: [PATCH] Fixed rule of 3 violations in many places. * Added virtual qualifier to a few destructors in subclasses. * Removed a few empty destructors that didn't need to be explicitly defined. * Fixed a few typos * Removed unnecessary empty virtual destructors in some classes with parent's who derrived from a class with a virtual destructor --- DebugUtils/Include/DebugDraw.h | 4 ++ Detour/Include/DetourNavMesh.h | 8 +++- Detour/Include/DetourNavMeshQuery.h | 3 ++ Detour/Include/DetourNode.h | 30 ++++++-------- DetourCrowd/Include/DetourCrowd.h | 5 +++ DetourCrowd/Include/DetourLocalBoundary.h | 5 +++ DetourCrowd/Include/DetourObstacleAvoidance.h | 7 ++++ DetourCrowd/Include/DetourPathCorridor.h | 7 +++- DetourCrowd/Include/DetourPathQueue.h | 4 ++ DetourCrowd/Include/DetourProximityGrid.h | 5 +++ DetourTileCache/Include/DetourTileCache.h | 6 ++- .../Include/DetourTileCacheBuilder.h | 6 +-- Recast/Include/Recast.h | 4 ++ Recast/Include/RecastAlloc.h | 13 ++++-- Recast/Source/RecastContour.cpp | 10 ++--- Recast/Source/RecastLayers.cpp | 6 +-- Recast/Source/RecastMesh.cpp | 40 +++++++++---------- Recast/Source/RecastMeshDetail.cpp | 4 +- Recast/Source/RecastRegion.cpp | 10 ++--- RecastDemo/Include/ChunkyTriMesh.h | 5 +++ RecastDemo/Include/ConvexVolumeTool.h | 1 - RecastDemo/Include/CrowdTool.h | 6 ++- RecastDemo/Include/InputGeom.h | 5 +++ RecastDemo/Include/MeshLoaderObj.h | 3 ++ RecastDemo/Include/NavMeshPruneTool.h | 7 +++- RecastDemo/Include/NavMeshTesterTool.h | 1 - RecastDemo/Include/Sample.h | 5 +++ RecastDemo/Include/SampleInterfaces.h | 13 +++--- RecastDemo/Include/Sample_Debug.h | 5 +++ RecastDemo/Include/Sample_SoloMesh.h | 5 +++ RecastDemo/Include/Sample_TempObstacles.h | 5 +++ RecastDemo/Include/Sample_TileMesh.h | 5 +++ RecastDemo/Include/TestCase.h | 9 +++++ RecastDemo/Include/ValueHistory.h | 1 - RecastDemo/Source/ConvexVolumeTool.cpp | 4 -- RecastDemo/Source/CrowdTool.cpp | 4 -- RecastDemo/Source/NavMeshTesterTool.cpp | 4 -- RecastDemo/Source/SampleInterfaces.cpp | 4 -- RecastDemo/Source/ValueHistory.cpp | 4 -- 39 files changed, 180 insertions(+), 93 deletions(-) diff --git a/DebugUtils/Include/DebugDraw.h b/DebugUtils/Include/DebugDraw.h index b24094fb..0b8c5935 100644 --- a/DebugUtils/Include/DebugDraw.h +++ b/DebugUtils/Include/DebugDraw.h @@ -210,6 +210,10 @@ public: virtual void end(); void clear(); void draw(struct duDebugDraw* dd); +private: + // Explicitly disabled copy constructor and copy assignment operator. + duDisplayList(const duDisplayList&); + duDisplayList& operator=(const duDisplayList&); }; diff --git a/Detour/Include/DetourNavMesh.h b/Detour/Include/DetourNavMesh.h index 083872f6..8ecd57e4 100644 --- a/Detour/Include/DetourNavMesh.h +++ b/Detour/Include/DetourNavMesh.h @@ -145,7 +145,7 @@ enum dtPolyTypes }; -/// Defines a polyogn within a dtMeshTile object. +/// Defines a polygon within a dtMeshTile object. /// @ingroup detour struct dtPoly { @@ -300,6 +300,9 @@ struct dtMeshTile int dataSize; ///< Size of the tile data. int flags; ///< Tile flags. (See: #dtTileFlags) dtMeshTile* next; ///< The next free tile, or the next tile in the spatial grid. +private: + dtMeshTile(const dtMeshTile&); + dtMeshTile& operator=(const dtMeshTile&); }; /// Configuration parameters used to define multi-tile navigation meshes. @@ -591,6 +594,9 @@ public: /// @} private: + // Explicitly disabled copy constructor and copy assignment operator. + dtNavMesh(const dtNavMesh&); + dtNavMesh& operator=(const dtNavMesh&); /// Returns pointer to tile in the tile array. dtMeshTile* getTile(int i); diff --git a/Detour/Include/DetourNavMeshQuery.h b/Detour/Include/DetourNavMeshQuery.h index 79c6762e..d3737a49 100644 --- a/Detour/Include/DetourNavMeshQuery.h +++ b/Detour/Include/DetourNavMeshQuery.h @@ -475,6 +475,9 @@ public: /// @} private: + // Explicitly disabled copy constructor and copy assignment operator + dtNavMeshQuery(const dtNavMeshQuery&); + dtNavMeshQuery& operator=(const dtNavMeshQuery&); /// Returns neighbour tile based on side. dtMeshTile* getNeighbourTileAt(int x, int y, int side) const; diff --git a/Detour/Include/DetourNode.h b/Detour/Include/DetourNode.h index 6fefdc8e..1494e1e8 100644 --- a/Detour/Include/DetourNode.h +++ b/Detour/Include/DetourNode.h @@ -42,17 +42,13 @@ struct dtNode dtPolyRef id; ///< Polygon ref the node corresponds to. }; - static const int DT_MAX_STATES_PER_NODE = 4; // number of extra states per node. See dtNode::state - - class dtNodePool { public: dtNodePool(int maxNodes, int hashSize); ~dtNodePool(); - inline void operator=(const dtNodePool&) {} void clear(); // Get a dtNode by ref and extra state information. If there is none then - allocate @@ -64,19 +60,19 @@ public: inline unsigned int getNodeIdx(const dtNode* node) const { if (!node) return 0; - return (unsigned int)(node - m_nodes)+1; + return (unsigned int)(node - m_nodes) + 1; } inline dtNode* getNodeAtIdx(unsigned int idx) { if (!idx) return 0; - return &m_nodes[idx-1]; + return &m_nodes[idx - 1]; } inline const dtNode* getNodeAtIdx(unsigned int idx) const { if (!idx) return 0; - return &m_nodes[idx-1]; + return &m_nodes[idx - 1]; } inline int getMemUsed() const @@ -95,6 +91,9 @@ public: inline int getNodeCount() const { return m_nodeCount; } private: + // Explicitly disabled copy constructor and copy assignment operator. + dtNodePool(const dtNodePool&); + dtNodePool& operator=(const dtNodePool&); dtNode* m_nodes; dtNodeIndex* m_first; @@ -109,17 +108,10 @@ class dtNodeQueue public: dtNodeQueue(int n); ~dtNodeQueue(); - inline void operator=(dtNodeQueue&) {} - inline void clear() - { - m_size = 0; - } + inline void clear() { m_size = 0; } - inline dtNode* top() - { - return m_heap[0]; - } + inline dtNode* top() { return m_heap[0]; } inline dtNode* pop() { @@ -152,12 +144,16 @@ public: inline int getMemUsed() const { return sizeof(*this) + - sizeof(dtNode*)*(m_capacity+1); + sizeof(dtNode*) * (m_capacity + 1); } inline int getCapacity() const { return m_capacity; } private: + // Explicitly disabled copy constructor and copy assignment operator. + dtNodeQueue(const dtNodeQueue&); + dtNodeQueue& operator=(const dtNodeQueue&); + void bubbleUp(int i, dtNode* node); void trickleDown(int i, dtNode* node); diff --git a/DetourCrowd/Include/DetourCrowd.h b/DetourCrowd/Include/DetourCrowd.h index 2d786f36..2a2003b1 100644 --- a/DetourCrowd/Include/DetourCrowd.h +++ b/DetourCrowd/Include/DetourCrowd.h @@ -343,6 +343,11 @@ public: /// Gets the query object used by the crowd. const dtNavMeshQuery* getNavMeshQuery() const { return m_navquery; } + +private: + // Explicitly disabled copy constructor and copy assignment operator. + dtCrowd(const dtCrowd&); + dtCrowd& operator=(const dtCrowd&); }; /// Allocates a crowd object using the Detour allocator. diff --git a/DetourCrowd/Include/DetourLocalBoundary.h b/DetourCrowd/Include/DetourLocalBoundary.h index e59bb564..56b5cb27 100644 --- a/DetourCrowd/Include/DetourLocalBoundary.h +++ b/DetourCrowd/Include/DetourLocalBoundary.h @@ -56,6 +56,11 @@ public: inline const float* getCenter() const { return m_center; } inline int getSegmentCount() const { return m_nsegs; } inline const float* getSegment(int i) const { return m_segs[i].s; } + +private: + // Explicitly disabled copy constructor and copy assignment operator. + dtLocalBoundary(const dtLocalBoundary&); + dtLocalBoundary& operator=(const dtLocalBoundary&); }; #endif // DETOURLOCALBOUNDARY_H diff --git a/DetourCrowd/Include/DetourObstacleAvoidance.h b/DetourCrowd/Include/DetourObstacleAvoidance.h index 6be3fbb2..cc46347a 100644 --- a/DetourCrowd/Include/DetourObstacleAvoidance.h +++ b/DetourCrowd/Include/DetourObstacleAvoidance.h @@ -58,6 +58,10 @@ public: inline float getSampleCollisionTimePenalty(const int i) const { return m_tpen[i]; } private: + // Explicitly disabled copy constructor and copy assignment operator. + dtObstacleAvoidanceDebugData(const dtObstacleAvoidanceDebugData&); + dtObstacleAvoidanceDebugData& operator=(const dtObstacleAvoidanceDebugData&); + int m_nsamples; int m_maxSamples; float* m_vel; @@ -122,6 +126,9 @@ public: const dtObstacleSegment* getObstacleSegment(const int i) { return &m_segments[i]; } private: + // Explicitly disabled copy constructor and copy assignment operator. + dtObstacleAvoidanceQuery(const dtObstacleAvoidanceQuery&); + dtObstacleAvoidanceQuery& operator=(const dtObstacleAvoidanceQuery&); void prepare(const float* pos, const float* dvel); diff --git a/DetourCrowd/Include/DetourPathCorridor.h b/DetourCrowd/Include/DetourPathCorridor.h index 863447ae..f5ee8df7 100644 --- a/DetourCrowd/Include/DetourPathCorridor.h +++ b/DetourCrowd/Include/DetourPathCorridor.h @@ -131,7 +131,12 @@ public: /// The number of polygons in the current corridor path. /// @return The number of polygons in the current corridor path. - inline int getPathCount() const { return m_npath; } + inline int getPathCount() const { return m_npath; } + +private: + // Explicitly disabled copy constructor and copy assignment operator. + dtPathCorridor(const dtPathCorridor&); + dtPathCorridor& operator=(const dtPathCorridor&); }; int dtMergeCorridorStartMoved(dtPolyRef* path, const int npath, const int maxPath, diff --git a/DetourCrowd/Include/DetourPathQueue.h b/DetourCrowd/Include/DetourPathQueue.h index fe3920b6..310721e7 100644 --- a/DetourCrowd/Include/DetourPathQueue.h +++ b/DetourCrowd/Include/DetourPathQueue.h @@ -70,6 +70,10 @@ public: inline const dtNavMeshQuery* getNavQuery() const { return m_navquery; } +private: + // Explicitly disabled copy constructor and copy assignment operator. + dtPathQueue(const dtPathQueue&); + dtPathQueue& operator=(const dtPathQueue&); }; #endif // DETOURPATHQUEUE_H diff --git a/DetourCrowd/Include/DetourProximityGrid.h b/DetourCrowd/Include/DetourProximityGrid.h index e880c276..d8968efd 100644 --- a/DetourCrowd/Include/DetourProximityGrid.h +++ b/DetourCrowd/Include/DetourProximityGrid.h @@ -59,6 +59,11 @@ public: inline const int* getBounds() const { return m_bounds; } inline float getCellSize() const { return m_cellSize; } + +private: + // Explicitly disabled copy constructor and copy assignment operator. + dtProximityGrid(const dtProximityGrid&); + dtProximityGrid& operator=(const dtProximityGrid&); }; dtProximityGrid* dtAllocProximityGrid(); diff --git a/DetourTileCache/Include/DetourTileCache.h b/DetourTileCache/Include/DetourTileCache.h index e2e3f42f..9c7e01c3 100644 --- a/DetourTileCache/Include/DetourTileCache.h +++ b/DetourTileCache/Include/DetourTileCache.h @@ -164,7 +164,10 @@ public: private: - + // Explicitly disabled copy constructor and copy assignment operator. + dtTileCache(const dtTileCache&); + dtTileCache& operator=(const dtTileCache&); + enum ObstacleRequestAction { REQUEST_ADD, @@ -203,7 +206,6 @@ private: static const int MAX_UPDATE = 64; dtCompressedTileRef m_update[MAX_UPDATE]; int m_nupdate; - }; dtTileCache* dtAllocTileCache(); diff --git a/DetourTileCache/Include/DetourTileCacheBuilder.h b/DetourTileCache/Include/DetourTileCacheBuilder.h index 7e3b124e..854183c9 100644 --- a/DetourTileCache/Include/DetourTileCacheBuilder.h +++ b/DetourTileCache/Include/DetourTileCacheBuilder.h @@ -78,11 +78,9 @@ struct dtTileCachePolyMesh struct dtTileCacheAlloc { - virtual ~dtTileCacheAlloc() { } + virtual ~dtTileCacheAlloc() {} - virtual void reset() - { - } + virtual void reset() {} virtual void* alloc(const size_t size) { diff --git a/Recast/Include/Recast.h b/Recast/Include/Recast.h index 9c7ae0c6..2adcdcb3 100644 --- a/Recast/Include/Recast.h +++ b/Recast/Include/Recast.h @@ -185,6 +185,10 @@ public: inline ~rcScopedTimer() { m_ctx->stopTimer(m_label); } private: + // Explicitly disabled copy constructor and copy assignment operator. + rcScopedTimer(const rcScopedTimer&); + rcScopedTimer& operator=(const rcScopedTimer&); + rcContext* const m_ctx; const rcTimerLabel m_label; }; diff --git a/Recast/Include/RecastAlloc.h b/Recast/Include/RecastAlloc.h index 7e15735b..f1608fb5 100644 --- a/Recast/Include/RecastAlloc.h +++ b/Recast/Include/RecastAlloc.h @@ -64,12 +64,14 @@ class rcIntArray { int* m_data; int m_size, m_cap; - inline rcIntArray(const rcIntArray&); - inline rcIntArray& operator=(const rcIntArray&); void doResize(int n); -public: + + // Explicitly disabled copy constructor and copy assignment operator. + rcIntArray(const rcIntArray&); + rcIntArray& operator=(const rcIntArray&); +public: /// Constructs an instance with an initial array size of zero. rcIntArray() : m_data(0), m_size(0), m_cap(0) {} @@ -135,6 +137,11 @@ public: /// The root array pointer. /// @return The root array pointer. inline operator T*() { return ptr; } + +private: + // Explicitly disabled copy constructor and copy assignment operator. + rcScopedDelete(const rcScopedDelete&); + rcScopedDelete& operator=(const rcScopedDelete&); }; #endif diff --git a/Recast/Source/RecastContour.cpp b/Recast/Source/RecastContour.cpp index dfd3cbdb..277ab015 100644 --- a/Recast/Source/RecastContour.cpp +++ b/Recast/Source/RecastContour.cpp @@ -731,7 +731,7 @@ static void mergeRegionHoles(rcContext* ctx, rcContourRegion& region) for (int i = 0; i < region.nholes; i++) maxVerts += region.holes[i].contour->nverts; - rcScopedDelete diags = (rcPotentialDiagonal*)rcAlloc(sizeof(rcPotentialDiagonal)*maxVerts, RC_ALLOC_TEMP); + rcScopedDelete diags((rcPotentialDiagonal*)rcAlloc(sizeof(rcPotentialDiagonal)*maxVerts, RC_ALLOC_TEMP)); if (!diags) { ctx->log(RC_LOG_WARNING, "mergeRegionHoles: Failed to allocated diags %d.", maxVerts); @@ -857,7 +857,7 @@ bool rcBuildContours(rcContext* ctx, rcCompactHeightfield& chf, return false; cset.nconts = 0; - rcScopedDelete flags = (unsigned char*)rcAlloc(sizeof(unsigned char)*chf.spanCount, RC_ALLOC_TEMP); + rcScopedDelete flags((unsigned char*)rcAlloc(sizeof(unsigned char)*chf.spanCount, RC_ALLOC_TEMP)); if (!flags) { ctx->log(RC_LOG_ERROR, "rcBuildContours: Out of memory 'flags' (%d).", chf.spanCount); @@ -1009,7 +1009,7 @@ bool rcBuildContours(rcContext* ctx, rcCompactHeightfield& chf, if (cset.nconts > 0) { // Calculate winding of all polygons. - rcScopedDelete winding = (char*)rcAlloc(sizeof(char)*cset.nconts, RC_ALLOC_TEMP); + rcScopedDelete winding((char*)rcAlloc(sizeof(char)*cset.nconts, RC_ALLOC_TEMP)); if (!winding) { ctx->log(RC_LOG_ERROR, "rcBuildContours: Out of memory 'hole' (%d).", cset.nconts); @@ -1030,7 +1030,7 @@ bool rcBuildContours(rcContext* ctx, rcCompactHeightfield& chf, // Collect outline contour and holes contours per region. // We assume that there is one outline and multiple holes. const int nregions = chf.maxRegions+1; - rcScopedDelete regions = (rcContourRegion*)rcAlloc(sizeof(rcContourRegion)*nregions, RC_ALLOC_TEMP); + rcScopedDelete regions((rcContourRegion*)rcAlloc(sizeof(rcContourRegion)*nregions, RC_ALLOC_TEMP)); if (!regions) { ctx->log(RC_LOG_ERROR, "rcBuildContours: Out of memory 'regions' (%d).", nregions); @@ -1038,7 +1038,7 @@ bool rcBuildContours(rcContext* ctx, rcCompactHeightfield& chf, } memset(regions, 0, sizeof(rcContourRegion)*nregions); - rcScopedDelete holes = (rcContourHole*)rcAlloc(sizeof(rcContourHole)*cset.nconts, RC_ALLOC_TEMP); + rcScopedDelete holes((rcContourHole*)rcAlloc(sizeof(rcContourHole)*cset.nconts, RC_ALLOC_TEMP)); if (!holes) { ctx->log(RC_LOG_ERROR, "rcBuildContours: Out of memory 'holes' (%d).", cset.nconts); diff --git a/Recast/Source/RecastLayers.cpp b/Recast/Source/RecastLayers.cpp index 6b02204b..22a357ef 100644 --- a/Recast/Source/RecastLayers.cpp +++ b/Recast/Source/RecastLayers.cpp @@ -92,7 +92,7 @@ bool rcBuildHeightfieldLayers(rcContext* ctx, rcCompactHeightfield& chf, const int w = chf.width; const int h = chf.height; - rcScopedDelete srcReg = (unsigned char*)rcAlloc(sizeof(unsigned char)*chf.spanCount, RC_ALLOC_TEMP); + rcScopedDelete srcReg((unsigned char*)rcAlloc(sizeof(unsigned char)*chf.spanCount, RC_ALLOC_TEMP)); if (!srcReg) { ctx->log(RC_LOG_ERROR, "rcBuildHeightfieldLayers: Out of memory 'srcReg' (%d).", chf.spanCount); @@ -101,7 +101,7 @@ bool rcBuildHeightfieldLayers(rcContext* ctx, rcCompactHeightfield& chf, memset(srcReg,0xff,sizeof(unsigned char)*chf.spanCount); const int nsweeps = chf.width; - rcScopedDelete sweeps = (rcLayerSweepSpan*)rcAlloc(sizeof(rcLayerSweepSpan)*nsweeps, RC_ALLOC_TEMP); + rcScopedDelete sweeps((rcLayerSweepSpan*)rcAlloc(sizeof(rcLayerSweepSpan)*nsweeps, RC_ALLOC_TEMP)); if (!sweeps) { ctx->log(RC_LOG_ERROR, "rcBuildHeightfieldLayers: Out of memory 'sweeps' (%d).", nsweeps); @@ -212,7 +212,7 @@ bool rcBuildHeightfieldLayers(rcContext* ctx, rcCompactHeightfield& chf, // Allocate and init layer regions. const int nregs = (int)regId; - rcScopedDelete regs = (rcLayerRegion*)rcAlloc(sizeof(rcLayerRegion)*nregs, RC_ALLOC_TEMP); + rcScopedDelete regs((rcLayerRegion*)rcAlloc(sizeof(rcLayerRegion)*nregs, RC_ALLOC_TEMP)); if (!regs) { ctx->log(RC_LOG_ERROR, "rcBuildHeightfieldLayers: Out of memory 'regs' (%d).", nregs); diff --git a/Recast/Source/RecastMesh.cpp b/Recast/Source/RecastMesh.cpp index a815e3c4..9b6f04e3 100644 --- a/Recast/Source/RecastMesh.cpp +++ b/Recast/Source/RecastMesh.cpp @@ -601,7 +601,7 @@ static bool canRemoveVertex(rcContext* ctx, rcPolyMesh& mesh, const unsigned sho // Find edges which share the removed vertex. const int maxEdges = numTouchedVerts*2; int nedges = 0; - rcScopedDelete edges = (int*)rcAlloc(sizeof(int)*maxEdges*3, RC_ALLOC_TEMP); + rcScopedDelete edges((int*)rcAlloc(sizeof(int)*maxEdges*3, RC_ALLOC_TEMP)); if (!edges) { ctx->log(RC_LOG_WARNING, "canRemoveVertex: Out of memory 'edges' (%d).", maxEdges*3); @@ -681,7 +681,7 @@ static bool removeVertex(rcContext* ctx, rcPolyMesh& mesh, const unsigned short } int nedges = 0; - rcScopedDelete edges = (int*)rcAlloc(sizeof(int)*numRemovedVerts*nvp*4, RC_ALLOC_TEMP); + rcScopedDelete edges((int*)rcAlloc(sizeof(int)*numRemovedVerts*nvp*4, RC_ALLOC_TEMP)); if (!edges) { ctx->log(RC_LOG_WARNING, "removeVertex: Out of memory 'edges' (%d).", numRemovedVerts*nvp*4); @@ -689,7 +689,7 @@ static bool removeVertex(rcContext* ctx, rcPolyMesh& mesh, const unsigned short } int nhole = 0; - rcScopedDelete hole = (int*)rcAlloc(sizeof(int)*numRemovedVerts*nvp, RC_ALLOC_TEMP); + rcScopedDelete hole((int*)rcAlloc(sizeof(int)*numRemovedVerts*nvp, RC_ALLOC_TEMP)); if (!hole) { ctx->log(RC_LOG_WARNING, "removeVertex: Out of memory 'hole' (%d).", numRemovedVerts*nvp); @@ -697,7 +697,7 @@ static bool removeVertex(rcContext* ctx, rcPolyMesh& mesh, const unsigned short } int nhreg = 0; - rcScopedDelete hreg = (int*)rcAlloc(sizeof(int)*numRemovedVerts*nvp, RC_ALLOC_TEMP); + rcScopedDelete hreg((int*)rcAlloc(sizeof(int)*numRemovedVerts*nvp, RC_ALLOC_TEMP)); if (!hreg) { ctx->log(RC_LOG_WARNING, "removeVertex: Out of memory 'hreg' (%d).", numRemovedVerts*nvp); @@ -705,7 +705,7 @@ static bool removeVertex(rcContext* ctx, rcPolyMesh& mesh, const unsigned short } int nharea = 0; - rcScopedDelete harea = (int*)rcAlloc(sizeof(int)*numRemovedVerts*nvp, RC_ALLOC_TEMP); + rcScopedDelete harea((int*)rcAlloc(sizeof(int)*numRemovedVerts*nvp, RC_ALLOC_TEMP)); if (!harea) { ctx->log(RC_LOG_WARNING, "removeVertex: Out of memory 'harea' (%d).", numRemovedVerts*nvp); @@ -822,21 +822,21 @@ static bool removeVertex(rcContext* ctx, rcPolyMesh& mesh, const unsigned short break; } - rcScopedDelete tris = (int*)rcAlloc(sizeof(int)*nhole*3, RC_ALLOC_TEMP); + rcScopedDelete tris((int*)rcAlloc(sizeof(int)*nhole*3, RC_ALLOC_TEMP)); if (!tris) { ctx->log(RC_LOG_WARNING, "removeVertex: Out of memory 'tris' (%d).", nhole*3); return false; } - rcScopedDelete tverts = (int*)rcAlloc(sizeof(int)*nhole*4, RC_ALLOC_TEMP); + rcScopedDelete tverts((int*)rcAlloc(sizeof(int)*nhole*4, RC_ALLOC_TEMP)); if (!tverts) { ctx->log(RC_LOG_WARNING, "removeVertex: Out of memory 'tverts' (%d).", nhole*4); return false; } - rcScopedDelete thole = (int*)rcAlloc(sizeof(int)*nhole, RC_ALLOC_TEMP); + rcScopedDelete thole((int*)rcAlloc(sizeof(int)*nhole, RC_ALLOC_TEMP)); if (!thole) { ctx->log(RC_LOG_WARNING, "removeVertex: Out of memory 'thole' (%d).", nhole); @@ -863,19 +863,19 @@ static bool removeVertex(rcContext* ctx, rcPolyMesh& mesh, const unsigned short } // Merge the hole triangles back to polygons. - rcScopedDelete polys = (unsigned short*)rcAlloc(sizeof(unsigned short)*(ntris+1)*nvp, RC_ALLOC_TEMP); + rcScopedDelete polys((unsigned short*)rcAlloc(sizeof(unsigned short)*(ntris+1)*nvp, RC_ALLOC_TEMP)); if (!polys) { ctx->log(RC_LOG_ERROR, "removeVertex: Out of memory 'polys' (%d).", (ntris+1)*nvp); return false; } - rcScopedDelete pregs = (unsigned short*)rcAlloc(sizeof(unsigned short)*ntris, RC_ALLOC_TEMP); + rcScopedDelete pregs((unsigned short*)rcAlloc(sizeof(unsigned short)*ntris, RC_ALLOC_TEMP)); if (!pregs) { ctx->log(RC_LOG_ERROR, "removeVertex: Out of memory 'pregs' (%d).", ntris); return false; } - rcScopedDelete pareas = (unsigned char*)rcAlloc(sizeof(unsigned char)*ntris, RC_ALLOC_TEMP); + rcScopedDelete pareas((unsigned char*)rcAlloc(sizeof(unsigned char)*ntris, RC_ALLOC_TEMP)); if (!pareas) { ctx->log(RC_LOG_ERROR, "removeVertex: Out of memory 'pareas' (%d).", ntris); @@ -1020,7 +1020,7 @@ bool rcBuildPolyMesh(rcContext* ctx, rcContourSet& cset, const int nvp, rcPolyMe return false; } - rcScopedDelete vflags = (unsigned char*)rcAlloc(sizeof(unsigned char)*maxVertices, RC_ALLOC_TEMP); + rcScopedDelete vflags((unsigned char*)rcAlloc(sizeof(unsigned char)*maxVertices, RC_ALLOC_TEMP)); if (!vflags) { ctx->log(RC_LOG_ERROR, "rcBuildPolyMesh: Out of memory 'vflags' (%d).", maxVertices); @@ -1063,7 +1063,7 @@ bool rcBuildPolyMesh(rcContext* ctx, rcContourSet& cset, const int nvp, rcPolyMe memset(mesh.regs, 0, sizeof(unsigned short)*maxTris); memset(mesh.areas, 0, sizeof(unsigned char)*maxTris); - rcScopedDelete nextVert = (int*)rcAlloc(sizeof(int)*maxVertices, RC_ALLOC_TEMP); + rcScopedDelete nextVert((int*)rcAlloc(sizeof(int)*maxVertices, RC_ALLOC_TEMP)); if (!nextVert) { ctx->log(RC_LOG_ERROR, "rcBuildPolyMesh: Out of memory 'nextVert' (%d).", maxVertices); @@ -1071,7 +1071,7 @@ bool rcBuildPolyMesh(rcContext* ctx, rcContourSet& cset, const int nvp, rcPolyMe } memset(nextVert, 0, sizeof(int)*maxVertices); - rcScopedDelete firstVert = (int*)rcAlloc(sizeof(int)*VERTEX_BUCKET_COUNT, RC_ALLOC_TEMP); + rcScopedDelete firstVert((int*)rcAlloc(sizeof(int)*VERTEX_BUCKET_COUNT, RC_ALLOC_TEMP)); if (!firstVert) { ctx->log(RC_LOG_ERROR, "rcBuildPolyMesh: Out of memory 'firstVert' (%d).", VERTEX_BUCKET_COUNT); @@ -1080,19 +1080,19 @@ bool rcBuildPolyMesh(rcContext* ctx, rcContourSet& cset, const int nvp, rcPolyMe for (int i = 0; i < VERTEX_BUCKET_COUNT; ++i) firstVert[i] = -1; - rcScopedDelete indices = (int*)rcAlloc(sizeof(int)*maxVertsPerCont, RC_ALLOC_TEMP); + rcScopedDelete indices((int*)rcAlloc(sizeof(int)*maxVertsPerCont, RC_ALLOC_TEMP)); if (!indices) { ctx->log(RC_LOG_ERROR, "rcBuildPolyMesh: Out of memory 'indices' (%d).", maxVertsPerCont); return false; } - rcScopedDelete tris = (int*)rcAlloc(sizeof(int)*maxVertsPerCont*3, RC_ALLOC_TEMP); + rcScopedDelete tris((int*)rcAlloc(sizeof(int)*maxVertsPerCont*3, RC_ALLOC_TEMP)); if (!tris) { ctx->log(RC_LOG_ERROR, "rcBuildPolyMesh: Out of memory 'tris' (%d).", maxVertsPerCont*3); return false; } - rcScopedDelete polys = (unsigned short*)rcAlloc(sizeof(unsigned short)*(maxVertsPerCont+1)*nvp, RC_ALLOC_TEMP); + rcScopedDelete polys((unsigned short*)rcAlloc(sizeof(unsigned short)*(maxVertsPerCont+1)*nvp, RC_ALLOC_TEMP)); if (!polys) { ctx->log(RC_LOG_ERROR, "rcBuildPolyMesh: Out of memory 'polys' (%d).", maxVertsPerCont*nvp); @@ -1376,7 +1376,7 @@ bool rcMergePolyMeshes(rcContext* ctx, rcPolyMesh** meshes, const int nmeshes, r } memset(mesh.flags, 0, sizeof(unsigned short)*maxPolys); - rcScopedDelete nextVert = (int*)rcAlloc(sizeof(int)*maxVerts, RC_ALLOC_TEMP); + rcScopedDelete nextVert((int*)rcAlloc(sizeof(int)*maxVerts, RC_ALLOC_TEMP)); if (!nextVert) { ctx->log(RC_LOG_ERROR, "rcMergePolyMeshes: Out of memory 'nextVert' (%d).", maxVerts); @@ -1384,7 +1384,7 @@ bool rcMergePolyMeshes(rcContext* ctx, rcPolyMesh** meshes, const int nmeshes, r } memset(nextVert, 0, sizeof(int)*maxVerts); - rcScopedDelete firstVert = (int*)rcAlloc(sizeof(int)*VERTEX_BUCKET_COUNT, RC_ALLOC_TEMP); + rcScopedDelete firstVert((int*)rcAlloc(sizeof(int)*VERTEX_BUCKET_COUNT, RC_ALLOC_TEMP)); if (!firstVert) { ctx->log(RC_LOG_ERROR, "rcMergePolyMeshes: Out of memory 'firstVert' (%d).", VERTEX_BUCKET_COUNT); @@ -1393,7 +1393,7 @@ bool rcMergePolyMeshes(rcContext* ctx, rcPolyMesh** meshes, const int nmeshes, r for (int i = 0; i < VERTEX_BUCKET_COUNT; ++i) firstVert[i] = -1; - rcScopedDelete vremap = (unsigned short*)rcAlloc(sizeof(unsigned short)*maxVertsPerMesh, RC_ALLOC_PERM); + rcScopedDelete vremap((unsigned short*)rcAlloc(sizeof(unsigned short)*maxVertsPerMesh, RC_ALLOC_PERM)); if (!vremap) { ctx->log(RC_LOG_ERROR, "rcMergePolyMeshes: Out of memory 'vremap' (%d).", maxVertsPerMesh); diff --git a/Recast/Source/RecastMeshDetail.cpp b/Recast/Source/RecastMeshDetail.cpp index d88db0ac..f1270cf2 100644 --- a/Recast/Source/RecastMeshDetail.cpp +++ b/Recast/Source/RecastMeshDetail.cpp @@ -1194,13 +1194,13 @@ bool rcBuildPolyMeshDetail(rcContext* ctx, const rcPolyMesh& mesh, const rcCompa int nPolyVerts = 0; int maxhw = 0, maxhh = 0; - rcScopedDelete bounds = (int*)rcAlloc(sizeof(int)*mesh.npolys*4, RC_ALLOC_TEMP); + rcScopedDelete bounds((int*)rcAlloc(sizeof(int)*mesh.npolys*4, RC_ALLOC_TEMP)); if (!bounds) { ctx->log(RC_LOG_ERROR, "rcBuildPolyMeshDetail: Out of memory 'bounds' (%d).", mesh.npolys*4); return false; } - rcScopedDelete poly = (float*)rcAlloc(sizeof(float)*nvp*3, RC_ALLOC_TEMP); + rcScopedDelete poly((float*)rcAlloc(sizeof(float)*nvp*3, RC_ALLOC_TEMP)); if (!poly) { ctx->log(RC_LOG_ERROR, "rcBuildPolyMeshDetail: Out of memory 'poly' (%d).", nvp*3); diff --git a/Recast/Source/RecastRegion.cpp b/Recast/Source/RecastRegion.cpp index 90e0523d..2bb35033 100644 --- a/Recast/Source/RecastRegion.cpp +++ b/Recast/Source/RecastRegion.cpp @@ -1363,7 +1363,7 @@ bool rcBuildRegionsMonotone(rcContext* ctx, rcCompactHeightfield& chf, const int h = chf.height; unsigned short id = 1; - rcScopedDelete srcReg = (unsigned short*)rcAlloc(sizeof(unsigned short)*chf.spanCount, RC_ALLOC_TEMP); + rcScopedDelete srcReg((unsigned short*)rcAlloc(sizeof(unsigned short)*chf.spanCount, RC_ALLOC_TEMP)); if (!srcReg) { ctx->log(RC_LOG_ERROR, "rcBuildRegionsMonotone: Out of memory 'src' (%d).", chf.spanCount); @@ -1372,7 +1372,7 @@ bool rcBuildRegionsMonotone(rcContext* ctx, rcCompactHeightfield& chf, memset(srcReg,0,sizeof(unsigned short)*chf.spanCount); const int nsweeps = rcMax(chf.width,chf.height); - rcScopedDelete sweeps = (rcSweepSpan*)rcAlloc(sizeof(rcSweepSpan)*nsweeps, RC_ALLOC_TEMP); + rcScopedDelete sweeps((rcSweepSpan*)rcAlloc(sizeof(rcSweepSpan)*nsweeps, RC_ALLOC_TEMP)); if (!sweeps) { ctx->log(RC_LOG_ERROR, "rcBuildRegionsMonotone: Out of memory 'sweeps' (%d).", nsweeps); @@ -1535,7 +1535,7 @@ bool rcBuildRegions(rcContext* ctx, rcCompactHeightfield& chf, const int w = chf.width; const int h = chf.height; - rcScopedDelete buf = (unsigned short*)rcAlloc(sizeof(unsigned short)*chf.spanCount*4, RC_ALLOC_TEMP); + rcScopedDelete buf((unsigned short*)rcAlloc(sizeof(unsigned short)*chf.spanCount*4, RC_ALLOC_TEMP)); if (!buf) { ctx->log(RC_LOG_ERROR, "rcBuildRegions: Out of memory 'tmp' (%d).", chf.spanCount*4); @@ -1672,7 +1672,7 @@ bool rcBuildLayerRegions(rcContext* ctx, rcCompactHeightfield& chf, const int h = chf.height; unsigned short id = 1; - rcScopedDelete srcReg = (unsigned short*)rcAlloc(sizeof(unsigned short)*chf.spanCount, RC_ALLOC_TEMP); + rcScopedDelete srcReg((unsigned short*)rcAlloc(sizeof(unsigned short)*chf.spanCount, RC_ALLOC_TEMP)); if (!srcReg) { ctx->log(RC_LOG_ERROR, "rcBuildRegionsMonotone: Out of memory 'src' (%d).", chf.spanCount); @@ -1681,7 +1681,7 @@ bool rcBuildLayerRegions(rcContext* ctx, rcCompactHeightfield& chf, memset(srcReg,0,sizeof(unsigned short)*chf.spanCount); const int nsweeps = rcMax(chf.width,chf.height); - rcScopedDelete sweeps = (rcSweepSpan*)rcAlloc(sizeof(rcSweepSpan)*nsweeps, RC_ALLOC_TEMP); + rcScopedDelete sweeps((rcSweepSpan*)rcAlloc(sizeof(rcSweepSpan)*nsweeps, RC_ALLOC_TEMP)); if (!sweeps) { ctx->log(RC_LOG_ERROR, "rcBuildRegionsMonotone: Out of memory 'sweeps' (%d).", nsweeps); diff --git a/RecastDemo/Include/ChunkyTriMesh.h b/RecastDemo/Include/ChunkyTriMesh.h index 7f428b68..53192c0c 100644 --- a/RecastDemo/Include/ChunkyTriMesh.h +++ b/RecastDemo/Include/ChunkyTriMesh.h @@ -37,6 +37,11 @@ struct rcChunkyTriMesh int* tris; int ntris; int maxTrisPerChunk; + +private: + // Explicitly disabled copy constructor and copy assignment operator. + rcChunkyTriMesh(const rcChunkyTriMesh&); + rcChunkyTriMesh& operator=(const rcChunkyTriMesh&); }; /// Creates partitioned triangle mesh (AABB tree), diff --git a/RecastDemo/Include/ConvexVolumeTool.h b/RecastDemo/Include/ConvexVolumeTool.h index fea87764..1f56cb07 100644 --- a/RecastDemo/Include/ConvexVolumeTool.h +++ b/RecastDemo/Include/ConvexVolumeTool.h @@ -39,7 +39,6 @@ class ConvexVolumeTool : public SampleTool public: ConvexVolumeTool(); - ~ConvexVolumeTool(); virtual int type() { return TOOL_CONVEX_VOLUME; } virtual void init(Sample* sample); diff --git a/RecastDemo/Include/CrowdTool.h b/RecastDemo/Include/CrowdTool.h index 956b2408..060d63c8 100644 --- a/RecastDemo/Include/CrowdTool.h +++ b/RecastDemo/Include/CrowdTool.h @@ -104,6 +104,11 @@ public: void updateTick(const float dt); inline CrowdToolParams* getToolParams() { return &m_toolParams; } + +private: + // Explicitly disabled copy constructor and copy assignment operator. + CrowdToolState(const CrowdToolState&); + CrowdToolState& operator=(const CrowdToolState&); }; @@ -126,7 +131,6 @@ class CrowdTool : public SampleTool public: CrowdTool(); - virtual ~CrowdTool(); virtual int type() { return TOOL_CROWD; } virtual void init(Sample* sample); diff --git a/RecastDemo/Include/InputGeom.h b/RecastDemo/Include/InputGeom.h index ba00098c..edc12957 100644 --- a/RecastDemo/Include/InputGeom.h +++ b/RecastDemo/Include/InputGeom.h @@ -140,6 +140,11 @@ public: void deleteConvexVolume(int i); void drawConvexVolumes(struct duDebugDraw* dd, bool hilight = false); ///@} + +private: + // Explicitly disabled copy constructor and copy assignment operator. + InputGeom(const InputGeom&); + InputGeom& operator=(const InputGeom&); }; #endif // INPUTGEOM_H diff --git a/RecastDemo/Include/MeshLoaderObj.h b/RecastDemo/Include/MeshLoaderObj.h index 01cb1549..8567432b 100644 --- a/RecastDemo/Include/MeshLoaderObj.h +++ b/RecastDemo/Include/MeshLoaderObj.h @@ -37,6 +37,9 @@ public: const std::string& getFileName() const { return m_filename; } private: + // Explicitly disabled copy constructor and copy assignment operator. + rcMeshLoaderObj(const rcMeshLoaderObj&); + rcMeshLoaderObj& operator=(const rcMeshLoaderObj&); void addVertex(float x, float y, float z, int& cap); void addTriangle(int a, int b, int c, int& cap); diff --git a/RecastDemo/Include/NavMeshPruneTool.h b/RecastDemo/Include/NavMeshPruneTool.h index 7d24620f..516098ee 100644 --- a/RecastDemo/Include/NavMeshPruneTool.h +++ b/RecastDemo/Include/NavMeshPruneTool.h @@ -34,7 +34,7 @@ class NavMeshPruneTool : public SampleTool public: NavMeshPruneTool(); - ~NavMeshPruneTool(); + virtual ~NavMeshPruneTool(); virtual int type() { return TOOL_NAVMESH_PRUNE; } virtual void init(Sample* sample); @@ -46,6 +46,11 @@ public: virtual void handleUpdate(const float dt); virtual void handleRender(); virtual void handleRenderOverlay(double* proj, double* model, int* view); + +private: + // Explicitly disabled copy constructor and copy assignment operator. + NavMeshPruneTool(const NavMeshPruneTool&); + NavMeshPruneTool& operator=(const NavMeshPruneTool&); }; #endif // NAVMESHPRUNETOOL_H diff --git a/RecastDemo/Include/NavMeshTesterTool.h b/RecastDemo/Include/NavMeshTesterTool.h index 0b5ec769..01f46808 100644 --- a/RecastDemo/Include/NavMeshTesterTool.h +++ b/RecastDemo/Include/NavMeshTesterTool.h @@ -94,7 +94,6 @@ class NavMeshTesterTool : public SampleTool public: NavMeshTesterTool(); - ~NavMeshTesterTool(); virtual int type() { return TOOL_NAVMESH_TESTER; } virtual void init(Sample* sample); diff --git a/RecastDemo/Include/Sample.h b/RecastDemo/Include/Sample.h index 9305b1f6..687fd4c8 100644 --- a/RecastDemo/Include/Sample.h +++ b/RecastDemo/Include/Sample.h @@ -162,6 +162,11 @@ public: void resetCommonSettings(); void handleCommonSettings(); + +private: + // Explicitly disabled copy constructor and copy assignment operator. + Sample(const Sample&); + Sample& operator=(const Sample&); }; diff --git a/RecastDemo/Include/SampleInterfaces.h b/RecastDemo/Include/SampleInterfaces.h index a9239b9f..139760f1 100644 --- a/RecastDemo/Include/SampleInterfaces.h +++ b/RecastDemo/Include/SampleInterfaces.h @@ -41,7 +41,6 @@ class BuildContext : public rcContext public: BuildContext(); - virtual ~BuildContext(); /// Dumps the log to stdout. void dumpLog(const char* format, ...); @@ -54,11 +53,11 @@ protected: /// Virtual functions for custom implementations. ///@{ virtual void doResetLog(); - virtual void doLog(const rcLogCategory /*category*/, const char* /*msg*/, const int /*len*/); + virtual void doLog(const rcLogCategory category, const char* msg, const int len); virtual void doResetTimers(); - virtual void doStartTimer(const rcTimerLabel /*label*/); - virtual void doStopTimer(const rcTimerLabel /*label*/); - virtual int doGetAccumulatedTime(const rcTimerLabel /*label*/) const; + virtual void doStartTimer(const rcTimerLabel label); + virtual void doStopTimer(const rcTimerLabel label); + virtual int doGetAccumulatedTime(const rcTimerLabel label) const; ///@} }; @@ -90,6 +89,10 @@ public: virtual bool isReading() const; virtual bool write(const void* ptr, const size_t size); virtual bool read(void* ptr, const size_t size); +private: + // Explicitly disabled copy constructor and copy assignment operator. + FileIO(const FileIO&); + FileIO& operator=(const FileIO&); }; #endif // SAMPLEINTERFACES_H diff --git a/RecastDemo/Include/Sample_Debug.h b/RecastDemo/Include/Sample_Debug.h index 1790dbb2..7340355c 100644 --- a/RecastDemo/Include/Sample_Debug.h +++ b/RecastDemo/Include/Sample_Debug.h @@ -52,6 +52,11 @@ public: virtual const float* getBoundsMin(); virtual const float* getBoundsMax(); + +private: + // Explicitly disabled copy constructor and copy assignment operator. + Sample_Debug(const Sample_Debug&); + Sample_Debug& operator=(const Sample_Debug&); }; diff --git a/RecastDemo/Include/Sample_SoloMesh.h b/RecastDemo/Include/Sample_SoloMesh.h index 0c21cd65..70afb11a 100644 --- a/RecastDemo/Include/Sample_SoloMesh.h +++ b/RecastDemo/Include/Sample_SoloMesh.h @@ -75,6 +75,11 @@ public: virtual void handleRenderOverlay(double* proj, double* model, int* view); virtual void handleMeshChanged(class InputGeom* geom); virtual bool handleBuild(); + +private: + // Explicitly disabled copy constructor and copy assignment operator. + Sample_SoloMesh(const Sample_SoloMesh&); + Sample_SoloMesh& operator=(const Sample_SoloMesh&); }; diff --git a/RecastDemo/Include/Sample_TempObstacles.h b/RecastDemo/Include/Sample_TempObstacles.h index 320da372..1297acee 100644 --- a/RecastDemo/Include/Sample_TempObstacles.h +++ b/RecastDemo/Include/Sample_TempObstacles.h @@ -85,6 +85,11 @@ public: void saveAll(const char* path); void loadAll(const char* path); + +private: + // Explicitly disabled copy constructor and copy assignment operator. + Sample_TempObstacles(const Sample_TempObstacles&); + Sample_TempObstacles& operator=(const Sample_TempObstacles&); }; diff --git a/RecastDemo/Include/Sample_TileMesh.h b/RecastDemo/Include/Sample_TileMesh.h index b322f815..4ad2325d 100644 --- a/RecastDemo/Include/Sample_TileMesh.h +++ b/RecastDemo/Include/Sample_TileMesh.h @@ -101,6 +101,11 @@ public: void removeTile(const float* pos); void buildAllTiles(); void removeAllTiles(); + +private: + // Explicitly disabled copy constructor and copy assignment operator. + Sample_TileMesh(const Sample_TileMesh&); + Sample_TileMesh& operator=(const Sample_TileMesh&); }; diff --git a/RecastDemo/Include/TestCase.h b/RecastDemo/Include/TestCase.h index e89e67d4..be54e5ea 100644 --- a/RecastDemo/Include/TestCase.h +++ b/RecastDemo/Include/TestCase.h @@ -59,6 +59,10 @@ class TestCase int findStraightPathTime; Test* next; + private: + // Explicitly disabled copy constructor and copy assignment operator. + Test(const Test&); + Test& operator=(const Test&); }; std::string m_sampleName; @@ -80,6 +84,11 @@ public: void handleRender(); bool handleRenderOverlay(double* proj, double* model, int* view); + +private: + // Explicitly disabled copy constructor and copy assignment operator. + TestCase(const TestCase&); + TestCase& operator=(const TestCase&); }; #endif // TESTCASE_H \ No newline at end of file diff --git a/RecastDemo/Include/ValueHistory.h b/RecastDemo/Include/ValueHistory.h index 4a37ed9c..2da53902 100644 --- a/RecastDemo/Include/ValueHistory.h +++ b/RecastDemo/Include/ValueHistory.h @@ -8,7 +8,6 @@ class ValueHistory int m_hsamples; public: ValueHistory(); - ~ValueHistory(); inline void addSample(const float val) { diff --git a/RecastDemo/Source/ConvexVolumeTool.cpp b/RecastDemo/Source/ConvexVolumeTool.cpp index 2d6963b9..323905d2 100644 --- a/RecastDemo/Source/ConvexVolumeTool.cpp +++ b/RecastDemo/Source/ConvexVolumeTool.cpp @@ -109,10 +109,6 @@ ConvexVolumeTool::ConvexVolumeTool() : { } -ConvexVolumeTool::~ConvexVolumeTool() -{ -} - void ConvexVolumeTool::init(Sample* sample) { m_sample = sample; diff --git a/RecastDemo/Source/CrowdTool.cpp b/RecastDemo/Source/CrowdTool.cpp index a2e4475d..ac6a4e35 100644 --- a/RecastDemo/Source/CrowdTool.cpp +++ b/RecastDemo/Source/CrowdTool.cpp @@ -867,10 +867,6 @@ CrowdTool::CrowdTool() : { } -CrowdTool::~CrowdTool() -{ -} - void CrowdTool::init(Sample* sample) { if (m_sample != sample) diff --git a/RecastDemo/Source/NavMeshTesterTool.cpp b/RecastDemo/Source/NavMeshTesterTool.cpp index 289a8ab9..22111beb 100644 --- a/RecastDemo/Source/NavMeshTesterTool.cpp +++ b/RecastDemo/Source/NavMeshTesterTool.cpp @@ -246,10 +246,6 @@ NavMeshTesterTool::NavMeshTesterTool() : m_randomRadius = 5.0f; } -NavMeshTesterTool::~NavMeshTesterTool() -{ -} - void NavMeshTesterTool::init(Sample* sample) { m_sample = sample; diff --git a/RecastDemo/Source/SampleInterfaces.cpp b/RecastDemo/Source/SampleInterfaces.cpp index f7e6bf78..9736f0a0 100644 --- a/RecastDemo/Source/SampleInterfaces.cpp +++ b/RecastDemo/Source/SampleInterfaces.cpp @@ -23,10 +23,6 @@ BuildContext::BuildContext() : resetTimers(); } -BuildContext::~BuildContext() -{ -} - // Virtual functions for custom implementations. void BuildContext::doResetLog() { diff --git a/RecastDemo/Source/ValueHistory.cpp b/RecastDemo/Source/ValueHistory.cpp index 30ae4b6f..4dc3e3e2 100644 --- a/RecastDemo/Source/ValueHistory.cpp +++ b/RecastDemo/Source/ValueHistory.cpp @@ -14,10 +14,6 @@ ValueHistory::ValueHistory() : m_samples[i] = 0; } -ValueHistory::~ValueHistory() -{ -} - float ValueHistory::getSampleMin() const { float val = m_samples[0];