From 4a2d131cb6807ef410876c838a791c636cfe421c Mon Sep 17 00:00:00 2001 From: wmayer Date: Sun, 21 Feb 2021 15:51:56 +0100 Subject: [PATCH] Mesh: [skip ci] Fix coverity warning Coverity warnings fixed: CID 316517 (#1 of 1): Uninitialized scalar variable (UNINIT) 13. uninit_use_in_call: Using uninitialized value t. Field t.err is uninitialized when calling push_back CID 316519 (#1 of 1): Uninitialized scalar variable (UNINIT) 3. uninit_use_in_call: Using uninitialized value v. Field v.tstart is uninitialized when calling push_back CID 316547 (#1 of 1): Uninitialized scalar variable (UNINIT) 13. uninit_use_in_call: Using uninitialized value t. Field t.err is uninitialized when calling push_back CID 316556 (#1 of 1): Uninitialized scalar variable (UNINIT) 3. uninit_use_in_call: Using uninitialized value v. Field v.tstart is uninitialized when calling push_back --- src/Mod/Mesh/App/Core/Decimation.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Mod/Mesh/App/Core/Decimation.cpp b/src/Mod/Mesh/App/Core/Decimation.cpp index ade14708de..19ebd694d1 100644 --- a/src/Mod/Mesh/App/Core/Decimation.cpp +++ b/src/Mod/Mesh/App/Core/Decimation.cpp @@ -52,6 +52,7 @@ void MeshSimplify::simplify(float tolerance, float reduction) const MeshPointArray& points = myKernel.GetPoints(); for (std::size_t i = 0; i < points.size(); i++) { Simplify::Vertex v; + v.tstart = 0; v.p = points[i]; alg.vertices.push_back(v); } @@ -59,6 +60,8 @@ void MeshSimplify::simplify(float tolerance, float reduction) const MeshFacetArray& facets = myKernel.GetFacets(); for (std::size_t i = 0; i < facets.size(); i++) { Simplify::Triangle t; + for (int j = 0; j < 4; j++) + t.err[j] = 0.0; for (int j = 0; j < 3; j++) t.v[j] = facets[i]._aulPoints[j]; alg.triangles.push_back(t); @@ -103,6 +106,7 @@ void MeshSimplify::simplify(int targetSize) const MeshPointArray& points = myKernel.GetPoints(); for (std::size_t i = 0; i < points.size(); i++) { Simplify::Vertex v; + v.tstart = 0; v.p = points[i]; alg.vertices.push_back(v); } @@ -110,6 +114,8 @@ void MeshSimplify::simplify(int targetSize) const MeshFacetArray& facets = myKernel.GetFacets(); for (std::size_t i = 0; i < facets.size(); i++) { Simplify::Triangle t; + for (int j = 0; j < 4; j++) + t.err[j] = 0.0; for (int j = 0; j < 3; j++) t.v[j] = facets[i]._aulPoints[j]; alg.triangles.push_back(t);