From 70ac3d8248c8c51816fdd736566e2bb9af91407f Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Tue, 19 Oct 2021 11:57:02 +0200 Subject: [PATCH] remove memset from align_pair.h and marching_cubes.h --- vcg/complex/algorithms/align_pair.h | 27 +++++++++---------- .../algorithms/create/marching_cubes.h | 6 +++-- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/vcg/complex/algorithms/align_pair.h b/vcg/complex/algorithms/align_pair.h index 284e5ac0..6b71a235 100644 --- a/vcg/complex/algorithms/align_pair.h +++ b/vcg/complex/algorithms/align_pair.h @@ -128,22 +128,21 @@ public: public: IterInfo() { - memset ( (void *) this, 0, sizeof(IterInfo)); } - double MinDistAbs; - int DistanceDiscarded; - int AngleDiscarded; - int BorderDiscarded; - int SampleTested; // how many points have been tested - int SampleUsed; // how many points have been actually used to compute the transformation - double pcl50; - double pclhi; - double AVG; - double RMS; - double StdDev; - int Time; // Ending time of this iteration - + double MinDistAbs = 0; + int DistanceDiscarded = 0; + int AngleDiscarded = 0; + int BorderDiscarded = 0; + int SampleTested = 0; // how many points have been tested + // how many points have been actually used to compute the transformation + int SampleUsed = 0; + double pcl50 = 0; + double pclhi = 0; + double AVG = 0; + double RMS = 0; + double StdDev = 0; + int Time = 0; // Ending time of this iteration }; std::vector I; diff --git a/vcg/complex/algorithms/create/marching_cubes.h b/vcg/complex/algorithms/create/marching_cubes.h index 830e0e1d..43e31cba 100644 --- a/vcg/complex/algorithms/create/marching_cubes.h +++ b/vcg/complex/algorithms/create/marching_cubes.h @@ -26,6 +26,7 @@ #define __VCG_MARCHING_CUBES #include "mc_lookup_table.h" +#include namespace vcg { @@ -665,14 +666,15 @@ namespace vcg VertexPointer vp = NULL; size_t face_idx = _mesh->face.size(); size_t v12_idx = -1; - size_t vertices_idx[3]; + std::array vertices_idx; if (v12 != NULL) v12_idx = v12 - &_mesh->vert[0]; AllocatorType::AddFaces(*_mesh, (int) n); for (int trig=0; trig<3*n; face_idx++ ) { vp = NULL; - memset(vertices_idx, -1, 3*sizeof(size_t)); + vertices_idx.fill(-1); + //memset(vertices_idx, -1, 3*sizeof(size_t)); for (int vert=0; vert<3; vert++, trig++) //ok {