From 1b4351f2f2291234195b77970e47637698eb93b6 Mon Sep 17 00:00:00 2001 From: abn Date: Mon, 3 Apr 2017 11:36:35 +0200 Subject: [PATCH] CLang compatibility 4 --- src/MEDLoader/MEDFileMeshLL.hxx | 1 + src/MEDLoader/MEDFileUtilities.hxx | 1 + src/MEDLoader/SauvMedConvertor.cxx | 2 +- src/MEDPartitioner/MEDPARTITIONER_MeshCollection.cxx | 2 +- .../MEDPARTITIONER_MeshCollectionMedAsciiDriver.cxx | 3 ++- src/ParaMEDMEM/MPIAccess.cxx | 10 +++++----- 6 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/MEDLoader/MEDFileMeshLL.hxx b/src/MEDLoader/MEDFileMeshLL.hxx index 0113a22bf..a76161233 100644 --- a/src/MEDLoader/MEDFileMeshLL.hxx +++ b/src/MEDLoader/MEDFileMeshLL.hxx @@ -46,6 +46,7 @@ namespace MEDCoupling protected: MeshOrStructMeshCls(int mid):_mid(mid) { } public: + virtual ~MeshOrStructMeshCls() {} int getID() const { return _mid; } virtual std::vector getAxisInfoOnMesh(med_idt fid, const std::string& mName, MEDCoupling::MEDCouplingMeshType& meshType, MEDCoupling::MEDCouplingAxisType& axType, int& nstep, int& Mdim, MEDFileString& description, MEDFileString& dtunit, MEDFileString& univName) const = 0; virtual double checkMeshTimeStep(med_idt fid, const std::string& mName, int nstep, int dt, int it) const = 0; diff --git a/src/MEDLoader/MEDFileUtilities.hxx b/src/MEDLoader/MEDFileUtilities.hxx index 32ed5d47e..27c93158d 100644 --- a/src/MEDLoader/MEDFileUtilities.hxx +++ b/src/MEDLoader/MEDFileUtilities.hxx @@ -53,6 +53,7 @@ namespace MEDCoupling { public: MEDFileWritable(); + virtual ~MEDFileWritable() {} void copyOptionsFrom(const MEDFileWritable& other) const; int getTooLongStrPolicy() const; void setTooLongStrPolicy(int newVal); diff --git a/src/MEDLoader/SauvMedConvertor.cxx b/src/MEDLoader/SauvMedConvertor.cxx index 10c87b2de..c94ff7387 100644 --- a/src/MEDLoader/SauvMedConvertor.cxx +++ b/src/MEDLoader/SauvMedConvertor.cxx @@ -1972,7 +1972,7 @@ double ASCIIReader::getDouble() const //0123456789012345678901234567890123456789012345678901234567890123456789 const size_t posE = 18; std::string aStr (_curPos); - if ( aStr.find('E') < 0 && aStr.find('e') < 0 ) + if ( aStr.find('E') == std::string::npos && aStr.find('e') == std::string::npos ) { if ( aStr.size() < posE+1 ) THROW_IK_EXCEPTION("No more doubles (line #" << lineNb() << ")"); diff --git a/src/MEDPartitioner/MEDPARTITIONER_MeshCollection.cxx b/src/MEDPartitioner/MEDPARTITIONER_MeshCollection.cxx index b19b15f13..e7023ab9c 100644 --- a/src/MEDPartitioner/MEDPARTITIONER_MeshCollection.cxx +++ b/src/MEDPartitioner/MEDPARTITIONER_MeshCollection.cxx @@ -398,7 +398,7 @@ void getNodeIds(MEDCoupling::MEDCouplingUMesh& meshOne, MEDCoupling::MEDCoupling { using std::vector; using MEDPARTITIONER::BBTreeOfDim; - if (!&meshOne || !&meshTwo) return; //empty or not existing + //if (!&meshOne || !&meshTwo) return; //empty or not existing double* bbox; BBTreeOfDim* tree = 0; int nv1=meshOne.getNumberOfNodes(); diff --git a/src/MEDPartitioner/MEDPARTITIONER_MeshCollectionMedAsciiDriver.cxx b/src/MEDPartitioner/MEDPARTITIONER_MeshCollectionMedAsciiDriver.cxx index 7d17c8ace..81231dace 100644 --- a/src/MEDPartitioner/MEDPARTITIONER_MeshCollectionMedAsciiDriver.cxx +++ b/src/MEDPartitioner/MEDPARTITIONER_MeshCollectionMedAsciiDriver.cxx @@ -183,7 +183,8 @@ void MeshCollectionMedAsciiDriver::write(const char* filename, ParaDomainSelecto if ( !domainSelector || domainSelector->isMyDomain( idomain ) ) { - if ( !_collection->getMesh()[idomain]->getNumberOfCells()==0 ) continue;//empty domain + // [ABN] spurious test in 8.2 - fixed as I think it should be: + if ( _collection->getMesh()[idomain]->getNumberOfCells() == 0 ) continue; WriteUMesh(distfilename.c_str(),(_collection->getMesh())[idomain],true); //writeSubdomain(idomain, nbdomains, distfilename.c_str(), domainSelector); } diff --git a/src/ParaMEDMEM/MPIAccess.cxx b/src/ParaMEDMEM/MPIAccess.cxx index f93e36aa1..49f4d35c9 100644 --- a/src/ParaMEDMEM/MPIAccess.cxx +++ b/src/ParaMEDMEM/MPIAccess.cxx @@ -137,7 +137,7 @@ namespace MEDCoupling array_of_displacements[0] = 0 ; array_of_displacements[1] = sizeof(double) ; array_of_displacements[2] = 2*sizeof(double) ; - MPI_Type_struct(3, array_of_blocklengths, array_of_displacements, + MPI_Type_create_struct(3, array_of_blocklengths, array_of_displacements, array_of_types, &_MPI_TIME) ; MPI_Type_commit(&_MPI_TIME) ; } @@ -867,7 +867,7 @@ namespace MEDCoupling int sts ; MPI_Aint extent ; flag = 0 ; - sts = MPI_Type_extent( datatype , &extent ) ; + sts = MPI_Type_get_extent( datatype , &extent ) ; if ( sts == MPI_SUCCESS ) { void * recvbuf = malloc( extent*outcount ) ; @@ -1040,7 +1040,7 @@ namespace MEDCoupling MPI_Aint MPIAccess::timeExtent() const { MPI_Aint aextent ; - MPI_Type_extent( _MPI_TIME , &aextent ) ; + MPI_Type_get_extent( _MPI_TIME , &aextent ) ; return aextent ; } @@ -1048,7 +1048,7 @@ namespace MEDCoupling MPI_Aint MPIAccess::intExtent() const { MPI_Aint aextent ; - MPI_Type_extent( MPI_INT , &aextent ) ; + MPI_Type_get_extent( MPI_INT , &aextent ) ; return aextent ; } @@ -1056,7 +1056,7 @@ namespace MEDCoupling MPI_Aint MPIAccess::doubleExtent() const { MPI_Aint aextent ; - MPI_Type_extent( MPI_DOUBLE , &aextent ) ; + MPI_Type_get_extent( MPI_DOUBLE , &aextent ) ; return aextent ; } -- 2.39.2