From 06ac794455d7c9eee11f03dbf1f4082d1def4057 Mon Sep 17 00:00:00 2001 From: Anthony Geay Date: Mon, 29 May 2017 09:56:04 +0200 Subject: [PATCH] warning hunting in medcoupling to ease template action in DataArrays --- src/MEDCoupling/MCType.hxx | 8 ++-- src/MEDCoupling/MEDCouplingCMesh.cxx | 4 +- src/MEDCoupling/MEDCouplingCMesh.hxx | 2 +- .../MEDCouplingCurveLinearMesh.cxx | 6 +-- .../MEDCouplingCurveLinearMesh.hxx | 2 +- .../MEDCouplingFieldDiscretization.cxx | 2 +- src/MEDCoupling/MEDCouplingFieldDouble.cxx | 15 ++++--- src/MEDCoupling/MEDCouplingFieldDouble.hxx | 4 +- src/MEDCoupling/MEDCouplingFieldFloat.cxx | 2 +- src/MEDCoupling/MEDCouplingFieldFloat.hxx | 2 +- src/MEDCoupling/MEDCouplingFieldInt.cxx | 2 +- .../MEDCouplingGaussLocalization.cxx | 4 +- src/MEDCoupling/MEDCouplingIMesh.cxx | 14 +++---- .../MEDCouplingMappedExtrudedMesh.cxx | 4 +- .../MEDCouplingMappedExtrudedMesh.hxx | 2 +- src/MEDCoupling/MEDCouplingMemArray.cxx | 39 ++++++++++--------- src/MEDCoupling/MEDCouplingMemArray.txx | 23 ++++++----- src/MEDCoupling/MEDCouplingMemArrayChar.cxx | 2 +- src/MEDCoupling/MEDCouplingPointSet.cxx | 4 +- src/MEDCoupling/MEDCouplingPointSet.hxx | 2 +- src/MEDCoupling/MEDCouplingRefCountObject.cxx | 8 ++-- src/MEDCoupling/MEDCouplingRefCountObject.hxx | 4 +- src/MEDCoupling/MEDCouplingStructuredMesh.cxx | 12 +++--- src/MEDCoupling/MEDCouplingStructuredMesh.hxx | 2 +- .../MEDCouplingTimeDiscretization.hxx | 1 + src/MEDCoupling/MEDCouplingUMesh.cxx | 12 +++--- src/MEDCoupling/MEDCouplingUMesh.hxx | 2 +- src/MEDCoupling/MEDCouplingVoronoi.cxx | 8 ++-- 28 files changed, 97 insertions(+), 95 deletions(-) diff --git a/src/MEDCoupling/MCType.hxx b/src/MEDCoupling/MCType.hxx index 8b8fe5417..a49573305 100644 --- a/src/MEDCoupling/MCType.hxx +++ b/src/MEDCoupling/MCType.hxx @@ -21,9 +21,11 @@ #ifndef __MEDCOUPLING_MCTYPE_HXX__ #define __MEDCOUPLING_MCTYPE_HXX__ -typedef long Int64; - -typedef int Int32; +namespace MEDCoupling +{ + typedef long Int64; + typedef int Int32; +} #define DataArrayInt DataArrayInt32 diff --git a/src/MEDCoupling/MEDCouplingCMesh.cxx b/src/MEDCoupling/MEDCouplingCMesh.cxx index f64050492..066d39ac4 100644 --- a/src/MEDCoupling/MEDCouplingCMesh.cxx +++ b/src/MEDCoupling/MEDCouplingCMesh.cxx @@ -36,9 +36,9 @@ MEDCouplingCMesh::MEDCouplingCMesh():_x_array(0),_y_array(0),_z_array(0) { } -MEDCouplingCMesh::MEDCouplingCMesh(const MEDCouplingCMesh& other, bool deepCopy):MEDCouplingStructuredMesh(other,deepCopy) +MEDCouplingCMesh::MEDCouplingCMesh(const MEDCouplingCMesh& other, bool deepCpy):MEDCouplingStructuredMesh(other,deepCpy) { - if(deepCopy) + if(deepCpy) { if(other._x_array) _x_array=other._x_array->deepCopy(); diff --git a/src/MEDCoupling/MEDCouplingCMesh.hxx b/src/MEDCoupling/MEDCouplingCMesh.hxx index 0af6ec292..8f17528ea 100644 --- a/src/MEDCoupling/MEDCouplingCMesh.hxx +++ b/src/MEDCoupling/MEDCouplingCMesh.hxx @@ -88,7 +88,7 @@ namespace MEDCoupling MEDCOUPLING_EXPORT std::string getVTKFileExtension() const; private: MEDCouplingCMesh(); - MEDCouplingCMesh(const MEDCouplingCMesh& other, bool deepCopy); + MEDCouplingCMesh(const MEDCouplingCMesh& other, bool deepCpy); ~MEDCouplingCMesh(); void writeVTKLL(std::ostream& ofs, const std::string& cellData, const std::string& pointData, DataArrayByte *byteData) const; std::string getVTKDataSetType() const; diff --git a/src/MEDCoupling/MEDCouplingCurveLinearMesh.cxx b/src/MEDCoupling/MEDCouplingCurveLinearMesh.cxx index b8e76f682..b321f93ec 100644 --- a/src/MEDCoupling/MEDCouplingCurveLinearMesh.cxx +++ b/src/MEDCoupling/MEDCouplingCurveLinearMesh.cxx @@ -16,7 +16,7 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -// Author : Anthony Geay (CEA/DEN) +// Author : Anthony Geay (EDF R&D) #include "MEDCouplingCurveLinearMesh.hxx" #include "MEDCouplingPointSet.hxx" @@ -37,9 +37,9 @@ MEDCouplingCurveLinearMesh::MEDCouplingCurveLinearMesh():_coords(0),_structure(0 { } -MEDCouplingCurveLinearMesh::MEDCouplingCurveLinearMesh(const MEDCouplingCurveLinearMesh& other, bool deepCopy):MEDCouplingStructuredMesh(other,deepCopy),_structure(other._structure) +MEDCouplingCurveLinearMesh::MEDCouplingCurveLinearMesh(const MEDCouplingCurveLinearMesh& other, bool deepCpy):MEDCouplingStructuredMesh(other,deepCpy),_structure(other._structure) { - if(deepCopy) + if(deepCpy) { if((const DataArrayDouble *)other._coords) _coords=other._coords->deepCopy(); diff --git a/src/MEDCoupling/MEDCouplingCurveLinearMesh.hxx b/src/MEDCoupling/MEDCouplingCurveLinearMesh.hxx index d9884d89c..616f67407 100644 --- a/src/MEDCoupling/MEDCouplingCurveLinearMesh.hxx +++ b/src/MEDCoupling/MEDCouplingCurveLinearMesh.hxx @@ -94,7 +94,7 @@ namespace MEDCoupling void getBarycenterAndOwnerMeshDim1(DataArrayDouble *bary) const; private: MEDCouplingCurveLinearMesh(); - MEDCouplingCurveLinearMesh(const MEDCouplingCurveLinearMesh& other, bool deepCopy); + MEDCouplingCurveLinearMesh(const MEDCouplingCurveLinearMesh& other, bool deepCpy); ~MEDCouplingCurveLinearMesh(); void writeVTKLL(std::ostream& ofs, const std::string& cellData, const std::string& pointData, DataArrayByte *byteData) const; std::string getVTKDataSetType() const; diff --git a/src/MEDCoupling/MEDCouplingFieldDiscretization.cxx b/src/MEDCoupling/MEDCouplingFieldDiscretization.cxx index 6cb1d512a..eb719663d 100644 --- a/src/MEDCoupling/MEDCouplingFieldDiscretization.cxx +++ b/src/MEDCoupling/MEDCouplingFieldDiscretization.cxx @@ -1701,7 +1701,7 @@ MEDCouplingFieldDouble *MEDCouplingFieldDiscretizationGauss::getMeasureField(con _discr_per_cell->checkAllocated(); if(_discr_per_cell->getNumberOfComponents()!=1) throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretizationGauss::getMeasureField : no discr per cell array defined but with nb of components different from 1 !"); - if(_discr_per_cell->getNumberOfTuples()!=vol->getNumberOfTuples()) + if(_discr_per_cell->getNumberOfTuples()!=(int)vol->getNumberOfTuples()) throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretizationGauss::getMeasureField : no discr per cell array defined but mismatch between nb of cells of mesh and size of spatial disr array !"); MCAuto offset=getOffsetArr(mesh); MCAuto arr=DataArrayDouble::New(); arr->alloc(getNumberOfTuples(mesh),1); diff --git a/src/MEDCoupling/MEDCouplingFieldDouble.cxx b/src/MEDCoupling/MEDCouplingFieldDouble.cxx index 504451a71..49bb8d442 100644 --- a/src/MEDCoupling/MEDCouplingFieldDouble.cxx +++ b/src/MEDCoupling/MEDCouplingFieldDouble.cxx @@ -174,9 +174,9 @@ MEDCouplingFieldDouble *MEDCouplingFieldDouble::deepCopy() const * \endif * \sa clone() */ -MEDCouplingFieldDouble *MEDCouplingFieldDouble::buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCopy) const +MEDCouplingFieldDouble *MEDCouplingFieldDouble::buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCpy) const { - MEDCouplingTimeDiscretization *tdo=timeDiscr()->buildNewTimeReprFromThis(td,deepCopy); + MEDCouplingTimeDiscretization *tdo=timeDiscr()->buildNewTimeReprFromThis(td,deepCpy); MCAuto disc; if(_type) disc=_type->clone(); @@ -548,7 +548,7 @@ MEDCouplingFieldDouble::MEDCouplingFieldDouble(const MEDCouplingFieldTemplate& f { } -MEDCouplingFieldDouble::MEDCouplingFieldDouble(const MEDCouplingFieldDouble& other, bool deepCopy):MEDCouplingFieldT(other,deepCopy) +MEDCouplingFieldDouble::MEDCouplingFieldDouble(const MEDCouplingFieldDouble& other, bool deepCpy):MEDCouplingFieldT(other,deepCpy) { } @@ -2016,7 +2016,6 @@ MCAuto MEDCouplingFieldDouble::convertQuadraticCellsToLi if(!disc2) throw INTERP_KERNEL::Exception("convertQuadraticCellsToLinear : Not a ON_GAUSS_PT field"); std::set gt2(umesh->getAllGeoTypes()); - const DataArrayDouble *arr(getArray()); std::vector< MCAuto > cellIdsV; std::vector< MCAuto > meshesV; std::vector< MEDCouplingGaussLocalization > glV; @@ -2980,12 +2979,12 @@ MCAuto MEDCouplingFieldDouble::voronoizeGen(const Voroni ptsInReal=gl.localizePtsInRefCooForEachCell(vorCellsForCurDisc->getCoords(),subMesh); } int nbPtsPerCell(vorCellsForCurDisc->getNumberOfNodes()); - for(std::size_t i=0;i elt(vorCellsForCurDisc->clone(false)); - MCAuto coo(ptsInReal->selectByTupleIdSafeSlice(i*nbPtsPerCell,(i+1)*nbPtsPerCell,1)); - elt->setCoords(coo); - cells[ids[i]]=elt; + MCAuto coo4(ptsInReal->selectByTupleIdSafeSlice(j*nbPtsPerCell,(j+1)*nbPtsPerCell,1)); + elt->setCoords(coo4); + cells[ids[j]]=elt; } } std::vector< const MEDCouplingUMesh * > cellsPtr(VecAutoToVecOfCstPt(cells)); diff --git a/src/MEDCoupling/MEDCouplingFieldDouble.hxx b/src/MEDCoupling/MEDCouplingFieldDouble.hxx index 5fadccd19..f12f4ed52 100644 --- a/src/MEDCoupling/MEDCouplingFieldDouble.hxx +++ b/src/MEDCoupling/MEDCouplingFieldDouble.hxx @@ -48,7 +48,7 @@ namespace MEDCoupling MEDCOUPLING_EXPORT DataArrayInt *findIdsInRange(double vmin, double vmax) const; MEDCOUPLING_EXPORT MEDCouplingFieldDouble *deepCopy() const; MEDCOUPLING_EXPORT MEDCouplingFieldDouble *clone(bool recDeepCpy) const; - MEDCOUPLING_EXPORT MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCopy) const; + MEDCOUPLING_EXPORT MEDCouplingFieldDouble *buildNewTimeReprFromThis(TypeOfTimeDiscretization td, bool deepCpy) const; MEDCOUPLING_EXPORT MEDCouplingFieldDouble *nodeToCellDiscretization() const; MEDCOUPLING_EXPORT MEDCouplingFieldDouble *cellToNodeDiscretization() const; MEDCOUPLING_EXPORT MEDCouplingFieldInt *convertToIntField() const; @@ -156,7 +156,7 @@ namespace MEDCoupling private: MEDCouplingFieldDouble(TypeOfField type, TypeOfTimeDiscretization td); MEDCouplingFieldDouble(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td); - MEDCouplingFieldDouble(const MEDCouplingFieldDouble& other, bool deepCopy); + MEDCouplingFieldDouble(const MEDCouplingFieldDouble& other, bool deepCpy); MEDCouplingFieldDouble(NatureOfField n, MEDCouplingTimeDiscretization *td, MEDCouplingFieldDiscretization *type); MCAuto voronoizeGen(const Voronizer *vor, double eps) const; MEDCouplingTimeDiscretization *timeDiscr(); diff --git a/src/MEDCoupling/MEDCouplingFieldFloat.cxx b/src/MEDCoupling/MEDCouplingFieldFloat.cxx index 7214562b6..2e7c7ddef 100644 --- a/src/MEDCoupling/MEDCouplingFieldFloat.cxx +++ b/src/MEDCoupling/MEDCouplingFieldFloat.cxx @@ -42,7 +42,7 @@ MEDCouplingFieldFloat::MEDCouplingFieldFloat(TypeOfField type, TypeOfTimeDiscret { } -MEDCouplingFieldFloat::MEDCouplingFieldFloat(const MEDCouplingFieldFloat& other, bool deepCopy):MEDCouplingFieldT(other,deepCopy) +MEDCouplingFieldFloat::MEDCouplingFieldFloat(const MEDCouplingFieldFloat& other, bool deepCpy):MEDCouplingFieldT(other,deepCpy) { } diff --git a/src/MEDCoupling/MEDCouplingFieldFloat.hxx b/src/MEDCoupling/MEDCouplingFieldFloat.hxx index 83e746596..043bc0251 100644 --- a/src/MEDCoupling/MEDCouplingFieldFloat.hxx +++ b/src/MEDCoupling/MEDCouplingFieldFloat.hxx @@ -42,7 +42,7 @@ namespace MEDCoupling MEDCOUPLING_EXPORT MEDCouplingFieldDouble *convertToDblField() const; protected: MEDCouplingFieldFloat(TypeOfField type, TypeOfTimeDiscretization td); - MEDCouplingFieldFloat(const MEDCouplingFieldFloat& other, bool deepCopy); + MEDCouplingFieldFloat(const MEDCouplingFieldFloat& other, bool deepCpy); MEDCouplingFieldFloat(NatureOfField n, MEDCouplingTimeDiscretizationFloat *td, MEDCouplingFieldDiscretization *type); MEDCouplingFieldFloat(const MEDCouplingFieldTemplate& ft, TypeOfTimeDiscretization td); ~MEDCouplingFieldFloat() { } diff --git a/src/MEDCoupling/MEDCouplingFieldInt.cxx b/src/MEDCoupling/MEDCouplingFieldInt.cxx index 51811f687..f2b4bd089 100644 --- a/src/MEDCoupling/MEDCouplingFieldInt.cxx +++ b/src/MEDCoupling/MEDCouplingFieldInt.cxx @@ -42,7 +42,7 @@ MEDCouplingFieldInt::MEDCouplingFieldInt(TypeOfField type, TypeOfTimeDiscretizat { } -MEDCouplingFieldInt::MEDCouplingFieldInt(const MEDCouplingFieldInt& other, bool deepCopy):MEDCouplingFieldT(other,deepCopy) +MEDCouplingFieldInt::MEDCouplingFieldInt(const MEDCouplingFieldInt& other, bool deepCpy):MEDCouplingFieldT(other,deepCpy) { } diff --git a/src/MEDCoupling/MEDCouplingGaussLocalization.cxx b/src/MEDCoupling/MEDCouplingGaussLocalization.cxx index 6c69fa0c6..e5a5a413c 100644 --- a/src/MEDCoupling/MEDCouplingGaussLocalization.cxx +++ b/src/MEDCoupling/MEDCouplingGaussLocalization.cxx @@ -222,7 +222,7 @@ MCAuto MEDCouplingGaussLocalization::localizePtsInRefCooForEach MCAuto ret(DataArrayDouble::New()); ret->alloc(nbPts*nbCells,outDim); double *retPtr(ret->getPointer()); - if(dim!=ptsInRefCoo->getNumberOfComponents()) + if(dim!=(int)ptsInRefCoo->getNumberOfComponents()) throw INTERP_KERNEL::Exception("MEDCouplingGaussLocalization::localizePtsInRefCooForEachCell : number of components of input coo is not equal to dim of element !"); const std::vector& wg(getWeights()); INTERP_KERNEL::GaussCoords calculator; @@ -240,7 +240,7 @@ MCAuto MEDCouplingGaussLocalization::buildRefCell() const { MCAuto coo(DataArrayDouble::New()); const INTERP_KERNEL::CellModel& cm(INTERP_KERNEL::CellModel::GetCellModel(getType())); - if(getDimension()!=cm.getDimension()) + if(getDimension()!=(int)cm.getDimension()) throw INTERP_KERNEL::Exception("BuildRefCell : dimension mistmatch !"); coo->alloc(cm.getNumberOfNodes(),getDimension()); std::copy(_ref_coord.begin(),_ref_coord.end(),coo->getPointer()); diff --git a/src/MEDCoupling/MEDCouplingIMesh.cxx b/src/MEDCoupling/MEDCouplingIMesh.cxx index 329c54584..b61fac40c 100644 --- a/src/MEDCoupling/MEDCouplingIMesh.cxx +++ b/src/MEDCoupling/MEDCouplingIMesh.cxx @@ -16,7 +16,7 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -// Author : Anthony Geay (CEA/DEN) +// Author : Anthony Geay (EDF R&D) #include "MEDCouplingIMesh.hxx" #include "MEDCouplingCMesh.hxx" @@ -37,7 +37,7 @@ MEDCouplingIMesh::MEDCouplingIMesh():_space_dim(-1) _structure[0]=0; _structure[1]=0; _structure[2]=0; } -MEDCouplingIMesh::MEDCouplingIMesh(const MEDCouplingIMesh& other, bool deepCopy):MEDCouplingStructuredMesh(other,deepCopy),_space_dim(other._space_dim),_axis_unit(other._axis_unit) +MEDCouplingIMesh::MEDCouplingIMesh(const MEDCouplingIMesh& other, bool deepCpy):MEDCouplingStructuredMesh(other,deepCpy),_space_dim(other._space_dim),_axis_unit(other._axis_unit) { _origin[0]=other._origin[0]; _origin[1]=other._origin[1]; _origin[2]=other._origin[2]; _dxyz[0]=other._dxyz[0]; _dxyz[1]=other._dxyz[1]; _dxyz[2]=other._dxyz[2]; @@ -289,7 +289,7 @@ void MEDCouplingIMesh::CondenseFineToCoarse(const std::vector& coarseSt, co throw INTERP_KERNEL::Exception("MEDCouplingIMesh::CondenseFineToCoarse : the parameters 1 or 3 are NULL or not allocated !"); int meshDim((int)coarseSt.size()),nbOfTuplesInCoarseExp(MEDCouplingStructuredMesh::DeduceNumberOfGivenStructure(coarseSt)),nbOfTuplesInFineExp(MEDCouplingStructuredMesh::DeduceNumberOfGivenRangeInCompactFrmt(fineLocInCoarse)); int nbCompo(fineDA->getNumberOfComponents()); - if(coarseDA->getNumberOfComponents()!=nbCompo) + if((int)coarseDA->getNumberOfComponents()!=nbCompo) throw INTERP_KERNEL::Exception("MEDCouplingIMesh::CondenseFineToCoarse : the number of components of fine DA and coarse one mismatches !"); if(meshDim!=(int)fineLocInCoarse.size() || meshDim!=(int)facts.size()) throw INTERP_KERNEL::Exception("MEDCouplingIMesh::CondenseFineToCoarse : the size of fineLocInCoarse (4th param) and facts (5th param) must be equal to the sier of coarseSt (2nd param) !"); @@ -419,7 +419,7 @@ void MEDCouplingIMesh::CondenseFineToCoarseGhost(const std::vector& coarseS std::vector coarseStG(coarseSt.size()); std::transform(coarseSt.begin(),coarseSt.end(),coarseStG.begin(),std::bind2nd(std::plus(),2*ghostSize)); int meshDim((int)coarseSt.size()),nbOfTuplesInCoarseExp(MEDCouplingStructuredMesh::DeduceNumberOfGivenStructure(coarseStG)); int nbCompo(fineDA->getNumberOfComponents()); - if(coarseDA->getNumberOfComponents()!=nbCompo) + if((int)coarseDA->getNumberOfComponents()!=nbCompo) throw INTERP_KERNEL::Exception("MEDCouplingIMesh::CondenseFineToCoarseGhost : the number of components of fine DA and coarse one mismatches !"); if(meshDim!=(int)fineLocInCoarse.size() || meshDim!=(int)facts.size()) throw INTERP_KERNEL::Exception("MEDCouplingIMesh::CondenseFineToCoarseGhost : the size of fineLocInCoarse (4th param) and facts (5th param) must be equal to the sier of coarseSt (2nd param) !"); @@ -548,7 +548,7 @@ void MEDCouplingIMesh::SpreadCoarseToFine(const DataArrayDouble *coarseDA, const throw INTERP_KERNEL::Exception("MEDCouplingIMesh::SpreadCoarseToFine : the parameters 1 or 3 are NULL or not allocated !"); int meshDim((int)coarseSt.size()),nbOfTuplesInCoarseExp(MEDCouplingStructuredMesh::DeduceNumberOfGivenStructure(coarseSt)),nbOfTuplesInFineExp(MEDCouplingStructuredMesh::DeduceNumberOfGivenRangeInCompactFrmt(fineLocInCoarse)); int nbCompo(fineDA->getNumberOfComponents()); - if(coarseDA->getNumberOfComponents()!=nbCompo) + if((int)coarseDA->getNumberOfComponents()!=nbCompo) throw INTERP_KERNEL::Exception("MEDCouplingIMesh::SpreadCoarseToFine : the number of components of fine DA and coarse one mismatches !"); if(meshDim!=(int)fineLocInCoarse.size() || meshDim!=(int)facts.size()) throw INTERP_KERNEL::Exception("MEDCouplingIMesh::SpreadCoarseToFine : the size of fineLocInCoarse (4th param) and facts (5th param) must be equal to the sier of coarseSt (2nd param) !"); @@ -654,7 +654,7 @@ void MEDCouplingIMesh::SpreadCoarseToFineGhost(const DataArrayDouble *coarseDA, std::vector coarseStG(coarseSt.size()); std::transform(coarseSt.begin(),coarseSt.end(),coarseStG.begin(),std::bind2nd(std::plus(),2*ghostSize)); int meshDim((int)coarseSt.size()),nbOfTuplesInCoarseExp(MEDCouplingStructuredMesh::DeduceNumberOfGivenStructure(coarseStG)); int nbCompo(fineDA->getNumberOfComponents()); - if(coarseDA->getNumberOfComponents()!=nbCompo) + if((int)coarseDA->getNumberOfComponents()!=nbCompo) throw INTERP_KERNEL::Exception("MEDCouplingIMesh::SpreadCoarseToFineGhost : the number of components of fine DA and coarse one mismatches !"); if(meshDim!=(int)fineLocInCoarse.size() || meshDim!=(int)facts.size()) throw INTERP_KERNEL::Exception("MEDCouplingIMesh::SpreadCoarseToFineGhost : the size of fineLocInCoarse (4th param) and facts (5th param) must be equal to the sier of coarseSt (2nd param) !"); @@ -746,7 +746,7 @@ void MEDCouplingIMesh::SpreadCoarseToFineGhostZone(const DataArrayDouble *coarse std::vector coarseStG(coarseSt.size()); std::transform(coarseSt.begin(),coarseSt.end(),coarseStG.begin(),std::bind2nd(std::plus(),2*ghostSize)); int meshDim((int)coarseSt.size()),nbOfTuplesInCoarseExp(MEDCouplingStructuredMesh::DeduceNumberOfGivenStructure(coarseStG)); int nbCompo(fineDA->getNumberOfComponents()); - if(coarseDA->getNumberOfComponents()!=nbCompo) + if((int)coarseDA->getNumberOfComponents()!=nbCompo) throw INTERP_KERNEL::Exception("MEDCouplingIMesh::SpreadCoarseToFineGhostZone : the number of components of fine DA and coarse one mismatches !"); if(meshDim!=(int)fineLocInCoarse.size() || meshDim!=(int)facts.size()) throw INTERP_KERNEL::Exception("MEDCouplingIMesh::SpreadCoarseToFineGhostZone : the size of fineLocInCoarse (4th param) and facts (5th param) must be equal to the sier of coarseSt (2nd param) !"); diff --git a/src/MEDCoupling/MEDCouplingMappedExtrudedMesh.cxx b/src/MEDCoupling/MEDCouplingMappedExtrudedMesh.cxx index 9456bffcd..021b5add4 100644 --- a/src/MEDCoupling/MEDCouplingMappedExtrudedMesh.cxx +++ b/src/MEDCoupling/MEDCouplingMappedExtrudedMesh.cxx @@ -130,9 +130,9 @@ MEDCouplingMappedExtrudedMesh::MEDCouplingMappedExtrudedMesh():_mesh2D(0),_mesh1 { } -MEDCouplingMappedExtrudedMesh::MEDCouplingMappedExtrudedMesh(const MEDCouplingMappedExtrudedMesh& other, bool deepCopy):MEDCouplingMesh(other),_cell_2D_id(other._cell_2D_id) +MEDCouplingMappedExtrudedMesh::MEDCouplingMappedExtrudedMesh(const MEDCouplingMappedExtrudedMesh& other, bool deepCpy):MEDCouplingMesh(other),_cell_2D_id(other._cell_2D_id) { - if(deepCopy) + if(deepCpy) { _mesh2D=other._mesh2D->clone(true); _mesh1D=other._mesh1D->clone(true); diff --git a/src/MEDCoupling/MEDCouplingMappedExtrudedMesh.hxx b/src/MEDCoupling/MEDCouplingMappedExtrudedMesh.hxx index 807c2f2c1..1da334c1b 100644 --- a/src/MEDCoupling/MEDCouplingMappedExtrudedMesh.hxx +++ b/src/MEDCoupling/MEDCouplingMappedExtrudedMesh.hxx @@ -113,7 +113,7 @@ namespace MEDCoupling private: MEDCouplingMappedExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId); MEDCouplingMappedExtrudedMesh(const MEDCouplingCMesh *mesh3D); - MEDCouplingMappedExtrudedMesh(const MEDCouplingMappedExtrudedMesh& other, bool deepCopy); + MEDCouplingMappedExtrudedMesh(const MEDCouplingMappedExtrudedMesh& other, bool deepCpy); MEDCouplingMappedExtrudedMesh(); void computeExtrusion(const MEDCouplingUMesh *mesh3D); void computeExtrusionAlg(const MEDCouplingUMesh *mesh3D); diff --git a/src/MEDCoupling/MEDCouplingMemArray.cxx b/src/MEDCoupling/MEDCouplingMemArray.cxx index 211e39df7..24142a4b2 100644 --- a/src/MEDCoupling/MEDCouplingMemArray.cxx +++ b/src/MEDCoupling/MEDCouplingMemArray.cxx @@ -196,12 +196,12 @@ void DataArray::copyPartOfStringInfoFrom(const DataArray& other, const std::vect void DataArray::copyPartOfStringInfoFrom2(const std::vector& compoIds, const DataArray& other) { - int nbOfCompo=getNumberOfComponents(); + std::size_t nbOfCompo(getNumberOfComponents()); std::size_t partOfCompoToSet=compoIds.size(); - if((int)partOfCompoToSet!=other.getNumberOfComponents()) + if(partOfCompoToSet!=other.getNumberOfComponents()) throw INTERP_KERNEL::Exception("Given compoIds has not the same size as number of components of given array !"); for(std::size_t i=0;i=nbOfCompo || compoIds[i]<0) + if(compoIds[i]>=(int)nbOfCompo || compoIds[i]<0) { std::ostringstream oss; oss << "Specified component id is out of range (" << compoIds[i] << ") compared with nb of actual components (" << nbOfCompo << ")"; throw INTERP_KERNEL::Exception(oss.str().c_str()); @@ -273,7 +273,7 @@ std::string DataArray::cppRepr(const std::string& varName) const */ void DataArray::setInfoOnComponents(const std::vector& info) { - if(getNumberOfComponents()!=(int)info.size()) + if(getNumberOfComponents()!=info.size()) { std::ostringstream oss; oss << "DataArray::setInfoOnComponents : input is of size " << info.size() << " whereas number of components is equal to " << getNumberOfComponents() << " !"; throw INTERP_KERNEL::Exception(oss.str().c_str()); @@ -556,7 +556,7 @@ void DataArray::setInfoOnComponent(int i, const std::string& info) */ void DataArray::setInfoAndChangeNbOfCompo(const std::vector& info) { - if(getNumberOfComponents()!=(int)info.size()) + if(getNumberOfComponents()!=info.size()) { if(!isAllocated()) _info_on_compo=info; @@ -581,7 +581,7 @@ void DataArray::checkNbOfTuples(int nbOfTuples, const std::string& msg) const void DataArray::checkNbOfComps(int nbOfCompo, const std::string& msg) const { - if(getNumberOfComponents()!=nbOfCompo) + if((int)getNumberOfComponents()!=nbOfCompo) { std::ostringstream oss; oss << msg << " : mismatch number of components : expected " << nbOfCompo << " having " << getNumberOfComponents() << " !"; throw INTERP_KERNEL::Exception(oss.str().c_str()); @@ -1246,7 +1246,7 @@ DataArrayInt *DataArrayDouble::findClosestTupleId(const DataArrayDouble *other) if(!other) throw INTERP_KERNEL::Exception("DataArrayDouble::findClosestTupleId : other instance is NULL !"); checkAllocated(); other->checkAllocated(); - int nbOfCompo=getNumberOfComponents(); + std::size_t nbOfCompo(getNumberOfComponents()); if(nbOfCompo!=other->getNumberOfComponents()) { std::ostringstream oss; oss << "DataArrayDouble::findClosestTupleId : number of components in this is " << nbOfCompo; @@ -1309,7 +1309,8 @@ DataArrayInt *DataArrayDouble::computeNbOfInteractionsWith(const DataArrayDouble throw INTERP_KERNEL::Exception("DataArrayDouble::computeNbOfInteractionsWith : input array is NULL !"); if(!isAllocated() || !otherBBoxFrmt->isAllocated()) throw INTERP_KERNEL::Exception("DataArrayDouble::computeNbOfInteractionsWith : this and input array must be allocated !"); - int nbOfComp(getNumberOfComponents()),nbOfTuples(getNumberOfTuples()); + std::size_t nbOfComp(getNumberOfComponents()); + int nbOfTuples(getNumberOfTuples()); if(nbOfComp!=otherBBoxFrmt->getNumberOfComponents()) { std::ostringstream oss; oss << "DataArrayDouble::computeNbOfInteractionsWith : this number of components (" << nbOfComp << ") must be equal to the number of components of input array (" << otherBBoxFrmt->getNumberOfComponents() << ") !"; @@ -3189,7 +3190,7 @@ DataArrayDouble *DataArrayDouble::Aggregate(const std::vector::const_iterator it=a.begin(); - int nbOfComp=(*it)->getNumberOfComponents(); + std::size_t nbOfComp((*it)->getNumberOfComponents()); int nbt=(*it++)->getNumberOfTuples(); for(int i=1;it!=a.end();it++,i++) { @@ -3228,7 +3229,7 @@ DataArrayDouble *DataArrayDouble::Dot(const DataArrayDouble *a1, const DataArray throw INTERP_KERNEL::Exception("DataArrayDouble::Dot : input DataArrayDouble instance is NULL !"); a1->checkAllocated(); a2->checkAllocated(); - int nbOfComp=a1->getNumberOfComponents(); + std::size_t nbOfComp(a1->getNumberOfComponents()); if(nbOfComp!=a2->getNumberOfComponents()) throw INTERP_KERNEL::Exception("Nb of components mismatch for array Dot !"); int nbOfTuple=a1->getNumberOfTuples(); @@ -3242,7 +3243,7 @@ DataArrayDouble *DataArrayDouble::Dot(const DataArrayDouble *a1, const DataArray for(int i=0;igetNumberOfComponents(); + std::size_t nbOfComp(a1->getNumberOfComponents()); if(nbOfComp!=a2->getNumberOfComponents()) throw INTERP_KERNEL::Exception("Nb of components mismatch for array crossProduct !"); if(nbOfComp!=3) @@ -3312,7 +3313,7 @@ DataArrayDouble *DataArrayDouble::Max(const DataArrayDouble *a1, const DataArray { if(!a1 || !a2) throw INTERP_KERNEL::Exception("DataArrayDouble::Max : input DataArrayDouble instance is NULL !"); - int nbOfComp=a1->getNumberOfComponents(); + std::size_t nbOfComp(a1->getNumberOfComponents()); if(nbOfComp!=a2->getNumberOfComponents()) throw INTERP_KERNEL::Exception("Nb of components mismatch for array Max !"); int nbOfTuple=a1->getNumberOfTuples(); @@ -3347,7 +3348,7 @@ DataArrayDouble *DataArrayDouble::Min(const DataArrayDouble *a1, const DataArray { if(!a1 || !a2) throw INTERP_KERNEL::Exception("DataArrayDouble::Min : input DataArrayDouble instance is NULL !"); - int nbOfComp=a1->getNumberOfComponents(); + std::size_t nbOfComp(a1->getNumberOfComponents()); if(nbOfComp!=a2->getNumberOfComponents()) throw INTERP_KERNEL::Exception("Nb of components mismatch for array min !"); int nbOfTuple=a1->getNumberOfTuples(); @@ -4559,7 +4560,7 @@ DataArrayInt *DataArrayInt::indicesOfSubPart(const DataArrayInt& partOfThis) con std::map m; for(int i=0;i s(begin(),end()); // in C++11, should use unordered_set (O(1) complexity) - if (s.size() != nbOfTuples) + if ((int)s.size() != nbOfTuples) return false; return true; } @@ -5022,7 +5023,7 @@ DataArrayInt *DataArrayInt::findIdsEqualTuple(const int *tupleBg, const int *tup { std::size_t nbOfCompoExp(std::distance(tupleBg,tupleEnd)); checkAllocated(); - if(getNumberOfComponents()!=(int)nbOfCompoExp) + if(getNumberOfComponents()!=nbOfCompoExp) { std::ostringstream oss; oss << "DataArrayInt::findIdsEqualTuple : mismatch of number of components. Input tuple has " << nbOfCompoExp << " whereas this array has " << getNumberOfComponents() << " components !"; throw INTERP_KERNEL::Exception(oss.str().c_str()); @@ -5397,7 +5398,7 @@ DataArrayInt *DataArrayInt::Aggregate(const DataArrayInt *a1, const DataArrayInt { if(!a1 || !a2) throw INTERP_KERNEL::Exception("DataArrayInt::Aggregate : input DataArrayInt instance is NULL !"); - int nbOfComp=a1->getNumberOfComponents(); + std::size_t nbOfComp(a1->getNumberOfComponents()); if(nbOfComp!=a2->getNumberOfComponents()) throw INTERP_KERNEL::Exception("Nb of components mismatch for array Aggregation !"); int nbOfTuple1=a1->getNumberOfTuples(); @@ -5434,7 +5435,7 @@ DataArrayInt *DataArrayInt::Aggregate(const std::vector& a if(a.empty()) throw INTERP_KERNEL::Exception("DataArrayInt::Aggregate : input list must be NON EMPTY !"); std::vector::const_iterator it=a.begin(); - int nbOfComp=(*it)->getNumberOfComponents(); + std::size_t nbOfComp((*it)->getNumberOfComponents()); int nbt=(*it++)->getNumberOfTuples(); for(int i=1;it!=a.end();it++,i++) { diff --git a/src/MEDCoupling/MEDCouplingMemArray.txx b/src/MEDCoupling/MEDCouplingMemArray.txx index aaec5ed8e..51edbee96 100644 --- a/src/MEDCoupling/MEDCouplingMemArray.txx +++ b/src/MEDCoupling/MEDCouplingMemArray.txx @@ -659,7 +659,7 @@ namespace MEDCoupling std::ostringstream oss; oss << Traits::ArrayTypeName << "::getIJSafe : request for tupleId " << tupleId << " should be in [0," << getNumberOfTuples() << ") !"; throw INTERP_KERNEL::Exception(oss.str().c_str()); } - if(compoId<0 || compoId>=getNumberOfComponents()) + if(compoId<0 || compoId>=(int)getNumberOfComponents()) { std::ostringstream oss; oss << Traits::ArrayTypeName << "::getIJSafe : request for compoId " << compoId << " should be in [0," << getNumberOfComponents() << ") !"; throw INTERP_KERNEL::Exception(oss.str().c_str()); @@ -825,7 +825,7 @@ namespace MEDCoupling { if(isAllocated()) { - if(nbOfTuple!=getNumberOfTuples() || nbOfCompo!=getNumberOfComponents()) + if(nbOfTuple!=getNumberOfTuples() || nbOfCompo!=(int)getNumberOfComponents()) alloc(nbOfTuple,nbOfCompo); } else @@ -1136,21 +1136,21 @@ namespace MEDCoupling { DataArrayTemplate *directRet(const_cast *>(this)); directRet->incrRef(); - MCAuto > ret(directRet); - return DynamicCastSafe,typename Traits::ArrayTypeCh>(ret); + MCAuto > ret2(directRet); + return DynamicCastSafe,typename Traits::ArrayTypeCh>(ret2); } else { - MCAuto ret(selectByTupleIdSafeSlice(a,b,c)); - return DynamicCastSafe::ArrayTypeCh>(ret); + MCAuto ret2(selectByTupleIdSafeSlice(a,b,c)); + return DynamicCastSafe::ArrayTypeCh>(ret2); } } const DataArrayPartDefinition *dpd(dynamic_cast(pd)); if(dpd) { MCAuto arr(dpd->toDAI()); - MCAuto ret(selectByTupleIdSafe(arr->begin(),arr->end())); - return DynamicCastSafe::ArrayTypeCh>(ret); + MCAuto ret2(selectByTupleIdSafe(arr->begin(),arr->end())); + return DynamicCastSafe::ArrayTypeCh>(ret2); } throw INTERP_KERNEL::Exception("DataArrayTemplate::selectPartDef : unrecognized part def !"); @@ -1928,7 +1928,7 @@ namespace MEDCoupling checkAllocated(); a->checkAllocated(); tuplesSelec->checkAllocated(); - int nbOfComp=getNumberOfComponents(); + std::size_t nbOfComp(getNumberOfComponents()); if(nbOfComp!=a->getNumberOfComponents()) throw INTERP_KERNEL::Exception("DataArrayTemplate::setPartOfValuesAdv : This and a do not have the same number of components !"); if(tuplesSelec->getNumberOfComponents()!=2) @@ -1993,7 +1993,7 @@ namespace MEDCoupling checkAllocated(); a->checkAllocated(); tuplesSelec->checkAllocated(); - int nbOfComp(getNumberOfComponents()); + std::size_t nbOfComp(getNumberOfComponents()); if(nbOfComp!=a->getNumberOfComponents()) throw INTERP_KERNEL::Exception("DataArrayTemplate::setContigPartOfSelectedValues : This and a do not have the same number of components !"); if(tuplesSelec->getNumberOfComponents()!=1) @@ -2058,7 +2058,7 @@ namespace MEDCoupling throw INTERP_KERNEL::Exception("DataArrayTemplate::setContigPartOfSelectedValuesSlice : input DataArray aBase is not a DataArrayDouble !"); checkAllocated(); a->checkAllocated(); - int nbOfComp(getNumberOfComponents()); + std::size_t nbOfComp(getNumberOfComponents()); const char msg[]="DataArrayDouble::setContigPartOfSelectedValuesSlice"; int nbOfTupleToWrite(DataArray::GetNumberOfItemGivenBES(bg,end2,step,msg)); if(nbOfComp!=a->getNumberOfComponents()) @@ -3221,7 +3221,6 @@ struct NotInRange this->checkAllocated(); if(this->getNumberOfComponents()!=1) throw INTERP_KERNEL::Exception("DataArrayDouble::isUniform : must be applied on DataArrayDouble with only one component, you can call 'rearrange' method before !"); - int nbOfTuples(this->getNumberOfTuples()); const T *w(this->begin()),*end2(this->end()); const T vmin(val-eps),vmax(val+eps); for(;w!=end2;w++) diff --git a/src/MEDCoupling/MEDCouplingMemArrayChar.cxx b/src/MEDCoupling/MEDCouplingMemArrayChar.cxx index 590423fdb..6c9011087 100644 --- a/src/MEDCoupling/MEDCouplingMemArrayChar.cxx +++ b/src/MEDCoupling/MEDCouplingMemArrayChar.cxx @@ -453,7 +453,7 @@ DataArrayChar *DataArrayChar::Aggregate(const std::vector if(a.empty()) throw INTERP_KERNEL::Exception("DataArrayChar::Aggregate : input list must be NON EMPTY !"); std::vector::const_iterator it=a.begin(); - int nbOfComp=(*it)->getNumberOfComponents(); + std::size_t nbOfComp((*it)->getNumberOfComponents()); int nbt=(*it++)->getNumberOfTuples(); for(int i=1;it!=a.end();it++,i++) { diff --git a/src/MEDCoupling/MEDCouplingPointSet.cxx b/src/MEDCoupling/MEDCouplingPointSet.cxx index 981d8dcf1..b373b3cfd 100644 --- a/src/MEDCoupling/MEDCouplingPointSet.cxx +++ b/src/MEDCoupling/MEDCouplingPointSet.cxx @@ -40,10 +40,10 @@ MEDCouplingPointSet::MEDCouplingPointSet():_coords(0) { } -MEDCouplingPointSet::MEDCouplingPointSet(const MEDCouplingPointSet& other, bool deepCopy):MEDCouplingMesh(other),_coords(0) +MEDCouplingPointSet::MEDCouplingPointSet(const MEDCouplingPointSet& other, bool deepCpy):MEDCouplingMesh(other),_coords(0) { if(other._coords) - _coords=other._coords->performCopyOrIncrRef(deepCopy); + _coords=other._coords->performCopyOrIncrRef(deepCpy); } MEDCouplingPointSet::~MEDCouplingPointSet() diff --git a/src/MEDCoupling/MEDCouplingPointSet.hxx b/src/MEDCoupling/MEDCouplingPointSet.hxx index b79414e4d..a3ece6f4d 100644 --- a/src/MEDCoupling/MEDCouplingPointSet.hxx +++ b/src/MEDCoupling/MEDCouplingPointSet.hxx @@ -50,7 +50,7 @@ namespace MEDCoupling { protected: MEDCOUPLING_EXPORT MEDCouplingPointSet(); - MEDCOUPLING_EXPORT MEDCouplingPointSet(const MEDCouplingPointSet& other, bool deepCopy); + MEDCOUPLING_EXPORT MEDCouplingPointSet(const MEDCouplingPointSet& other, bool deepCpy); MEDCOUPLING_EXPORT ~MEDCouplingPointSet(); public: MEDCOUPLING_EXPORT void updateTime() const; diff --git a/src/MEDCoupling/MEDCouplingRefCountObject.cxx b/src/MEDCoupling/MEDCouplingRefCountObject.cxx index c75f7934a..725c1cf19 100644 --- a/src/MEDCoupling/MEDCouplingRefCountObject.cxx +++ b/src/MEDCoupling/MEDCouplingRefCountObject.cxx @@ -330,7 +330,7 @@ void GlobalDict::clear() _my_map.clear(); } -void GlobalDict::setKeyValue(const std::string& key, const std::string& value) +void GlobalDict::setKeyValue(const std::string& key, const std::string& val) { std::map::const_iterator it(_my_map.find(key)); if(it!=_my_map.end()) @@ -339,12 +339,12 @@ void GlobalDict::setKeyValue(const std::string& key, const std::string& value) oss << "GlobalDict::setKeyValue : key \"" << key << "\" already exists !"; throw INTERP_KERNEL::Exception(oss.str().c_str()); } - _my_map[key]=value; + _my_map[key]=val; } -void GlobalDict::setKeyValueForce(const std::string& key, const std::string& value) +void GlobalDict::setKeyValueForce(const std::string& key, const std::string& val) { - _my_map[key]=value; + _my_map[key]=val; } std::string GlobalDict::printSelf() const diff --git a/src/MEDCoupling/MEDCouplingRefCountObject.hxx b/src/MEDCoupling/MEDCouplingRefCountObject.hxx index 5130f1a2f..7fdf91f53 100644 --- a/src/MEDCoupling/MEDCouplingRefCountObject.hxx +++ b/src/MEDCoupling/MEDCouplingRefCountObject.hxx @@ -114,8 +114,8 @@ namespace MEDCoupling MEDCOUPLING_EXPORT std::vector keys() const; MEDCOUPLING_EXPORT void erase(const std::string& key); MEDCOUPLING_EXPORT void clear(); - MEDCOUPLING_EXPORT void setKeyValue(const std::string& key, const std::string& value); - MEDCOUPLING_EXPORT void setKeyValueForce(const std::string& key, const std::string& value); + MEDCOUPLING_EXPORT void setKeyValue(const std::string& key, const std::string& val); + MEDCOUPLING_EXPORT void setKeyValueForce(const std::string& key, const std::string& val); MEDCOUPLING_EXPORT std::string printSelf() const; private: GlobalDict() { } diff --git a/src/MEDCoupling/MEDCouplingStructuredMesh.cxx b/src/MEDCoupling/MEDCouplingStructuredMesh.cxx index ab70da60d..665e89082 100644 --- a/src/MEDCoupling/MEDCouplingStructuredMesh.cxx +++ b/src/MEDCoupling/MEDCouplingStructuredMesh.cxx @@ -33,7 +33,7 @@ MEDCouplingStructuredMesh::MEDCouplingStructuredMesh() { } -MEDCouplingStructuredMesh::MEDCouplingStructuredMesh(const MEDCouplingStructuredMesh& other, bool deepCopy):MEDCouplingMesh(other) +MEDCouplingStructuredMesh::MEDCouplingStructuredMesh(const MEDCouplingStructuredMesh& other, bool deepCpy):MEDCouplingMesh(other) { } @@ -984,8 +984,8 @@ DataArrayInt *MEDCouplingStructuredMesh::Build1GTNodalConnectivity2D(const int * conn->alloc(4*n1*n2,1); int *cp(conn->getPointer()); std::size_t pos(0); - for(int j=0;jalloc(8*n1*n2*n3,1); int *cp(conn->getPointer()); std::size_t pos(0); - for(int k=0;kareCellsIncludedIn(&otherDimM1OnSameCoords,2,idsTmp); + m01->areCellsIncludedIn(&otherDimM1OnSameCoords,2,idsTmp); DAInt ids(idsTmp); // In the neighbor information remove the connection between high dimension cells and its low level constituents which are part // of the frontier given in parameter (i.e. the cells of low dimension from the group delimiting the crack): @@ -3044,14 +3044,14 @@ void MEDCouplingUMesh::setConnectivity(DataArrayInt *conn, DataArrayInt *connInd * Copy constructor. If 'deepCopy' is false \a this is a shallow copy of other. * If 'deeCpy' is true all arrays (coordinates and connectivities) are deeply copied. */ -MEDCouplingUMesh::MEDCouplingUMesh(const MEDCouplingUMesh& other, bool deepCopy):MEDCouplingPointSet(other,deepCopy),_mesh_dim(other._mesh_dim), +MEDCouplingUMesh::MEDCouplingUMesh(const MEDCouplingUMesh& other, bool deepCpy):MEDCouplingPointSet(other,deepCpy),_mesh_dim(other._mesh_dim), _nodal_connec(0),_nodal_connec_index(0), _types(other._types) { if(other._nodal_connec) - _nodal_connec=other._nodal_connec->performCopyOrIncrRef(deepCopy); + _nodal_connec=other._nodal_connec->performCopyOrIncrRef(deepCpy); if(other._nodal_connec_index) - _nodal_connec_index=other._nodal_connec_index->performCopyOrIncrRef(deepCopy); + _nodal_connec_index=other._nodal_connec_index->performCopyOrIncrRef(deepCpy); } MEDCouplingUMesh::~MEDCouplingUMesh() @@ -3716,7 +3716,7 @@ MCAuto MEDCouplingUMesh::clipSingle3DCellByPlane(const double std::vector > res; buildSubCellsFromCut(cut3DSurf,desc2->begin(),descIndx2->begin(),mDesc1->getCoords()->begin(),eps,res); std::size_t sz(res.size()); - if(res.size()==mDesc1->getNumberOfCells() && sameNbNodes) + if((int)res.size()==mDesc1->getNumberOfCells() && sameNbNodes) throw INTERP_KERNEL::Exception("MEDCouplingUMesh::clipSingle3DCellByPlane : cell is not clipped !"); for(std::size_t i=0;igetNumberOfComponents()!=spaceDim) + if((int)pts->getNumberOfComponents()!=spaceDim) { std::ostringstream oss; oss << "MEDCouplingUMesh::distanceToPoints : input pts DataArrayDouble has " << pts->getNumberOfComponents() << " components whereas it should be equal to " << spaceDim << " (mesh spaceDimension) !"; throw INTERP_KERNEL::Exception(oss.str()); diff --git a/src/MEDCoupling/MEDCouplingUMesh.hxx b/src/MEDCoupling/MEDCouplingUMesh.hxx index 6a79c6175..9f1a8606f 100644 --- a/src/MEDCoupling/MEDCouplingUMesh.hxx +++ b/src/MEDCoupling/MEDCouplingUMesh.hxx @@ -285,7 +285,7 @@ namespace MEDCoupling private: // all private methods are impl in MEDCouplingUMesh_internal.cxx MEDCouplingUMesh(); - MEDCouplingUMesh(const MEDCouplingUMesh& other, bool deepCopy); + MEDCouplingUMesh(const MEDCouplingUMesh& other, bool deepCpy); ~MEDCouplingUMesh(); void checkFullyDefined() const; void checkConnectivityFullyDefined() const; diff --git a/src/MEDCoupling/MEDCouplingVoronoi.cxx b/src/MEDCoupling/MEDCouplingVoronoi.cxx index 7e7efbcfd..a7cff07b9 100644 --- a/src/MEDCoupling/MEDCouplingVoronoi.cxx +++ b/src/MEDCoupling/MEDCouplingVoronoi.cxx @@ -405,7 +405,7 @@ MCAuto MEDCoupling::Voronizer2D::doIt(const MEDCouplingUMesh * newCoords=a->getCoords()->selectByTupleId(tmp->begin(),tmp->end()); } const double *cPtr(newCoords->begin()); - for(int i=0;igetNumberOfTuples();i++,cPtr+=2) + for(int j=0;jgetNumberOfTuples();j++,cPtr+=2) { std::set zeCandidates; { @@ -530,9 +530,9 @@ MCAuto MEDCoupling::Voronizer3D::doIt(const MEDCouplingUMesh * zeCandidates.insert(*it4); } } - std::set tmp,newElementsToDo; - std::set_difference(zeCandidates.begin(),zeCandidates.end(),elemsDone.begin(),elemsDone.end(),std::inserter(tmp,tmp.begin())); - std::set_union(elemsToDo.begin(),elemsToDo.end(),tmp.begin(),tmp.end(),std::inserter(newElementsToDo,newElementsToDo.begin())); + std::set tmp2,newElementsToDo; + std::set_difference(zeCandidates.begin(),zeCandidates.end(),elemsDone.begin(),elemsDone.end(),std::inserter(tmp2,tmp2.begin())); + std::set_union(elemsToDo.begin(),elemsToDo.end(),tmp2.begin(),tmp2.end(),std::inserter(newElementsToDo,newElementsToDo.begin())); elemsToDo=newElementsToDo; } // -- 2.39.2