From: eap Date: Thu, 14 Jan 2016 11:35:43 +0000 (+0300) Subject: Fix compilation errors using gcc-5.X relating to explicit stream::operator bool() X-Git-Tag: V7_8_0a1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=19e2d378855d88bebfacafff27fa117c0e646053;p=plugins%2Fhybridplugin.git Fix compilation errors using gcc-5.X relating to explicit stream::operator bool() + Fix compilation warnings --- diff --git a/src/HYBRIDPlugin/HYBRIDPlugin_Hypothesis.cxx b/src/HYBRIDPlugin/HYBRIDPlugin_Hypothesis.cxx index fc9c0ca..45051c2 100644 --- a/src/HYBRIDPlugin/HYBRIDPlugin_Hypothesis.cxx +++ b/src/HYBRIDPlugin/HYBRIDPlugin_Hypothesis.cxx @@ -50,21 +50,21 @@ HYBRIDPlugin_Hypothesis::HYBRIDPlugin_Hypothesis(int hypId, int studyId, SMESH_G myCollisionMode(DefaultCollisionMode()), myBoundaryLayersGrowth(DefaultBoundaryLayersGrowth()), myElementGeneration(DefaultElementGeneration()), - myAddMultinormals(DefaultAddMultinormals()), - mySmoothNormals(DefaultSmoothNormals()), - myHeightFirstLayer(DefaultHeightFirstLayer()), - myBoundaryLayersProgression(DefaultBoundaryLayersProgression()), - myMultinormalsAngle(DefaultMultinormalsAngle()), - myNbOfBoundaryLayers(DefaultNbOfBoundaryLayers()), - myWorkingDirectory(DefaultWorkingDirectory()), myKeepFiles(DefaultKeepFiles()), + myWorkingDirectory(DefaultWorkingDirectory()), myVerboseLevel(DefaultVerboseLevel()), myToCreateNewNodes(DefaultToCreateNewNodes()), myToUseBoundaryRecoveryVersion(DefaultToUseBoundaryRecoveryVersion()), myToUseFemCorrection(DefaultToUseFEMCorrection()), myToRemoveCentralPoint(DefaultToRemoveCentralPoint()), - myGradation(DefaultGradation()), myLogInStandardOutput(DefaultStandardOutputLog()), + myGradation(DefaultGradation()), + myAddMultinormals(DefaultAddMultinormals()), + mySmoothNormals(DefaultSmoothNormals()), + myHeightFirstLayer(DefaultHeightFirstLayer()), + myBoundaryLayersProgression(DefaultBoundaryLayersProgression()), + myMultinormalsAngle(DefaultMultinormalsAngle()), + myNbOfBoundaryLayers(DefaultNbOfBoundaryLayers()), _enfVertexList(DefaultHYBRIDEnforcedVertexList()), _enfVertexCoordsSizeList(DefaultHYBRIDEnforcedVertexCoordsValues()), _enfVertexEntrySizeList(DefaultHYBRIDEnforcedVertexEntryValues()), @@ -769,7 +769,7 @@ bool HYBRIDPlugin_Hypothesis::SetEnforcedGroup(const SMESHDS_Mesh* theMeshDS, SM MESSAGE("HYBRIDPlugin_Hypothesis::SetEnforcedGroup"); TIDSortedElemSet theElemSet; if ( theIDs->length() == 0 ){MESSAGE("The source group is empty");} - for (int i=0; i < theIDs->length(); i++) { + for ( CORBA::ULong i = 0; i < theIDs->length(); i++) { CORBA::Long ind = theIDs[i]; if (elementType == SMESH::NODE) { @@ -1355,7 +1355,7 @@ std::ostream & HYBRIDPlugin_Hypothesis::SaveTo(std::ostream & save) } if (enfVertex->coords.size()) { save << " " << "__BEGIN_COORDS__"; - for (int i=0;icoords.size();i++) + for ( size_t i = 0; i < enfVertex->coords.size(); i++ ) save << " " << enfVertex->coords[i]; save << " " << "__END_COORDS__"; } @@ -1411,67 +1411,67 @@ std::istream & HYBRIDPlugin_Hypothesis::LoadFrom(std::istream & load) int i; double d; - isOK = (load >> i); + isOK = static_cast(load >> i); if (isOK) myBoundaryLayersGrowth = (short) i; else load.clear(ios::badbit | load.rdstate()); - isOK = (load >> i); + isOK = static_cast(load >> i); if (isOK) myElementGeneration = (short) i; else load.clear(ios::badbit | load.rdstate()); - isOK = (load >> i); + isOK = static_cast(load >> i); if (isOK) myAddMultinormals = (bool) i; else load.clear(ios::badbit | load.rdstate()); - isOK = (load >> i); + isOK = static_cast(load >> i); if (isOK) mySmoothNormals = (bool) i; else load.clear(ios::badbit | load.rdstate()); - isOK = (load >> i); + isOK = static_cast(load >> i); if (isOK) myLayersOnAllWrap = (bool) i; else load.clear(ios::badbit | load.rdstate()); - isOK = (load >> i); + isOK = static_cast(load >> i); if (isOK) myNbOfBoundaryLayers = (short) i; else load.clear(ios::badbit | load.rdstate()); - isOK = (load >> d); + isOK = static_cast(load >> d); if (isOK) myHeightFirstLayer = d; else load.clear(ios::badbit | load.rdstate()); - isOK = (load >> d); + isOK = static_cast(load >> d); if (isOK) myBoundaryLayersProgression = d; else load.clear(ios::badbit | load.rdstate()); - isOK = (load >> d); + isOK = static_cast(load >> d); if (isOK) myMultinormalsAngle = d; else load.clear(ios::badbit | load.rdstate()); - isOK = (load >> i); + isOK = static_cast(load >> i); if (isOK) myKeepFiles = (bool) i; else load.clear(ios::badbit | load.rdstate()); - isOK = (load >> myWorkingDirectory); + isOK = static_cast(load >> myWorkingDirectory); if (isOK) { if ( myWorkingDirectory == "0") { // myWorkingDirectory was empty myKeepFiles = false; @@ -1486,14 +1486,14 @@ std::istream & HYBRIDPlugin_Hypothesis::LoadFrom(std::istream & load) load.clear(ios::badbit | load.rdstate()); if ( !myWorkingDirectory.empty() ) { - isOK = (load >> i); + isOK = static_cast(load >> i); if (isOK) myKeepFiles = i; else load.clear(ios::badbit | load.rdstate()); } - isOK = (load >> i); + isOK = static_cast(load >> i); if (isOK) myVerboseLevel = (short) i; else @@ -1504,12 +1504,12 @@ std::istream & HYBRIDPlugin_Hypothesis::LoadFrom(std::istream & load) bool hasOptions = false; bool hasEnforcedVertices = false; bool hasEnforcedMeshes = false; - isOK = (load >> separator); + isOK = static_cast(load >> separator); if ( isOK && ( separator == "0" || separator == "1" )) { myToMakeGroupsOfDomains = ( separator == "1" ); - isOK = (load >> separator); + isOK = static_cast(load >> separator); } if (isOK) { @@ -1524,7 +1524,7 @@ std::istream & HYBRIDPlugin_Hypothesis::LoadFrom(std::istream & load) if (hasOptions) { std::string txt; while (isOK) { - isOK = (load >> txt); + isOK = static_cast(load >> txt); if (isOK) { if (txt == "__OPTIONS_END__") { if (!myTextOption.empty()) { @@ -1541,7 +1541,7 @@ std::istream & HYBRIDPlugin_Hypothesis::LoadFrom(std::istream & load) } if (hasOptions) { - isOK = (load >> separator); + isOK = static_cast(load >> separator); if (isOK && separator == "__ENFORCED_VERTICES_BEGIN__") hasEnforcedVertices = true; if (isOK && separator == "__ENFORCED_MESHES_BEGIN__") @@ -1553,14 +1553,14 @@ std::istream & HYBRIDPlugin_Hypothesis::LoadFrom(std::istream & load) double size, coords[3]; bool isCompound; bool hasCoords = false; - isOK = (load >> txt); // __BEGIN_VERTEX__ + isOK = static_cast(load >> txt); // __BEGIN_VERTEX__ while (isOK) { if (txt == "__ENFORCED_VERTICES_END__") isOK = false; THYBRIDEnforcedVertex *enfVertex = new THYBRIDEnforcedVertex(); while (isOK) { - isOK = (load >> txt); + isOK = static_cast(load >> txt); if (txt == "__END_VERTEX__") { enfVertex->name = name; enfVertex->geomEntry = entry; @@ -1586,7 +1586,7 @@ std::istream & HYBRIDPlugin_Hypothesis::LoadFrom(std::istream & load) if (txt == "__BEGIN_NAME__") { // __BEGIN_NAME__ while (isOK && (txt != "__END_NAME__")) { - isOK = (load >> txt); + isOK = static_cast(load >> txt); if (txt != "__END_NAME__") { if (!name.empty()) name += " "; @@ -1597,9 +1597,9 @@ std::istream & HYBRIDPlugin_Hypothesis::LoadFrom(std::istream & load) } if (txt == "__BEGIN_ENTRY__") { // __BEGIN_ENTRY__ - isOK = (load >> entry); - isOK = (load >> isCompound); - isOK = (load >> txt); // __END_ENTRY__ + isOK = static_cast(load >> entry); + isOK = static_cast(load >> isCompound); + isOK = static_cast(load >> txt); // __END_ENTRY__ if (txt != "__END_ENTRY__") throw std::exception(); MESSAGE("entry: " << entry); @@ -1607,7 +1607,7 @@ std::istream & HYBRIDPlugin_Hypothesis::LoadFrom(std::istream & load) if (txt == "__BEGIN_GROUP__") { // __BEGIN_GROUP__ while (isOK && (txt != "__END_GROUP__")) { - isOK = (load >> txt); + isOK = static_cast(load >> txt); if (txt != "__END_GROUP__") { if (!groupName.empty()) groupName += " "; @@ -1619,28 +1619,28 @@ std::istream & HYBRIDPlugin_Hypothesis::LoadFrom(std::istream & load) if (txt == "__BEGIN_COORDS__") { // __BEGIN_COORDS__ hasCoords = true; - isOK = (load >> coords[0] >> coords[1] >> coords[2]); - isOK = (load >> txt); // __END_COORDS__ + isOK = static_cast(load >> coords[0] >> coords[1] >> coords[2]); + isOK = static_cast(load >> txt); // __END_COORDS__ if (txt != "__END_COORDS__") throw std::exception(); MESSAGE("coords: " << coords[0] <<","<< coords[1] <<","<< coords[2]); } if (txt == "__BEGIN_SIZE__") { // __BEGIN_ENTRY__ - isOK = (load >> size); - isOK = (load >> txt); // __END_ENTRY__ + isOK = static_cast(load >> size); + isOK = static_cast(load >> txt); // __END_ENTRY__ if (txt != "__END_SIZE__") { throw std::exception(); } MESSAGE("size: " << size); } } - isOK = (load >> txt); // __BEGIN_VERTEX__ + isOK = static_cast(load >> txt); // __BEGIN_VERTEX__ } } if (hasEnforcedVertices) { - isOK = (load >> separator); + isOK = static_cast(load >> separator); if (isOK && separator == "__ENFORCED_MESHES_BEGIN__") hasEnforcedMeshes = true; } @@ -1648,7 +1648,7 @@ std::istream & HYBRIDPlugin_Hypothesis::LoadFrom(std::istream & load) if (hasEnforcedMeshes) { std::string txt, name, entry, groupName; int elementType = -1, persistID = -1; - isOK = (load >> txt); // __BEGIN_ENF_MESH__ + isOK = static_cast(load >> txt); // __BEGIN_ENF_MESH__ while (isOK) { // if (isOK) { if (txt == "__ENFORCED_MESHES_END__") @@ -1656,7 +1656,7 @@ std::istream & HYBRIDPlugin_Hypothesis::LoadFrom(std::istream & load) THYBRIDEnforcedMesh *enfMesh = new THYBRIDEnforcedMesh(); while (isOK) { - isOK = (load >> txt); + isOK = static_cast(load >> txt); if (txt == "__END_ENF_MESH__") { enfMesh->name = name; enfMesh->entry = entry; @@ -1677,7 +1677,7 @@ std::istream & HYBRIDPlugin_Hypothesis::LoadFrom(std::istream & load) if (txt == "__BEGIN_NAME__") { // __BEGIN_NAME__ while (isOK && (txt != "__END_NAME__")) { - isOK = (load >> txt); + isOK = static_cast(load >> txt); if (txt != "__END_NAME__") { if (!name.empty()) name += " "; @@ -1688,16 +1688,16 @@ std::istream & HYBRIDPlugin_Hypothesis::LoadFrom(std::istream & load) } if (txt == "__BEGIN_ENTRY__") { // __BEGIN_ENTRY__ - isOK = (load >> entry); - isOK = (load >> txt); // __END_ENTRY__ + isOK = static_cast(load >> entry); + isOK = static_cast(load >> txt); // __END_ENTRY__ if (txt != "__END_ENTRY__") throw std::exception(); MESSAGE("entry: " << entry); } if (txt == "__BEGIN_ELEM_TYPE__") { // __BEGIN_ELEM_TYPE__ - isOK = (load >> elementType); - isOK = (load >> txt); // __END_ELEM_TYPE__ + isOK = static_cast(load >> elementType); + isOK = static_cast(load >> txt); // __END_ELEM_TYPE__ if (txt != "__END_ELEM_TYPE__") throw std::exception(); MESSAGE("elementType: " << elementType); @@ -1705,7 +1705,7 @@ std::istream & HYBRIDPlugin_Hypothesis::LoadFrom(std::istream & load) if (txt == "__BEGIN_GROUP__") { // __BEGIN_GROUP__ while (isOK && (txt != "__END_GROUP__")) { - isOK = (load >> txt); + isOK = static_cast(load >> txt); if (txt != "__END_GROUP__") { if (!groupName.empty()) groupName += " "; @@ -1716,13 +1716,13 @@ std::istream & HYBRIDPlugin_Hypothesis::LoadFrom(std::istream & load) } // if if (txt == "__PERSIST_ID__") { - isOK = (load >> persistID); + isOK = static_cast(load >> persistID); MESSAGE("persistID: " << persistID); } std::cout << "isOK: " << isOK << std::endl; } // while // } // if - isOK = (load >> txt); // __BEGIN_ENF_MESH__ + isOK = static_cast(load >> txt); // __BEGIN_ENF_MESH__ } // while } // if