Salome HOME
#18963 Minimize compiler warnings
authorSALOME <salome@opencascade.com>
Mon, 24 Aug 2020 10:51:41 +0000 (13:51 +0300)
committervsr <vsr@opencascade.com>
Tue, 8 Dec 2020 16:01:10 +0000 (19:01 +0300)
src/HexoticPlugin/HexoticPlugin_Hexotic.cxx
src/HexoticPlugin/HexoticPlugin_Hypothesis.cxx
src/HexoticPlugin/HexoticPlugin_Hypothesis.hxx
src/HexoticPlugin/HexoticPlugin_Hypothesis_i.cxx
src/HexoticPlugin/HexoticPlugin_Hypothesis_i.hxx
src/HexoticPlugin/HexoticPlugin_i.cxx
src/HexoticPlugin/MG_Hexotic_API.cxx

index 887e868203299c65f360a84dd792bb3c6152b98f..5f414a6d55b744bd03f02da1bdd6b5d650c2c8fe 100644 (file)
@@ -81,7 +81,7 @@ static void removeFile( const TCollection_AsciiString& fileName )
   try {
     OSD_File( fileName ).Remove();
   }
-  catch ( Standard_ProgramError ) {
+  catch ( Standard_ProgramError& ) {
     MESSAGE("Can't remove file: " << fileName.ToCString() << " ; file does not exist or permission denied");
   }
 }
@@ -988,7 +988,7 @@ std::vector<std::string> HexoticPlugin_Hexotic::writeSizeMapFile( MG_Hexotic_API
 //=============================================================================
 
 bool HexoticPlugin_Hexotic::Compute(SMESH_Mesh&          aMesh,
-                                    const TopoDS_Shape& aShape)
+                                    const TopoDS_Shape& /*aShape*/)
 {
   _computeCanceled = false;
   bool Ok = true;
index 71b2f7e1bb65928e43f871c9d332bd46bc7a960b..f82429d24e63cfed9b0af72320b31d47dba9d930 100644 (file)
@@ -265,7 +265,6 @@ void HexoticPlugin_Hypothesis::SetRemoveLogOnSuccess(bool removeLogOnSuccess)
 
 void HexoticPlugin_Hypothesis::SetOptionValue(const std::string& optionName,
                                               const std::string& optionValue)
-  throw (std::invalid_argument)
 {
   TOptionValues::iterator op_val = _option2value.find(optionName);
   if (op_val == _option2value.end())
@@ -330,7 +329,6 @@ void HexoticPlugin_Hypothesis::SetOptionValue(const std::string& optionName,
 //  empty if it equals a default one.
 std::string HexoticPlugin_Hypothesis::GetOptionValue(const std::string& optionName,
                                                      bool*              isDefault) const
-  throw (std::invalid_argument)
 {
   TOptionValues::const_iterator op_val = _option2value.find(optionName);
   if (op_val == _option2value.end())
@@ -363,7 +361,7 @@ bool HexoticPlugin_Hypothesis::HasOptionDefined( const std::string& optionName )
   {
     GetOptionValue( optionName, &isDefault );
   }
-  catch ( std::invalid_argument )
+  catch ( std::invalid_argument& )
   {
     return false;
   }
@@ -401,7 +399,6 @@ HexoticPlugin_Hypothesis::TOptionValues HexoticPlugin_Hypothesis::GetOptionValue
 //================================================================================
 
 bool HexoticPlugin_Hypothesis::ToBool(const std::string& str, bool* isOk )
-  throw (std::invalid_argument)
 {
   std::string s = str;
   if ( isOk ) *isOk = true;
@@ -431,7 +428,6 @@ bool HexoticPlugin_Hypothesis::ToBool(const std::string& str, bool* isOk )
 //================================================================================
 
 double HexoticPlugin_Hypothesis::ToDbl(const std::string& str, bool* isOk )
-  throw (std::invalid_argument)
 {
   if ( str.empty() ) throw std::invalid_argument("Empty value provided");
 
@@ -456,7 +452,6 @@ double HexoticPlugin_Hypothesis::ToDbl(const std::string& str, bool* isOk )
 //================================================================================
 
 int HexoticPlugin_Hypothesis::ToInt(const std::string& str, bool* isOk )
-  throw (std::invalid_argument)
 {
   if ( str.empty() ) throw std::invalid_argument("Empty value provided");
 
@@ -859,8 +854,8 @@ std::istream& operator >>(std::istream& load, HexoticPlugin_Hypothesis& hyp)
  * \retval bool - always false
  */
 //================================================================================
-bool HexoticPlugin_Hypothesis::SetParametersByMesh(const SMESH_Mesh*   theMesh,
-                                                   const TopoDS_Shape& theShape)
+bool HexoticPlugin_Hypothesis::SetParametersByMesh(const SMESH_Mesh*   /*theMesh*/,
+                                                   const TopoDS_Shape& /*theShape*/)
 {
   return false;
 }
index 7ee5b8322aa5ee144b1a8b86dc5681ecd8e9a8c1..523da6a515bd62dc1a7f81e32a2cb9e9008dc254 100644 (file)
@@ -107,9 +107,9 @@ public:
   typedef std::set< std::string >              TOptionNames;
 
   void SetOptionValue(const std::string& optionName,
-                      const std::string& optionValue) throw (std::invalid_argument);
+                      const std::string& optionValue);
   std::string GetOptionValue(const std::string& optionName,
-                             bool*              isDefault=0) const throw (std::invalid_argument);
+                             bool*              isDefault=0) const;
   bool HasOptionDefined( const std::string& optionName ) const;
   void ClearOption(const std::string& optionName);
   TOptionValues        GetOptionValues()       const;
@@ -117,9 +117,9 @@ public:
   std::string GetAdvancedOption( bool customOnly = false ) const;
   void SetAdvancedOption(const std::string& theOptions); // obsolete
 
-  static bool  ToBool(const std::string& str, bool* isOk=0) throw (std::invalid_argument);
-  static double ToDbl(const std::string& str, bool* isOk=0) throw (std::invalid_argument);
-  static int    ToInt(const std::string& str, bool* isOk=0) throw (std::invalid_argument);
+  static bool  ToBool(const std::string& str, bool* isOk=0);
+  static double ToDbl(const std::string& str, bool* isOk=0);
+  static int    ToInt(const std::string& str, bool* isOk=0);
 
 
   // Size Maps
index 26817616d8880a889ef17e3234aff7265d527b63..bbf36d530fb86044f2c9182b5005199c98cde7bd 100644 (file)
@@ -167,7 +167,7 @@ void HexoticPlugin_Hypothesis_i::SetHexoticNbProc (CORBA::Long theValue)
     SMESH::TPythonDump() << _this() << ".SetHexoticNbProc( " << theValue << " )";
 }
 
-void HexoticPlugin_Hypothesis_i::SetHexoticWorkingDirectory(const char* path) throw ( SALOME::SALOME_Exception )
+void HexoticPlugin_Hypothesis_i::SetHexoticWorkingDirectory(const char* path)
 {
   if (!path )
     THROW_SALOME_CORBA_EXCEPTION( "Null working directory",SALOME::BAD_PARAM );
@@ -263,7 +263,6 @@ void HexoticPlugin_Hypothesis_i::SetHexoticMaxMemory (CORBA::Long theValue)
 }
 
 void HexoticPlugin_Hypothesis_i::SetOptionValue(const char* optionName, const char* optionValue)
-  throw (SALOME::SALOME_Exception)
 {
   ASSERT(myBaseImpl);
   try {
@@ -313,7 +312,7 @@ void HexoticPlugin_Hypothesis_i::SetOptionValue(const char* optionName, const ch
       try {
         valueChanged = ( this->GetImpl()->GetOptionValue( name, &isDefault ) != optionValue );
       }
-      catch ( std::invalid_argument ) {
+      catch ( std::invalid_argument& ) {
       }
       if ( valueChanged )
       {
@@ -331,7 +330,6 @@ void HexoticPlugin_Hypothesis_i::SetOptionValue(const char* optionName, const ch
 //=============================================================================
 
 char* HexoticPlugin_Hypothesis_i::GetOptionValue(const char* optionName)
-  throw (SALOME::SALOME_Exception)
 {
   ASSERT(myBaseImpl);
   try {
@@ -409,7 +407,6 @@ HexoticPlugin::string_array* HexoticPlugin_Hypothesis_i::GetAdvancedOptionValues
 //=============================================================================
 
 void HexoticPlugin_Hypothesis_i::SetOptionValues(const HexoticPlugin::string_array& options)
-  throw (SALOME::SALOME_Exception)
 {
   for (CORBA::ULong i = 0; i < options.length(); ++i)
   {
@@ -470,7 +467,6 @@ void HexoticPlugin_Hypothesis_i::SetAdvancedOptionValues(const HexoticPlugin::st
 //=============================================================================
 
 void HexoticPlugin_Hypothesis_i::SetAdvancedOption(const char* optionsAndValues)
-  throw (SALOME::SALOME_Exception)
 {
   if ( !optionsAndValues ) return;
 
index 37b75e52a76dd32530c9e9080b2e16f83bcacbbd..f79c550d751e60acf75ca00945ce435115f6d9c1 100644 (file)
@@ -74,7 +74,7 @@ class HEXOTICPLUGIN_EXPORT HexoticPlugin_Hypothesis_i:
   void SetHexoticNbProc(CORBA::Long theVal);
   CORBA::Long GetHexoticNbProc();
 
-  void SetHexoticWorkingDirectory(const char* path) throw ( SALOME::SALOME_Exception );
+  void SetHexoticWorkingDirectory(const char* path);
   char* GetHexoticWorkingDirectory();
 
   void SetKeepFiles(::CORBA::Boolean toKeep);
@@ -95,19 +95,19 @@ class HEXOTICPLUGIN_EXPORT HexoticPlugin_Hypothesis_i:
   void SetHexoticMaxMemory(CORBA::Long theVal);
   CORBA::Long GetHexoticMaxMemory();
 
-  void SetAdvancedOption(const char* theOptions) throw (SALOME::SALOME_Exception);
+  void SetAdvancedOption(const char* theOptions);
   char* GetAdvancedOption();
   void SetTextOptions(const char* theOptions); // obsolete
   char* GetTextOptions();
 
-  void SetOptionValue(const char* optionName, const char* optionValue) throw (SALOME::SALOME_Exception);
-  char* GetOptionValue(const char* optionName) throw (SALOME::SALOME_Exception);
+  void SetOptionValue(const char* optionName, const char* optionValue);
+  char* GetOptionValue(const char* optionName);
   void UnsetOption(const char* optionName);
 
   HexoticPlugin::string_array* GetOptionValues();
   HexoticPlugin::string_array* GetAdvancedOptionValues();
 
-  void SetOptionValues(const HexoticPlugin::string_array& options) throw (SALOME::SALOME_Exception);
+  void SetOptionValues(const HexoticPlugin::string_array& options);
   void SetAdvancedOptionValues(const HexoticPlugin::string_array& options);
 
   void AddOption(const char* optionName, const char* optionValue);
index 9a0db043bf446ed584fa987419e5380e5dd0758b..079ebf5d166243829b25fd507a4fbd40550b7f3c 100644 (file)
@@ -58,7 +58,6 @@ extern "C"
     else if (strcmp(aHypName, "Hexotic_Parameters") == 0 ||
              strcmp(aHypName, "MG-Hexa Parameters") == 0)
       aCreator = new HexoticPlugin_Creator_i<HexoticPlugin_Hypothesis_i>;
-    else ;
 
     return aCreator;
   }
index 82fc6ba90bb59195cbfbd7de742dbbd221187305..beb9bffd4e5237a022fb2fe6eabfe09c8807a0c6 100644 (file)
@@ -373,7 +373,7 @@ struct MG_Hexotic_API::LibData
     _nbRequiredTria = nb;
   }
 
-  void AddNode( double x, double y, double z, int domain )
+  void AddNode( double x, double y, double z, int /*domain*/ )
   {
     _xyz.push_back( x );
     _xyz.push_back( y );
@@ -701,6 +701,14 @@ bool MG_Hexotic_API::LibData::Compute()
   return true;
 }
 
+#else // ifdef USE_MG_LIBS
+
+struct MG_Hexotic_API::LibData // to avoid compiler warnings
+{
+  volatile bool& _cancelled_flag;
+  double& _progress;
+  LibData(volatile bool& cancelled_flag, double& progress): _cancelled_flag{cancelled_flag}, _progress{progress} {}
+};
 
 #endif // ifdef USE_MG_LIBS
 
@@ -714,9 +722,9 @@ bool MG_Hexotic_API::LibData::Compute()
 MG_Hexotic_API::MG_Hexotic_API(volatile bool& cancelled_flag, double& progress)
 {
   _useLib = false;
+  _libData = new LibData( cancelled_flag, progress );
 #ifdef USE_MG_LIBS
   _useLib = true;
-  _libData = new LibData( cancelled_flag, progress );
   _libData->Init();
   if ( getenv("MG_HEXA_USE_EXE"))
     _useLib = false;
@@ -901,7 +909,7 @@ void MG_Hexotic_API::GmfGotoKwd( int iMesh, GmfKwdCod what )
  */
 //================================================================================
 
-void MG_Hexotic_API::GmfGetLin( int iMesh, GmfKwdCod what, int* nbNodes, int* faceInd, int* ori, int* domain, int dummy )
+void MG_Hexotic_API::GmfGetLin( int iMesh, GmfKwdCod what, int* nbNodes, int* faceInd, int* ori, int* domain, int /*dummy*/ )
 {
   if ( _useLib ) {
 #ifdef USE_MG_LIBS