From 39b7b2a46508d3ed10d6877a59163fcea4f65ee5 Mon Sep 17 00:00:00 2001 From: kgv Date: Sat, 28 Jul 2018 21:18:05 +0300 Subject: [PATCH] 0029997: Coding Rules - eliminate GCC compiler warnings -Wmaybe-uninitialized in Select3D_InteriorSensitivePointSet.cxx --- src/Select3D/Select3D_InteriorSensitivePointSet.cxx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Select3D/Select3D_InteriorSensitivePointSet.cxx b/src/Select3D/Select3D_InteriorSensitivePointSet.cxx index 4668b72528..708e4122b7 100644 --- a/src/Select3D/Select3D_InteriorSensitivePointSet.cxx +++ b/src/Select3D/Select3D_InteriorSensitivePointSet.cxx @@ -238,11 +238,9 @@ Select3D_BndBox3d Select3D_InteriorSensitivePointSet::Box (const Standard_Intege Standard_Real Select3D_InteriorSensitivePointSet::Center (const Standard_Integer theIdx, const Standard_Integer theAxis) const { - Standard_Integer aPolygIdx = myPolygonsIdxs->Value (theIdx); - const gp_XYZ& aCOG = myPlanarPolygons.Value (aPolygIdx)->CenterOfGeometry().XYZ(); - Standard_Real aCenter = theAxis == 0 ? aCOG.X() : (theAxis == 1 ? aCOG.Y() : aCOG.Z()); - - return aCenter; + const Standard_Integer aPolygIdx = myPolygonsIdxs->Value (theIdx); + const gp_Pnt aCOG = myPlanarPolygons.Value (aPolygIdx)->CenterOfGeometry(); + return aCOG.Coord (theAxis - 1); } //=======================================================================