From f4a97dd837416514d3756ae17fe99867940e7846 Mon Sep 17 00:00:00 2001 From: eap Date: Fri, 6 Dec 2019 17:08:25 +0300 Subject: [PATCH] LOT4: fix -Wconversion in config=int32 --- src/INTERP_KERNEL/CellModel.cxx | 6 +++--- .../InterpKernelGeo2DQuadraticPolygon.cxx | 16 ++++++++-------- src/INTERP_KERNEL/InterpKernelCellSimplify.cxx | 4 ++-- src/INTERP_KERNEL/SplitterTetra.cxx | 14 +++++++------- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/INTERP_KERNEL/CellModel.cxx b/src/INTERP_KERNEL/CellModel.cxx index ff27642f0..cf71d3a61 100644 --- a/src/INTERP_KERNEL/CellModel.cxx +++ b/src/INTERP_KERNEL/CellModel.cxx @@ -471,7 +471,7 @@ namespace INTERP_KERNEL if(!isDynamic()) return _nb_of_little_sons; else//polyhedron - return FromIdType(lgth-std::count(conn,conn+lgth,-1))/2; + return FromIdType(lgth-ToIdType(std::count(conn,conn+lgth,-1)/2)); } /*! @@ -591,7 +591,7 @@ namespace INTERP_KERNEL } const mcIdType *where2=std::find(where,nodalConn+lgth,-1); std::copy(where,where2,sonNodalConn); - return FromIdType(where2-where); + return (unsigned)(where2-where); } else throw INTERP_KERNEL::Exception("CellModel::fillSonCellNodalConnectivity2 : no sons on NORM_POLYL !"); @@ -753,7 +753,7 @@ namespace INTERP_KERNEL where++; } const mcIdType *where2=std::find(where,nodalConn+lgth,-1); - return FromIdType(where2-where); + return (unsigned)(where2-where); } else throw INTERP_KERNEL::Exception("CellModel::getNumberOfNodesConstituentTheSon2 : no sons on NORM_POLYL !"); diff --git a/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DQuadraticPolygon.cxx b/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DQuadraticPolygon.cxx index c18c70791..7494e5328 100644 --- a/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DQuadraticPolygon.cxx +++ b/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DQuadraticPolygon.cxx @@ -517,7 +517,7 @@ void QuadraticPolygon::buildFromCrudeDataArray2(const std::map >(edgeId1,std::pair(descBg1[j]>0,offset1)));// it exists an edge into pol1 given by tuple (idIn1,direct1) that is colinear at edge 'edgeId' in pol2 //std::pair0; } - offset1+=intersectEdges1[edgeId1].size()/2;//offset1 is used to find the INTERP_KERNEL::Edge * instance into pol1 that will be part of edge into pol2 + offset1+=ToIdType(intersectEdges1[edgeId1].size()/2);//offset1 is used to find the INTERP_KERNEL::Edge * instance into pol1 that will be part of edge into pol2 } directos=idIns1.empty(); } @@ -543,16 +543,16 @@ void QuadraticPolygon::buildFromCrudeDataArray2(const std::map > >::const_iterator it=idIns1.begin();it!=idIns1.end() && !found;it++) { mcIdType idIn1=(*it).first;//store if needed the cell id in 1 direct1=(*it).second.first; offset1=(*it).second.second; const std::vector& subEdge1PossiblyAlreadyIn1=intersectEdges1[idIn1]; - nbOfSubEdges1=subEdge1PossiblyAlreadyIn1.size()/2; + nbOfSubEdges1=ToIdType(subEdge1PossiblyAlreadyIn1.size()/2); offset2=0; - for(std::size_t k=0;k0; const std::vector& subEdge1PossiblyAlreadyIn1=intersectEdges1[idIn1]; - std::size_t nbOfSubEdges1=subEdge1PossiblyAlreadyIn1.size()/2; + mcIdType nbOfSubEdges1=ToIdType(subEdge1PossiblyAlreadyIn1.size()/2); mcIdType offset2=0; bool found=false; - for(std::size_t kk=0;kk(offset1+(direct1?offset2:nbOfSubEdges1-offset2-1))]; + ElementaryEdge *e=pol1[(int)(offset1+(direct1?offset2:nbOfSubEdges1-offset2-1))]; e->getPtr()->declareOn(); } } } - offset1+=intersectEdges1[edgeId1].size()/2;//offset1 is used to find the INTERP_KERNEL::Edge * instance into pol1 that will be part of edge into pol2 + offset1+=ToIdType(intersectEdges1[edgeId1].size()/2);//offset1 is used to find the INTERP_KERNEL::Edge * instance into pol1 that will be part of edge into pol2 } } } diff --git a/src/INTERP_KERNEL/InterpKernelCellSimplify.cxx b/src/INTERP_KERNEL/InterpKernelCellSimplify.cxx index 326baa5cf..028f61b5a 100644 --- a/src/INTERP_KERNEL/InterpKernelCellSimplify.cxx +++ b/src/INTERP_KERNEL/InterpKernelCellSimplify.cxx @@ -182,7 +182,7 @@ INTERP_KERNEL::NormalizedCellType CellSimplify::tryToUnPoly3D(const mcIdType *co std::set nodes(conn,conn+lgth); nodes.erase(-1); std::size_t nbOfNodes=nodes.size(); - mcIdType magicNumber=100*nbOfNodes+nbOfFaces; + std::size_t magicNumber=100*nbOfNodes+nbOfFaces; switch(magicNumber) { case 806: @@ -260,7 +260,7 @@ bool CellSimplify::orientOppositeFace(const mcIdType *baseFace, mcIdType *retCon std::vector< std::pair >::iterator it=std::find(oppEdges.begin(),oppEdges.end(),pInOpp); if(it==oppEdges.end())//the opposite edge of side face is not found opposite face ... maybe problem of orientation of polyhedron return false; - mcIdType pos2=std::distance(oppEdges.begin(),it); + mcIdType pos2=ToIdType(std::distance(oppEdges.begin(),it)); mcIdType offset=pos-pos2; if(offset<0) offset+=lgthBaseFace; diff --git a/src/INTERP_KERNEL/SplitterTetra.cxx b/src/INTERP_KERNEL/SplitterTetra.cxx index d7453f5fd..543ce3cbd 100644 --- a/src/INTERP_KERNEL/SplitterTetra.cxx +++ b/src/INTERP_KERNEL/SplitterTetra.cxx @@ -186,7 +186,7 @@ namespace INTERP_KERNEL } case NORM_POLYHED: { - mcIdType nbOfFaces(ToIdType(std::count(nodalConnBg,nodalConnEnd,-1)+1)); + std::size_t nbOfFaces(std::count(nodalConnBg,nodalConnEnd,-1)+1); std::size_t nbOfTetra(std::distance(nodalConnBg,nodalConnEnd)-nbOfFaces+1); addCoords.resize((nbOfFaces+1)*3); tetrasNodalConn.resize(nbOfTetra*4); @@ -194,21 +194,21 @@ namespace INTERP_KERNEL const mcIdType *work(nodalConnBg); double *tmp(&addCoords[0]),*tmp2(&addCoords[3*nbOfFaces]); tmp2[0]=0.; tmp2[1]=0.; tmp2[2]=0.; - for(mcIdType i=0;i(nbOfNodesOfFace); + double nbNF = (double)nbOfNodesOfFace; tmp[0]/=nbNF; tmp[1]/=nbNF; tmp[2]/=nbNF; tmp2[0]+=tmp[0]; tmp2[1]+=tmp[1]; tmp2[2]+=tmp[2]; work+=nbOfNodesOfFace+1; } - double nbF = FromIdType(nbOfFaces); + double nbF = (double)nbOfFaces; tmp2[0]/=nbF; tmp2[1]/=nbF; tmp2[2]/=nbF; return ; } -- 2.39.2