From eb1ebea490f386059f220c1b3d4247cfad2c5024 Mon Sep 17 00:00:00 2001 From: abv Date: Mon, 28 Apr 2014 17:12:27 +0400 Subject: [PATCH] 0024877: GCC 4.4.5 compiler warnings on Debian when OCCT is bult using CMake Warnings fixed --- src/Adaptor3d/Adaptor3d_CurveOnSurface.cxx | 4 +-- src/MeshVS/MeshVS_Mesh.cxx | 27 +++++-------------- .../ShapeConstruct_ProjectCurveOnSurface.cxx | 2 +- src/ViewerTest/ViewerTest_ViewerCommands.cxx | 2 +- 4 files changed, 10 insertions(+), 25 deletions(-) diff --git a/src/Adaptor3d/Adaptor3d_CurveOnSurface.cxx b/src/Adaptor3d/Adaptor3d_CurveOnSurface.cxx index 3083d950ac..ea7056994d 100644 --- a/src/Adaptor3d/Adaptor3d_CurveOnSurface.cxx +++ b/src/Adaptor3d/Adaptor3d_CurveOnSurface.cxx @@ -191,7 +191,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; @@ -609,7 +609,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(); diff --git a/src/MeshVS/MeshVS_Mesh.cxx b/src/MeshVS/MeshVS_Mesh.cxx index 2146f9ad50..e519f7f51b 100644 --- a/src/MeshVS/MeshVS_Mesh.cxx +++ b/src/MeshVS/MeshVS_Mesh.cxx @@ -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 )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; diff --git a/src/ShapeConstruct/ShapeConstruct_ProjectCurveOnSurface.cxx b/src/ShapeConstruct/ShapeConstruct_ProjectCurveOnSurface.cxx index 58d5017738..f3f9bff88d 100644 --- a/src/ShapeConstruct/ShapeConstruct_ProjectCurveOnSurface.cxx +++ b/src/ShapeConstruct/ShapeConstruct_ProjectCurveOnSurface.cxx @@ -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++) { diff --git a/src/ViewerTest/ViewerTest_ViewerCommands.cxx b/src/ViewerTest/ViewerTest_ViewerCommands.cxx index aecf92600c..cfc15efaa8 100644 --- a/src/ViewerTest/ViewerTest_ViewerCommands.cxx +++ b/src/ViewerTest/ViewerTest_ViewerCommands.cxx @@ -2153,7 +2153,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)); -- 2.39.5