]> OCCT Git - occt-copy.git/commitdiff
0026852: Coding - compiler warnings issued by GCC 5.2.1
authorabv <abv@opencascade.com>
Sun, 8 Nov 2015 16:29:24 +0000 (19:29 +0300)
committerabv <abv@opencascade.com>
Mon, 9 Nov 2015 12:04:54 +0000 (15:04 +0300)
Compiler warnings eliminated:
- BRepAlgo_DSAccess: avoid copying of local list
- IntPatch, IntTools: initialize "possibly used uninitialized" variables by zeros
- Intf: slight refactoring
- OSD_signal: suppress unused argument
- OpenGL: add missing initializers in structures
- STEPConstruct_GDTProperty: correct function signature to pass output parameters by reference

src/BRepAlgo/BRepAlgo_DSAccess.cxx
src/IntPatch/IntPatch_ImpImpIntersection_4.gxx
src/IntTools/IntTools_EdgeEdge.cxx
src/Intf/Intf_Tool.cxx
src/OSD/OSD_signal.cxx
src/OpenGl/OpenGl_AspectFace.cxx
src/OpenGl/OpenGl_AspectMarker.cxx
src/OpenGl/OpenGl_GraphicDriver.cxx
src/OpenGl/OpenGl_Trihedron.cxx
src/STEPConstruct/STEPConstruct_GDTProperty.cxx
src/STEPConstruct/STEPConstruct_GDTProperty.hxx

index 620365eb6c05e6d611a3471e077158877ded8f9e..ae103e3ac42d84de8ad258fe866c1bf4ccfd184c 100644 (file)
@@ -443,12 +443,12 @@ const TopTools_ListOfShape& BRepAlgo_DSAccess::SectionVertex
 (const TopoDS_Shape& F,
  const TopoDS_Shape& E)
 {
-  TopTools_ListOfShape Result;
-  Result.Clear();
-  if(F.ShapeType() != TopAbs_FACE) return myEmptyListOfShape;
-  if(E.ShapeType() != TopAbs_EDGE) return myEmptyListOfShape;
+  myListOfVertex.Clear();
+  if(F.ShapeType() != TopAbs_FACE || E.ShapeType() != TopAbs_EDGE)
+    return myListOfVertex;
   Standard_Integer iF = myHDS->Shape(F), iE = myHDS->Shape(E);
-  if((iF == 0) || (iE == 0)) return myEmptyListOfShape;
+  if((iF == 0) || (iE == 0))
+    return myListOfVertex;
 
   const TopOpeBRepDS_DataStructure& DS = myHDS->DS();
   const TopOpeBRepDS_ListOfInterference& LI = 
@@ -464,13 +464,12 @@ const TopTools_ListOfShape& BRepAlgo_DSAccess::SectionVertex
       goodKind  = I->GeometryType();
       goodIndex = I->Geometry();
       if(goodKind == TopOpeBRepDS_VERTEX)
-       Result.Append(myHDS->Shape(goodIndex));
+       myListOfVertex.Append(myHDS->Shape(goodIndex));
       else 
        if (goodKind == TopOpeBRepDS_POINT)
-         Result.Append(myHB->NewVertex(goodIndex));
+         myListOfVertex.Append(myHB->NewVertex(goodIndex));
     }
   }
-  myListOfVertex = Result;
   return myListOfVertex;
 }
 
index 02704fe8fb60cc475a0f8b90d4f3f5f9c0d051d7..6b05437b7a14b1befbae146772779aee791c5e29 100644 (file)
@@ -2510,7 +2510,7 @@ Standard_Boolean IntCyCyTrim( const IntSurf_Quadric& theQuad1,
         anUexpect[i] = anUf;
       }
       
-      Standard_Real aCriticalDelta[aNbCritPointsMax];
+      Standard_Real aCriticalDelta[aNbCritPointsMax] = {0};
       for(Standard_Integer aCritPID = 0; aCritPID < aNbCritPoints; aCritPID++)
       { //We are not intersted in elements of aCriticalDelta array
         //if their index is greater than or equal to aNbCritPoints
index d9474f0401f8e2c6226e9ea7511946a9d6e8ea12..095fb507a24c90894ab153f5dd0670e0a64c4ba5 100644 (file)
@@ -1030,6 +1030,7 @@ Standard_Integer FindDistPC(const Standard_Real aT1A,
   //
   iC = bMaxDist ? 1 : -1;
   iErr = 0;
+  aT1max = aT2max = 0.; // silence GCC warning
   //
   aGS = 0.6180339887498948482045868343656;// =0.5*(1.+sqrt(5.))-1.;
   aA = aT1A;
index 0b2a28bbafb0d72a32cc78bdfcb1dec15a4939d1..c776f2e3dc5852119204eca07499edb25720376a 100644 (file)
@@ -975,39 +975,24 @@ Standard_Integer Intf_Tool::Inters3d(const gp_Hypr& theCurv,
     {
       if(parint[i] <= parint[j])
       {
-        Standard_Real aTemp = parint[i];
-        parint[i] = parint[j];
-        parint[j] = aTemp;
-
-        aTemp = zint[i];
-        zint[i] = zint[j];
-        zint[j] = aTemp;
-
-        aTemp = yint[i];
-        yint[i] = yint[j];
-        yint[j] = aTemp;
-
-        aTemp = xint[i];
-        xint[i] = xint[j];
-        xint[j] = aTemp;
-
-        aTemp = bord[i];
-        bord[i] = bord[j];
-        bord[j] = RealToInt(aTemp);
+       std::swap (parint[i], parint[j]);
+       std::swap (zint[i], zint[j]);
+       std::swap (yint[i], yint[j]);
+       std::swap (xint[i], xint[j]);
+       std::swap (bord[i], bord[j]);
       }
 
       if((i < nbpi - 1) && IsEqual(parint[i], parint[i+1]))
       {
-        for(Standard_Integer k = i + 1; k < aNbDiffPoints; k++)
+        aNbDiffPoints--;
+        for(Standard_Integer k = i; k < aNbDiffPoints; k++)
         {
-          parint[k-1] = parint[k];
-          zint[k-1] = zint[k];
-          yint[k-1] = yint[k];
-          xint[k-1] = xint[k];
-          bord[k-1] = bord[k];
+          parint[k] = parint[k+1];
+          zint[k] = zint[k+1];
+          yint[k] = yint[k+1];
+          xint[k] = xint[k+1];
+          bord[k] = bord[k+1];
         }
-
-        aNbDiffPoints--;
       }
     }
   }
index 49799165f68ee965534727497c366d6de3ae5139..6f7f009472408a568260e7b3895e0ddf05e8d48c 100644 (file)
@@ -343,7 +343,8 @@ static void SegvHandler(const int theSignal,
     return;
   }
 #else
-  (void )theContext;
+  (void)theSignal; // silence GCC warnings
+  (void)theContext;
 #endif
 #ifdef linux
   if (fFltExceptions)
index a4252161b89d3630a0b6196e9311e17c04cbe464..0b290b5e6a013009ae9e44c9c48e0c63e2bd0707 100644 (file)
@@ -43,7 +43,8 @@ namespace
     {{ 1.0F, 1.0F, 1.0F, 1.0F }}, // diffuse color
     {{ 1.0F, 1.0F, 1.0F, 1.0F }}, // specular color
     {{ 1.0F, 1.0F, 1.0F, 1.0F }}, // emissive color
-    {{ 1.0F, 1.0F, 1.0F, 1.0F }}  // material color
+    {{ 1.0F, 1.0F, 1.0F, 1.0F }}, // material color
+    Graphic3d_BSDF()
   };
 
   static const TCollection_AsciiString THE_EMPTY_KEY;
index bc3508bf7fe81d0c14732d7cdbd01fe7ced9c33c..6227c16517ef8a5af41de924224073738f4d896b 100644 (file)
@@ -174,19 +174,19 @@ typedef PM_FONT_INFO* pm_font_info;
 static const PM_FONT_INFO arrPMFontInfo[][TEL_NO_OF_SIZES] =
 {
  // TOM_POINT - not used
- {{0},
-  {0},
-  {0},
-  {0},
-  {0},
-  {0},
-  {0},
-  {0},
-  {0},
-  {0},
-  {0},
-  {0},
-  {0}},
+ {{0, 0, 0},
+  {0, 0, 0},
+  {0, 0, 0},
+  {0, 0, 0},
+  {0, 0, 0},
+  {0, 0, 0},
+  {0, 0, 0},
+  {0, 0, 0},
+  {0, 0, 0},
+  {0, 0, 0},
+  {0, 0, 0},
+  {0, 0, 0},
+  {0, 0, 0}},
 
  // TOM_PLUS
  {{ 9.f,  9.f, PM_PLUS_10_OFT},
index 545009d2b05a8149595be8dfb9dd64f96256a3c6..3881cfe58c41609f5cf102449588456a42000b76 100644 (file)
@@ -492,7 +492,8 @@ void OpenGl_GraphicDriver::TextSize (const Handle(Graphic3d_CView)& theView,
     { 1.F, 1.F, 1.F }, //ColorSubTitle
     0, //TextZoomable
     0.F, //TextAngle
-    (int)Font_FA_Regular //TextFontAspect
+    (int)Font_FA_Regular, //TextFontAspect
+    0 //ShaderProgram
   };
   aTextAspect.SetAspect(aDefaultContextText);
   TCollection_ExtendedString anExtText = theText;
index e25d821d24f27bacfc048d7430222f0d43c85852..11c0178adb67b130327e2d8eb9550252866fb6db 100644 (file)
@@ -197,7 +197,7 @@ void OpenGl_Trihedron::redraw (const Handle(OpenGl_Workspace)& theWorkspace) con
 
   // Set line aspect
   const OpenGl_AspectLine* aCurrentAspectLine = theWorkspace->AspectLine (Standard_True);
-  CALL_DEF_CONTEXTLINE aLineAspect = {1, 1, { 1.F, 1.F, 1.F },  aCurrentAspectLine->Type(), aCurrentAspectLine->Width()};
+  CALL_DEF_CONTEXTLINE aLineAspect = {1, 1, { 1.F, 1.F, 1.F },  aCurrentAspectLine->Type(), aCurrentAspectLine->Width(), 0};
   aLineAspect.Color.r = myZColor.r();
   aLineAspect.Color.g = myZColor.g();
   aLineAspect.Color.b = myZColor.b();
index c777b29ba4eb31eabcd8d3cec1a9c28ba177728e..59cdd34577793dd62fa58b56cccdb5ca34802c65 100644 (file)
@@ -166,9 +166,9 @@ void STEPConstruct_GDTProperty::GetDimModifiers(const Handle(StepRepr_CompoundRe
 //purpose  : 
 //=======================================================================
 void STEPConstruct_GDTProperty::GetDimClassOfTolerance(const Handle(StepShape_LimitsAndFits)& theLAF,
-                                   Standard_Boolean theHolle,
-                                   XCAFDimTolObjects_DimensionFormVariance theFV,
-                                   XCAFDimTolObjects_DimensionGrade theG)
+                                   Standard_Boolean& theHolle,
+                                   XCAFDimTolObjects_DimensionFormVariance& theFV,
+                                   XCAFDimTolObjects_DimensionGrade& theG)
 {
   Handle(TCollection_HAsciiString) aFormV = theLAF->FormVariance();
   Handle(TCollection_HAsciiString) aGrade = theLAF->Grade();
@@ -597,4 +597,4 @@ Standard_Boolean STEPConstruct_GDTProperty::GetTolValueType(const Handle(TCollec
       return Standard_True;
     }
     return Standard_False;
-}
\ No newline at end of file
+}
index cd995eb43ce982e6ae01c16b1104e1c2ebe9b8df..19204e2739962a70b74f63a9415ceee6e82a2817 100644 (file)
@@ -47,9 +47,9 @@ public:
                                               XCAFDimTolObjects_DimensionModifiersSequence& theModifiers);
 
   Standard_EXPORT static void GetDimClassOfTolerance(const Handle(StepShape_LimitsAndFits)& theLAF,
-                                                     Standard_Boolean theHolle,
-                                                     XCAFDimTolObjects_DimensionFormVariance theFV,
-                                                     XCAFDimTolObjects_DimensionGrade theG);
+                                                     Standard_Boolean& theHolle,
+                                                     XCAFDimTolObjects_DimensionFormVariance& theFV,
+                                                     XCAFDimTolObjects_DimensionGrade& theG);
 
   Standard_EXPORT static Standard_Boolean GetDimType(const Handle(TCollection_HAsciiString)& theName,
                                                      XCAFDimTolObjects_DimensionType& theType);