From: eap Date: Thu, 10 Dec 2020 09:35:57 +0000 (+0300) Subject: #18963 Minimize compiler warnings (finish) X-Git-Tag: V9_7_0a1~4 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=047bd384f7772487925617225087ce65948d09ed;p=plugins%2Fghs3dplugin.git #18963 Minimize compiler warnings (finish) --- diff --git a/src/GHS3DPlugin/GHS3DPlugin_GHS3D.cxx b/src/GHS3DPlugin/GHS3DPlugin_GHS3D.cxx index f339773..0030d60 100644 --- a/src/GHS3DPlugin/GHS3DPlugin_GHS3D.cxx +++ b/src/GHS3DPlugin/GHS3DPlugin_GHS3D.cxx @@ -691,7 +691,7 @@ static bool readGMFFile(MG_Tetra_API* MGOutput, std::vector< const SMDS_MeshElement* > foundVolumes; if ( !hasGeom && theHelper->GetMesh()->NbVolumes() > 0 ) elemSearcher = SMESH_MeshAlgos::GetElementSearcher( *theMeshDS ); - unique_ptr< SMESH_ElementSearcher > elemSearcherDeleter( elemSearcher ); //auto_ptr + unique_ptr< SMESH_ElementSearcher > elemSearcherDeleter( elemSearcher ); // IMP 0022172: [CEA 790] create the groups corresponding to domains std::vector< std::vector< const SMDS_MeshElement* > > elemsOfDomain; @@ -1722,8 +1722,7 @@ bool GHS3DPlugin_GHS3D::Compute(SMESH_Mesh& theMesh, TCollection_AsciiString aSmdsToGhs3dIdMapFileName; aSmdsToGhs3dIdMapFileName = aGenericName + ".ids"; // ids relation ofstream aIdsFile ( aSmdsToGhs3dIdMapFileName.ToCString() , ios::out); - Ok = aIdsFile.rdbuf()->is_open(); - if (!Ok) { + if ( !aIdsFile.rdbuf()->is_open() ) { INFOS( "Can't write into " << aSmdsToGhs3dIdMapFileName); //return error(SMESH_Comment("Can't write into ") << aSmdsToGhs3dIdMapFileName); } diff --git a/src/GHS3DPlugin/GHS3DPlugin_Optimizer.hxx b/src/GHS3DPlugin/GHS3DPlugin_Optimizer.hxx index cea0d57..21c09a2 100644 --- a/src/GHS3DPlugin/GHS3DPlugin_Optimizer.hxx +++ b/src/GHS3DPlugin/GHS3DPlugin_Optimizer.hxx @@ -44,7 +44,7 @@ public: virtual bool Compute(SMESH_Mesh& theMesh, SMESH_MesherHelper* theHelper); - virtual bool Compute(SMESH_Mesh & aMesh, + virtual bool Compute(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape); static const char* Name() { return "MG-Tetra Optimization"; } diff --git a/src/GHS3DPlugin/MG_Tetra_API.cxx b/src/GHS3DPlugin/MG_Tetra_API.cxx index 4503061..258a081 100644 --- a/src/GHS3DPlugin/MG_Tetra_API.cxx +++ b/src/GHS3DPlugin/MG_Tetra_API.cxx @@ -695,7 +695,9 @@ struct MG_Tetra_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} {} + LibData(volatile bool& cancelled_flag, double& progress): + _cancelled_flag{cancelled_flag}, _progress{progress} + {} }; #endif // ifdef USE_MG_LIBS diff --git a/src/GUI/GHS3DPluginGUI_HypothesisCreator.cxx b/src/GUI/GHS3DPluginGUI_HypothesisCreator.cxx index 86295da..50e6003 100644 --- a/src/GUI/GHS3DPluginGUI_HypothesisCreator.cxx +++ b/src/GUI/GHS3DPluginGUI_HypothesisCreator.cxx @@ -1038,7 +1038,7 @@ void GHS3DPluginGUI_HypothesisCreator::addEnforcedVertex(double x, double y, dou { myEnforcedTableWidget->disconnect(SIGNAL( itemChanged(QTableWidgetItem *))); bool okToCreate = true; - double itemX=0.,itemY=0.,itemZ=0.,itemSize = 0; // todo: itemX, itemY, itemZ must be explicitly initialized to avoid warning (see below) + double itemX=0.,itemY=0.,itemZ=0.,itemSize = 0; QString itemEntry, itemGroupName = QString(""); // bool itemIsCompound; int rowCount = myEnforcedTableWidget->rowCount(); @@ -1083,7 +1083,7 @@ void GHS3DPluginGUI_HypothesisCreator::addEnforcedVertex(double x, double y, dou break; - if (( !isCompound && ((itemX == x) && (itemY == y) && (itemZ == z))) || // todo: itemX, itemY, itemZ must be explicitly initialized to avoid warning (see above) + if (( !isCompound && ((itemX == x) && (itemY == y) && (itemZ == z))) || ( !itemEntry.isEmpty() && ( itemEntry == geomEntry.c_str() ))) { // update size @@ -1864,7 +1864,7 @@ bool GHS3DPluginGUI_HypothesisCreator::storeParamsToHypo( const GHS3DHypothesisD _PTR(SObject) aSObj = aStudy->FindObjectID(enfMesh->entry.c_str()); SMESH::SMESH_IDSource_var theSource = SMESH::SObjectToInterface( aSObj ); - SMESH::ElementType elementType = SMESH::NODE; // todo: elementType must be explicitly initialized to avoid warning (see below) + SMESH::ElementType elementType = SMESH::NODE; switch(enfMesh->elementType) { case 0: elementType = SMESH::NODE; @@ -1879,7 +1879,7 @@ bool GHS3DPluginGUI_HypothesisCreator::storeParamsToHypo( const GHS3DHypothesisD break; } - ok = h->p_SetEnforcedMesh(theSource, elementType, enfMesh->name.c_str(), enfMesh->groupName.c_str()); // todo: elementType must be explicitly initialized to avoid warning (see above) + ok = h->p_SetEnforcedMesh(theSource, elementType, enfMesh->name.c_str(), enfMesh->groupName.c_str()); } // for } // try catch ( const SALOME::SALOME_Exception& ex )