0029151: GCC 7.1 warnings "this statement may fall through" [-Wimplicit-fallthrough=]
[occt.git] / src / BndLib / BndLib.cxx
index b581764..5b67936 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;
@@ -306,7 +320,7 @@ void BndLib::Add( const gp_Lin& L,const Standard_Real P1,
 
   if (Precision::IsNegativeInfinite(P1)) {
     if (Precision::IsNegativeInfinite(P2)) {
-      Standard_Failure::Raise("BndLib::bad parameter");
+      throw Standard_Failure("BndLib::bad parameter");
     }
     else if (Precision::IsPositiveInfinite(P2)) {
       OpenMinMax(L.Direction(),B);
@@ -323,7 +337,7 @@ void BndLib::Add( const gp_Lin& L,const Standard_Real P1,
       B.Add(ElCLib::Value(0.,L));
     }
     else if (Precision::IsPositiveInfinite(P2)) {
-      Standard_Failure::Raise("BndLib::bad parameter");
+      throw Standard_Failure("BndLib::bad parameter");
     }
     else {
       OpenMax(L.Direction(),B);
@@ -351,7 +365,7 @@ void BndLib::Add( const gp_Lin2d& L,const Standard_Real P1,
 
   if (Precision::IsNegativeInfinite(P1)) {
     if (Precision::IsNegativeInfinite(P2)) {
-      Standard_Failure::Raise("BndLib::bad parameter");
+      throw Standard_Failure("BndLib::bad parameter");
     }
     else if (Precision::IsPositiveInfinite(P2)) {
       OpenMinMax(L.Direction(),B);
@@ -368,7 +382,7 @@ void BndLib::Add( const gp_Lin2d& L,const Standard_Real P1,
       B.Add(ElCLib::Value(0.,L));
     }
     else if (Precision::IsPositiveInfinite(P2)) {
-      Standard_Failure::Raise("BndLib::bad parameter");
+      throw Standard_Failure("BndLib::bad parameter");
     }
     else {
       OpenMax(L.Direction(),B);
@@ -767,7 +781,7 @@ void BndLib::Add( const gp_Parab& P,const Standard_Real P1,
 
   if (Precision::IsNegativeInfinite(P1)) {
     if (Precision::IsNegativeInfinite(P2)) {
-      Standard_Failure::Raise("BndLib::bad parameter");
+      throw Standard_Failure("BndLib::bad parameter");
     }
     else if (Precision::IsPositiveInfinite(P2)) {
       B.OpenXmax();B.OpenYmax();B.OpenZmax();
@@ -782,7 +796,7 @@ void BndLib::Add( const gp_Parab& P,const Standard_Real P1,
       B.OpenXmin();B.OpenYmin();B.OpenZmin();
     }
     else if (Precision::IsPositiveInfinite(P2)) {
-      Standard_Failure::Raise("BndLib::bad parameter");
+      throw Standard_Failure("BndLib::bad parameter");
     }
     else {
       B.Add(ElCLib::Value(P2,P));
@@ -811,7 +825,7 @@ void BndLib::Add( const gp_Parab2d& P,const Standard_Real P1,
 
   if (Precision::IsNegativeInfinite(P1)) {
     if (Precision::IsNegativeInfinite(P2)) {
-      Standard_Failure::Raise("BndLib::bad parameter");
+      throw Standard_Failure("BndLib::bad parameter");
     }
     else if (Precision::IsPositiveInfinite(P2)) {
       B.OpenXmax();B.OpenYmax();
@@ -826,7 +840,7 @@ void BndLib::Add( const gp_Parab2d& P,const Standard_Real P1,
       B.OpenXmin();B.OpenYmin();
     }
     else if (Precision::IsPositiveInfinite(P2)) {
-      Standard_Failure::Raise("BndLib::bad parameter");
+      throw Standard_Failure("BndLib::bad parameter");
     }
     else {
       B.Add(ElCLib::Value(P2,P));
@@ -861,7 +875,7 @@ void BndLib::Add(const gp_Hypr& H,
 {
   if (Precision::IsNegativeInfinite(P1)) {
     if (Precision::IsNegativeInfinite(P2)) {
-      Standard_Failure::Raise("BndLib::bad parameter");
+      throw Standard_Failure("BndLib::bad parameter");
     }
     else if (Precision::IsPositiveInfinite(P2)) {
       B.OpenXmax();B.OpenYmax();B.OpenZmax();
@@ -876,7 +890,7 @@ void BndLib::Add(const gp_Hypr& H,
       B.OpenXmin();B.OpenYmin();B.OpenZmin();
     }
     else if (Precision::IsPositiveInfinite(P2)) {
-      Standard_Failure::Raise("BndLib::bad parameter");
+      throw Standard_Failure("BndLib::bad parameter");
     }
     else {
       B.Add(ElCLib::Value(P2,H));
@@ -904,7 +918,7 @@ void BndLib::Add(const gp_Hypr2d& H,const Standard_Real P1,
   
   if (Precision::IsNegativeInfinite(P1)) {
     if (Precision::IsNegativeInfinite(P2)) {
-      Standard_Failure::Raise("BndLib::bad parameter");
+      throw Standard_Failure("BndLib::bad parameter");
     }
     else if (Precision::IsPositiveInfinite(P2)) {
       B.OpenXmax();B.OpenYmax();
@@ -919,7 +933,7 @@ void BndLib::Add(const gp_Hypr2d& H,const Standard_Real P1,
       B.OpenXmin();B.OpenYmin();
     }
     else if (Precision::IsPositiveInfinite(P2)) {
-      Standard_Failure::Raise("BndLib::bad parameter");
+      throw Standard_Failure("BndLib::bad parameter");
     }
     else {
       B.Add(ElCLib::Value(P2,H));
@@ -963,7 +977,7 @@ void BndLib::Add( const gp_Cylinder& S,const Standard_Real UMin,
   {
     if (Precision::IsNegativeInfinite(VMax))
     {
-      Standard_Failure::Raise("BndLib::bad parameter");
+      throw Standard_Failure("BndLib::bad parameter");
     }
     else if (Precision::IsPositiveInfinite(VMax))
     {
@@ -983,7 +997,7 @@ void BndLib::Add( const gp_Cylinder& S,const Standard_Real UMin,
     }
     else if (Precision::IsPositiveInfinite(VMax))
     {
-      Standard_Failure::Raise("BndLib::bad parameter");
+      throw Standard_Failure("BndLib::bad parameter");
     }
     else
     {
@@ -1057,7 +1071,7 @@ void BndLib::Add(const gp_Cone& S,const Standard_Real UMin,
   {
     if (Precision::IsNegativeInfinite(VMax)) 
     {
-      Standard_Failure::Raise("BndLib::bad parameter");
+      throw Standard_Failure("BndLib::bad parameter");
     }
     else if (Precision::IsPositiveInfinite(VMax)) 
     {
@@ -1081,7 +1095,7 @@ void BndLib::Add(const gp_Cone& S,const Standard_Real UMin,
     }
     else if (Precision::IsPositiveInfinite(VMax)) 
     {
-      Standard_Failure::Raise("BndLib::bad parameter");
+      throw Standard_Failure("BndLib::bad parameter");
     }
     else 
     {
@@ -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;
       }