]> OCCT Git - occt.git/commitdiff
0024236: Eliminate GCC compiler warning (uninitialized variables)
authorski <ski@opencascade.com>
Thu, 10 Oct 2013 10:47:21 +0000 (14:47 +0400)
committerbugmaster <bugmaster@opencascade.com>
Thu, 10 Oct 2013 13:08:58 +0000 (17:08 +0400)
16 files changed:
src/Adaptor3d/Adaptor3d_CurveOnSurface.cxx
src/Approx/Approx_SameParameter.cxx
src/ChFi3d/ChFi3d_Builder_CnCrn.cxx
src/ChFi3d/ChFi3d_ChBuilder.cxx
src/ChFiDS/ChFiDS_FilSpine.cxx
src/Contap/Contap_ContourGen_3.gxx
src/Graphic3d/Graphic3d_ArrayOfPrimitives.cxx
src/IntPatch/IntPatch_PrmPrmIntersection.cxx
src/Intf/Intf_InterferencePolygonPolyhedron.gxx
src/OpenGl/OpenGl_View.cxx
src/ProjLib/ProjLib_ProjectedCurve.cxx
src/QANewModTopOpe/QANewModTopOpe_Glue_shell.cxx
src/ShapeConstruct/ShapeConstruct_ProjectCurveOnSurface.cxx
src/TopOpeBRep/TopOpeBRep_FFTransitionTool.cxx
src/TopOpeBRepDS/TopOpeBRepDS_Edge3dInterferenceTool.cxx
src/TopOpeBRepDS/TopOpeBRepDS_HDataStructure.cxx

index 7dfb692b603860a6d35bd21e60f7cd61d9a82e21..daefec99fa801d74ecbe232c8a2ccef6dc56240a 100755 (executable)
@@ -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)
index 6c9e58acfb5e2cd17f05cac2a3be76aab5425c8d..49fc3a290c5466334e895e6ba72725fa0089ec9d 100755 (executable)
@@ -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;
 
index 46469058c63fadd4cad2b072913ab54137f685d7..7df15da1d7ded2d67ea75de49ebf7e71b33e059f 100755 (executable)
@@ -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;
index 38de95ae6dfdf1de84712a55aadf0dc627059590..5d96f7fe46bcaac664d6bbd17196dbd8254e3481 100755 (executable)
@@ -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;
index 2636679d7de28e5e200037368d9f7bd24b7cfa2b..dd946870afbb0b9079b4408542f7dc80bade99f2 100755 (executable)
@@ -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++)
     {
index fb5b95b5f1fc1c1496c65d6a84071ff201e1fde6..e9fd41b51a30ac2d3665a3b7f3c709bc6a25818a 100755 (executable)
@@ -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();
index ef6a77426be8ab61723f7ed8fba55327ee6afc78..6dd7e8dfab06a9094880a8f2c8ec8196d7bd0056 100755 (executable)
@@ -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);
 }
index c21ee517a3571a3606ac0077cb2b698119a2409f..93705065f73cb83fa7a312ad841cdf1680a0a55f 100755 (executable)
@@ -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; i<SU1; i++,U+=du1) { 
          for(V=resv0,j=0; j<SV1; V+=dv1,j++) {       
index 2a7f0da1b9dd7b45ca67a09d31c342422a82509a..68273ca47b27351706e90de8a3867c8fe31622d0 100755 (executable)
@@ -810,7 +810,7 @@ void Intf_InterferencePolygonPolyhedron::Intersect
   }
   if(NoIntersectionWithTriangle == Standard_False) { 
     gp_XYZ spLieu=BegO.XYZ()+((EndO.XYZ()-BegO.XYZ())*param);
-    Standard_Real dPiE[3], dPtPi[3], sigd;
+    Standard_Real dPiE[3] = { 0.0, 0.0, 0.0 }, dPtPi[3], sigd;
     Standard_Integer is = 0;
     Standard_Integer sEdge=-1;
     Standard_Integer sVertex=-1;
@@ -1092,7 +1092,7 @@ void Intf_InterferencePolygonPolyhedron::Intersect (const gp_Pnt& BegO,
   }
   if(NoIntersectionWithTriangle == Standard_False) { 
     gp_XYZ spLieu=BegO.XYZ()+((EndO.XYZ()-BegO.XYZ())*param);
-    Standard_Real dPiE[3], dPtPi[3], sigd;
+    Standard_Real dPiE[3] = { 0.0, 0.0, 0.0 }, dPtPi[3], sigd;
     Standard_Integer is = 0;
     Standard_Integer sEdge=-1;
     Standard_Integer sVertex=-1;
index b9fff66b7497f5675ba4044bb02d8910495054ed..ae4425d4d5b9157d47d4957b0f23c7cf6f3f3702 100644 (file)
@@ -187,6 +187,7 @@ void OpenGl_View::SetLights (const CALL_DEF_VIEWCONTEXT &AContext)
   for ( ; i < nb_lights; i++, alight++ )
   {
     OpenGl_Light rep;
+    memset(&rep,0,sizeof(rep));
 
        switch( alight->LightType )
     {
index 2f5911a9a0b8f215f881efd548a6b1edc329ebd8..74e6b172a8b1d445ebb8549ecdb04d705dba8ebd 100755 (executable)
@@ -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;
        
index b9074d5ab07bd8e5765c2e810f5e893fb35dd9b7..373b6a32163867a651acc4f3d8a519afcc335566 100755 (executable)
@@ -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
 
index a7db26483e3be6818cdedfbe8b007a53fc00e072..ca3b179e913fde1ea483fd865ba637a157a83608 100755 (executable)
@@ -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;
index 6de5d42a536498305c444ee63ecbf13563953005..15c14d9792892bcee4a360ad18e32cf48121a2b9 100755 (executable)
@@ -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;
index a0f18e38976d411ab90b9cbcfee16fc826c3b550..a8add8766bfbd83e1e0133d358bf63b7ad2d61d9 100755 (executable)
@@ -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;}  
   // <myP3d> :
   {
index 69a5cf05c8ef2043d0302fba584e42e5f375d4c7..cabdcc5cdcb23924992930bb8bafc872aedc86a3 100755 (executable)
@@ -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;