From 17a3d1e81fb1078303d9b7d4f01f41a54e536488 Mon Sep 17 00:00:00 2001 From: wmayer Date: Sat, 4 Feb 2017 15:16:47 +0100 Subject: [PATCH] fix warnings: -Wmaybe-uninitialized --- src/3rdParty/salomesmesh/src/SMESH/GEOMUtils.cpp | 2 +- src/Mod/Path/App/Area.cpp | 2 +- src/Mod/Sketcher/Gui/CommandConstraints.cpp | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/3rdParty/salomesmesh/src/SMESH/GEOMUtils.cpp b/src/3rdParty/salomesmesh/src/SMESH/GEOMUtils.cpp index c8639d06e..87a0c2cf0 100644 --- a/src/3rdParty/salomesmesh/src/SMESH/GEOMUtils.cpp +++ b/src/3rdParty/salomesmesh/src/SMESH/GEOMUtils.cpp @@ -1127,7 +1127,7 @@ bool GEOMUtils::FixShapeTolerance( TopoDS_Shape& shape, bool GEOMUtils::FixShapeCurves( TopoDS_Shape& shape ) { - Standard_Real aT, aTolE, aD, aDMax; + Standard_Real aT, aTolE, aD, aDMax = 0.0; TopExp_Explorer aExpF, aExpE; NCollection_DataMap aDMETol; aExpF.Init(shape, TopAbs_FACE); diff --git a/src/Mod/Path/App/Area.cpp b/src/Mod/Path/App/Area.cpp index 6e7a6364e..006849e55 100644 --- a/src/Mod/Path/App/Area.cpp +++ b/src/Mod/Path/App/Area.cpp @@ -1343,7 +1343,7 @@ struct ShapeInfo{ const TopoDS_Shape &wire = it->wire; TopoDS_Shape support; bool support_edge; - double d; + double d = 0; gp_Pnt p; bool done = false; bool is_start = false; diff --git a/src/Mod/Sketcher/Gui/CommandConstraints.cpp b/src/Mod/Sketcher/Gui/CommandConstraints.cpp index 79f09fcc3..38e965e0c 100644 --- a/src/Mod/Sketcher/Gui/CommandConstraints.cpp +++ b/src/Mod/Sketcher/Gui/CommandConstraints.cpp @@ -746,6 +746,7 @@ namespace SketcherGui { * example, when in lock, horizontal, or vertical constraint modes. */ enum SelType { + SelUnknown = 0, SelVertex = 1, SelRoot = 2, SelEdge = 4, @@ -866,7 +867,7 @@ public: selIdPair.GeoId = Constraint::GeoUndef; selIdPair.PosId = Sketcher::none; std::stringstream ss; - SelType newSelType; + SelType newSelType = SelUnknown; //For each SelType allowed, check if button is released there and assign it to selIdPair int VtId = sketchgui->getPreselectPoint(); @@ -4318,7 +4319,8 @@ void CmdSketcherConstrainAngle::activated(int iMsg) const Part::GeomLineSegment *lineSeg2 = static_cast(geom2); // find the two closest line ends - Sketcher::PointPos PosId1,PosId2; + Sketcher::PointPos PosId1 = Sketcher::none; + Sketcher::PointPos PosId2 = Sketcher::none; Base::Vector3d p1[2], p2[2]; p1[0] = lineSeg1->getStartPoint(); p1[1] = lineSeg1->getEndPoint();