From bd4f33e4cfd6d33555eeb1ebe6680a168c122246 Mon Sep 17 00:00:00 2001 From: abn Date: Mon, 3 Apr 2017 10:43:40 +0200 Subject: [PATCH] clang compilation. --- src/INTERP_KERNEL/InterpKernelMeshQuality.hxx | 2 +- .../SingleElementPlanarTests.cxx | 114 +++++++++--------- .../TransformedTriangleTest.cxx | 2 +- src/MEDCoupling/MEDCouplingFieldDouble.cxx | 2 +- src/MEDCoupling/MEDCouplingFieldInt.cxx | 2 +- src/MEDCoupling/MEDCouplingMemArray.cxx | 8 +- src/MEDCoupling/MEDCouplingMemArrayChar.cxx | 4 +- .../MEDCouplingTimeDiscretization.cxx | 4 +- src/MEDLoader/MEDFileField.cxx | 4 +- src/MEDLoader/MEDFileMeshLL.hxx | 1 + src/MEDLoader/MEDFileUtilities.hxx | 1 + src/MEDLoader/SauvMedConvertor.cxx | 2 +- .../MEDPARTITIONER_MeshCollection.cxx | 2 +- ...RTITIONER_MeshCollectionMedAsciiDriver.cxx | 3 +- src/ParaMEDMEM/MPIAccess.cxx | 18 +-- 15 files changed, 86 insertions(+), 83 deletions(-) diff --git a/src/INTERP_KERNEL/InterpKernelMeshQuality.hxx b/src/INTERP_KERNEL/InterpKernelMeshQuality.hxx index 6ac61c3d0..b61a384be 100644 --- a/src/INTERP_KERNEL/InterpKernelMeshQuality.hxx +++ b/src/INTERP_KERNEL/InterpKernelMeshQuality.hxx @@ -18,7 +18,7 @@ // // Author : Anthony Geay (CEA/DEN) -#ifndef __INTERPKERNELMESHQUALITY_HXX_ +#ifndef __INTERPKERNELMESHQUALITY_HXX__ #define __INTERPKERNELMESHQUALITY_HXX__ #include "INTERPKERNELDefines.hxx" diff --git a/src/INTERP_KERNELTest/SingleElementPlanarTests.cxx b/src/INTERP_KERNELTest/SingleElementPlanarTests.cxx index 2abd41fdd..3aac0de46 100644 --- a/src/INTERP_KERNELTest/SingleElementPlanarTests.cxx +++ b/src/INTERP_KERNELTest/SingleElementPlanarTests.cxx @@ -262,17 +262,17 @@ namespace INTERP_TEST } // Square and diamond intersecting with no degeneracy // /\ - // / \ - // / \ - // __/______\__ - // | / \ | - // |/ \| + // / \ + // / \ + // __/______\__ + // | / \ | + // |/ \| // / \ - // /| |\ - // \| |/ - // \ / - // |\ /| - // |_\________/_| + // /| |\ + // \| |/ + // \ / + // |\ /| + // |_\________/_| // \ / // \ / // \ / @@ -369,7 +369,7 @@ namespace INTERP_TEST // Two diamonds intersecting at one vertex on edge and one double vertex // /\ /\ // / \ / \ - // / ¤ \ + // / � \ // / / \ \ // \ \ / / // \ * / @@ -500,12 +500,12 @@ namespace INTERP_TEST (INTERP_KERNEL::checkEqualPolygons,2>(&actual_result, &expected_result, _Epsilon))); } // square and diamond intersecting at four degenerated pointss // - // ²/²\ - // ² / ² \ - // ² / ² \ - // ² \ ² / - // ² \ ² / - // ²\²/ + // �/�\ + // � / � \ + // � / � \ + // � \ � / + // � \ � / + // �\�/ // \brief Status : pass void SingleElementPlanarTests::diamondsCritical2() @@ -542,14 +542,14 @@ namespace INTERP_TEST // Two tangent hexagons with double vertices and a critical starting vertex on edge // _________ - // / \²²² - // ² \² - // / \ - // / ² ² \ + // / \��� + // � \� + // / \ + // / � � \ // \ / - // \ ² ² / + // \ � � / // \ / - // \²_______²/ + // \�_______�/ // \brief Status : pass @@ -599,11 +599,11 @@ namespace INTERP_TEST // Two tangent hexagons with double vertices and a critical starting vertex on edge // _______ // / \ - // / \ + // / \ // \ / // \_______/ // / \ - // / \ + // / \ // \ / // \_______/ @@ -666,22 +666,22 @@ namespace INTERP_TEST (INTERP_KERNEL::checkEqualPolygons,2>(&actual_result, &expected_result, _Epsilon))); } // Two diamonds sharing a vertex in an exclusion configuration - // /\ - // / \ - // / \ - // / \ - // \ / - // \ / - // \ / - // \/ - // /\ - // / \ - // / \ - // / \ - // \ / - // \ / - // \ / - // \/ + // /\ + // / \ + // / \ + // / \ + // \ / + // \ / + // \ / + // \/ + // /\ + // / \ + // / \ + // / \ + // \ / + // \ / + // \ / + // \/ // \brief Status : pass @@ -710,12 +710,12 @@ namespace INTERP_TEST // ____ // /|\ / // / | \/ - // / | /\ - // / |/ \ - // \ / - // \ / - // \ / - // \ / + // / | /\ + // / |/ \ + // \ / + // \ / + // \ / + // \ / // \brief Status : pass void SingleElementPlanarTests:: triangleAndDiamondCritical() @@ -751,7 +751,7 @@ namespace INTERP_TEST // | | // | |\ | // | | \| - // | | \ + // | | \ // | | |\ // | | |/ // | | / @@ -794,10 +794,10 @@ namespace INTERP_TEST } // Two triangles with a starting vertex on edge - // /\ ²²²² - // / ² ² - // / ² ² - // /__²___\ + // /\ ���� + // / � � + // / � � + // /__�___\ // \brief Status : pass void SingleElementPlanarTests::trianglesCritical() @@ -839,7 +839,7 @@ namespace INTERP_TEST // /\ /\ // / \ / \ // / \ / \ - // /______\/______\ + // /______\/______\ // \brief Status : pass @@ -952,10 +952,10 @@ namespace INTERP_TEST } // Two triangles with double starting point in an outer tangency configuration - // /\ - // / \ - // / \ - // /______\ + // /\ + // / \ + // / \ + // /______\ // \ / // \ / // \ / diff --git a/src/INTERP_KERNELTest/TransformedTriangleTest.cxx b/src/INTERP_KERNELTest/TransformedTriangleTest.cxx index da36fb861..4cc591f27 100644 --- a/src/INTERP_KERNELTest/TransformedTriangleTest.cxx +++ b/src/INTERP_KERNELTest/TransformedTriangleTest.cxx @@ -263,7 +263,7 @@ namespace INTERP_TEST const int num_zero = (c_yz*c_xh == 0.0 ? 1 : 0) + (c_zx*c_yh == 0.0 ? 1 : 0) + (c_xy*c_zh == 0.0 ? 1 : 0); const int num_neg = (c_yz*c_xh < 0.0 ? 1 : 0) + (c_zx*c_yh < 0.0 ? 1 : 0) + (c_xy*c_zh < 0.0 ? 1 : 0); - if((num_zero == 1 && num_neg != 1) || num_zero == 2 || num_neg == 0 && num_zero !=3 || num_neg == 3 ) + if((num_zero == 1 && num_neg != 1) || num_zero == 2 || (num_neg == 0 && num_zero !=3) || num_neg == 3 ) { ++num_cases; diff --git a/src/MEDCoupling/MEDCouplingFieldDouble.cxx b/src/MEDCoupling/MEDCouplingFieldDouble.cxx index c4841f062..3fef0349a 100644 --- a/src/MEDCoupling/MEDCouplingFieldDouble.cxx +++ b/src/MEDCoupling/MEDCouplingFieldDouble.cxx @@ -39,7 +39,7 @@ using namespace MEDCoupling; -template class MEDCouplingFieldT; +template class MEDCoupling::MEDCouplingFieldT; /*! * Creates a new MEDCouplingFieldDouble, of given spatial type and time discretization. diff --git a/src/MEDCoupling/MEDCouplingFieldInt.cxx b/src/MEDCoupling/MEDCouplingFieldInt.cxx index f6b6fa297..51811f687 100644 --- a/src/MEDCoupling/MEDCouplingFieldInt.cxx +++ b/src/MEDCoupling/MEDCouplingFieldInt.cxx @@ -26,7 +26,7 @@ using namespace MEDCoupling; -template class MEDCouplingFieldT; +template class MEDCoupling::MEDCouplingFieldT; MEDCouplingFieldInt *MEDCouplingFieldInt::New(TypeOfField type, TypeOfTimeDiscretization td) { diff --git a/src/MEDCoupling/MEDCouplingMemArray.cxx b/src/MEDCoupling/MEDCouplingMemArray.cxx index 53213b741..6609e9142 100644 --- a/src/MEDCoupling/MEDCouplingMemArray.cxx +++ b/src/MEDCoupling/MEDCouplingMemArray.cxx @@ -36,10 +36,10 @@ typedef double (*MYFUNCPTR)(double); using namespace MEDCoupling; -template class MemArray; -template class MemArray; -template class DataArrayTemplate; -template class DataArrayTemplate; +template class MEDCoupling::MemArray; +template class MEDCoupling::MemArray; +template class MEDCoupling::DataArrayTemplate; +template class MEDCoupling::DataArrayTemplate; template void DataArrayDouble::findCommonTuplesAlg(const double *bbox, int nbNodes, int limitNodeId, double prec, DataArrayInt *c, DataArrayInt *cI) const diff --git a/src/MEDCoupling/MEDCouplingMemArrayChar.cxx b/src/MEDCoupling/MEDCouplingMemArrayChar.cxx index 854dcf880..590423fdb 100644 --- a/src/MEDCoupling/MEDCouplingMemArrayChar.cxx +++ b/src/MEDCoupling/MEDCouplingMemArrayChar.cxx @@ -30,8 +30,8 @@ using namespace MEDCoupling; -template class MemArray; -template class DataArrayTemplate; +template class MEDCoupling::MemArray; +template class MEDCoupling::DataArrayTemplate; /*! * Returns an integer value characterizing \a this array, which is useful for a quick diff --git a/src/MEDCoupling/MEDCouplingTimeDiscretization.cxx b/src/MEDCoupling/MEDCouplingTimeDiscretization.cxx index b29ee50fd..988048d99 100644 --- a/src/MEDCoupling/MEDCouplingTimeDiscretization.cxx +++ b/src/MEDCoupling/MEDCouplingTimeDiscretization.cxx @@ -29,8 +29,8 @@ using namespace MEDCoupling; -template class MEDCouplingTimeDiscretizationTemplate; -template class MEDCouplingTimeDiscretizationTemplate; +template class MEDCoupling::MEDCouplingTimeDiscretizationTemplate; +template class MEDCoupling::MEDCouplingTimeDiscretizationTemplate; const char MEDCouplingTimeDiscretizationInt::REPR[]="One time label."; diff --git a/src/MEDLoader/MEDFileField.cxx b/src/MEDLoader/MEDFileField.cxx index 9b389e440..df38605c5 100644 --- a/src/MEDLoader/MEDFileField.cxx +++ b/src/MEDLoader/MEDFileField.cxx @@ -44,8 +44,8 @@ extern med_geometry_type typmai3[34]; using namespace MEDCoupling; -template class MEDFileField1TSTemplateWithoutSDA; -template class MEDFileField1TSTemplateWithoutSDA; +template class MEDCoupling::MEDFileField1TSTemplateWithoutSDA; +template class MEDCoupling::MEDFileField1TSTemplateWithoutSDA; const char MEDFileField1TSWithoutSDA::TYPE_STR[]="FLOAT64"; const char MEDFileIntField1TSWithoutSDA::TYPE_STR[]="INT32"; 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..65e903676 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) ; } @@ -865,9 +865,9 @@ namespace MEDCoupling int MPIAccess::cancel( int source, int theMPITag, MPI_Datatype datatype, int outcount, int &flag ) { int sts ; - MPI_Aint extent ; + MPI_Aint extent, lbound ; flag = 0 ; - sts = MPI_Type_extent( datatype , &extent ) ; + sts = MPI_Type_get_extent( datatype , &lbound, &extent ) ; if ( sts == MPI_SUCCESS ) { void * recvbuf = malloc( extent*outcount ) ; @@ -1039,24 +1039,24 @@ namespace MEDCoupling // Returns the MPI size of a TimeMessage MPI_Aint MPIAccess::timeExtent() const { - MPI_Aint aextent ; - MPI_Type_extent( _MPI_TIME , &aextent ) ; + MPI_Aint aextent, lbound ; + MPI_Type_get_extent( _MPI_TIME , &lbound, &aextent ) ; return aextent ; } // Returns the MPI size of a MPI_INT MPI_Aint MPIAccess::intExtent() const { - MPI_Aint aextent ; - MPI_Type_extent( MPI_INT , &aextent ) ; + MPI_Aint aextent, lbound ; + MPI_Type_get_extent( MPI_INT , &lbound, &aextent ) ; return aextent ; } // Returns the MPI size of a MPI_DOUBLE MPI_Aint MPIAccess::doubleExtent() const { - MPI_Aint aextent ; - MPI_Type_extent( MPI_DOUBLE , &aextent ) ; + MPI_Aint aextent, lbound ; + MPI_Type_get_extent( MPI_DOUBLE , &lbound, &aextent ) ; return aextent ; } -- 2.39.2