From d20d815bbe18b4c15b0e2c7670ba63f2a6839271 Mon Sep 17 00:00:00 2001 From: ski Date: Thu, 10 Oct 2013 14:47:21 +0400 Subject: [PATCH] 0024236: Eliminate GCC compiler warning (uninitialized variables) --- src/Adaptor3d/Adaptor3d_CurveOnSurface.cxx | 4 ++-- src/Approx/Approx_SameParameter.cxx | 2 +- src/ChFi3d/ChFi3d_Builder_CnCrn.cxx | 2 +- src/ChFi3d/ChFi3d_ChBuilder.cxx | 2 +- src/ChFiDS/ChFiDS_FilSpine.cxx | 2 +- src/Contap/Contap_ContourGen_3.gxx | 2 +- src/Graphic3d/Graphic3d_ArrayOfPrimitives.cxx | 2 +- src/IntPatch/IntPatch_PrmPrmIntersection.cxx | 2 +- src/Intf/Intf_InterferencePolygonPolyhedron.gxx | 4 ++-- src/OpenGl/OpenGl_View.cxx | 1 + src/ProjLib/ProjLib_ProjectedCurve.cxx | 2 +- src/QANewModTopOpe/QANewModTopOpe_Glue_shell.cxx | 2 +- src/ShapeConstruct/ShapeConstruct_ProjectCurveOnSurface.cxx | 2 +- src/TopOpeBRep/TopOpeBRep_FFTransitionTool.cxx | 2 +- src/TopOpeBRepDS/TopOpeBRepDS_Edge3dInterferenceTool.cxx | 2 +- src/TopOpeBRepDS/TopOpeBRepDS_HDataStructure.cxx | 2 +- 16 files changed, 18 insertions(+), 17 deletions(-) diff --git a/src/Adaptor3d/Adaptor3d_CurveOnSurface.cxx b/src/Adaptor3d/Adaptor3d_CurveOnSurface.cxx index 7dfb692b60..daefec99fa 100755 --- a/src/Adaptor3d/Adaptor3d_CurveOnSurface.cxx +++ b/src/Adaptor3d/Adaptor3d_CurveOnSurface.cxx @@ -237,7 +237,7 @@ static void Locate1Coord(const Standard_Integer Index, const Handle(Geom_BSplineCurve)& BSplC, gp_Pnt2d& LeftBot, gp_Pnt2d& RightTop) { - Standard_Real Comp1=0, DComp1=0, cur, f, l; + Standard_Real Comp1=0, DComp1=0, cur, f = 0.0, l = 0.0; Standard_Real Tol = Precision::PConfusion()/10; Standard_Integer i = 1, Bnd1, Bnd2; Standard_Boolean DIsNull= Standard_False; @@ -616,7 +616,7 @@ static void Locate2Coord(const Standard_Integer Index, const TColStd_Array1OfReal& Arr, gp_Pnt2d& LeftBot, gp_Pnt2d& RightTop) { - Standard_Real Comp=0,DComp=0,Tmp1,Tmp2; + Standard_Real Comp=0,DComp=0,Tmp1=0.0,Tmp2=0.0; Standard_Real Tol=Precision::PConfusion()/10; Standard_Integer N, NUp=0, NLo=0; if(Index==1) diff --git a/src/Approx/Approx_SameParameter.cxx b/src/Approx/Approx_SameParameter.cxx index 6c9e58acfb..49fc3a290c 100755 --- a/src/Approx/Approx_SameParameter.cxx +++ b/src/Approx/Approx_SameParameter.cxx @@ -377,7 +377,7 @@ void Approx_SameParameter::Build(const Standard_Real Tolerance) //Control tangents at the extremities to know if the //reparametring is possible and calculate the tangents //at the extremities of the function of change of variable. - Standard_Real tangent[2]; + Standard_Real tangent[2] = { 0.0, 0.0 }; gp_Pnt Pcons,Pc3d; gp_Vec Vcons,Vc3d; diff --git a/src/ChFi3d/ChFi3d_Builder_CnCrn.cxx b/src/ChFi3d/ChFi3d_Builder_CnCrn.cxx index 46469058c6..7df15da1d7 100755 --- a/src/ChFi3d/ChFi3d_Builder_CnCrn.cxx +++ b/src/ChFi3d/ChFi3d_Builder_CnCrn.cxx @@ -1044,7 +1044,7 @@ void ChFi3d_Builder::PerformMoreThreeCorner(const Standard_Integer Jndex, TopoDS_Face face; Standard_Integer jfp = 0,ii; Standard_Integer ic,icplus,icmoins,icplus2, - sense,index,indice,isurf1,isurf2; + sense,index = 0,indice,isurf1,isurf2; Standard_Integer cbplus=0, n3d=0,IVtx = 0,nb; Standard_Boolean sameside,trouve,isfirst; Standard_Real pardeb ,parfin,xdir,ydir; diff --git a/src/ChFi3d/ChFi3d_ChBuilder.cxx b/src/ChFi3d/ChFi3d_ChBuilder.cxx index 38de95ae6d..5d96f7fe46 100755 --- a/src/ChFi3d/ChFi3d_ChBuilder.cxx +++ b/src/ChFi3d/ChFi3d_ChBuilder.cxx @@ -1927,7 +1927,7 @@ void ChFi3d_ChBuilder::ExtentTwoCorner(const TopoDS_Vertex& V, Handle(ChFiDS_ChamfSpine) chsp[2]; - Standard_Real d[4], dis[2]; + Standard_Real d[4], dis[2] = { 0.0, 0.0 }; Standard_Integer j; TopoDS_Face F[4]; Standard_Real tmpang, tmd; diff --git a/src/ChFiDS/ChFiDS_FilSpine.cxx b/src/ChFiDS/ChFiDS_FilSpine.cxx index 2636679d7d..dd946870af 100755 --- a/src/ChFiDS/ChFiDS_FilSpine.cxx +++ b/src/ChFiDS/ChFiDS_FilSpine.cxx @@ -265,7 +265,7 @@ Standard_Boolean ChFiDS_FilSpine::IsConstant(const Standard_Integer IE)const Standard_Real Uf = FirstParameter(IE); Standard_Real Ul = LastParameter(IE); - Standard_Real StartRad, par, rad; + Standard_Real StartRad = 0.0, par, rad; Standard_Integer i; for (i = 1; i < parandrad.Length(); i++) { diff --git a/src/Contap/Contap_ContourGen_3.gxx b/src/Contap/Contap_ContourGen_3.gxx index fb5b95b5f1..e9fd41b51a 100755 --- a/src/Contap/Contap_ContourGen_3.gxx +++ b/src/Contap/Contap_ContourGen_3.gxx @@ -86,7 +86,7 @@ static void PutPointsOnLine (const Contap_TheSearch& solrst, gp_Pnt ptonsurf; gp_Vec vectg,normale,tgtrst; - Standard_Real paramlin; + Standard_Real paramlin = 0.0; Standard_Integer nbLin = slin.Length(); diff --git a/src/Graphic3d/Graphic3d_ArrayOfPrimitives.cxx b/src/Graphic3d/Graphic3d_ArrayOfPrimitives.cxx index ef6a77426b..6dd7e8dfab 100755 --- a/src/Graphic3d/Graphic3d_ArrayOfPrimitives.cxx +++ b/src/Graphic3d/Graphic3d_ArrayOfPrimitives.cxx @@ -591,7 +591,7 @@ gp_Pnt2d Graphic3d_ArrayOfPrimitives::VertexTexel(const Standard_Integer aRank) Quantity_Color Graphic3d_ArrayOfPrimitives::BoundColor(const Standard_Integer aRank) const { - Standard_Real r,g,b; + Standard_Real r = 0.0, g = 0.0, b = 0.0; BoundColor(aRank,r,g,b); return Quantity_Color(r,g,b,Quantity_TOC_RGB); } diff --git a/src/IntPatch/IntPatch_PrmPrmIntersection.cxx b/src/IntPatch/IntPatch_PrmPrmIntersection.cxx index c21ee517a3..93705065f7 100755 --- a/src/IntPatch/IntPatch_PrmPrmIntersection.cxx +++ b/src/IntPatch/IntPatch_PrmPrmIntersection.cxx @@ -3124,7 +3124,7 @@ void IntPatch_PrmPrmIntersection::PointDepart(Handle(IntSurf_LineOn2S)& LineOn2S //-- aucun point du triangle n a ete trouve assez proche //-- on recherche les 3 points les plus proches de P //-- dans chacun des tableaux - Standard_Real Dist3[3],u3[3],v3[3]; + Standard_Real Dist3[3],u3[3] = { 0.0, 0.0, 0.0 },v3[3] = { 0.0, 0.0, 0.0 }; Dist3[0]=Dist3[1]=Dist3[2]=RealLast(); for(U=resu0,i=0; iLightType ) { diff --git a/src/ProjLib/ProjLib_ProjectedCurve.cxx b/src/ProjLib/ProjLib_ProjectedCurve.cxx index 2f5911a9a0..74e6b172a8 100755 --- a/src/ProjLib/ProjLib_ProjectedCurve.cxx +++ b/src/ProjLib/ProjLib_ProjectedCurve.cxx @@ -467,7 +467,7 @@ void ProjLib_ProjectedCurve::Load(const Handle(Adaptor3d_HCurve)& C) default: { Standard_Boolean IsTrimmed[2] = {Standard_False, Standard_False}; - Standard_Real Vsingular[2]; //for surfaces of revolution + Standard_Real Vsingular[2] = { 0.0 , 0.0 }; //for surfaces of revolution Standard_Real f = 0., l = 0., dt = 0.; const Standard_Real eps = 0.01; diff --git a/src/QANewModTopOpe/QANewModTopOpe_Glue_shell.cxx b/src/QANewModTopOpe/QANewModTopOpe_Glue_shell.cxx index b9074d5ab0..373b6a3216 100755 --- a/src/QANewModTopOpe/QANewModTopOpe_Glue_shell.cxx +++ b/src/QANewModTopOpe/QANewModTopOpe_Glue_shell.cxx @@ -1366,7 +1366,7 @@ QANewModTopOpe_Glue::SectionInsideFace(const TopoDS_Face& theFace, TopoDS_Edge aEdge; TopoDS_Vertex aVer; - Standard_Real aPar, aDist; + Standard_Real aPar=0.0, aDist; if (IsVertexOnFaceBound (aSVer, aFace1, aEdge, aVer, aPar, aDist)) { // aSVer contacts aFace's boundary diff --git a/src/ShapeConstruct/ShapeConstruct_ProjectCurveOnSurface.cxx b/src/ShapeConstruct/ShapeConstruct_ProjectCurveOnSurface.cxx index a7db26483e..ca3b179e91 100755 --- a/src/ShapeConstruct/ShapeConstruct_ProjectCurveOnSurface.cxx +++ b/src/ShapeConstruct/ShapeConstruct_ProjectCurveOnSurface.cxx @@ -1351,7 +1351,7 @@ Handle(Geom_Curve) ShapeConstruct_ProjectCurveOnSurface::InterpolateCurve3d(cons gp_Pnt pt; Standard_Integer mpt[2]; mpt[0] = mpt[1] = 0; - Standard_Real t, tpar[2], isoValue=0.; + Standard_Real t, tpar[2] = { 0.0, 0.0 }, isoValue=0.; Standard_Real mindist2; Standard_Real mind2[2]; mindist2 = mind2[0] = mind2[1] = 4*prec*prec; diff --git a/src/TopOpeBRep/TopOpeBRep_FFTransitionTool.cxx b/src/TopOpeBRep/TopOpeBRep_FFTransitionTool.cxx index 6de5d42a53..15c14d9792 100755 --- a/src/TopOpeBRep/TopOpeBRep_FFTransitionTool.cxx +++ b/src/TopOpeBRep/TopOpeBRep_FFTransitionTool.cxx @@ -333,7 +333,7 @@ static Standard_Boolean FUN_GeomTrans(const Handle(Geom_Surface)& S1, gp_Pnt P1; gp_Vec D1_C1; C1->D1(T1,P1,D1_C1); // D1_C2 : D1(C2(P1)) - Standard_Real T2; + Standard_Real T2 = 0.0; Standard_Boolean projok = ::FUN_ProjectPoint(P1,C2,FC2,LC2,T2); if ( !projok ) { return Standard_False; diff --git a/src/TopOpeBRepDS/TopOpeBRepDS_Edge3dInterferenceTool.cxx b/src/TopOpeBRepDS/TopOpeBRepDS_Edge3dInterferenceTool.cxx index a0f18e3897..a8add8766b 100755 --- a/src/TopOpeBRepDS/TopOpeBRepDS_Edge3dInterferenceTool.cxx +++ b/src/TopOpeBRepDS/TopOpeBRepDS_Edge3dInterferenceTool.cxx @@ -176,7 +176,7 @@ void TopOpeBRepDS_Edge3dInterferenceTool::Init myTole = Precision::Angular(); // NYI - Standard_Real pref; Standard_Boolean ok = ::FUN_hasparam(I, pref); + Standard_Real pref=0.0; Standard_Boolean ok = ::FUN_hasparam(I, pref); if (!ok) {FUN_Raise(); return;} // : { diff --git a/src/TopOpeBRepDS/TopOpeBRepDS_HDataStructure.cxx b/src/TopOpeBRepDS/TopOpeBRepDS_HDataStructure.cxx index 69a5cf05c8..cabdcc5cdc 100755 --- a/src/TopOpeBRepDS/TopOpeBRepDS_HDataStructure.cxx +++ b/src/TopOpeBRepDS/TopOpeBRepDS_HDataStructure.cxx @@ -91,7 +91,7 @@ Standard_EXPORT Standard_Boolean FUN_HDS_FACESINTERFER TopOpeBRepDS_ListIteratorOfListOfInterference itL1(L1); for (;itL1.More(); itL1.Next()) { const Handle(TopOpeBRepDS_Interference)& I = itL1.Value(); - TopOpeBRepDS_Kind GT,ST;Standard_Integer G,S; + TopOpeBRepDS_Kind GT = TopOpeBRepDS_UNKNOWN, ST = TopOpeBRepDS_UNKNOWN; Standard_Integer G,S = 0; FUN_HDS_data(I,GT,G,ST,S); // interference face1/edge/face2 Standard_Boolean fef = Standard_True;