Skip to content

Commit

Permalink
Part: [skip ci] Fix coverity warning
Browse files Browse the repository at this point in the history
Coverity warnings fixed:

CID 316522 (#2 of 2): Uninitialized scalar variable (UNINIT)
5. uninit_use_in_call: Using uninitialized value newSelection. Field newSelection.shapeType is uninitialized when calling push_back
  • Loading branch information
wwmayer committed Feb 21, 2021
1 parent abfbed3 commit 1d41226
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Mod/Part/Gui/TaskDimension.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,7 @@ void PartGui::TaskMeasureLinear::onSelectionChanged(const Gui::SelectionChanges&
if (msg.Type == Gui::SelectionChanges::AddSelection)
{
DimSelections::DimSelection newSelection;
newSelection.shapeType = DimSelections::None;
newSelection.documentName = msg.pDocName;
newSelection.objectName = msg.pObjectName;
newSelection.subObjectName = msg.pSubName;
Expand All @@ -557,6 +558,7 @@ void PartGui::TaskMeasureLinear::onSelectionChanged(const Gui::SelectionChanges&
if (msg.Type == Gui::SelectionChanges::AddSelection)
{
DimSelections::DimSelection newSelection;
newSelection.shapeType = DimSelections::None;
newSelection.documentName = msg.pDocName;
newSelection.objectName = msg.pObjectName;
newSelection.subObjectName = msg.pSubName;
Expand Down Expand Up @@ -1537,6 +1539,7 @@ void PartGui::TaskMeasureAngular::onSelectionChanged(const Gui::SelectionChanges
return;
mat.inverse();
DimSelections::DimSelection newSelection;
newSelection.shapeType = DimSelections::None;
newSelection.documentName = msg.pDocName;
newSelection.objectName = msg.pObjectName;
newSelection.subObjectName = msg.pSubName;
Expand Down

0 comments on commit 1d41226

Please sign in to comment.