Salome HOME
Fix compilation errors using gcc-5.X relating to explicit stream::operator bool()
[modules/smesh.git] / src / StdMeshers / StdMeshers_NumberOfSegments.cxx
index 8d262e36f17595715ef7aeaff76556baf7022dda..2fec858ef786ca860ef903aefcfde26ddd466c7d 100644 (file)
@@ -548,7 +548,7 @@ istream & StdMeshers_NumberOfSegments::LoadFrom(istream & load)
   int a;
 
   // read number of segments
-  isOK = (load >> a);
+  isOK = static_cast<bool>(load >> a);
   if (isOK)
     _numberOfSegments = a;
   else
@@ -561,7 +561,7 @@ istream & StdMeshers_NumberOfSegments::LoadFrom(istream & load)
   //    (nb.segments, distr.type, some other params.),
   //    we wait here the ditribution type, which is integer
   double scale_factor;
-  isOK = (load >> scale_factor);
+  isOK = static_cast<bool>(load >> scale_factor);
   a = (int)scale_factor;
 
   // try to interprete ditribution type,
@@ -582,7 +582,7 @@ istream & StdMeshers_NumberOfSegments::LoadFrom(istream & load)
   {
   case DT_Scale:
     {
-      isOK = (load >> b);
+      isOK = static_cast<bool>(load >> b);
       if (isOK)
         _scaleFactor = b;
       else
@@ -596,13 +596,13 @@ istream & StdMeshers_NumberOfSegments::LoadFrom(istream & load)
     break;
   case DT_TabFunc:
     {
-      isOK = (load >> a);
+      isOK = static_cast<bool>(load >> a);
       if (isOK)
       {
         _table.resize(a, 0.);
         for ( size_t i=0; i < _table.size(); i++ )
         {
-          isOK = (load >> b);
+          isOK = static_cast<bool>(load >> b);
           if (isOK)
             _table[i] = b;
           else
@@ -621,7 +621,7 @@ istream & StdMeshers_NumberOfSegments::LoadFrom(istream & load)
   case DT_ExprFunc:
     {
       string str;
-      isOK = (load >> str);
+      isOK = static_cast<bool>(load >> str);
       if (isOK)
         _func = str;
       else
@@ -640,7 +640,7 @@ istream & StdMeshers_NumberOfSegments::LoadFrom(istream & load)
 
   if (_distrType == DT_TabFunc || _distrType == DT_ExprFunc)
   {
-    isOK = (load >> a);
+    isOK = static_cast<bool>(load >> a);
     if (isOK)
       _convMode = a;
     else
@@ -649,14 +649,14 @@ istream & StdMeshers_NumberOfSegments::LoadFrom(istream & load)
 
   // load reversed edges IDs
   int intVal;
-  isOK = (load >> intVal);
+  isOK = static_cast<bool>(load >> intVal);
   if ( isOK && _distrType != DT_Regular && intVal > 0 ) {
     _edgeIDs.reserve( intVal );
     for ( size_t i = 0; i < _edgeIDs.capacity() && isOK; i++) {
-      isOK = (load >> intVal);
+      isOK = static_cast<bool>(load >> intVal);
       if ( isOK ) _edgeIDs.push_back( intVal );
     }
-    isOK = (load >> _objEntry);
+    isOK = static_cast<bool>(load >> _objEntry);
   }
 
   return load;