From f7c1e4751ee424df5997e18b57d789d2c5c6fc90 Mon Sep 17 00:00:00 2001 From: Anthony Geay Date: Thu, 28 Nov 2024 14:08:16 +0100 Subject: [PATCH] Warning hunting with gcc10 --- src/MEDCoupling/MEDCouplingMemArray.txx | 10 +++++----- src/MEDLoader/MEDFileFieldInternal.cxx | 2 +- src/MEDLoader/MEDFileFieldInternal.hxx | 2 +- src/MEDPartitioner/Test/MEDPARTITIONERTest.cxx | 4 +++- src/MEDPartitioner/medpartitioner.cxx | 3 ++- src/ParaMEDMEM/ByStringMPIProcessorGroup.cxx | 2 +- src/ParaMEDMEM/CommInterface.hxx | 4 ++-- 7 files changed, 15 insertions(+), 12 deletions(-) diff --git a/src/MEDCoupling/MEDCouplingMemArray.txx b/src/MEDCoupling/MEDCouplingMemArray.txx index 940101fff..77a91c97d 100755 --- a/src/MEDCoupling/MEDCouplingMemArray.txx +++ b/src/MEDCoupling/MEDCouplingMemArray.txx @@ -430,13 +430,13 @@ namespace MEDCoupling } template - void MemArray::CPPDeallocator(void *pt, void *param) + void MemArray::CPPDeallocator(void *pt, void */*param*/) { delete [] reinterpret_cast(pt); } template - void MemArray::CDeallocator(void *pt, void *param) + void MemArray::CDeallocator(void *pt, void */*param*/) { free(pt); } @@ -598,9 +598,9 @@ namespace MEDCoupling } mcIdType nbElems=DataArrayTools::GetNumberOfItemGivenBESRelative(start,stop,step,"DataArray::GetSlice"); mcIdType minNbOfElemsPerSlice=nbElems/nbOfSlices; - startSlice=start+minNbOfElemsPerSlice*step*sliceId; + startSlice=start+FromIdType(minNbOfElemsPerSlice)*step*FromIdType(sliceId); if(sliceId(minNbOfElemsPerSlice)*step*(FromIdType(sliceId+1)); else stopSlice=stop; } @@ -3498,7 +3498,7 @@ struct NotInRange } template - struct ImplReprTraits { static void SetPrecision(std::ostream& oss) { } }; + struct ImplReprTraits { static void SetPrecision(std::ostream& /*oss*/) { } }; template<> struct ImplReprTraits { static void SetPrecision(std::ostream& oss) { oss.precision(17); } }; diff --git a/src/MEDLoader/MEDFileFieldInternal.cxx b/src/MEDLoader/MEDFileFieldInternal.cxx index 84eb086ac..0ba97666c 100644 --- a/src/MEDLoader/MEDFileFieldInternal.cxx +++ b/src/MEDLoader/MEDFileFieldInternal.cxx @@ -2835,7 +2835,7 @@ MCAuto MEDFileFieldPerMeshPerTypePerDisc::Agg MCAuto MEDFileFieldPerMesh::Aggregate(mcIdType &start, const std::vector& pms, const std::vector< std::vector< std::pair > >& dts, MEDFileAnyTypeField1TSWithoutSDA *father, std::vector > >& extractInfo) { - MCAuto ret(new MEDFileFieldPerMesh(father,pms[0]->getMeshName(),pms[0]->getMeshIteration(),pms[0]->getMeshOrder())); + MCAuto ret(new MEDFileFieldPerMesh(father,pms[0]->getMeshIteration(),pms[0]->getMeshOrder())); std::map > > m; std::size_t i(0); for(std::vector::const_iterator it=pms.begin();it!=pms.end();it++,i++) diff --git a/src/MEDLoader/MEDFileFieldInternal.hxx b/src/MEDLoader/MEDFileFieldInternal.hxx index e2270e5dd..26fbb7e06 100644 --- a/src/MEDLoader/MEDFileFieldInternal.hxx +++ b/src/MEDLoader/MEDFileFieldInternal.hxx @@ -416,7 +416,7 @@ namespace MEDCoupling MEDFileFieldPerMesh(med_idt fid, MEDFileAnyTypeField1TSWithoutSDA *fath, int meshCsit, int meshIteration, int meshOrder, const MEDFileFieldNameScope& nasc, const MEDFileMesh *mm, const MEDFileEntities *entities); MEDFileFieldPerMesh(med_idt fid, MEDFileAnyTypeField1TSWithoutSDA *fath, int meshCsit, int meshIteration, int meshOrder, const MEDFileFieldNameScope& nasc, const PartDefinition *pd, const MEDFileEntities *entities); MEDFileFieldPerMesh(MEDFileAnyTypeField1TSWithoutSDA *fath, const MEDCouplingMesh *mesh); - MEDFileFieldPerMesh(MEDFileAnyTypeField1TSWithoutSDA *fath, const std::string& meshName, int meshIt, int meshOrd):_mesh_iteration(meshIt),_mesh_order(meshOrd),_father(fath) { } + MEDFileFieldPerMesh(MEDFileAnyTypeField1TSWithoutSDA *fath, int meshIt, int meshOrd):_mesh_iteration(meshIt),_mesh_order(meshOrd),_father(fath) { } private: int _mesh_iteration; int _mesh_order; diff --git a/src/MEDPartitioner/Test/MEDPARTITIONERTest.cxx b/src/MEDPartitioner/Test/MEDPARTITIONERTest.cxx index f9816ce69..2b8b42801 100644 --- a/src/MEDPartitioner/Test/MEDPARTITIONERTest.cxx +++ b/src/MEDPartitioner/Test/MEDPARTITIONERTest.cxx @@ -43,6 +43,8 @@ #include #include #include +#include + #ifdef WIN32 #include #define getcwd _getcwd @@ -855,7 +857,7 @@ void MEDPARTITIONERTest::testMeshCollectionSinglePartitionMetis() MEDPARTITIONER::ParallelTopology* aPT = (MEDPARTITIONER::ParallelTopology*) collection.getTopology(); aPT->setGlobalNumerotationDefault(collection.getParaDomainSelector()); //Creating the graph and partitioning it - auto_ptr< MEDPARTITIONER::Topology > new_topo; + unique_ptr< MEDPARTITIONER::Topology > new_topo; new_topo.reset( collection.createPartition(ndomains,MEDPARTITIONER::Graph::METIS) ); //Creating a new mesh collection from the partitioning MEDPARTITIONER::MeshCollection new_collection(collection,new_topo.get(),split_family,empty_groups); diff --git a/src/MEDPartitioner/medpartitioner.cxx b/src/MEDPartitioner/medpartitioner.cxx index 59198ebe9..d84087fde 100644 --- a/src/MEDPartitioner/medpartitioner.cxx +++ b/src/MEDPartitioner/medpartitioner.cxx @@ -43,6 +43,7 @@ #include #include #include +#include using namespace std; using namespace MEDPARTITIONER; @@ -212,7 +213,7 @@ int main(int argc, char** argv) //Creating the graph and partitioning it if (MyGlobals::_Is0verbose) cout << "Computing partition with " << library << endl; - auto_ptr< MEDPARTITIONER::Topology > new_topo; + unique_ptr< MEDPARTITIONER::Topology > new_topo; if (library == "metis") new_topo.reset( collection.createPartition(ndomains,MEDPARTITIONER::Graph::METIS)); else diff --git a/src/ParaMEDMEM/ByStringMPIProcessorGroup.cxx b/src/ParaMEDMEM/ByStringMPIProcessorGroup.cxx index 49f39e8a0..506380840 100644 --- a/src/ParaMEDMEM/ByStringMPIProcessorGroup.cxx +++ b/src/ParaMEDMEM/ByStringMPIProcessorGroup.cxx @@ -69,7 +69,7 @@ namespace MEDCoupling interface.allGatherV( simCodeTag.c_str(), stringSize, MPI_CHAR, &globalnames, words_size.data(), displacement.data(), MPI_CHAR, world_comm ); - for (size_t rank = 0; rank < size_world; rank++) + for (size_t rank = 0; rank < (std::size_t)(size_world); rank++) { std::string strByRank( &globalnames[displacement[ rank ]], words_size[ rank ] ); myRanksSet[ strByRank ].insert( (int)rank ); diff --git a/src/ParaMEDMEM/CommInterface.hxx b/src/ParaMEDMEM/CommInterface.hxx index 3d52fe9a5..690421c65 100644 --- a/src/ParaMEDMEM/CommInterface.hxx +++ b/src/ParaMEDMEM/CommInterface.hxx @@ -181,7 +181,7 @@ namespace MEDCoupling nbOfElemsInt = CommInterface::ToIntArray(nbOfElems,size); offsetsIn = CommInterface::ComputeOffset(nbOfElemsInt,size); } - this->gatherV(array->begin(),nbOfCellsRequested,ParaTraits::MPIDataType,result.get(),nbOfElemsInt.get(),offsetsIn.get(),ParaTraits::MPIDataType,root,comm); + this->gatherV(array->begin(),FromIdType(nbOfCellsRequested),ParaTraits::MPIDataType,result.get(),nbOfElemsInt.get(),offsetsIn.get(),ParaTraits::MPIDataType,root,comm); if(rank==root) { resultIndex = ComputeOffsetFull(nbOfElems,size); @@ -222,7 +222,7 @@ namespace MEDCoupling result.reset(new T[nbOfCellIdsSum]); std::unique_ptr nbOfElemsInt( CommInterface::ToIntArray(nbOfElems,size) ); std::unique_ptr offsetsIn( CommInterface::ComputeOffset(nbOfElemsInt,size) ); - this->allGatherV(array->begin(),nbOfCellsRequested,ParaTraits::MPIDataType,result.get(),nbOfElemsInt.get(),offsetsIn.get(),ParaTraits::MPIDataType,comm); + this->allGatherV(array->begin(),FromIdType(nbOfCellsRequested),ParaTraits::MPIDataType,result.get(),nbOfElemsInt.get(),offsetsIn.get(),ParaTraits::MPIDataType,comm); resultIndex = ComputeOffsetFull(nbOfElems,size); return size; } -- 2.39.2