]> OCCT Git - occt-copy.git/commitdiff
0024877: GCC 4.4.5 compiler warnings on Debian when OCCT is bult using CMake
authorabv <abv@opencascade.com>
Mon, 28 Apr 2014 13:12:27 +0000 (17:12 +0400)
committerabv <abv@opencascade.com>
Tue, 29 Apr 2014 05:35:52 +0000 (09:35 +0400)
Warnings fixed

src/Adaptor3d/Adaptor3d_CurveOnSurface.cxx
src/MeshVS/MeshVS_Mesh.cxx
src/OpenGl/OpenGl_Workspace.cxx
src/ShapeConstruct/ShapeConstruct_ProjectCurveOnSurface.cxx
src/ViewerTest/ViewerTest_ViewerCommands.cxx

index 10b6c20eddf257b05f5d4e65f415d26cb68a0871..b94af898d85a7ac4a761aeb42e15d562a01ed320 100644 (file)
@@ -194,7 +194,7 @@ static void FindBounds(const TColStd_Array1OfReal& Arr,
                       Standard_Boolean& DerNull)
 
 {
-  Standard_Integer N;
+  Standard_Integer N=0;
   Standard_Real Tol=Precision::PConfusion()/10;
   Hunt(Arr,Coord,N);
   DerNull=Standard_False;
@@ -612,7 +612,7 @@ static void Locate2Coord(const Standard_Integer Index,
 {
   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;
+  Standard_Integer N=0, NUp=0, NLo=0;
   if(Index==1)
     { Comp=UV.X();
       DComp=DUV.Y();
index 52a30e238983d6a3a3751450bc17ed2ec7b36e51..f6088b0a8306094d92567a333c2c06268c177c16 100644 (file)
@@ -310,31 +310,16 @@ void MeshVS_Mesh::ComputeSelection ( const Handle(SelectMgr_Selection)& theSelec
       {
       case MeshVS_MSM_BOX:
         {
-          Standard_Real min[3], max[3]; Standard_Boolean first = Standard_True;
+          Bnd_Box box;
           TColStd_MapIteratorOfPackedMapOfInteger anIterN( anAllNodesMap );
-
           for( ; anIterN.More(); anIterN.Next() )
+         {
             if( myDataSource->GetGeom( anIterN.Key(), Standard_False, aCoords, NbNodes, aType ) ) {
-              if( first )
-              {
-                for( Standard_Integer i=1; i<=3; i++ )
-                  min[i-1] = max[i-1] = aCoords( i );
-                first = Standard_False;
-              }
-              else
-                for( Standard_Integer i=1; i<=3; i++ )
-                {
-                  if( aCoords( i )<min[i-1] )
-                    min[i-1] = aCoords( i );
-                  if( aCoords( i )>max[i-1] )
-                    max[i-1] = aCoords( i );
-                }
+              box.Add (gp_Pnt (aCoords(1), aCoords(2), aCoords(3)));
             }
-          Bnd_Box box;
-          box.Add( gp_Pnt( min[0], min[1], min[2] ) );
-          box.Add( gp_Pnt( max[0], max[1], max[2] ) );
-
-          theSelection->Add( new Select3D_SensitiveBox( myWholeMeshOwner, box ) );
+         }
+          if (!box.IsVoid())
+            theSelection->Add (new Select3D_SensitiveBox (myWholeMeshOwner, box));
         }
         break;
 
index 422bf8d3e913f7fec4bdb2ec08ac7da18f98a369..c3c77d02967f64e172b2501b614ef6d1149b70b1 100644 (file)
@@ -166,8 +166,8 @@ OpenGl_Workspace::OpenGl_Workspace (const Handle(OpenGl_Display)& theDisplay,
   TextParam_applied (NULL),
   ViewMatrix_applied (&myDefaultMatrix),
   StructureMatrix_applied (&myDefaultMatrix),
-  PolygonOffset_applied (THE_DEFAULT_POFFSET),
-  myModelViewMatrix (myDefaultMatrix)
+  myModelViewMatrix (myDefaultMatrix),
+  PolygonOffset_applied (THE_DEFAULT_POFFSET)
 {
   theDisplay->InitAttributes();
 
index 58d50177382a7135a92eba70f4bd2f7d8cca6110..f3f9bff88d4dcdd745c8adc43e1436cc5dfd5051 100644 (file)
@@ -1379,7 +1379,7 @@ Handle(Geom_Curve) ShapeConstruct_ProjectCurveOnSurface::InterpolateCurve3d(cons
     Standard_Boolean PtEQext1 = Standard_False;
     Standard_Boolean PtEQext2 = Standard_False;
 
-    Standard_Real currd2[2], tp[2];
+    Standard_Real currd2[2], tp[2] = {0, 0};
     Standard_Integer mp[2];
     
     for (Standard_Integer i=0; i<2; i++) {
index 83df6a86b94be1b3cae0a0c3b7b8ae6d76a2e2ff..ca971e1f835a37c698a251afb52c23d955a2d39a 100644 (file)
@@ -2157,7 +2157,7 @@ int ViewerMainLoop(Standard_Integer argc, const char** argv)
   switch (aReport.type) {
       case ClientMessage:
         {
-          if(aReport.xclient.data.l[0] == GetDisplayConnection()->GetAtom(Aspect_XA_DELETE_WINDOW))
+          if((Atom)aReport.xclient.data.l[0] == GetDisplayConnection()->GetAtom(Aspect_XA_DELETE_WINDOW))
           {
             // Close the window
             ViewerTest::RemoveView(FindViewIdByWindowHandle (aReport.xclient.window));