0024180: Eliminate CLang / GCC compiler warning -Wswitch
authorski <ski@opencascade.com>
Thu, 28 Nov 2013 07:13:41 +0000 (11:13 +0400)
committerbugmaster <bugmaster@opencascade.com>
Thu, 28 Nov 2013 07:14:22 +0000 (11:14 +0400)
Eliminated warnings -Wswitch shown by gcc
Eliminated two new warnings about wrong initialization order
Eliminated warnings about unused functions.
A few more ICC warnings (type conversions) fixed

39 files changed:
src/Adaptor3d/Adaptor3d_HSurfaceTool.cxx
src/Adaptor3d/Adaptor3d_TopolTool.cxx
src/BRepExtrema/BRepExtrema_DistShapeShape.cxx
src/BRepExtrema/BRepExtrema_DistanceSS.cxx
src/BRepFill/BRepFill_Pipe.cxx
src/BinLDrivers/BinLDrivers_DocumentStorageDriver.cxx
src/BinMNaming/BinMNaming_NamedShapeDriver.cxx
src/BinMNaming/BinMNaming_NamingDriver.cxx
src/ChFi3d/ChFi3d_Builder_0.cxx
src/Contap/Contap_HCurve2dToolGen.gxx
src/DDocStd/DDocStd_ApplicationCommands.cxx
src/DNaming/DNaming_TransformationDriver.cxx
src/Font/Font_FontMgr.cxx
src/GeomAdaptor/GeomAdaptor_Surface.cxx
src/GeomInt/GeomInt_LineConstructor.cxx
src/IntPatch/IntPatch_HInterTool.cxx
src/IntPatch/IntPatch_ImpPrmIntersection.cxx
src/IntPatch/IntPatch_Intersection.cxx
src/IntPatch/IntPatch_Point.cxx
src/MNaming/MNaming_NamedShapeRetrievalDriver.cxx
src/MNaming/MNaming_NamedShapeStorageDriver.cxx
src/OSD/OSD_Error.cxx
src/OpenGl/OpenGl_PrimitiveArray.cxx
src/PCDM/PCDM.cdl
src/QABugs/QABugs_11.cxx
src/QADNaming/QADNaming_IteratorsCommands.cxx
src/QANewBRepNaming/QANewBRepNaming.cxx
src/StepFile/step.lex
src/TObj/TObj.msg
src/TObj/TObj_Application.cxx
src/TopOpeBRep/TopOpeBRep_LineInter.cxx
src/TopOpeBRepBuild/TopOpeBRepBuild_VertexInfo.cxx
src/V3d/V3d_View.cxx
src/Visual3d/Visual3d_ViewManager.cxx
src/VrmlData/VrmlData_ShapeConvert.cxx
src/XSDRAWSTLVRML/XSDRAWSTLVRML.cxx
src/XmlMNaming/XmlMNaming_NamedShapeDriver.cxx
src/math/math_DoubleTab.gxx
src/math/math_SingleTab.gxx

index 58aea74..d9e8ca7 100755 (executable)
@@ -32,6 +32,8 @@ Standard_Integer Adaptor3d_HSurfaceTool::NbSamplesU(const Handle(Adaptor3d_HSurf
       return (nbs < 2 ? 2 : nbs);
     }
     case GeomAbs_Torus: return 20;
+    default:
+      break;
   }
   return 10;
 }
@@ -53,6 +55,8 @@ Standard_Integer Adaptor3d_HSurfaceTool::NbSamplesV(const Handle(Adaptor3d_HSurf
     case GeomAbs_Torus:
     case GeomAbs_SurfaceOfRevolution:
     case GeomAbs_SurfaceOfExtrusion: return 15;
+    default:
+      break;
   }
   return 10;
 }
index 97812db..d1b2a9a 100755 (executable)
@@ -55,7 +55,7 @@ static void GetConeApexParam(const gp_Cone& C, Standard_Real& U, Standard_Real&
 }
 
 
-Adaptor3d_TopolTool::Adaptor3d_TopolTool () : nbRestr(0),idRestr(0),myNbSamplesU(-1)
+Adaptor3d_TopolTool::Adaptor3d_TopolTool () : myNbSamplesU(-1),nbRestr(0),idRestr(0)
                                               
 {
 }
index c1889e4..18d861b 100755 (executable)
@@ -461,6 +461,8 @@ void BRepExtrema_DistShapeShape::Dump(Standard_OStream& o) const
     
     switch (SupportTypeShape1(i))
     {
+      case BRepExtrema_IsVertex:
+        break;
       case BRepExtrema_IsOnEdge:
         ParOnEdgeS1(i,r1);
         o << "parameter on the first edge :  t= " << r1 << endl;
@@ -472,6 +474,8 @@ void BRepExtrema_DistShapeShape::Dump(Standard_OStream& o) const
     }
     switch (SupportTypeShape2(i))
     {
+      case BRepExtrema_IsVertex:
+        break;
       case BRepExtrema_IsOnEdge:
         ParOnEdgeS2(i,r1);
         o << "parameter on the second edge : t=" << r1 << endl;
index e39c17c..3abc59b 100755 (executable)
@@ -545,6 +545,8 @@ void BRepExtrema_DistanceSS::Perform(const TopoDS_Shape& S1, const TopoDS_Shape&
           Perform( V1, F2, B1, B2 );
           break;
         }
+        default:
+          break;
       }
       break;
     }
@@ -585,6 +587,8 @@ void BRepExtrema_DistanceSS::Perform(const TopoDS_Shape& S1, const TopoDS_Shape&
           Perform( E1, F2, B1, B2 );
           break;
         }
+        default:
+          break;
       }
       break;
     }
@@ -617,9 +621,13 @@ void BRepExtrema_DistanceSS::Perform(const TopoDS_Shape& S1, const TopoDS_Shape&
           Perform( F1, F2, B1, B2 );
           break;
         }
+        default:
+          break;
       }
       break;
     }
+    default:
+      break;
   }
 }
 
index 2d4c25f..46e6a24 100755 (executable)
@@ -142,6 +142,8 @@ void BRepFill_Pipe::Perform(const TopoDS_Wire&  Spine,
   case GeomFill_IsDiscreteTrihedron:
     TLaw = new GeomFill_DiscreteTrihedron();
     break;
+  default:
+    break;
   }
   Handle(GeomFill_CurveAndTrihedron) Loc = 
     new (GeomFill_CurveAndTrihedron) (TLaw);
index 10f4396..d280bb1 100755 (executable)
@@ -180,7 +180,7 @@ void BinLDrivers_DocumentStorageDriver::Write
       WriteMessage (aStr + theFileName);
 #endif
       SetIsError(Standard_True);
-      SetStoreStatus(PCDM_SS_DiskWritingFailure);
+      SetStoreStatus(PCDM_SS_WriteFailure);
     }
 
   }
index 2e86336..051861a 100755 (executable)
@@ -42,7 +42,7 @@ static Standard_Character EvolutionToChar(const TNaming_Evolution theEvol)
     case TNaming_MODIFY       : return 'M';
     case TNaming_DELETE       : return 'D';
     case TNaming_SELECTED     : return 'S';
-      //    case TNaming_REPLACE      : return 'R';
+    case TNaming_REPLACE      : return 'M'; // for compatibility case TNaming_REPLACE      : return 'R';
   default:
     Standard_DomainError::Raise("TNaming_Evolution:: Evolution Unknown");
   }
@@ -211,9 +211,9 @@ Standard_Boolean BinMNaming_NamedShapeDriver::Paste
     case TNaming_SELECTED     : 
       aBuilder.Select(aNewShape, anOldShape); 
       break;
-      //    case TNaming_REPLACE      :
-      //      aBuilder.Replace(anOldShape, aNewShape); 
-      //      break;
+    case TNaming_REPLACE      :
+      aBuilder.Modify(anOldShape, aNewShape); // for compatibility aBuilder.Replace(anOldShape, aNewShape);
+      break;
       default :
         Standard_DomainError::Raise("TNaming_Evolution:: Evolution Unknown");
     }
index c61a156..18b2fee 100755 (executable)
 #include <BinMNaming.hxx>
 #include <TCollection_AsciiString.hxx>
 #include <TDF_Tool.hxx>
+
 #define  NULL_ENTRY "0:0"
-#define  OBSOLETE_NUM sizeof(Standard_Integer)
+#define  OBSOLETE_NUM (int)sizeof(Standard_Integer)
+
 //=======================================================================
 // 'Z' - is reserved for: forfidden to use
 //=======================================================================
index d303c66..2b5e9b0 100755 (executable)
@@ -1765,6 +1765,8 @@ TopAbs_Orientation ChFi3d_TrsfTrans(const IntSurf_TypeTrans T1)
   switch (T1)  {
     case IntSurf_In:  return TopAbs_FORWARD;
     case IntSurf_Out: return TopAbs_REVERSED;
+    default:
+      break;
   }
   return TopAbs_INTERNAL;
 }
index 03f0276..579de55 100755 (executable)
@@ -48,6 +48,8 @@ Standard_Integer Contap_HCurve2dToolGen::NbSamples (const CurveGen& C,
       nbs/= U1-U0;
       if(nbs < 2.0) nbs = 2.;
       break;
+    default:
+      break;
   }
   if (nbs>50.)
     nbs = 50.;
index 593fde7..00c9488 100755 (executable)
@@ -261,17 +261,32 @@ static Standard_Integer DDocStd_SaveAs (Draw_Interpretor& di,
     PCDM_StoreStatus theStatus = A->SaveAs(D,path);
     if (theStatus != PCDM_SS_OK ) {
       switch ( theStatus ) {
-      case PCDM_SS_DriverFailure: {
-       di << " could not store , no driver found to make it " <<"\n" ;
-       break ;
-      }
-      case PCDM_SS_WriteFailure: {
-       di << " Write access failure " << "\n" ;  
-       break;
-      }
-      case PCDM_SS_Failure: {
-       di << " Write failure " << "\n" ;  
-      }
+        case PCDM_SS_DriverFailure: {
+          di << "Error saving document: Could not store , no driver found to make it" << "\n";
+          break ;
+        }
+        case PCDM_SS_WriteFailure: {
+          di << "Error saving document: Write access failure" << "\n";
+          break;
+        }
+        case PCDM_SS_Failure: {
+          di << "Error saving document: Write failure" << "\n" ;
+          break;
+        }
+        case PCDM_SS_Doc_IsNull: {
+          di << "Error saving document: No document to save" << "\n";
+          break ;
+        }
+        case PCDM_SS_No_Obj: {
+          di << "Error saving document: No objects written" << "\n";
+          break;
+        }
+        case PCDM_SS_Info_Section_Error: {
+          di << "Error saving document: Write info section failure" << "\n" ;
+          break;
+        }
+        default:
+          break;
       }
       return 1;
     } else {
index dcef94d..53497dd 100644 (file)
@@ -320,6 +320,7 @@ static void CollectShapes(const TopoDS_Shape& SSh, TopoDS_Compound& C,
     }
     break;
   case TopAbs_VERTEX:
+  {
     const Handle(TNaming_NamedShape) aNS =  TNaming_Tool::NamedShape(SSh, theLab);
     if(!aNS.IsNull())
       if(SMap.Add(SSh)) {
@@ -327,8 +328,11 @@ static void CollectShapes(const TopoDS_Shape& SSh, TopoDS_Compound& C,
 //     if(isPrimitive)
 //       TagMap.Bind(SSh, aNS->Label().Tag());
       }
+   }
+  break;
+    default:
     break;
-  }   
+  }
 }
 
 //=======================================================================
index 4f64e23..59467c8 100644 (file)
@@ -69,7 +69,7 @@ static const Font_FontMgr_FontAliasMapNode Font_FontMgr_MapOfFontsAliases[] =
 
 };
 
-#define NUM_FONT_ENTRIES (sizeof(Font_FontMgr_MapOfFontsAliases)/sizeof(Font_FontMgr_FontAliasMapNode))
+#define NUM_FONT_ENTRIES (int)(sizeof(Font_FontMgr_MapOfFontsAliases)/sizeof(Font_FontMgr_FontAliasMapNode))
 
 #if (defined(_WIN32) || defined(__WIN32__))
 
index 80bf9a6..4a09068 100755 (executable)
@@ -187,24 +187,36 @@ GeomAbs_Shape GeomAdaptor_Surface::UContinuity() const
       return LocalContinuity(myBspl->UDegree(), myBspl->NbUKnots(), TK, TM,
                              myUFirst, myULast, IsUPeriodic());
     }
-       case GeomAbs_OffsetSurface:
+    case GeomAbs_OffsetSurface:
     {
       switch(BasisSurface()->UContinuity())
       {
-        case GeomAbs_CN : return GeomAbs_CN; 
-        case GeomAbs_C2 : return GeomAbs_C1; 
-        case GeomAbs_C1 : return GeomAbs_C0;
+      case GeomAbs_CN :
+      case GeomAbs_C3 : return GeomAbs_CN;
+      case GeomAbs_G2 :
+      case GeomAbs_C2 : return GeomAbs_C1;
+      case GeomAbs_G1 :
+      case GeomAbs_C1 : return GeomAbs_C0;
+      case GeomAbs_C0 : break;
       }
       Standard_NoSuchObject::Raise("GeomAdaptor_Surface::UContinuity");
-         break;
+      break;
     }
-       case GeomAbs_SurfaceOfExtrusion:
+    case GeomAbs_SurfaceOfExtrusion:
     {
       GeomAdaptor_Curve GC
         ((*((Handle(Geom_SurfaceOfLinearExtrusion)*)&mySurface))->BasisCurve(),myUFirst,myULast);
       return GC.Continuity();
     }
-       case GeomAbs_OtherSurface: Standard_NoSuchObject::Raise("GeomAdaptor_Surface::UContinuity");
+    case GeomAbs_OtherSurface: 
+      Standard_NoSuchObject::Raise("GeomAdaptor_Surface::UContinuity");
+    case GeomAbs_Plane:
+    case GeomAbs_Cylinder:
+    case GeomAbs_Cone:
+    case GeomAbs_Sphere:
+    case GeomAbs_Torus:
+    case GeomAbs_BezierSurface:
+    case GeomAbs_SurfaceOfRevolution: break;
   }
   return GeomAbs_CN;
 }
@@ -228,24 +240,36 @@ GeomAbs_Shape GeomAdaptor_Surface::VContinuity() const
       return LocalContinuity(myBspl->VDegree(), myBspl->NbVKnots(), TK, TM,
                              myVFirst, myVLast, IsVPeriodic());
     }
-       case GeomAbs_OffsetSurface:
+    case GeomAbs_OffsetSurface:
     {
       switch(BasisSurface()->VContinuity())
       {
-        case GeomAbs_CN : return GeomAbs_CN; 
-        case GeomAbs_C2 : return GeomAbs_C1;
-        case GeomAbs_C1 : return GeomAbs_C0;
+      case GeomAbs_CN : 
+      case GeomAbs_C3 : return GeomAbs_CN; 
+      case GeomAbs_G2 :
+      case GeomAbs_C2 : return GeomAbs_C1;
+      case GeomAbs_G1 :
+      case GeomAbs_C1 : return GeomAbs_C0;
+      case GeomAbs_C0 : break;
       }
       Standard_NoSuchObject::Raise("GeomAdaptor_Surface::VContinuity");
       break;
     }
-       case GeomAbs_SurfaceOfRevolution:
+    case GeomAbs_SurfaceOfRevolution:
     {
       GeomAdaptor_Curve GC
         ((*((Handle(Geom_SurfaceOfRevolution)*)&mySurface))->BasisCurve(),myVFirst,myVLast);
       return GC.Continuity();
     }
-       case GeomAbs_OtherSurface: Standard_NoSuchObject::Raise("GeomAdaptor_Surface::VContinuity");
+    case GeomAbs_OtherSurface:
+      Standard_NoSuchObject::Raise("GeomAdaptor_Surface::VContinuity");
+    case GeomAbs_Plane:
+    case GeomAbs_Cylinder:
+    case GeomAbs_Cone:
+    case GeomAbs_Sphere:
+    case GeomAbs_Torus:
+    case GeomAbs_BezierSurface:
+    case GeomAbs_SurfaceOfExtrusion: break;
   }
   return GeomAbs_CN;
 }
@@ -265,7 +289,7 @@ Standard_Integer GeomAdaptor_Surface::NbUIntervals(const GeomAbs_Shape S) const
         (myBspl->VIso(myBspl->VKnot(myBspl->FirstVKnotIndex())),myUFirst,myULast);
       return myBasisCurve.NbIntervals(S);
     }
-       case GeomAbs_SurfaceOfExtrusion:
+         case GeomAbs_SurfaceOfExtrusion:
     {
       GeomAdaptor_Curve myBasisCurve
         ((*((Handle(Geom_SurfaceOfLinearExtrusion)*)&mySurface))->BasisCurve(),myUFirst,myULast);
@@ -273,7 +297,7 @@ Standard_Integer GeomAdaptor_Surface::NbUIntervals(const GeomAbs_Shape S) const
         return myBasisCurve.NbIntervals(S);
       break;
     }
-       case GeomAbs_OffsetSurface:
+         case GeomAbs_OffsetSurface:
     {
       GeomAbs_Shape BaseS = GeomAbs_CN;
       switch(S)
@@ -283,10 +307,20 @@ Standard_Integer GeomAdaptor_Surface::NbUIntervals(const GeomAbs_Shape S) const
         case GeomAbs_C0: BaseS = GeomAbs_C1; break;
         case GeomAbs_C1: BaseS = GeomAbs_C2; break;
         case GeomAbs_C2: BaseS = GeomAbs_C3; break;
+        case GeomAbs_C3:
+        case GeomAbs_CN: break;
       }
       GeomAdaptor_Surface Sur((*((Handle(Geom_OffsetSurface)*)&mySurface))->BasisSurface());
       return Sur.NbUIntervals(BaseS);
     }
+    case GeomAbs_Plane:
+    case GeomAbs_Cylinder:
+    case GeomAbs_Cone:
+    case GeomAbs_Sphere:
+    case GeomAbs_Torus:
+    case GeomAbs_BezierSurface:
+    case GeomAbs_OtherSurface:
+    case GeomAbs_SurfaceOfRevolution: break;
   }
   return 1;
 }
@@ -306,7 +340,7 @@ Standard_Integer GeomAdaptor_Surface::NbVIntervals(const GeomAbs_Shape S) const
         (myBspl->UIso(myBspl->UKnot(myBspl->FirstUKnotIndex())),myVFirst,myVLast);
       return myBasisCurve.NbIntervals(S);
     }
-       case GeomAbs_SurfaceOfRevolution:
+         case GeomAbs_SurfaceOfRevolution:
     {
       GeomAdaptor_Curve myBasisCurve
         ((*((Handle(Geom_SurfaceOfRevolution)*)&mySurface))->BasisCurve(),myVFirst,myVLast);
@@ -314,7 +348,7 @@ Standard_Integer GeomAdaptor_Surface::NbVIntervals(const GeomAbs_Shape S) const
         return myBasisCurve.NbIntervals(S);
       break;
     }
-       case GeomAbs_OffsetSurface:
+         case GeomAbs_OffsetSurface:
     {
       GeomAbs_Shape BaseS = GeomAbs_CN;
       switch(S)
@@ -324,10 +358,20 @@ Standard_Integer GeomAdaptor_Surface::NbVIntervals(const GeomAbs_Shape S) const
         case GeomAbs_C0: BaseS = GeomAbs_C1; break;
         case GeomAbs_C1: BaseS = GeomAbs_C2; break;
         case GeomAbs_C2: BaseS = GeomAbs_C3; break;
+        case GeomAbs_C3:
+        case GeomAbs_CN: break;
       }
       GeomAdaptor_Surface Sur((*((Handle(Geom_OffsetSurface)*)&mySurface))->BasisSurface());
       return Sur.NbVIntervals(BaseS);
-       }
+         }
+    case GeomAbs_Plane:
+    case GeomAbs_Cylinder:
+    case GeomAbs_Cone:
+    case GeomAbs_Sphere:
+    case GeomAbs_Torus:
+    case GeomAbs_BezierSurface:
+    case GeomAbs_OtherSurface:
+    case GeomAbs_SurfaceOfExtrusion: break;
   }
   return 1;
 }
@@ -351,7 +395,7 @@ void GeomAdaptor_Surface::UIntervals(TColStd_Array1OfReal& T, const GeomAbs_Shap
       myBasisCurve.Intervals(T,S);
       break;
     }
-       case GeomAbs_SurfaceOfExtrusion:
+         case GeomAbs_SurfaceOfExtrusion:
     {
       GeomAdaptor_Curve myBasisCurve
         ((*((Handle(Geom_SurfaceOfLinearExtrusion)*)&mySurface))->BasisCurve(),myUFirst,myULast);
@@ -362,7 +406,7 @@ void GeomAdaptor_Surface::UIntervals(TColStd_Array1OfReal& T, const GeomAbs_Shap
       }
       break;
     }
-       case GeomAbs_OffsetSurface:
+         case GeomAbs_OffsetSurface:
     {
       GeomAbs_Shape BaseS = GeomAbs_CN;
       switch(S)
@@ -372,11 +416,21 @@ void GeomAdaptor_Surface::UIntervals(TColStd_Array1OfReal& T, const GeomAbs_Shap
         case GeomAbs_C0: BaseS = GeomAbs_C1; break;
         case GeomAbs_C1: BaseS = GeomAbs_C2; break;
         case GeomAbs_C2: BaseS = GeomAbs_C3; break;
+        case GeomAbs_C3:
+        case GeomAbs_CN: break;
       }
       GeomAdaptor_Surface Sur((*((Handle(Geom_OffsetSurface)*)&mySurface))->BasisSurface());
       myNbUIntervals = Sur.NbUIntervals(BaseS);
       Sur.UIntervals(T, BaseS);
     }
+    case GeomAbs_Plane:
+    case GeomAbs_Cylinder:
+    case GeomAbs_Cone:
+    case GeomAbs_Sphere:
+    case GeomAbs_Torus:
+    case GeomAbs_BezierSurface:
+    case GeomAbs_OtherSurface:
+    case GeomAbs_SurfaceOfRevolution: break;
   }
 
   T(T.Lower()) = myUFirst;
@@ -402,7 +456,7 @@ void GeomAdaptor_Surface::VIntervals(TColStd_Array1OfReal& T, const GeomAbs_Shap
       myBasisCurve.Intervals(T,S);
       break;
     }
-       case GeomAbs_SurfaceOfRevolution:
+         case GeomAbs_SurfaceOfRevolution:
     {
       GeomAdaptor_Curve myBasisCurve
         ((*((Handle(Geom_SurfaceOfRevolution)*)&mySurface))->BasisCurve(),myVFirst,myVLast);
@@ -413,7 +467,7 @@ void GeomAdaptor_Surface::VIntervals(TColStd_Array1OfReal& T, const GeomAbs_Shap
       }
       break;
     }
-       case GeomAbs_OffsetSurface:
+         case GeomAbs_OffsetSurface:
     {
       GeomAbs_Shape BaseS = GeomAbs_CN;
       switch(S)
@@ -423,11 +477,21 @@ void GeomAdaptor_Surface::VIntervals(TColStd_Array1OfReal& T, const GeomAbs_Shap
         case GeomAbs_C0: BaseS = GeomAbs_C1; break;
         case GeomAbs_C1: BaseS = GeomAbs_C2; break;
         case GeomAbs_C2: BaseS = GeomAbs_C3; break;
+        case GeomAbs_C3:
+        case GeomAbs_CN: break;
       }
       GeomAdaptor_Surface Sur((*((Handle(Geom_OffsetSurface)*)&mySurface))->BasisSurface());
       myNbVIntervals = Sur.NbVIntervals(BaseS);
       Sur.VIntervals(T, BaseS);
     }
+    case GeomAbs_Plane:
+    case GeomAbs_Cylinder:
+    case GeomAbs_Cone:
+    case GeomAbs_Sphere:
+    case GeomAbs_Torus:
+    case GeomAbs_BezierSurface:
+    case GeomAbs_OtherSurface:
+    case GeomAbs_SurfaceOfExtrusion: break;
   }
   
   T(T.Lower()) = myVFirst;
index 6bf5a63..0d98d52 100755 (executable)
@@ -260,6 +260,9 @@ void GeomInt_LineConstructor::Perform(const Handle(IntPatch_Line)& L)
           case IntPatch_Ellipse:   Pmid = ElCLib::Value(pmid,GLine->Ellipse()); break;
           case IntPatch_Hyperbola: Pmid = ElCLib::Value(pmid,GLine->Hyperbola()); break;
           case IntPatch_Parabola:  Pmid = ElCLib::Value(pmid,GLine->Parabola()); break;
+          case IntPatch_Analytic:
+          case IntPatch_Walking:
+          case IntPatch_Restriction: break; // cases Analytic, Walking and Restriction are handled above
         }
         Parameters(myHS1,myHS2,Pmid,u1,v1,u2,v2);
         Recadre(myHS1,myHS2,u1,v1,u2,v2);
index fbb27d6..9ec56b6 100755 (executable)
@@ -64,6 +64,9 @@ Standard_Integer IntPatch_HInterTool::NbSamplesV (const Handle(Adaptor3d_HSurfac
     case GeomAbs_Torus:
     case GeomAbs_SurfaceOfRevolution:
     case GeomAbs_SurfaceOfExtrusion: return 15;
+
+    case GeomAbs_OffsetSurface:
+    case GeomAbs_OtherSurface: return 10;
   }
   return 10;
 }
@@ -82,13 +85,16 @@ Standard_Integer IntPatch_HInterTool::NbSamplesU (const Handle(Adaptor3d_HSurfac
       if (!S->IsURational()) nbs *= 2;
       if (nbs < 4) nbs = 4;
       return nbs;
-       }
+         }
     case GeomAbs_Torus: return 20;
-    //case GeomAbs_Cylinder:
-    //case GeomAbs_Cone:
-    //case GeomAbs_Sphere:
-    //case GeomAbs_SurfaceOfRevolution:
-    //case GeomAbs_SurfaceOfExtrusion: return 10;
+
+    case GeomAbs_Cylinder:
+    case GeomAbs_Cone:
+    case GeomAbs_Sphere:
+    case GeomAbs_SurfaceOfRevolution:
+    case GeomAbs_SurfaceOfExtrusion:
+    case GeomAbs_OffsetSurface:
+    case GeomAbs_OtherSurface: return 10;
   }
   return 10;
 }
index 56cb016..8f4fbb2 100755 (executable)
@@ -376,6 +376,8 @@ void Recadre(const Standard_Boolean ,
     case GeomAbs_Sphere:
       while(U1<(U1p-1.5*M_PI)) U1+=M_PI+M_PI;
       while(U1>(U1p+1.5*M_PI)) U1-=M_PI+M_PI;
+    default:
+      break;
   }
   switch(typeS2)
   { 
@@ -387,6 +389,8 @@ void Recadre(const Standard_Boolean ,
     case GeomAbs_Sphere:
       while(U2<(U2p-1.5*M_PI)) U2+=M_PI+M_PI;
       while(U2>(U2p+1.5*M_PI)) U2-=M_PI+M_PI;
+    default:
+      break;
   }
   pt.SetParameters(U1,V1,U2,V2);
 }
index a6e156c..ef5cf0f 100755 (executable)
@@ -628,6 +628,8 @@ static void FUN_NewFirstLast(const GeomAbs_CurveType& ga_ct,
          }
       break;
     }
+  default:
+    break;
   }
 }
 //================================================================================
@@ -1477,7 +1479,7 @@ void IntPatch_Intersection::Dump(const Standard_Integer ,
     nbR2++;
   }
   
-  printf("\nDUMP_INT:  ----empt:%2d  tgte:%2d  oppo:%2d ---------------------------------",empt,tgte,empt);
+  printf("\nDUMP_INT:  ----empt:%2ud  tgte:%2ud  oppo:%2ud ---------------------------------",empt,tgte,empt);
   Standard_Integer i,j,nbr1,nbr2,nbgl,nbgc,nbge,nbgp,nbgh,nbl,nbr,nbg,nbw,nba;
   nbl=nbr=nbg=nbw=nba=nbgl=nbge=nbr1=nbr2=nbgc=nbgp=nbgh=0;
   nbl=NbLines();
index 20dded4..a293c3d 100755 (executable)
@@ -82,16 +82,20 @@ void IntPatch_Point::ReverseTransition()
     IntSurf_Transition TLine;
     switch (traline1.TransitionType())
     {
-         case IntSurf_In: TLine.SetValue(Standard_False,IntSurf_Out); break;
-         case IntSurf_Out: TLine.SetValue(Standard_False,IntSurf_In); break;
-       }
+    case IntSurf_In: TLine.SetValue(Standard_False,IntSurf_Out); break;
+    case IntSurf_Out: TLine.SetValue(Standard_False,IntSurf_In); break;
+    default:
+      break;
+    }
     traline1=TLine;
     IntSurf_Transition TArc;
     switch (tra1.TransitionType())
     {
-         case IntSurf_In: TArc.SetValue(Standard_False,IntSurf_Out); break;
-         case IntSurf_Out: TArc.SetValue(Standard_False,IntSurf_In); break;
-       }
+    case IntSurf_In: TArc.SetValue(Standard_False,IntSurf_Out); break;
+    case IntSurf_Out: TArc.SetValue(Standard_False,IntSurf_In); break;
+    default:
+      break;
+    }
     tra1=TArc;
   }
   if(onS2)
@@ -99,16 +103,20 @@ void IntPatch_Point::ReverseTransition()
     IntSurf_Transition TLine;
     switch (traline2.TransitionType())
     {
-         case IntSurf_In: TLine.SetValue(Standard_False,IntSurf_Out); break;
-         case IntSurf_Out: TLine.SetValue(Standard_False,IntSurf_In); break;
-       }
+    case IntSurf_In: TLine.SetValue(Standard_False,IntSurf_Out); break;
+    case IntSurf_Out: TLine.SetValue(Standard_False,IntSurf_In); break;
+    default:
+      break;
+    }
     traline2=TLine;
     IntSurf_Transition TArc;
     switch (tra2.TransitionType())
     {
-         case IntSurf_In: TArc.SetValue(Standard_False,IntSurf_Out); break;
-         case IntSurf_Out: TArc.SetValue(Standard_False,IntSurf_In); break;
-       }
+    case IntSurf_In: TArc.SetValue(Standard_False,IntSurf_Out); break;
+    case IntSurf_Out: TArc.SetValue(Standard_False,IntSurf_In); break;
+    default:
+      break;
+    }
     tra2=TArc;
   }  
 }
index 4cb3628..24e60fb 100755 (executable)
@@ -149,7 +149,7 @@ void MNaming_NamedShapeRetrievalDriver::Paste (
     case TNaming_SELECTED     : {
       Bld.Select(NewShape, OldShape); break;
     }
-    case TNaming_REPLACE      :{
+    case TNaming_REPLACE      : {
       //Bld.Replace(OldShape,NewShape); break;
       Bld.Modify(OldShape,NewShape); break;// for compatibility only
     }  
index 84ee517..9520773 100755 (executable)
@@ -158,7 +158,7 @@ Standard_Integer EvolutionInt(const TNaming_Evolution i)
     case TNaming_MODIFY       : return 2;
     case TNaming_DELETE       : return 3;
     case TNaming_SELECTED     : return 4;
-      //case TNaming_REPLACE      : return 5;
+    case TNaming_REPLACE      : return 2; //case TNaming_REPLACE      : return 5; for compatibility
   default:
     Standard_DomainError::Raise("TNaming_Evolution; enum term unknown");
   }
index 8a7f006..f8e8c0b 100755 (executable)
@@ -604,7 +604,7 @@ static ERROR_TABLE fileErrorTable[] = {
 
 };
 
-#define FILE_ERR_TABLE_SIZE (  sizeof ( fileErrorTable ) / sizeof ( fileErrorTable[ 0 ] )  )
+#define FILE_ERR_TABLE_SIZE (int)(sizeof(fileErrorTable) / sizeof(fileErrorTable[0]))
 
 static ERROR_TABLE fileNodeErrorTable[] = {
 
index 0a5b0b2..cf9d973 100755 (executable)
@@ -207,6 +207,8 @@ void OpenGl_PrimitiveArray::DrawArray (Tint theLightingModel,
     case TelTriangleFansArrayType:
       glColor3fv (theInteriorColour->rgb);
       break;
+    case TelUnknownArrayType:
+      break;
   }
 
   // Temporarily disable environment mapping
@@ -687,6 +689,8 @@ OpenGl_PrimitiveArray::OpenGl_PrimitiveArray (CALL_DEF_PARRAY* thePArray)
     case TelTriangleFansArrayType:
       myDrawMode = GL_TRIANGLE_FAN;
       break;
+    case TelUnknownArrayType:
+      break;
   }
 }
 
index f9b3609..f6703bf 100755 (executable)
@@ -58,8 +58,6 @@ is
            SS_DriverFailure,
            SS_WriteFailure,
            SS_Failure,
-           SS_DiskWritingFailure,
-           SS_UserRightsFailure,
            SS_Doc_IsNull,
            SS_No_Obj,
            SS_Info_Section_Error
index c3c0a64..ee64739 100755 (executable)
@@ -779,17 +779,32 @@ static Standard_Integer OCC381_Save (Draw_Interpretor& di, Standard_Integer nb,
   PCDM_StoreStatus theStatus = A->Save(D, theStatusMessage);
   if (theStatus != PCDM_SS_OK ) {
     switch ( theStatus ) {
-    case PCDM_SS_DriverFailure: {
-      di << " Could not store , no driver found to make it " <<"\n" ;
-      break ;
-    }
-    case PCDM_SS_WriteFailure: {
-      di << " Write access failure " << "\n" ;
-      break;
-    }
-    case PCDM_SS_Failure: {
-      di << " Write failure " << "\n" ;
-    }
+      case PCDM_SS_DriverFailure: {
+        di << "Error saving document: Could not store , no driver found to make it" << "\n";
+        break ;
+      }
+      case PCDM_SS_WriteFailure: {
+        di << "Error saving document: Write access failure" << "\n";
+        break;
+      }
+      case PCDM_SS_Failure: {
+        di << "Error saving document: Write failure" << "\n" ;
+        break;
+      }
+      case PCDM_SS_Doc_IsNull: {
+        di << "Error saving document: No document to save" << "\n";
+        break ;
+      }
+      case PCDM_SS_No_Obj: {
+        di << "Error saving document: No objects written" << "\n";
+        break;
+      }
+      case PCDM_SS_Info_Section_Error: {
+        di << "Error saving document: Write info section failure" << "\n" ;
+        break;
+      }
+      default:
+          break;
     }
     return 1;
   }
@@ -814,17 +829,32 @@ static Standard_Integer OCC381_SaveAs (Draw_Interpretor& di, Standard_Integer nb
   PCDM_StoreStatus theStatus = A->SaveAs(D,path, theStatusMessage);
   if (theStatus != PCDM_SS_OK ) {
     switch ( theStatus ) {
-    case PCDM_SS_DriverFailure: {
-      di << " Could not store , no driver found to make it " <<"\n" ;
-      break ;
-    }
-    case PCDM_SS_WriteFailure: {
-      di << " Write access failure " << "\n" ;
-      break;
-    }
-    case PCDM_SS_Failure: {
-      di << " Write failure " << "\n" ;
-    }
+      case PCDM_SS_DriverFailure: {
+        di << "Error saving document: Could not store , no driver found to make it" << "\n";
+        break ;
+      }
+      case PCDM_SS_WriteFailure: {
+        di << "Error saving document: Write access failure" << "\n";
+        break;
+      }
+      case PCDM_SS_Failure: {
+        di << "Error saving document: Write failure" << "\n" ;
+        break;
+      }
+      case PCDM_SS_Doc_IsNull: {
+        di << "Error saving document: No document to save" << "\n";
+        break ;
+      }
+      case PCDM_SS_No_Obj: {
+        di << "Error saving document: No objects written" << "\n";
+        break;
+      }
+      case PCDM_SS_Info_Section_Error: {
+        di << "Error saving document: Write info section failure" << "\n" ;
+        break;
+      }
+      default:
+          break;
     }
     return 1;
   }
index 785f967..fc541d6 100755 (executable)
@@ -50,8 +50,8 @@ static const char* EvolutionString(TNaming_Evolution theEvolution) {
     return "DELETE";
   case TNaming_SELECTED :
     return "SELECTED";
-//  case TNaming_REPLACE :
-//    return "REPLACE";
+  case TNaming_REPLACE :
+    return "MODIFY";
   }
   return "UNKNOWN_Evolution";
 }
index 7bfabc2..1afe10d 100755 (executable)
@@ -88,6 +88,11 @@ void QANewBRepNaming::LoadNamedShape (TNaming_Builder& theBuilder,
       theBuilder.Modify(theOS, theNS);
       break;
     }
+    case TNaming_REPLACE :
+    {
+      theBuilder.Modify(theOS, theNS);
+      break;
+    } // for compatibility
 //  case TNaming_REPLACE :
 //    {
 //      theBuilder.Replace(theOS, theNS);
index 89d6b67..565c3a8 100755 (executable)
@@ -50,6 +50,11 @@ void rec_typarg(int argtype);
 #pragma warning(disable:4131 4244 4273 4267 4127)
 #endif
 
+// disable GCC warnings in flex code
+#ifdef __GNUC__
+#pragma GCC diagnostic ignored "-Wunused-function"
+#endif
+
 %}
 %%
 "      "       {;}
index a4546ec..c596373 100755 (executable)
@@ -56,9 +56,6 @@
 .TObj_Appl_SFailure
   Error saving document %s : general failure of persistence driver
   
-.TObj_Appl_SDiskWritingFailure
-  Error saving document %s : possibly the disk is full or other disk write problem occurred
-  
 .TObj_Appl_SDocIsNull
   Error saving document %s : No document to save
   
index 7cec227..313e102 100755 (executable)
@@ -103,9 +103,6 @@ Standard_Boolean TObj_Application::SaveDocument
     case PCDM_SS_Failure:
       ErrorMessage (Message_Msg("TObj_Appl_SFailure") << aPath);
       break;
-    case PCDM_SS_DiskWritingFailure:
-      ErrorMessage (Message_Msg("TObj_Appl_SDiskWritingFailure") << aPath);
-      break;
     case PCDM_SS_Doc_IsNull:
       ErrorMessage (Message_Msg("TObj_Appl_SDocIsNull") << aPath);
       break;
index a1d228a..5d457ce 100755 (executable)
@@ -345,6 +345,8 @@ Standard_Boolean TopOpeBRep_LineInter::IsPeriodic() const
   {
     case TopOpeBRep_CIRCLE  :
     case TopOpeBRep_ELLIPSE : return Standard_True;
+    default:
+      break;
   }
   return Standard_False;
 }
@@ -410,6 +412,8 @@ Standard_Integer TopOpeBRep_LineInter::NbWPoint() const
   switch (myTypeLineCurve)
   {
     case TopOpeBRep_WALKING : return myILW->NbPnts();
+    default:
+      break;
   }
   return 0;
 }
index 36e321d..af47484 100755 (executable)
@@ -141,7 +141,7 @@ TopOpeBRepBuild_VertexInfo::TopOpeBRepBuild_VertexInfo()
   void TopOpeBRepBuild_VertexInfo::Dump() const
 {
   printf(" *** Dump the Vertex Info ***\n");
-  printf(" mySmart  : %d\n", mySmart);
+  printf(" mySmart  : %ud\n", mySmart);
   printf(" Edges    : %d In, %d Out\n", myEdgesIn.Extent(), myEdgesOut.Extent());
   
   
index 204b854..1703c7f 100755 (executable)
@@ -266,12 +266,12 @@ static Graphic3d_Vertex& _MyProjReferencePoint() {
 
 V3d_View::V3d_View(const Handle(V3d_Viewer)& VM, const V3d_TypeOfView Type ) :
 MyType ( Type ),
+MyProjModel(V3d_TPM_SCREEN),
 MyViewer(VM.operator->()),
 MyActiveLights(),
 MyViewContext (),
 myActiveLightsIterator(),
 SwitchSetFront(Standard_False),
-MyProjModel(V3d_TPM_SCREEN),
 MyTrsf (1, 4, 1, 4)         // S3892
 {
   myImmediateUpdate = Standard_False;
@@ -367,13 +367,13 @@ MyTrsf (1, 4, 1, 4)         // S3892
 
 V3d_View::V3d_View(const Handle(V3d_Viewer)& VM,const Handle(V3d_View)& V, const V3d_TypeOfView Type ) :
 MyType ( Type ),
+MyProjModel(V3d_TPM_SCREEN),
 MyViewer(VM.operator->()),
 MyActiveLights(),
 MyViewContext (),
 myActiveLightsIterator(),
 SwitchSetFront(Standard_False),
-MyTrsf (1, 4, 1, 4),                                    // S3892
-MyProjModel(V3d_TPM_SCREEN)
+MyTrsf (1, 4, 1, 4)                                    // S3892
 {
   Handle(Visual3d_View) FromView = V->View() ;
 
index c3f0bfa..c97a78a 100755 (executable)
@@ -957,7 +957,7 @@ Standard_Boolean Exist = Standard_False;
 
 #if defined(_WIN32) || defined(__WIN32__)
   const Handle(WNT_Window) THEWindow = Handle(WNT_Window)::DownCast (AWindow);
-  int TheSpecifiedWindowId = int (THEWindow->HWindow ());
+  Aspect_Handle TheSpecifiedWindowId = THEWindow->HWindow ();
 #elif defined(__APPLE__) && !defined(MACOSX_USE_GLX)
   const Handle(Cocoa_Window) THEWindow = Handle(Cocoa_Window)::DownCast (AWindow);
   NSView* TheSpecifiedWindowId = THEWindow->HView();
@@ -974,7 +974,7 @@ Standard_Boolean Exist = Standard_False;
 const Handle(Aspect_Window) AspectWindow = (MyIterator.Value ())->Window ();
 #if defined(_WIN32) || defined(__WIN32__)
    const Handle(WNT_Window) theWindow = Handle(WNT_Window)::DownCast (AspectWindow);
-   int TheWindowIdOfView = int (theWindow->HWindow ());
+   Aspect_Handle TheWindowIdOfView = theWindow->HWindow ();
 #elif defined(__APPLE__) && !defined(MACOSX_USE_GLX)
    const Handle(Cocoa_Window) theWindow = Handle(Cocoa_Window)::DownCast (AspectWindow);
    NSView* TheWindowIdOfView = theWindow->HView();
index b70ff5a..f53bb63 100755 (executable)
@@ -294,6 +294,8 @@ void VrmlData_ShapeConvert::Convert (const Standard_Boolean theExtractFaces,
             }
           }
           break;
+        default:
+          break;
         }
         
         if (aTShapeNode.IsNull() == Standard_False) {
index 9840404..a8958e2 100755 (executable)
@@ -187,21 +187,25 @@ static Standard_Integer loadvrml
           shape = aScene.GetShape(ShapeAppMap);
           break;
         }
-      case VrmlData_EmptyData:          aStr = "EmptyData"; break;
-      case VrmlData_UnrecoverableError: aStr = "UnrecoverableError"; break;
-      case VrmlData_GeneralError:       aStr = "GeneralError"; break;
-      case VrmlData_EndOfFile:          aStr = "EndOfFile"; break;
-      case VrmlData_NotVrmlFile:        aStr = "NotVrmlFile"; break;
-      case VrmlData_CannotOpenFile:     aStr = "CannotOpenFile"; break;
-      case VrmlData_VrmlFormatError:    aStr = "VrmlFormatError"; break;
-      case VrmlData_NumericInputError:  aStr = "NumericInputError"; break;
-      case VrmlData_IrrelevantNumber:   aStr = "IrrelevantNumber"; break;
-      case VrmlData_BooleanInputError:  aStr = "BooleanInputError"; break;
-      case VrmlData_StringInputError:   aStr = "StringInputError"; break;
-      case VrmlData_NodeNameUnknown:    aStr = "NodeNameUnknown"; break;
-      case VrmlData_NonPositiveSize:    aStr = "NonPositiveSize"; break;
-      case VrmlData_ReadUnknownNode:    aStr = "ReadUnknownNode"; break;
-      case VrmlData_NonSupportedFeature:aStr = "NonSupportedFeature"; break;
+      case VrmlData_EmptyData:            aStr = "EmptyData"; break;
+      case VrmlData_UnrecoverableError:   aStr = "UnrecoverableError"; break;
+      case VrmlData_GeneralError:         aStr = "GeneralError"; break;
+      case VrmlData_EndOfFile:            aStr = "EndOfFile"; break;
+      case VrmlData_NotVrmlFile:          aStr = "NotVrmlFile"; break;
+      case VrmlData_CannotOpenFile:       aStr = "CannotOpenFile"; break;
+      case VrmlData_VrmlFormatError:      aStr = "VrmlFormatError"; break;
+      case VrmlData_NumericInputError:    aStr = "NumericInputError"; break;
+      case VrmlData_IrrelevantNumber:     aStr = "IrrelevantNumber"; break;
+      case VrmlData_BooleanInputError:    aStr = "BooleanInputError"; break;
+      case VrmlData_StringInputError:     aStr = "StringInputError"; break;
+      case VrmlData_NodeNameUnknown:      aStr = "NodeNameUnknown"; break;
+      case VrmlData_NonPositiveSize:      aStr = "NonPositiveSize"; break;
+      case VrmlData_ReadUnknownNode:      aStr = "ReadUnknownNode"; break;
+      case VrmlData_NonSupportedFeature:  aStr = "NonSupportedFeature"; break;
+      case VrmlData_OutputStreamUndefined:aStr = "OutputStreamUndefined"; break;
+      case VrmlData_NotImplemented:       aStr = "NotImplemented"; break;
+      default:
+        break;
       }
       if (aStr) {
         di << " ++ VRML Error: " << aStr << " in line "
index 88f021c..e183123 100755 (executable)
@@ -160,6 +160,9 @@ Standard_Boolean XmlMNaming_NamedShapeDriver::Paste
     case TNaming_SELECTED:
       aBld.Select(aNewShape, anOldShape);
       break;
+    case TNaming_REPLACE:
+      aBld.Modify(anOldShape,aNewShape);
+      break; // for compatibility
       //    case TNaming_REPLACE:
       //      aBld.Replace(anOldShape,aNewShape);
       //      break;
@@ -248,7 +251,7 @@ static const XmlObjMgt_DOMString& EvolutionString(const TNaming_Evolution i)
     case TNaming_MODIFY       : return ::EvolModifyString();
     case TNaming_DELETE       : return ::EvolDeleteString();
     case TNaming_SELECTED     : return ::EvolSelectedString();
-      //    case TNaming_REPLACE      : return ::EvolReplaceString();
+    case TNaming_REPLACE      : return ::EvolModifyString();  //    case TNaming_REPLACE      : return ::EvolReplaceString(); for compatibility
   default:
     Standard_DomainError::Raise("TNaming_Evolution; enum term unknown");
   }
index 083ddb4..65af8e2 100755 (executable)
@@ -25,7 +25,7 @@
 #include <Standard_Integer.hxx>
 
 // macro to get size of C array
-#define CARRAY_LENGTH(arr) (sizeof(arr)/sizeof(arr[0]))
+#define CARRAY_LENGTH(arr) (int)(sizeof(arr)/sizeof(arr[0]))
 
 void math_DoubleTab::Allocate()
 {
index cd4bdd1..39de762 100755 (executable)
@@ -22,7 +22,7 @@
 #include <Standard_Failure.hxx>
 
 // macro to get size of C array
-#define CARRAY_LENGTH(arr) (sizeof(arr)/sizeof(arr[0]))
+#define CARRAY_LENGTH(arr) (int)(sizeof(arr)/sizeof(arr[0]))
 
 math_SingleTab::math_SingleTab(const Standard_Integer LowerIndex,
                               const Standard_Integer UpperIndex) :