Skip to content

Commit

Permalink
Mesh: [skip ci] Fix coverity warning
Browse files Browse the repository at this point in the history
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
  • Loading branch information
wwmayer committed Feb 21, 2021
1 parent d433307 commit 91c36f9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Mod/Mesh/App/Core/Decimation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,16 @@ 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);
}

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);
Expand Down Expand Up @@ -103,13 +106,16 @@ 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);
}

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);
Expand Down

0 comments on commit 91c36f9

Please sign in to comment.