]> OCCT Git - occt-copy.git/commitdiff
0029151: GCC 7.1 warnings "this statement may fall through" [-Wimplicit-fallthrough=]
authorabv <abv@opencascade.com>
Thu, 28 Sep 2017 07:26:47 +0000 (10:26 +0300)
committerkgv <kgv@opencascade.com>
Mon, 4 Dec 2017 18:15:47 +0000 (21:15 +0300)
New macro Standard_FALLTHROUGH is defined for use in a switch statement immediately before a case label, if code associated with the previous case label may fall through to that
next label (i.e. does not end with "break" or "return" etc.).
This macro indicates that the fall through is intentional and should not be diagnosed by a compiler that warns on fallthrough.

The macro is inserted in places that currently generate such warning message and where fallthrough is intentional.

Doxygen comments are provided for this and other macros in Standard_Macro.hxx.

34 files changed:
src/APIHeaderSection/APIHeaderSection_EditHeader.cxx
src/Approx/Approx_CurvlinFunc.cxx
src/BRepLib/BRepLib_FindSurface.cxx
src/BRepTest/BRepTest_CheckCommands.cxx
src/BndLib/BndLib.cxx
src/BndLib/BndLib_AddSurface.cxx
src/Extrema/Extrema_ExtCS.cxx
src/GeomLib/GeomLib.cxx
src/GeometryTest/GeometryTest_ContinuityCommands.cxx
src/IFSelect/IFSelect_SessionPilot.cxx
src/IGESConvGeom/IGESConvGeom.cxx
src/IGESDraw/IGESDraw_GeneralModule.cxx
src/IGESDraw/IGESDraw_ToolDrawing.cxx
src/IGESToBRep/IGESToBRep_TopoSurface.cxx
src/IntPatch/IntPatch_ALineToWLine.cxx
src/IntPatch/IntPatch_ImpPrmIntersection.cxx
src/IntPatch/IntPatch_Intersection.cxx
src/IntTools/IntTools_EdgeEdge.cxx
src/Intrv/Intrv_Intervals.cxx
src/LDOM/LDOMBasicString.cxx
src/LDOM/LDOMParser.cxx
src/LDOM/LDOMString.cxx
src/LDOM/LDOM_XmlReader.cxx
src/Message/Message_MsgFile.cxx
src/NCollection/NCollection_UtfIterator.lxx
src/OpenGl/OpenGl_AspectMarker.cxx
src/ProjLib/ProjLib_ProjectOnPlane.cxx
src/STEPControl/STEPControl_ActorWrite.cxx
src/SelectMgr/SelectMgr_SelectionManager.cxx
src/Standard/Standard_Macro.hxx
src/TDataXtd/TDataXtd_Geometry.cxx
src/TNaming/TNaming_Name.cxx
src/UnitsAPI/UnitsAPI.cxx
src/ViewerTest/ViewerTest_AutoUpdater.cxx

index 92a12f5330978ef279b13ef05ddef01490b5feb7..51adb10c11a7f5e379b6bf791d07c7192b5695bd 100644 (file)
@@ -45,29 +45,34 @@ static Standard_Boolean IsTimeStamp
     case  4 : if (uncar < '0' || uncar > '9') return Standard_False;
       break;
     case  5 : if (uncar != '-') return Standard_False;
+      Standard_FALLTHROUGH
     case  6 : if (uncar != '0' && uncar != '1') return Standard_False;
       break;
     case  7 : if (uncar < '0' || uncar > '9') return Standard_False;
       if (dizmois == '1' && (uncar < '0' || uncar > '2')) return Standard_False;
       break;
     case  8 : if (uncar != '-') return Standard_False;
+      Standard_FALLTHROUGH
     case  9 : if (uncar < '0' || uncar > '3') return Standard_False;
       break;
     case 10 : if (uncar < '0' || uncar > '9') return Standard_False;
       if (dizjour == '3' && (uncar != '0' && uncar != '1')) return Standard_False;
       break;
     case 11 : if (uncar != 'T') return Standard_False;
+      Standard_FALLTHROUGH
     case 12 : if (uncar < '0' || uncar > '2') return Standard_False;
       break;
     case 13 : if (uncar < '0' || uncar > '9') return Standard_False;
       if (dizheur == '2' && (uncar < '0' || uncar > '3')) return Standard_False;
       break;
     case 14 : if (uncar != ':') return Standard_False;
+      Standard_FALLTHROUGH
     case 15 : if (uncar < '0' || uncar > '5') return Standard_False;
       break;
     case 16 : if (uncar < '0' || uncar > '9') return Standard_False;
       break;
     case 17 : if (uncar != ':') return Standard_False;
+      Standard_FALLTHROUGH
     case 18 : if (uncar < '0' || uncar > '5') return Standard_False;
       break;
     case 19 : if (uncar < '0' || uncar > '9') return Standard_False;
index 35e10c7d7e1546a5eef5d90e03a94427e97ca294..37aadf579f8d3c897643246f8659072d939d4e86 100644 (file)
@@ -354,6 +354,7 @@ void Approx_CurvlinFunc::Trim(const Standard_Real First, const Standard_Real Las
     myC2D2 = ((Adaptor3d_CurveOnSurface *)(&(HCurOnSur->Curve())))->GetCurve();
     mySurf2 = ((Adaptor3d_CurveOnSurface *)(&(HCurOnSur->Curve())))->GetSurface();
 
+    Standard_FALLTHROUGH
   case 2:
     CurOnSur.Load(myC2D1);
     CurOnSur.Load(mySurf1);
index 64451fb673dee5b79434f9a075d1213eee3851cb..998176d3656a9b25b2786a4db544f4549fb11b9e 100644 (file)
@@ -361,12 +361,9 @@ void BRepLib_FindSurface::Init(const TopoDS_Shape&    S,
     case GeomAbs_Ellipse:
     case GeomAbs_Hyperbola:
     case GeomAbs_Parabola:
-      if (c.GetType() == GeomAbs_Line)
-        // Two points on straight segment
-        iNbPoints=2;
-      else
-        // Four points on otheranalitical curves
-        iNbPoints=4;
+      // Two points on straight segment, Four points on otheranalitical curves
+      iNbPoints = (c.GetType() == GeomAbs_Line ? 2 : 4);
+      Standard_FALLTHROUGH
     default:
       { 
         // Put some points on other curves
index e35547afbb5ad6825bb37a9f2b22c593a7d53473..d4e0ef75e5ab29bb12987402062bef847d44cec8 100644 (file)
@@ -1091,12 +1091,16 @@ static Standard_Integer shapeG1continuity (Draw_Interpretor& di, Standard_Intege
   nbeval = (Standard_Integer ) Draw::Atof( a[3]);
 
   switch(n)
-    { case 7  : epsG1 = Draw::Atof(a[6]);
-      case 6  : epsC0   = Draw::Atof(a[5]);
-      case 5  : epsnl    = Draw::Atof(a[4]);
-      case 4  : {} break;
-      default : return 1;
-    }
+  { 
+  case 7  : epsG1 = Draw::Atof(a[6]);
+    Standard_FALLTHROUGH
+  case 6  : epsC0 = Draw::Atof(a[5]);
+    Standard_FALLTHROUGH
+  case 5  : epsnl = Draw::Atof(a[4]);
+    Standard_FALLTHROUGH
+  case 4  : break;
+  default : return 1;
+  }
 
 
   Standard_Real pard1, parf1, U, Uf, deltaU, nb = 0;
@@ -1216,12 +1220,14 @@ static Standard_Integer shapeG0continuity (Draw_Interpretor& di, Standard_Intege
   nbeval = (Standard_Integer ) Draw::Atof( a[3]);
 
   switch(n)
-    { case 6  : epsC0   = Draw::Atof(a[5]);
-      case 5  : epsnl    = Draw::Atof(a[4]);
-      case 4  : {} break;
-      default : return 1;
-    }
-
+  { 
+  case 6  : epsC0   = Draw::Atof(a[5]);
+    Standard_FALLTHROUGH
+  case 5  : epsnl    = Draw::Atof(a[4]);
+    Standard_FALLTHROUGH
+  case 4  : break;
+  default : return 1;
+  }
 
   Standard_Real pard1, parf1, U, Uf, deltaU, nb = 0;
   Standard_Boolean isconti = Standard_True;
@@ -1337,15 +1343,20 @@ static Standard_Integer shapeG2continuity (Draw_Interpretor& di, Standard_Intege
   nbeval = (Standard_Integer ) Draw::Atof( a[3]);
 
   switch(n)
-    { 
-      case 9  :  maxlen   = Draw::Atof(a[8]);
-      case 8   : percent   = Draw::Atof(a[7]);      
-      case 7   : epsG1 = Draw::Atof(a[6]);
-      case 6  :  epsC0   = Draw::Atof(a[5]);
-      case 5  :  epsnl   = Draw::Atof(a[4]);
-      case 4  : {} break;
-      default : return 1;
-    }
+  { 
+  case 9  :  maxlen = Draw::Atof(a[8]);
+    Standard_FALLTHROUGH
+  case 8   : percent = Draw::Atof(a[7]);      
+    Standard_FALLTHROUGH
+  case 7   : epsG1 = Draw::Atof(a[6]);
+    Standard_FALLTHROUGH
+  case 6  :  epsC0 = Draw::Atof(a[5]);
+    Standard_FALLTHROUGH
+  case 5  :  epsnl = Draw::Atof(a[4]);
+    Standard_FALLTHROUGH
+  case 4  : break;
+  default : return 1;
+  }
 
 
   Standard_Real pard1, parf1, U, Uf, deltaU, nb = 0;
index 2f2ef919c01573240836ec4d98eeb4842c7968bd..5b67936abe59e299828fba98f2179b8973881e11 100644 (file)
@@ -137,71 +137,85 @@ namespace
         addPoint1;
         if (aFin <= 1) break;
       }
+      Standard_FALLTHROUGH
     case 2:
       {
         addPoint2;
         if (aFin <= 2) break;
       }
+      Standard_FALLTHROUGH
     case 3:
       {
         addPoint3;
         if (aFin <= 3) break;
       }
+      Standard_FALLTHROUGH
     case 4:
       {
         addPoint4;
         if (aFin <= 4) break;
       }
+      Standard_FALLTHROUGH
     case 5:
       {
         addPoint5;
         if (aFin <= 5) break;
       }
+      Standard_FALLTHROUGH
     case 6:
       {
         addPoint6;
         if (aFin <= 6) break;
       }
+      Standard_FALLTHROUGH
     case 7:
       {
         addPoint7;
         if (aFin <= 7) break;
       }
+      Standard_FALLTHROUGH
     case 8:
       {
         addPoint0;
         if (aFin <= 8) break;
       }
+      Standard_FALLTHROUGH
     case 9:
       {
         addPoint1;
         if (aFin <= 9) break;
       }  
+      Standard_FALLTHROUGH
     case 10:
       {
         addPoint2;
         if (aFin <= 10) break;
       }
+      Standard_FALLTHROUGH
     case 11:
       {
         addPoint3;
         if (aFin <= 11) break;
       }  
+      Standard_FALLTHROUGH
     case 12:
       {
         addPoint4;
         if (aFin <= 12) break;
       }  
+      Standard_FALLTHROUGH
     case 13:
       {
         addPoint5;
         if (aFin <= 13) break;
       }
+      Standard_FALLTHROUGH
     case 14:
       {
         addPoint6;
         if (aFin <= 14) break;
       }
+      Standard_FALLTHROUGH
     case 15:
       {
         addPoint7;
@@ -1271,41 +1285,49 @@ void BndLib::Add(const gp_Torus& S,const Standard_Real UMin,
       addP0;
       if (Fi2 <= 0) break;
     }
+    Standard_FALLTHROUGH
   case 1 : 
     {
       addP1;
       if (Fi2 <= 1) break;
     }
+    Standard_FALLTHROUGH
   case 2 :  
     {
       addP2;
       if (Fi2 <= 2) break;
     }
+    Standard_FALLTHROUGH
   case 3 :  
     {
       addP3;
       if (Fi2 <= 3) break;
     }
+    Standard_FALLTHROUGH
   case 4 :  
     {
       addP4;
       if (Fi2 <= 4) break;
     }
+    Standard_FALLTHROUGH
   case 5 :  
     {
       addP5;
       if (Fi2 <= 5) break;
     }
+    Standard_FALLTHROUGH
   case 6 :  
     {
       addP6;
       if (Fi2 <= 6) break;
     }
+    Standard_FALLTHROUGH
   case 7 :  
     {
       addP7;
       if (Fi2 <= 7) break;
     }
+    Standard_FALLTHROUGH
   case 8 :  
   default :
     {
@@ -1313,18 +1335,25 @@ void BndLib::Add(const gp_Torus& S,const Standard_Real UMin,
       switch (Fi2) {
       case 15 :  
         addP7;
+        Standard_FALLTHROUGH
       case 14 :  
         addP6;
+        Standard_FALLTHROUGH
       case 13 :  
         addP5;
+        Standard_FALLTHROUGH
       case 12 :  
         addP4;
+        Standard_FALLTHROUGH
       case 11 :  
         addP3;
+        Standard_FALLTHROUGH
       case 10 :  
         addP2;
+        Standard_FALLTHROUGH
       case 9 : 
         addP1;
+        Standard_FALLTHROUGH
       case 8 : 
         break;
       }    
index b2f23ceeffd21dec869b558edf75ec689e5fda36..d55bddd3d6320085c250581c87007c0ac2841385 100644 (file)
@@ -460,6 +460,7 @@ void BndLib_AddSurface::Add(const Adaptor3d_Surface& S,
           break;
       }
     }
+    Standard_FALLTHROUGH
   default: 
     {
       Standard_Integer Nu = NbUSamples(S);
index 1b8ae22f282830517e0f32a9d1b71c9e906a14bb..4b953656bd319238b99870fbf1bfa711b5ae53e0 100644 (file)
@@ -129,6 +129,7 @@ void Extrema_ExtCS::Perform(const Adaptor3d_Curve& C,
       case GeomAbs_Plane:
         myExtElCS.Perform(C.Line(), myS->Plane());
         if (myExtElCS.IsParallel())   break;
+        Standard_FALLTHROUGH
 
       case GeomAbs_Torus:
       case GeomAbs_Cone:
@@ -233,6 +234,7 @@ void Extrema_ExtCS::Perform(const Adaptor3d_Curve& C,
         break;
       }
     }
+    Standard_FALLTHROUGH
   case GeomAbs_Hyperbola: 
     {
       if(myCtype == GeomAbs_Hyperbola && myStype == GeomAbs_Plane) {
@@ -241,6 +243,7 @@ void Extrema_ExtCS::Perform(const Adaptor3d_Curve& C,
         break;
       }
     }
+    Standard_FALLTHROUGH
   default:
     {
       Extrema_GenExtCS Ext;
index 5d7b6a2489260795ca4257e4d71fb9e070c17f4b..da9ae9a9b4a15fa6beb5f8a2b07b4e0af2844989 100644 (file)
@@ -2495,6 +2495,7 @@ void GeomLib::IsClosed (const Handle(Geom_Surface)& S,
         return;
       }
     }
+    Standard_FALLTHROUGH
     case GeomAbs_Cylinder:
     {
       if(Precision::IsInfinite(v1))
index 449bf4d46d57999a6ba471ef45592e147c4f1d0e..abe6b42fa45c9abc9758bdf31774de4b5f00b6cd 100644 (file)
@@ -60,7 +60,8 @@ void InitEpsCurv(Standard_Real&  epsnl ,Standard_Real&  epsdis, Standard_Real& e
 /*********************************************************************************/
 
 static Standard_Integer surfaceCcontinuity (Draw_Interpretor& di, Standard_Integer n, const char** a)
-{ Standard_Real U1, U2, V1, V2, u1, u2, v1, v2;
+{ 
+  Standard_Real U1, U2, V1, V2, u1, u2, v1, v2;
   GeomAbs_Shape TypeCont; 
   Standard_Integer ord;
   Standard_Boolean b1, b2, b3, b4;
@@ -75,86 +76,100 @@ static Standard_Integer surfaceCcontinuity (Draw_Interpretor& di, Standard_Integ
   Handle(Geom_Surface) surf2 = DrawTrSurf::GetSurface(a[5]);
   if (surf2.IsNull()) return 1;
    
-      U1 = Draw::Atof(a[3]);
-      U2 = Draw::Atof(a[6]);
-      V1 = Draw::Atof(a[4]); 
-      V2 = Draw::Atof(a[7]); 
+  U1 = Draw::Atof(a[3]);
+  U2 = Draw::Atof(a[6]);
+  V1 = Draw::Atof(a[4]); 
+  V2 = Draw::Atof(a[7]); 
 
-      ord = Draw::Atoi(a[1]);
+  ord = Draw::Atoi(a[1]);
 
-      surf1->Bounds(u1, u2, v1, v2);
-      b1 = ((((U1>=u1)&&(U1<=u2))||((U1<=u1)&&(U1>=u2))));
-      b3 = ((((V1>=v1)&&(V1<=v2))||((V1<=v1)&&(V1>=v2))));
+  surf1->Bounds(u1, u2, v1, v2);
+  b1 = ((((U1>=u1)&&(U1<=u2))||((U1<=u1)&&(U1>=u2))));
+  b3 = ((((V1>=v1)&&(V1<=v2))||((V1<=v1)&&(V1>=v2))));
 
-      surf2->Bounds(u1, u2, v1, v2);
-      b2 = ((((U2>=u1)&&(U2<=u2))||((U2<=u1)&&(U2>=u2))));
-      b4 = ((((V2>=v1)&&(V2<=v2))||((V2<=v1)&&(V2>=v2))));
-     
-      if (!((b1 && b2)&&(b3 && b4))) return 1;
+  surf2->Bounds(u1, u2, v1, v2);
+  b2 = ((((U2>=u1)&&(U2<=u2))||((U2<=u1)&&(U2>=u2))));
+  b4 = ((((V2>=v1)&&(V2<=v2))||((V2<=v1)&&(V2>=v2))));
 
-       switch ( ord )
-       { case 0 : { TypeCont=GeomAbs_C0;
-                    switch(n)
-                       { case 10  : epsC0= Draw::Atof(a[9]);
-                         case 9   : epsnl = Draw::Atof(a[8]);
-                         case 8 : {} break;
-                         default : return 1;
-                       } 
-                   LocalAnalysis_SurfaceContinuity RES (surf1, U1, V1, surf2, U2, V2, 
-                    TypeCont,epsnl,epsC0,epsC1,epsC2,epsG1,perce,maxlen);
-                   //LocalAnalysis::Dump(RES,cout);
-                   Standard_SStream aSStream;
-                   LocalAnalysis::Dump(RES,aSStream);
-                   di << aSStream;
-                 } 
-                 break;
-        case 1 : { TypeCont=GeomAbs_C1;
-                     switch(n)
-                       { case 11 : epsC1=Draw::Atof(a[10]); 
-                          case 10  : epsC0= Draw::Atof(a[9]);
-                         case 9  : epsnl = Draw::Atof(a[8]);
-                         case 8  : {} break;
-                         default : return 1;
-                       } 
-                   LocalAnalysis_SurfaceContinuity RES (surf1, U1, V1, surf2, U2, V2, 
-                    TypeCont,epsnl,epsC0,epsC1,epsC2,epsG1,perce,maxlen );
-                   //LocalAnalysis::Dump(RES,cout);
-                   Standard_SStream aSStream;
-                   LocalAnalysis::Dump(RES,aSStream);
-                   di << aSStream;
-     
-                 } 
-                 break;
-        case 2 : { TypeCont=GeomAbs_C2;
-                    switch(n)
-                      {
-                          case 12 : epsC2= Draw::Atof(a[11]); 
-                          case 11 : epsC1=Draw::Atof(a[10]); 
-                          case 10 : epsC0= Draw::Atof(a[9]);
-                         case 9  : epsnl = Draw::Atof(a[8]);
-                         case 8  : {} break;
-                         default : return 1;
-                       } 
-                   LocalAnalysis_SurfaceContinuity RES (surf1, U1, V1, surf2, U2, V2, 
-                           TypeCont, epsnl,epsC0,epsC1,epsC2,epsG1,perce,maxlen  );
-                    //LocalAnalysis::Dump(RES,cout);    
-                   Standard_SStream aSStream;
-                    LocalAnalysis::Dump(RES,aSStream);    
-                   di << aSStream;
-                 }
-                 break;
-
-        
-        default : {} 
-       }
-   return 0; 
+  if (!((b1 && b2)&&(b3 && b4))) return 1;
+
+  switch ( ord )
+  { 
+  case 0 : 
+    { 
+      TypeCont = GeomAbs_C0;
+      switch(n)
+      { 
+      case 10: epsC0 = Draw::Atof(a[9]);
+        Standard_FALLTHROUGH
+      case 9 : epsnl = Draw::Atof(a[8]);
+        Standard_FALLTHROUGH
+      case 8 : break;
+      default : 
+        std::cerr << "Error: invalid number of arguments: expected to get 8 - 10 parameters" << std::endl;
+        return 1;
+      } 
+    } 
+    break;
+
+  case 1 : 
+    { 
+      TypeCont = GeomAbs_C1;
+      switch(n)
+      { 
+      case 11 : epsC1 = Draw::Atof(a[10]); 
+        Standard_FALLTHROUGH
+      case 10 : epsC0 = Draw::Atof(a[9]);
+        Standard_FALLTHROUGH
+      case 9  : epsnl = Draw::Atof(a[8]);
+        Standard_FALLTHROUGH
+      case 8  : break;
+      default : 
+        std::cerr << "Error: invalid number of arguments: expected to get 8 - 11 parameters" << std::endl;
+        return 1;
+      } 
+    } 
+    break;
+
+  case 2 : 
+    { 
+      TypeCont = GeomAbs_C2;
+      switch(n)
+      {
+      case 12 : epsC2 = Draw::Atof(a[11]); 
+        Standard_FALLTHROUGH
+      case 11 : epsC1 = Draw::Atof(a[10]); 
+        Standard_FALLTHROUGH
+      case 10 : epsC0 = Draw::Atof(a[9]);
+        Standard_FALLTHROUGH
+      case 9  : epsnl = Draw::Atof(a[8]);
+        Standard_FALLTHROUGH
+      case 8  : break;
+      default : 
+        std::cerr << "Error: invalid number of arguments: expected to get 8 - 12 parameters" << std::endl;
+        return 1;
+      } 
+    }
+    break;
+  default:
+    std::cerr << "Error: invalid value of parameter 1 (" << a[1] << "): should be 0, 1, or 2" << std::endl;
+    return 1;
+  }
+
+  LocalAnalysis_SurfaceContinuity RES (surf1, U1, V1, surf2, U2, V2, 
+                                       TypeCont, epsnl, epsC0, epsC1, epsC2, epsG1, perce, maxlen);
+  //LocalAnalysis::Dump(RES,cout);    
+  Standard_SStream aSStream;
+  LocalAnalysis::Dump(RES,aSStream);    
+  di << aSStream;
+  return 0; 
 }
 
 /*********************************************************************************/
 
 static Standard_Integer surfaceGcontinuity (Draw_Interpretor& di, Standard_Integer n, const char** a)
-{ Standard_Real U1, U2, V1, V2,u1, u2, v1, v2;
+{ 
+  Standard_Real U1, U2, V1, V2,u1, u2, v1, v2;
   GeomAbs_Shape TypeCont; 
   Standard_Integer ord;
   Standard_Boolean b1, b2, b3, b4;
@@ -169,72 +184,86 @@ static Standard_Integer surfaceGcontinuity (Draw_Interpretor& di, Standard_Integ
   Handle(Geom_Surface) surf2 = DrawTrSurf::GetSurface(a[5]);
   if (surf2.IsNull()) return 1;
    
-      U1 = Draw::Atof(a[3]);
-      U2 = Draw::Atof(a[6]);
-      V1 = Draw::Atof(a[4]); 
-      V2 = Draw::Atof(a[7]); 
+  U1 = Draw::Atof(a[3]);
+  U2 = Draw::Atof(a[6]);
+  V1 = Draw::Atof(a[4]); 
+  V2 = Draw::Atof(a[7]); 
 
-      ord = Draw::Atoi(a[1]);
+  ord = Draw::Atoi(a[1]);
 
-      surf1->Bounds(u1, u2, v1, v2);
-      b1 = ((((U1>=u1)&&(U1<=u2))||((U1<=u1)&&(U1>=u2))));
-      b3 = ((((V1>=v1)&&(V1<=v2))||((V1<=v1)&&(V1>=v2))));
+  surf1->Bounds(u1, u2, v1, v2);
+  b1 = ((((U1>=u1)&&(U1<=u2))||((U1<=u1)&&(U1>=u2))));
+  b3 = ((((V1>=v1)&&(V1<=v2))||((V1<=v1)&&(V1>=v2))));
 
-      surf2->Bounds(u1, u2, v1, v2);
-      b2 = ((((U2>=u1)&&(U2<=u2))||((U2<=u1)&&(U2>=u2))));
-      b4 = ((((V2>=v1)&&(V2<=v2))||((V2<=v1)&&(V2>=v2))));
-     
-      if (!((b1 && b2)&&(b3 && b4))) return 1;
+  surf2->Bounds(u1, u2, v1, v2);
+  b2 = ((((U2>=u1)&&(U2<=u2))||((U2<=u1)&&(U2>=u2))));
+  b4 = ((((V2>=v1)&&(V2<=v2))||((V2<=v1)&&(V2>=v2))));
 
-       switch ( ord )
-       { 
-        case 1 : { TypeCont=GeomAbs_G1;
-                     switch(n)
-                        { case 11 : epsG1=Draw::Atof(a[10]); 
-                          case 10  : epsC0= Draw::Atof(a[9]);
-                         case 9  : epsnl = Draw::Atof(a[8]);
-                         case 8  : {} break;
-                         default : return 1;
-                       } 
-                  LocalAnalysis_SurfaceContinuity RES (surf1, U1, V1, surf2, U2, V2, 
-                      TypeCont,epsnl,epsC0,epsC1,epsC2,epsG1,perce,maxlen );
-                   //LocalAnalysis::Dump(RES,cout);
-                   Standard_SStream aSStream;
-                   LocalAnalysis::Dump(RES,aSStream);
-                   di << aSStream;
-    
-                 } 
-                 break;
-        case 2 : { TypeCont=GeomAbs_G2;
-                    switch(n)
-                     {   case 13 : maxlen =Draw::Atof (a[12]);
-                          case 12 :  perce=Draw::Atof(a[11]); 
-                          case 11 : epsG1=Draw::Atof(a[10]); 
-                          case 10 : epsC0= Draw::Atof(a[9]);
-                         case 9  : epsnl = Draw::Atof(a[8]);
-                         case 8  : {} break;
-                         default : return 1;
-                       } 
-                  LocalAnalysis_SurfaceContinuity RES (surf1, U1, V1, surf2, U2, V2, 
-                          TypeCont, epsnl,epsC0,epsC1,epsC2,epsG1,perce,maxlen  ); 
-                   //LocalAnalysis::Dump(RES,cout);
-                   Standard_SStream aSStream;
-                   LocalAnalysis::Dump(RES,aSStream);
-                   di << aSStream;
-                 }
-                 break;
-
-        
-        default : {} 
-       }
-   return 0;  
+  if (!((b1 && b2)&&(b3 && b4))) return 1;
+
+
+  switch ( ord )
+  { 
+  case 1 : 
+    { 
+      TypeCont = GeomAbs_G1;
+      switch(n)
+      { 
+      case 11 : epsG1 = Draw::Atof(a[10]); 
+        Standard_FALLTHROUGH
+      case 10 : epsC0 = Draw::Atof(a[9]);
+        Standard_FALLTHROUGH
+      case 9  : epsnl = Draw::Atof(a[8]);
+        Standard_FALLTHROUGH
+      case 8  : break;
+      default : 
+        std::cerr << "Error: invalid number of arguments: expected to get 8 - 11 parameters" << std::endl;
+        return 1;
+      } 
+    } 
+    break;
+
+  case 2 : 
+    { 
+      TypeCont = GeomAbs_G2;
+      switch(n)
+      {
+      case 13 : maxlen = Draw::Atof (a[12]);
+        Standard_FALLTHROUGH
+      case 12 : perce = Draw::Atof(a[11]); 
+        Standard_FALLTHROUGH
+      case 11 : epsG1 = Draw::Atof(a[10]); 
+        Standard_FALLTHROUGH
+      case 10 : epsC0 = Draw::Atof(a[9]);
+        Standard_FALLTHROUGH
+      case 9  : epsnl = Draw::Atof(a[8]);
+        Standard_FALLTHROUGH
+      case 8  : break;
+      default : 
+        std::cerr << "Error: invalid number of arguments: expected to get 8 - 13 parameters" << std::endl;
+        return 1;
+      } 
+    }
+    break;
+  default:
+    std::cerr << "Error: invalid value of parameter 1 (" << a[1] << "): should be 1 or 2" << std::endl;
+    return 1;
+  }
+  
+  LocalAnalysis_SurfaceContinuity RES (surf1, U1, V1, surf2, U2, V2, 
+                                       TypeCont, epsnl, epsC0, epsC1, epsC2, epsG1, perce, maxlen);
+  //LocalAnalysis::Dump(RES,cout);
+  Standard_SStream aSStream;
+  LocalAnalysis::Dump(RES,aSStream);
+  di << aSStream;
+  return 0;  
 }
 
 /*********************************************************************************/
 
 static Standard_Integer curveGcontinuity(Draw_Interpretor& di, Standard_Integer n, const char** a)
-{ Standard_Real U1, U2, u1, u2;
+{ 
+  Standard_Real U1, U2, u1, u2;
   GeomAbs_Shape  TypeCont; 
   Standard_Integer ord;
   Standard_Boolean b1, b2;
@@ -263,53 +292,69 @@ static Standard_Integer curveGcontinuity(Draw_Interpretor& di, Standard_Integer
 
   InitEpsCurv( epsnl,epsC0, epsC1, epsC2, epsG1, epsG2, percent,maxlen);
   switch ( ord )
-       
-         case 1 : {
-                    switch(n)
-                       { case 9 :  epsG1=Draw::Atof(a[8]); 
-                          case 8  : epsC0= Draw::Atof(a[7]);
-                         case 7  : epsnl = Draw::Atof(a[6]);
-                         case 6  : {} break;
-                         default : return 1;
-                       }                         
-                    TypeCont=GeomAbs_G1;
-                   LocalAnalysis_CurveContinuity RES (curv1, U1, curv2, U2, TypeCont, 
-                    epsnl,epsC0, epsC1, epsC2, epsG1,epsG2,percent,maxlen  );
-                    //LocalAnalysis::Dump(RES,cout); 
-                   Standard_SStream aSStream;
-                    LocalAnalysis::Dump(RES,aSStream); 
-                   di << aSStream;
-                 } 
-                 break;
-        case 2 : { 
-                    TypeCont=GeomAbs_G2;
-                    switch(n)
-                      {case 12 :maxlen =Draw::Atof(a[11]);
-                       case  11 :percent=Draw::Atof(a[10]);
-                        case 10 : epsG2= Draw::Atof(a[9]); 
-                        case 9 : epsG1=Draw::Atof(a[8]); 
-                        case 8  : epsC0= Draw::Atof(a[7]);
-                       case 7  : epsnl = Draw::Atof(a[6]);
-                       case 6  : {} break;
-                       default : return 1;
-                       } 
-                    LocalAnalysis_CurveContinuity RES (curv1, U1, curv2, U2, TypeCont,
-                         epsnl,epsC0, epsC1, epsC2, epsG1, epsG2,percent,maxlen  );
-                     //LocalAnalysis::Dump(RES,cout);   
-                   Standard_SStream aSStream;
-                   LocalAnalysis::Dump(RES,aSStream);   
-                   di << aSStream;
-                 }
-                 break; 
-        default : {}
-       }
-    return 0; 
+  { 
+  case 1 : 
+    {
+      TypeCont = GeomAbs_G1;
+      switch(n)
+      { 
+      case 9 :  epsG1 = Draw::Atof(a[8]); 
+        Standard_FALLTHROUGH
+      case 8  : epsC0 = Draw::Atof(a[7]);
+        Standard_FALLTHROUGH
+      case 7  : epsnl = Draw::Atof(a[6]);
+        Standard_FALLTHROUGH
+      case 6  : break;
+      default : 
+        std::cerr << "Error: invalid number of arguments: expected to get 6 - 8 parameters" << std::endl;
+        return 1;
+      }                         
+    } 
+    break;
+  case 2 : 
+    { 
+      TypeCont = GeomAbs_G2;
+      switch(n)
+      {
+      case 12 : maxlen = Draw::Atof(a[11]);
+        Standard_FALLTHROUGH
+      case 11 : percent = Draw::Atof(a[10]);
+        Standard_FALLTHROUGH
+      case 10 : epsG2 = Draw::Atof(a[9]); 
+        Standard_FALLTHROUGH
+      case 9  : epsG1 = Draw::Atof(a[8]); 
+        Standard_FALLTHROUGH
+      case 8  : epsC0 = Draw::Atof(a[7]);
+        Standard_FALLTHROUGH
+      case 7  : epsnl = Draw::Atof(a[6]);
+        Standard_FALLTHROUGH
+      case 6  : break;
+      default : 
+        std::cerr << "Error: invalid number of arguments: expected to get 6 - 12 parameters" << std::endl;
+        return 1;
+      } 
     }
+    break; 
+
+  default:
+    std::cerr << "Error: invalid value of parameter 1 (" << a[1] << "): should be 1 or 2" << std::endl;
+    return 1;
+  }
+
+  LocalAnalysis_CurveContinuity RES (curv1, U1, curv2, U2, TypeCont,
+                                     epsnl, epsC0, epsC1, epsC2, epsG1, epsG2, percent, maxlen);
+  //LocalAnalysis::Dump(RES,cout);   
+  Standard_SStream aSStream;
+  LocalAnalysis::Dump(RES,aSStream);   
+  di << aSStream;
+  return 0; 
+}
 
 /*********************************************************************************/
 
 static Standard_Integer curveCcontinuity(Draw_Interpretor& di, Standard_Integer n, const char** a)
-{ Standard_Real U1, U2, u1, u2;
+{ 
+  Standard_Real U1, U2, u1, u2;
   GeomAbs_Shape  TypeCont; 
   Standard_Integer ord;
   Standard_Boolean b1, b2;
@@ -321,77 +366,94 @@ static Standard_Integer curveCcontinuity(Draw_Interpretor& di, Standard_Integer
   Handle(Geom_Curve) curv2 = DrawTrSurf::GetCurve(a[4]);
   if (curv2.IsNull()) return 1;
 
-   U1 = Draw::Atof(a[3]);
-   U2 = Draw::Atof(a[5]);
-   ord = Draw::Atoi(a[1]);
+  U1 = Draw::Atof(a[3]);
+  U2 = Draw::Atof(a[5]);
 
-   u1=curv1->FirstParameter();
-   u2=curv1->LastParameter();
-   b1 = ((((U1>=u1)&&(U1<=u2))||((U1<=u1)&&(U1>=u2))));
-   
-   u1=curv2->FirstParameter();
-   u2=curv2->LastParameter();   
-   b2 = ((((U2>=u1)&&(U2<=u2))||((U2<=u1)&&(U2>=u2))));
-     
-   if (!(b1 && b2)) return 1;
-
-
-   InitEpsCurv( epsnl,epsC0, epsC1, epsC2, epsG1, epsG2, percent,maxlen);
-   switch ( ord )
-       { case 0 : {  switch(n)
-                       { case 8  : epsC0= Draw::Atof(a[7]);
-                         case 7  : epsnl = Draw::Atof(a[6]);
-                         case 6  : {} break;
-                         default : return 1;
-                       }                     
-                      TypeCont=GeomAbs_C0;
-                     LocalAnalysis_CurveContinuity  RES (curv1, U1, curv2, U2, TypeCont,
-                       epsnl,epsC0, epsC1, epsC2, epsG1,epsG2,percent,maxlen  );
-                    //LocalAnalysis::Dump(RES,cout);
-                    Standard_SStream aSStream;
-                    LocalAnalysis::Dump(RES,aSStream);
-                    di << aSStream;
-
-                  }  break;
-        case 1 : { switch(n)
-                       { case 9 : epsC1 =Draw::Atof(a[8]);
-                          case 8  : epsC0= Draw::Atof(a[7]);
-                         case 7  : epsnl = Draw::Atof(a[6]);
-                         case 6  : {} break;
-                         default : return 1;
-                       }                          
-                    TypeCont=GeomAbs_C1;
-                   LocalAnalysis_CurveContinuity RES (curv1, U1, curv2, U2, TypeCont, 
-                    epsnl,epsC0, epsC1, epsC2, epsG1,epsG2,percent,maxlen  );
-                    //LocalAnalysis::Dump(RES,cout); 
-                   Standard_SStream aSStream;
-                    LocalAnalysis::Dump(RES,aSStream); 
-                   di << aSStream;
-                  
-                 } break;
-        case 2 : {  TypeCont=GeomAbs_C2;
-                     switch(n)
-                      {
-                          case 10 : epsC2= Draw::Atof(a[9]); 
-                          case 9  : epsC1=Draw::Atof(a[8]); 
-                          case 8  : epsC0= Draw::Atof(a[7]);
-                         case 7  : epsnl = Draw::Atof(a[6]);
-                         case 6  : {} break;
-                         default : return 1;
-                       } 
-                   LocalAnalysis_CurveContinuity RES (curv1, U1, curv2, U2, TypeCont, 
-                    epsnl,epsC0, epsC1, epsC2, epsG1, epsG2,percent,maxlen  );
-                    //LocalAnalysis::Dump(RES,cout);   
-                   Standard_SStream aSStream;
-                    LocalAnalysis::Dump(RES,aSStream);   
-                   di << aSStream;
-                 }
-                 break; 
-        default : {}
-       }
-    return 0;
+  ord = Draw::Atoi(a[1]);
+
+  u1=curv1->FirstParameter();
+  u2=curv1->LastParameter();
+  b1 = ((((U1>=u1)&&(U1<=u2))||((U1<=u1)&&(U1>=u2))));
+
+  u1=curv2->FirstParameter();
+  u2=curv2->LastParameter();   
+  b2 = ((((U2>=u1)&&(U2<=u2))||((U2<=u1)&&(U2>=u2))));
+
+  if (!(b1 && b2)) return 1;
+
+  InitEpsCurv( epsnl,epsC0, epsC1, epsC2, epsG1, epsG2, percent,maxlen);
+  switch ( ord )
+  { 
+  case 0 : 
+    {
+      TypeCont = GeomAbs_C0;
+      switch(n)
+      { 
+      case 8  : epsC0 = Draw::Atof(a[7]);
+        Standard_FALLTHROUGH
+      case 7  : epsnl = Draw::Atof(a[6]);
+        Standard_FALLTHROUGH
+      case 6  : break;
+      default : 
+        std::cerr << "Error: invalid number of arguments: expected to get 6 - 8 parameters" << std::endl;
+        return 1;
+      }
+    }  
+    break;
+  case 1 : 
+    { 
+      TypeCont = GeomAbs_C1;
+      switch(n)
+      { 
+      case 9 : epsC1 = Draw::Atof(a[8]);
+        Standard_FALLTHROUGH
+      case 8 : epsC0 = Draw::Atof(a[7]);
+        Standard_FALLTHROUGH
+      case 7 : epsnl = Draw::Atof(a[6]);
+        Standard_FALLTHROUGH
+      case 6 : break;
+      default : 
+        std::cerr << "Error: invalid number of arguments: expected to get 6 - 9 parameters" << std::endl;
+        return 1;
+      }                          
+    } 
+    break;
+
+  case 2 : 
+    {  
+      TypeCont = GeomAbs_C2;
+      switch(n)
+      {
+      case 10 : epsC2 = Draw::Atof(a[9]); 
+        Standard_FALLTHROUGH
+      case 9  : epsC1 = Draw::Atof(a[8]); 
+        Standard_FALLTHROUGH
+      case 8  : epsC0 = Draw::Atof(a[7]);
+        Standard_FALLTHROUGH
+      case 7  : epsnl = Draw::Atof(a[6]);
+        Standard_FALLTHROUGH
+      case 6  : break;
+      default : 
+        std::cerr << "Error: invalid number of arguments: expected to get 6 - 10 parameters" << std::endl;
+        return 1;
+      } 
     }
+    break; 
+
+  default:
+    std::cerr << "Error: invalid value of parameter 1 (" << a[1] << "): should be 0, 1, or 2" << std::endl;
+    return 1;
+  }
+
+  LocalAnalysis_CurveContinuity RES (curv1, U1, curv2, U2, TypeCont, 
+                                     epsnl, epsC0, epsC1, epsC2, epsG1, epsG2, percent, maxlen);
+  //LocalAnalysis::Dump(RES,cout);   
+  Standard_SStream aSStream;
+  LocalAnalysis::Dump(RES,aSStream);   
+  di << aSStream;
+  return 0;
+}
+
 /***************************************************************************/
 void GeometryTest::ContinuityCommands( Draw_Interpretor& theCommands)
 {
@@ -404,8 +466,6 @@ void GeometryTest::ContinuityCommands( Draw_Interpretor& theCommands)
 
   g = "GEOMETRY curves and surfaces continuity analysis ";
 
-
-
   theCommands.Add("surfaceCcontinuity",
                  " surfaceCcontinuity   order surf1 parU1 parV1 surf2 parU2 parV2  [eps_nul[ epsC0 [epsC1 [epsC2]]]]",  
                  __FILE__,
index 987c474abc11e2b98dc9b97a2156ae6bb969a4d2..f03a41ea38a6494338039b28c140354e6964bfe1 100644 (file)
@@ -377,6 +377,7 @@ IFSelect_SessionPilot::IFSelect_SessionPilot (const Standard_CString prompt)
       modhelp = 1;
       cout<<"  --  Commands candidate for  xsnew  --"<<endl;
 //  HELP : soit complet (par defaut)  soit limite a xsnew
+      Standard_FALLTHROUGH
     case  0 : {                               //        ****     HELP
       Handle(TColStd_HSequenceOfAsciiString) list;
 //    Help complet : on donne la liste des commandes, sans plus (deja pas mal)
index 5acd4e5ea2a246273c38c273cf5cf014bdf9b9bf..09fd54899682741e78beb13983ca841640f0785b 100644 (file)
@@ -95,8 +95,10 @@ Standard_Integer  IGESConvGeom::SplineCurveFromIGES
     switch (degree) {
     case 3 :
       coeff.SetValue(coeff.Lower()+3, gp_Pnt(DX*Di3, DY*Di3, DZ*Di3));
+        Standard_FALLTHROUGH
     case 2 :
       coeff.SetValue(coeff.Lower()+2, gp_Pnt(CX*Di2, CY*Di2, CZ*Di2));
+        Standard_FALLTHROUGH
     case 1 :
       coeff.SetValue(coeff.Lower()+1, gp_Pnt(BX*Di, BY*Di, BZ*Di));
       coeff.SetValue(coeff.Lower()+0, gp_Pnt(AX, AY, AZ));
index 8cf2742d50e59e5881446f2e056651f07dbe1593..7de22dfd8c4b54c9e8986ceca56b0f84a16912ac 100644 (file)
@@ -178,12 +178,14 @@ IGESDraw_GeneralModule::IGESDraw_GeneralModule ()    {  }
       IGESDraw_ToolViewsVisible tool;
       tool.OwnImplied(anent,iter);
     }
+    break;
     case 14 : {
       DeclareAndCast(IGESDraw_ViewsVisibleWithAttr,anent,ent);
       if (anent.IsNull()) break;
       IGESDraw_ToolViewsVisibleWithAttr tool;
       tool.OwnImplied(anent,iter);
     }
+    break;
     default : break;
   }
 }
index dfe1cff3c83357a0847bda3f1268bd32ef36508c..418b255d5fdae449eef5dececab5cbf5c3187f99 100644 (file)
@@ -277,6 +277,7 @@ void IGESDraw_ToolDrawing::OwnDump
       break; // Nothing to be dumped here
     case 5 :        // Presently level 5 and 6 have the same Dump
       S << endl;
+      Standard_FALLTHROUGH
     case 6 :
       {
        Standard_Integer I;
index b637c15d7d79267972ca512fb1e47b2fd5442b53..c799e05044ac6ff7531fbc13192933204de3fcbb 100644 (file)
@@ -1019,14 +1019,15 @@ TopoDS_Shape IGESToBRep_TopoSurface::TransferOffsetSurface
     }
   case TopAbs_SHELL :
     {
-      SendWarning(st, "The First Surface only will be transfered.");
       TopoDS_Iterator dabovil(igesShape);
       if (dabovil.More()) {
-       face = TopoDS::Face(dabovil.Value());
-       break;
+        SendWarning(st, "The First Surface only will be transfered.");
+        face = TopoDS::Face(dabovil.Value());
+        break;
       }
       /* else  AddF("... */
     }
+    Standard_FALLTHROUGH
   default:
     {
       Message_Msg msg1156("IGES_1156");
index ed54dd94d1aedd061d6269cdfb680d584d9c84ef..3e56529b7b319b03929249f5f42bbb8e419bac23 100644 (file)
@@ -101,6 +101,7 @@ static IntPatch_SpecPntType IsPoleOrSeam(const Handle(Adaptor3d_HSurface)& theS1
           break;
         }
       }
+      Standard_FALLTHROUGH
     case GeomAbs_Torus:
       if(aType == GeomAbs_Torus)
       {
@@ -113,6 +114,7 @@ static IntPatch_SpecPntType IsPoleOrSeam(const Handle(Adaptor3d_HSurface)& theS1
           break;
         }
       }
+      Standard_FALLTHROUGH
     case GeomAbs_Cylinder:
       theSingularSurfaceID = i + 1;
       AddVertexPoint(theLine, theVertex, theArrPeriods);
index ac89bbbcbb9fc878ffd6c8319c50f37110f51d11..180ec90fc8f1907e901b4b0a99331fbbaa3ad7a0 100644 (file)
@@ -428,6 +428,7 @@ void Recadre(const Standard_Boolean ,
   case GeomAbs_Torus:
     while(V1<(V1p-1.5*M_PI)) V1+=M_PI+M_PI;
     while(V1>(V1p+1.5*M_PI)) V1-=M_PI+M_PI;
+    Standard_FALLTHROUGH
   case GeomAbs_Cylinder:
   case GeomAbs_Cone:
   case GeomAbs_Sphere:
@@ -441,6 +442,7 @@ void Recadre(const Standard_Boolean ,
   case GeomAbs_Torus:
     while(V2<(V2p-1.5*M_PI)) V2+=M_PI+M_PI;
     while(V2>(V2p+1.5*M_PI)) V2-=M_PI+M_PI;
+    Standard_FALLTHROUGH
   case GeomAbs_Cylinder:
   case GeomAbs_Cone:
   case GeomAbs_Sphere:
index d1c31735702df7fa5f82a02b422d5e2f316ec186..bf8c949e9a54ab16ff586aba875fccbf66de05f1 100644 (file)
@@ -166,6 +166,7 @@ void IntPatch_Intersection::Perform(const Handle(Adaptor3d_HSurface)&  S1,
       if (Intersector.IsDone() && Intersector.IsEmpty())
         break;
     }
+    Standard_FALLTHROUGH
   default:
     {
       IntPatch_PrmPrmIntersection interpp;
index 3121648169215cfc15d4bfd1de759b8649cbd2d7..d3a69f143dcba36f2941041106609a3b6106b1d6 100644 (file)
@@ -1385,6 +1385,7 @@ Standard_Real ResolutionCoeff(const BRepAdaptor_Curve& theBAC,
       break;
     }
   }
+  Standard_FALLTHROUGH
   case GeomAbs_Hyperbola :
   case GeomAbs_Parabola : 
   case GeomAbs_OtherCurve :{
@@ -1460,6 +1461,7 @@ Standard_Real Resolution(const Handle(Geom_Curve)& theCurve,
       break;
     }
   }
+  Standard_FALLTHROUGH
   default:
     aRes = theResCoeff * theR3D;
     break;
index 1446809f393ef0b2648c79df04ce91dc10b402cf..a7a961ce3697baaeeacb14cf0a26c52549e49c04 100644 (file)
@@ -194,9 +194,11 @@ void Intrv_Intervals::Unite (const Intrv_Interval& Tool)
     case Intrv_Similar :
       Tins.FuseAtStart(myInter(index).Start(),
                       myInter(index).TolStart());    // modifier le debut
+      Standard_FALLTHROUGH
     case Intrv_JustEnclosingAtEnd :
       Tins.FuseAtEnd  (myInter(index).End  (),
                       myInter(index).TolEnd  ());    // modifier la fin
+      Standard_FALLTHROUGH
     case Intrv_Enclosing :
       myInter.Remove(index);                          // detruire et
       index--;                                        // continuer
index c30b3f16a58864ecd269cc16d65f25ad4857543e..c64641224dd1afa6654ccec32cc60487a6e44bd5 100644 (file)
@@ -92,6 +92,7 @@ LDOMBasicString::LDOMBasicString (const LDOMBasicString& anOther)
       memcpy (myVal.ptr, anOther.myVal.ptr, aLen);
       break;
     }
+    Standard_FALLTHROUGH
   case LDOM_AsciiDoc:
   case LDOM_AsciiDocClear:
   case LDOM_AsciiHashed:
@@ -148,6 +149,7 @@ LDOMBasicString& LDOMBasicString::operator = (const LDOMBasicString& anOther)
       memcpy (myVal.ptr, anOther.myVal.ptr, aLen);
       break;
     }
+    Standard_FALLTHROUGH
   case LDOM_AsciiDoc:
   case LDOM_AsciiDocClear:
   case LDOM_AsciiHashed:
index a8f0e70fd7facde51055f881a0209ed0a9f18d56..cf682c0eec838ff230460400aaacfccecbad9152 100644 (file)
@@ -180,6 +180,7 @@ Standard_Boolean LDOMParser::ParseDocument (istream& theIStream, const Standard_
         break;
       }
       isDoctype = Standard_True;
+      continue;
     case LDOM_XmlReader::XML_COMMENT:
       continue;
     case LDOM_XmlReader::XML_FULL_ELEMENT:
@@ -198,6 +199,9 @@ Standard_Boolean LDOMParser::ParseDocument (istream& theIStream, const Standard_
         }
         continue;
       }
+      isError = Standard_True;
+      myError = "Expected comment or end-of-file";
+      break;
     case LDOM_XmlReader::XML_START_ELEMENT:
       if (isElement == Standard_False) {
         isElement = Standard_True;
@@ -224,11 +228,13 @@ Standard_Boolean LDOMParser::ParseDocument (istream& theIStream, const Standard_
       }
       isError = Standard_True;
       myError = "Expected comment or end-of-file";
+      break;
     case LDOM_XmlReader::XML_END_ELEMENT:
       if (endElement()) {
         isError = Standard_True;
         myError = "User abort at endElement()";
       }
+      break;
     case LDOM_XmlReader::XML_EOF:
       break;
     case LDOM_XmlReader::XML_UNKNOWN:
index ec0aa00977c24534290c98f5919cf14ac088accd..e69c452e4ea09d75f71b6e2cfcc143b38b47b67e 100644 (file)
@@ -47,6 +47,7 @@ LDOMString::LDOMString (const LDOMBasicString&          anOther,
     break;
   case LDOM_AsciiFree:
     myType = LDOM_AsciiDoc;
+    Standard_FALLTHROUGH
   case LDOM_AsciiDocClear:
   case LDOM_AsciiDoc:
     {
index 0655a9a5111ee800e1b40d78f3d15e39cfbd6a21..401dfc79e1256228592c0f686a516a6b2c369f06 100644 (file)
@@ -215,6 +215,7 @@ LDOM_XmlReader::RecordType LDOM_XmlReader::ReadRecord (Standard_IStream& theIStr
         return XML_UNKNOWN;
       case '\0':
         if (myEOF == Standard_True) continue;
+        Standard_FALLTHROUGH
       default:
         //      Limitation: we do not treat '&' as special character
         aPtr = (const char *) memchr (myPtr, '<', myEndPtr - myPtr);
@@ -431,6 +432,7 @@ attr_name:
       switch (myPtr[0]) {
       case '=' :
         aState = STATE_ATTRIBUTE_VALUE;
+        Standard_FALLTHROUGH
       case ' ' :
       case '\t':
       case '\n':
@@ -559,6 +561,7 @@ static Standard_Boolean isName (const char  * aString,
           aNameEnd = aPtr;
           return Standard_False;
         }
+        Standard_FALLTHROUGH
       case '.' :
       case '-' :
       case '_' :
index 123822d3d9212e999982496c752cf6d57cca2e0c..2c5deba4f402914fac0be245fe3346f547e38862 100644 (file)
@@ -159,6 +159,7 @@ template <class _Char> static inline Standard_Boolean loadFile (_Char * theBuffe
         aMessage += aString;
         break;
       }
+      Standard_FALLTHROUGH
     case MsgFile_WaitingMessage:
       if (isKeyword == Standard_False)
       {
@@ -168,6 +169,7 @@ template <class _Char> static inline Standard_Boolean loadFile (_Char * theBuffe
         break;
       }
       //      Pass from here to 'case MsgFile_WaitingKeyword'
+      Standard_FALLTHROUGH
     case MsgFile_WaitingKeyword:
       if (isKeyword)
       {
index 6cee87cc5cb5089bd62498dd530da835e6552a30..0813fa1152b9ceb253a5412580fb6f01ddc71cbf 100755 (executable)
@@ -79,10 +79,15 @@ inline void NCollection_UtfIterator<Type>::readUTF8()
   switch (aBytesToRead)
   {
     case 5: myCharUtf32 += *aPos++; myCharUtf32 <<= 6; // remember, illegal UTF-8
+      Standard_FALLTHROUGH
     case 4: myCharUtf32 += *aPos++; myCharUtf32 <<= 6; // remember, illegal UTF-8
+      Standard_FALLTHROUGH
     case 3: myCharUtf32 += *aPos++; myCharUtf32 <<= 6;
+      Standard_FALLTHROUGH
     case 2: myCharUtf32 += *aPos++; myCharUtf32 <<= 6;
+      Standard_FALLTHROUGH
     case 1: myCharUtf32 += *aPos++; myCharUtf32 <<= 6;
+      Standard_FALLTHROUGH
     case 0: myCharUtf32 += *aPos++;
   }
   myCharUtf32 -= offsetsFromUTF8[aBytesToRead];
index f94d236d357dc322c1117288ae9cf7ea48b77092..3d96ccea1eae30b832f82b524bf30a1f9eb83d6a 100644 (file)
@@ -1737,6 +1737,7 @@ void OpenGl_AspectMarker::Resources::BuildSprites (const Handle(OpenGl_Context)&
           Handle(TColStd_HArray1OfByte) aBitMap = fillPointBitmap (aSize);
           aMarkerImage2 = new Graphic3d_MarkerImage (aBitMap, aSize, aSize);
         }
+        Standard_FALLTHROUGH
         case Aspect_TOM_O_PLUS:
         case Aspect_TOM_O_STAR:
         case Aspect_TOM_O_X:
@@ -1754,8 +1755,10 @@ void OpenGl_AspectMarker::Resources::BuildSprites (const Handle(OpenGl_Context)&
         }
         case Aspect_TOM_RING1:
           if (aLimit == 0.0f) aLimit = aScale * 0.2f;
+          Standard_FALLTHROUGH
         case Aspect_TOM_RING2:
           if (aLimit == 0.0f) aLimit = aScale * 0.5f;
+          Standard_FALLTHROUGH
         case Aspect_TOM_RING3:
         {
           if (aLimit == 0.0f) aLimit = aScale * 0.8f;
@@ -1896,6 +1899,7 @@ void OpenGl_AspectMarker::Resources::BuildSprites (const Handle(OpenGl_Context)&
           glBitmap (aSize, aSize, (GLfloat )(0.5f * aSize), (GLfloat )(0.5f * aSize),
                     0.0f, 0.0f, &aBitMap->Array1().Value (aBitMap->Lower()));
         }
+        Standard_FALLTHROUGH
         case Aspect_TOM_O_PLUS:
         case Aspect_TOM_O_STAR:
         case Aspect_TOM_O_X:
@@ -1940,8 +1944,10 @@ void OpenGl_AspectMarker::Resources::BuildSprites (const Handle(OpenGl_Context)&
         }
         case Aspect_TOM_RING1:
           if (aLimit == 0.0f) aLimit = aScale * 0.2f;
+          Standard_FALLTHROUGH
         case Aspect_TOM_RING2:
           if (aLimit == 0.0f) aLimit = aScale * 0.5f;
+          Standard_FALLTHROUGH
         case Aspect_TOM_RING3:
         {
           if (aLimit == 0.0f) aLimit = aScale * 0.8f;
index 709687f539e714e6e4e46ba324590a7e3862931f..61375aa3ed789901e7e704745a7a6e88fda71dc0 100644 (file)
@@ -624,6 +624,7 @@ void ProjLib_ProjectOnPlane::Load(const Handle(Adaptor3d_HCurve)&    C,
       R1 = R2 = Circ.Radius();
 
     }
+    Standard_FALLTHROUGH
   case GeomAbs_Ellipse:
     {
       if ( Type == GeomAbs_Ellipse) {
index 268c968ff88fc15555292a1032c86e1fb2c8b391..e47775d05d40318063e143bfb3cf1db468e0992c 100644 (file)
@@ -312,8 +312,8 @@ void STEPControl_ActorWrite::SetMode (const STEPControl_StepModelType M)
   case STEPControl_BrepWithVoids :     ModeTrans() = 5; break;
   case STEPControl_FacetedBrep :       ModeTrans() = 1; break;
   case STEPControl_FacetedBrepAndBrepWithVoids : ModeTrans() = 6; break;
-  case STEPControl_ShellBasedSurfaceModel :      ModeTrans() = 2;
-  case STEPControl_GeometricCurveSet :           ModeTrans() = 4;
+  case STEPControl_ShellBasedSurfaceModel :      ModeTrans() = 2; break;
+  case STEPControl_GeometricCurveSet :           ModeTrans() = 4; break;
   case STEPControl_Hybrid : ModeTrans() = 0; break;  // PAS IMPLEMENTE !!
     default: break;
   }
index eb36f0343a7b75255de521eb7cb61de6aa3b87ae..706db350474d97fe46476c02cc87c417669b08d3 100644 (file)
@@ -339,17 +339,27 @@ void SelectMgr_SelectionManager::Activate (const Handle(SelectMgr_SelectableObje
 
   switch (aSelection->UpdateStatus())
   {
-  case SelectMgr_TOU_Full:
-    if (theObject->HasSelection (theMode))
-      theSelector->RemoveSelectionOfObject (theObject, aSelection);
-    theObject->RecomputePrimitives (theMode);
-  case SelectMgr_TOU_Partial:
-    if(theObject->HasTransformation())
-      theObject->UpdateTransformations (aSelection);
-    theSelector->RebuildObjectsTree();
-    break;
-  default:
-    break;
+    case SelectMgr_TOU_Full:
+    {
+      if (theObject->HasSelection (theMode))
+      {
+        theSelector->RemoveSelectionOfObject (theObject, aSelection);
+      }
+      theObject->RecomputePrimitives (theMode);
+      // pass through SelectMgr_TOU_Partial
+    }
+    Standard_FALLTHROUGH
+    case SelectMgr_TOU_Partial:
+    {
+      if(theObject->HasTransformation())
+      {
+        theObject->UpdateTransformations (aSelection);
+      }
+      theSelector->RebuildObjectsTree();
+      break;
+    }
+    default:
+      break;
   }
   aSelection->UpdateStatus(SelectMgr_TOU_None);
 
@@ -744,16 +754,22 @@ void SelectMgr_SelectionManager::Update (const Handle(SelectMgr_SelectableObject
     {
       switch (aSelection->UpdateStatus())
       {
-      case SelectMgr_TOU_Full:
-        ClearSelectionStructures (theObject, aSelection->Mode());
-        theObject->RecomputePrimitives (aSelection->Mode()); // no break on purpose...
-        RestoreSelectionStructures (theObject, aSelection->Mode());
-      case SelectMgr_TOU_Partial:
-        theObject->UpdateTransformations (aSelection);
-        rebuildSelectionStructures();
-        break;
-      default:
-        break;
+        case SelectMgr_TOU_Full:
+        {
+          ClearSelectionStructures (theObject, aSelection->Mode());
+          theObject->RecomputePrimitives (aSelection->Mode()); // no break on purpose...
+          RestoreSelectionStructures (theObject, aSelection->Mode());
+          // pass through SelectMgr_TOU_Partial
+        }
+        Standard_FALLTHROUGH
+        case SelectMgr_TOU_Partial:
+        {
+          theObject->UpdateTransformations (aSelection);
+          rebuildSelectionStructures();
+          break;
+        }
+        default:
+          break;
       }
       aSelection->UpdateStatus (SelectMgr_TOU_None);
       aSelection->UpdateBVHStatus (SelectMgr_TBU_None);
@@ -799,16 +815,22 @@ void SelectMgr_SelectionManager::Update (const Handle(SelectMgr_SelectableObject
     {
       switch (aSelection->UpdateStatus())
       {
-      case SelectMgr_TOU_Full:
-        ClearSelectionStructures (theObject, aSelection->Mode());
-        theObject->RecomputePrimitives (aSelection->Mode());
-        RestoreSelectionStructures (theObject, aSelection->Mode());
-      case SelectMgr_TOU_Partial:
-        theObject->UpdateTransformations (aSelection);
-        rebuildSelectionStructures();
-        break;
-      default:
-        break;
+        case SelectMgr_TOU_Full:
+        {
+          ClearSelectionStructures (theObject, aSelection->Mode());
+          theObject->RecomputePrimitives (aSelection->Mode());
+          RestoreSelectionStructures (theObject, aSelection->Mode());
+          // pass through SelectMgr_TOU_Partial
+        }
+        Standard_FALLTHROUGH
+        case SelectMgr_TOU_Partial:
+        {
+          theObject->UpdateTransformations (aSelection);
+          rebuildSelectionStructures();
+          break;
+        }
+        default:
+          break;
       }
       aSelection->UpdateStatus (SelectMgr_TOU_None);
       aSelection->UpdateBVHStatus (SelectMgr_TBU_None);
@@ -818,19 +840,25 @@ void SelectMgr_SelectionManager::Update (const Handle(SelectMgr_SelectableObject
     {
       switch (aSelection->UpdateStatus())
       {
-      case SelectMgr_TOU_Full:
-        ClearSelectionStructures (theObject, aSelection->Mode(), theSelector);
-        theObject->RecomputePrimitives (aSelection->Mode());
-        RestoreSelectionStructures (theObject, aSelection->Mode(), theSelector);
-      case SelectMgr_TOU_Partial:
-        if (theObject->HasTransformation())
+        case SelectMgr_TOU_Full:
         {
-          theObject->UpdateTransformations (aSelection);
-          theSelector->RebuildObjectsTree();
+          ClearSelectionStructures (theObject, aSelection->Mode(), theSelector);
+          theObject->RecomputePrimitives (aSelection->Mode());
+          RestoreSelectionStructures (theObject, aSelection->Mode(), theSelector);
+          // pass through SelectMgr_TOU_Partial
         }
-        break;
-      default:
-        break;
+        Standard_FALLTHROUGH
+        case SelectMgr_TOU_Partial:
+        {
+          if (theObject->HasTransformation())
+          {
+            theObject->UpdateTransformations (aSelection);
+            theSelector->RebuildObjectsTree();
+          }
+          break;
+        }
+        default:
+          break;
       }
 
       aSelection->UpdateStatus(SelectMgr_TOU_None);
index fd04320593a2bd65f3a8b187aba5b77eea1d96bb..b1038fafd61f676e917bca4df31ce683bb912d3e 100644 (file)
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-// Purpose:   This file is intended to be the first file #included to any
-//            Open CASCADE source. It defines platform-specific pre-processor 
-//            macros necessary for correct compilation of Open CASCADE code
+//! @file
+//! This file is intended to be the first file included to any
+//! Open CASCADE source. It defines platform-specific pre-processor 
+//! macros necessary for correct compilation of Open CASCADE code.
 
 #ifndef _Standard_Macro_HeaderFile
 # define _Standard_Macro_HeaderFile
 
+//! @def Standard_OVERRIDE
+//! Should be used in declarations of virtual methods overriden in the
+//! derived classes, to cause compilation error in the case if that virtual 
+//! function disappears or changes its signature in the base class.
+//!
+//! Expands to C++11 keyword "override" on compilers that are known to
+//! suppot it; empty in other cases.
 #if defined(__cplusplus) && (__cplusplus >= 201100L)
   // part of C++11 standard
   #define Standard_OVERRIDE override
   #define Standard_OVERRIDE
 #endif
 
-// Macro for marking variables / functions as possibly unused
-// so that compiler will not emit redundant "unused" warnings.
+//! @def Standard_FALLTHROUGH
+//! Should be used in a switch statement immediately before a case label,
+//! if code associated with the previous case label may fall through to that
+//! next label (i.e. does not end with "break" or "return" etc.). 
+//! This macro indicates that the fall through is intentional and should not be 
+//! diagnosed by a compiler that warns on fallthrough.
+//!
+//! Expands to C++17 attribute statement "[[fallthrough]];" on compilers that 
+//! declare support of C++17, or to "__attribute__((fallthrough));" on 
+//! GCC 7+.
+#if defined(__cplusplus) && (__cplusplus >= 201703L)
+  // part of C++17 standard
+  #define Standard_FALLTHROUGH [[fallthrough]];
+#elif defined(__GNUC__) && (__GNUC__ >= 7)
+  // gcc 7+
+  #define Standard_FALLTHROUGH __attribute__((fallthrough));
+#else
+  #define Standard_FALLTHROUGH
+#endif
+
+//! @def Standard_UNUSED
+//! Macro for marking variables / functions as possibly unused
+//! so that compiler will not emit redundant "unused" warnings.
+//!
+//! Expands to "__attribute__((unused))" on GCC and CLang.
 #if defined(__GNUC__) || defined(__clang__)
   #define Standard_UNUSED __attribute__((unused))
 #else
   #define Standard_UNUSED
 #endif
 
-// Macro Standard_DEPRECATED("message") can be used to declare a method deprecated.
-// If OCCT_NO_DEPRECATED is defined, Standard_DEPRECATED is defined empty.
+//! @def Standard_DEPRECATED("message")
+//! Can be used in declaration of a method or a class to mark it as deprecated.
+//! Use of such method or class will cause compiler warning (if supported by 
+//! compiler and unless disabled).
+//! If macro OCCT_NO_DEPRECATED is defined, Standard_DEPRECATED is defined empty.
 #ifdef OCCT_NO_DEPRECATED
   #define Standard_DEPRECATED(theMsg)
 #else
 #endif
 #endif
 
-// Disable warnings about deprecated features.
-// This is useful for sections of code kept for backward compatibility and scheduled for removal.
-
+//! @def Standard_DISABLE_DEPRECATION_WARNINGS
+//! Disables warnings on use of deprecated features (see Standard_DEPRECATED),
+//! from the current point till appearance of Standard_ENABLE_DEPRECATION_WARNINGS macro.
+//! This is useful for sections of code kept for backward compatibility and scheduled for removal.
+//!
+//! @def Standard_ENABLE_DEPRECATION_WARNINGS
+//! Enables warnings on use of deprecated features previously disabled by
+//! Standard_DISABLE_DEPRECATION_WARNINGS.
 #if defined(__ICL) || defined (__INTEL_COMPILER)
   #define Standard_DISABLE_DEPRECATION_WARNINGS __pragma(warning(push)) __pragma(warning(disable:1478))
   #define Standard_ENABLE_DEPRECATION_WARNINGS  __pragma(warning(pop))
 
 #endif
 
+//! @def Standard_EXPORT
+//! This macro should be used in declarations of public methods 
+//! to ensure that they are exported from DLL on Windows and thus
+//! can be called from other (dependent) libraries or applications.
+
 # if defined(_WIN32) && !defined(HAVE_NO_DLL)
 
 //======================================================
 #   endif  // __Standard_DLL
 # endif  // __Standard_API
 
-// Support of Universal Windows Platform
+//! @def OCCT_UWP
+//! This macro is defined on Windows platform in the case if the code
+//! is being compiled for UWP (Universal Windows Platform).
 #if defined(WINAPI_FAMILY) && WINAPI_FAMILY == WINAPI_FAMILY_APP
  #define OCCT_UWP
 #else
index 2f31cf4433c9aef61680d25feda77bd9f455a2cb..f2e5beefc189558b9bf28df4caca046be0295c8e 100644 (file)
@@ -383,52 +383,50 @@ TDataXtd_GeometryEnum  TDataXtd_Geometry::Type (const Handle(TNaming_NamedShape)
       // TopLoc_Location loc;
       Handle(Geom_Curve) curve = BRep_Tool::Curve (edge,first,last);
       if (!curve.IsNull()) {
-       if (curve->IsInstance (STANDARD_TYPE (Geom_TrimmedCurve))) {
-         curve =  (Handle(Geom_TrimmedCurve)::DownCast (curve))->BasisCurve ();
-       }
-       if (curve->IsInstance(STANDARD_TYPE(Geom_Line))) {
-         type = TDataXtd_LINE;
-       }
-       else if (curve->IsInstance(STANDARD_TYPE(Geom_Circle))) {
-         type = TDataXtd_CIRCLE;
-       }
-       else if (curve->IsInstance(STANDARD_TYPE(Geom_Ellipse))) {
-         type = TDataXtd_ELLIPSE;
-       }
-       break;
+        if (curve->IsInstance (STANDARD_TYPE (Geom_TrimmedCurve))) {
+          curve =  (Handle(Geom_TrimmedCurve)::DownCast (curve))->BasisCurve ();
+        }
+        if (curve->IsInstance(STANDARD_TYPE(Geom_Line))) {
+          type = TDataXtd_LINE;
+        }
+        else if (curve->IsInstance(STANDARD_TYPE(Geom_Circle))) {
+          type = TDataXtd_CIRCLE;
+        }
+        else if (curve->IsInstance(STANDARD_TYPE(Geom_Ellipse))) {
+          type = TDataXtd_ELLIPSE;
+        }
       }
 #ifdef OCCT_DEBUG
       else {
-       throw Standard_Failure("curve Null dans TDataXtd_Geometry");
+        throw Standard_Failure("curve Null dans TDataXtd_Geometry");
       }
 #endif
+      break;
     }
   case TopAbs_FACE : 
     {
       const TopoDS_Face& face = TopoDS::Face(shape);
       Handle(Geom_Surface) surface = BRep_Tool::Surface (face);
       if (!surface.IsNull()) {
-       if (surface->IsInstance(STANDARD_TYPE(Geom_RectangularTrimmedSurface))) { 
-         surface = Handle(Geom_RectangularTrimmedSurface)::DownCast (surface)->BasisSurface();
-       }
-       if (surface->IsInstance(STANDARD_TYPE(Geom_CylindricalSurface))) {
-         type = TDataXtd_CYLINDER;
-       }
-       else if (surface->IsInstance(STANDARD_TYPE(Geom_Plane))) {
-         type = TDataXtd_PLANE;
-       }
+        if (surface->IsInstance(STANDARD_TYPE(Geom_RectangularTrimmedSurface))) { 
+          surface = Handle(Geom_RectangularTrimmedSurface)::DownCast (surface)->BasisSurface();
+        }
+        if (surface->IsInstance(STANDARD_TYPE(Geom_CylindricalSurface))) {
+          type = TDataXtd_CYLINDER;
+        }
+        else if (surface->IsInstance(STANDARD_TYPE(Geom_Plane))) {
+          type = TDataXtd_PLANE;
+        }
       } 
 #ifdef OCCT_DEBUG
       else {
-       throw Standard_Failure("surface Null dans TDataXtd_Geometry");
+        throw Standard_Failure("surface Null dans TDataXtd_Geometry");
       }
 #endif
       break;
     }
     default :
-      {
-       break;
-      }
+      break;
   }
   return type;
 }
index 89fccc1db62a291b0f977a9abdb0495f7af36c0a..33b2ca055fc078e336281319db488d3ac98224c1 100644 (file)
@@ -423,62 +423,76 @@ static TopoDS_Shape ShapeWithType(const TopoDS_Shape     theShape,
     switch (aType) {
     case TopAbs_VERTEX: // can't do something from vertex
       break;
-    case TopAbs_EDGE: {// make wire from edges
-      if (theType <= TopAbs_SOLID) break;
-      BRepBuilderAPI_MakeWire aMakeWire;
-      aMakeWire.Add(aShapes);
-      if (!aMakeWire.IsDone()) return theShape;
-      if (theType == TopAbs_WIRE) return aMakeWire.Wire();
-      aShapes.Clear(); // don't break: we can do something more of it
-      aShapes.Append(aMakeWire.Wire());
-      aListIter.Initialize(aShapes);
-    }
-    case TopAbs_WIRE: {// make faceS from wires (one per one)
-      if (theType < TopAbs_SOLID) break;
-      TopTools_ListOfShape aFaces;
-      for(;aListIter.More();aListIter.Next()) {
-       BRepBuilderAPI_MakeFace aMakeFace(TopoDS::Wire(aListIter.Value()));
-       if (!aMakeFace.IsDone()) aFaces.Append(aMakeFace.Face());
+    case TopAbs_EDGE: 
+      {
+        // make wire from edges
+        if (theType <= TopAbs_SOLID) break;
+        BRepBuilderAPI_MakeWire aMakeWire;
+        aMakeWire.Add(aShapes);
+        if (!aMakeWire.IsDone()) return theShape;
+        if (theType == TopAbs_WIRE) return aMakeWire.Wire();
+        aShapes.Clear(); // don't break: we can do something more of it
+        aShapes.Append(aMakeWire.Wire());
+        aListIter.Initialize(aShapes);
       }
-      if (theType == TopAbs_FACE) {
-       if (aFaces.Extent() == 1) return aFaces.First();
-       return theShape;
+      Standard_FALLTHROUGH
+    case TopAbs_WIRE: 
+      {
+        // make faceS from wires (one per one)
+        if (theType < TopAbs_SOLID) break;
+        TopTools_ListOfShape aFaces;
+        for(;aListIter.More();aListIter.Next()) {
+          BRepBuilderAPI_MakeFace aMakeFace(TopoDS::Wire(aListIter.Value()));
+          if (!aMakeFace.IsDone()) aFaces.Append(aMakeFace.Face());
+        }
+        if (theType == TopAbs_FACE) {
+          if (aFaces.Extent() == 1) return aFaces.First();
+          return theShape;
+        }
+        aShapes.Assign(aFaces); // don't break: we can do something more of it
+        aListIter.Initialize(aShapes);
       }
-      aShapes.Assign(aFaces); // don't break: we can do something more of it
-      aListIter.Initialize(aShapes);
-    }
-    case TopAbs_FACE: {// make shell from faces
-      if (theType < TopAbs_SOLID) break;
-      BRep_Builder aShellBuilder;
-      TopoDS_Shell aShell;
-      aShellBuilder.MakeShell(aShell);
-      for(;aListIter.More();aListIter.Next()) aShellBuilder.Add(aShell,TopoDS::Face(aListIter.Value()));
-      aShell.Closed (BRep_Tool::IsClosed (aShell));
-      if (theType == TopAbs_SHELL) return aShell;
-      aShapes.Clear(); // don't break: we can do something more of it
-      aShapes.Append(aShell);
-      aListIter.Initialize(aShapes);
-    }
-    case TopAbs_SHELL: {// make solids from shells (one per one)
-      TopTools_ListOfShape aSolids;
-      for(;aListIter.More();aListIter.Next()) {
-       BRepBuilderAPI_MakeSolid aMakeSolid(TopoDS::Shell(aListIter.Value()));
-       if (aMakeSolid.IsDone()) aSolids.Append(aMakeSolid.Solid());
+      Standard_FALLTHROUGH
+    case TopAbs_FACE: 
+      {
+        // make shell from faces
+        if (theType < TopAbs_SOLID) break;
+        BRep_Builder aShellBuilder;
+        TopoDS_Shell aShell;
+        aShellBuilder.MakeShell(aShell);
+        for(;aListIter.More();aListIter.Next()) aShellBuilder.Add(aShell,TopoDS::Face(aListIter.Value()));
+        aShell.Closed (BRep_Tool::IsClosed (aShell));
+        if (theType == TopAbs_SHELL) return aShell;
+        aShapes.Clear(); // don't break: we can do something more of it
+        aShapes.Append(aShell);
+        aListIter.Initialize(aShapes);
       }
-      if (theType == TopAbs_SOLID) {
-       if (aSolids.Extent() == 1) return aSolids.First();
-       return theShape;
+      Standard_FALLTHROUGH
+    case TopAbs_SHELL: 
+      {
+        // make solids from shells (one per one)
+        TopTools_ListOfShape aSolids;
+        for(;aListIter.More();aListIter.Next()) {
+          BRepBuilderAPI_MakeSolid aMakeSolid(TopoDS::Shell(aListIter.Value()));
+          if (aMakeSolid.IsDone()) aSolids.Append(aMakeSolid.Solid());
+        }
+        if (theType == TopAbs_SOLID) {
+          if (aSolids.Extent() == 1) return aSolids.First();
+          return theShape;
+        }
+        aShapes.Assign(aSolids); // don't break: we can do something more of it
+        aListIter.Initialize(aShapes);
+      }
+      Standard_FALLTHROUGH
+    case TopAbs_SOLID: 
+      {
+        // make compsolid from solids
+        BRep_Builder aCompBuilder;
+        TopoDS_CompSolid aCompSolid;
+        aCompBuilder.MakeCompSolid(aCompSolid);
+        for(;aListIter.More();aListIter.Next()) aCompBuilder.Add(aCompSolid,TopoDS::Solid(aListIter.Value()));
+        if (theType == TopAbs_COMPSOLID) return aCompSolid;
       }
-      aShapes.Assign(aSolids); // don't break: we can do something more of it
-      aListIter.Initialize(aShapes);
-    }
-    case TopAbs_SOLID: {// make compsolid from solids
-      BRep_Builder aCompBuilder;
-      TopoDS_CompSolid aCompSolid;
-      aCompBuilder.MakeCompSolid(aCompSolid);
-      for(;aListIter.More();aListIter.Next()) aCompBuilder.Add(aCompSolid,TopoDS::Solid(aListIter.Value()));
-      if (theType == TopAbs_COMPSOLID) return aCompSolid;
-    }
     }
   }
   return theShape;
index 6adb509960f46b9d867d34f7d2cde881457e848f..03ad492ad91011ba9649953048b2317f2cb219f3 100644 (file)
@@ -41,6 +41,7 @@ void UnitsAPI::CheckLoading (const UnitsAPI_SystemUnits aSystemUnits)
     switch (aSystemUnits) {
       case UnitsAPI_DEFAULT :
         if( !CurrentUnits.IsNull() ) break;
+        Standard_FALLTHROUGH
       case UnitsAPI_SI :  
         currentSystem = UnitsAPI_SI; 
         if( SICurrentUnits.IsNull() ) {
index 62307d44f9b648bcf3a97e0164e9483f506977a3..61f45871fad7561c3e1abe9f8122f4ba7aa712a9 100644 (file)
@@ -102,6 +102,7 @@ void ViewerTest_AutoUpdater::Update()
         return;
       }
     }
+    Standard_FALLTHROUGH
     case ViewerTest_AutoUpdater::RedrawMode_Forced:
     {
       if (!myContext.IsNull())