From: SALOME Date: Mon, 24 Aug 2020 10:51:41 +0000 (+0300) Subject: #18963 Minimize compiler warnings X-Git-Tag: V9_7_0a1~4 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=2c9230e78ba7cef9339273699b9de88450983e5f;p=plugins%2Fhexoticplugin.git #18963 Minimize compiler warnings --- diff --git a/src/HexoticPlugin/HexoticPlugin_Hexotic.cxx b/src/HexoticPlugin/HexoticPlugin_Hexotic.cxx index 887e868..5f414a6 100644 --- a/src/HexoticPlugin/HexoticPlugin_Hexotic.cxx +++ b/src/HexoticPlugin/HexoticPlugin_Hexotic.cxx @@ -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 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; diff --git a/src/HexoticPlugin/HexoticPlugin_Hypothesis.cxx b/src/HexoticPlugin/HexoticPlugin_Hypothesis.cxx index 71b2f7e..f82429d 100644 --- a/src/HexoticPlugin/HexoticPlugin_Hypothesis.cxx +++ b/src/HexoticPlugin/HexoticPlugin_Hypothesis.cxx @@ -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; } diff --git a/src/HexoticPlugin/HexoticPlugin_Hypothesis.hxx b/src/HexoticPlugin/HexoticPlugin_Hypothesis.hxx index 7ee5b83..523da6a 100644 --- a/src/HexoticPlugin/HexoticPlugin_Hypothesis.hxx +++ b/src/HexoticPlugin/HexoticPlugin_Hypothesis.hxx @@ -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 diff --git a/src/HexoticPlugin/HexoticPlugin_Hypothesis_i.cxx b/src/HexoticPlugin/HexoticPlugin_Hypothesis_i.cxx index 2681761..bbf36d5 100644 --- a/src/HexoticPlugin/HexoticPlugin_Hypothesis_i.cxx +++ b/src/HexoticPlugin/HexoticPlugin_Hypothesis_i.cxx @@ -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; diff --git a/src/HexoticPlugin/HexoticPlugin_Hypothesis_i.hxx b/src/HexoticPlugin/HexoticPlugin_Hypothesis_i.hxx index 37b75e5..f79c550 100644 --- a/src/HexoticPlugin/HexoticPlugin_Hypothesis_i.hxx +++ b/src/HexoticPlugin/HexoticPlugin_Hypothesis_i.hxx @@ -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); diff --git a/src/HexoticPlugin/HexoticPlugin_i.cxx b/src/HexoticPlugin/HexoticPlugin_i.cxx index 9a0db04..079ebf5 100644 --- a/src/HexoticPlugin/HexoticPlugin_i.cxx +++ b/src/HexoticPlugin/HexoticPlugin_i.cxx @@ -58,7 +58,6 @@ extern "C" else if (strcmp(aHypName, "Hexotic_Parameters") == 0 || strcmp(aHypName, "MG-Hexa Parameters") == 0) aCreator = new HexoticPlugin_Creator_i; - else ; return aCreator; } diff --git a/src/HexoticPlugin/MG_Hexotic_API.cxx b/src/HexoticPlugin/MG_Hexotic_API.cxx index 82fc6ba..beb9bff 100644 --- a/src/HexoticPlugin/MG_Hexotic_API.cxx +++ b/src/HexoticPlugin/MG_Hexotic_API.cxx @@ -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