]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
LOT4: fix -Wconversion in config=int32
authoreap <eap@opencascade.com>
Fri, 6 Dec 2019 14:08:25 +0000 (17:08 +0300)
committereap <eap@opencascade.com>
Fri, 6 Dec 2019 14:08:25 +0000 (17:08 +0300)
src/INTERP_KERNEL/CellModel.cxx
src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DQuadraticPolygon.cxx
src/INTERP_KERNEL/InterpKernelCellSimplify.cxx
src/INTERP_KERNEL/SplitterTetra.cxx

index ff27642f08826317583cd218e2d04ac40f8fdecb..cf71d3a61eadc5e3cc4e65f1fc513d7b330a1842 100644 (file)
@@ -471,7 +471,7 @@ namespace INTERP_KERNEL
     if(!isDynamic())
       return _nb_of_little_sons;
     else//polyhedron
-      return FromIdType<unsigned>(lgth-std::count(conn,conn+lgth,-1))/2;
+      return FromIdType<unsigned>(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<unsigned>(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<unsigned>(where2-where);
+        return (unsigned)(where2-where);
       }
     else
       throw INTERP_KERNEL::Exception("CellModel::getNumberOfNodesConstituentTheSon2 : no sons on NORM_POLYL !");
index c18c70791f87a69c133102386f082fb938608e4f..7494e5328b275c1089b3c7f2b52eab84ba5392b6 100644 (file)
@@ -517,7 +517,7 @@ void QuadraticPolygon::buildFromCrudeDataArray2(const std::map<mcIdType,INTERP_K
                   idIns1.push_back(std::pair<mcIdType,std::pair<bool,mcIdType> >(edgeId1,std::pair<bool,mcIdType>(descBg1[j]>0,offset1)));// it exists an edge into pol1 given by tuple (idIn1,direct1) that is colinear at edge 'edgeId' in pol2
                   //std::pair<edgeId1); direct1=descBg1[j]>0;
                 }
-              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<mcIdType,INTERP_K
               bool direction11,found=false;
               bool direct1;//store if needed the direction in 1
               mcIdType offset2;
-              std::size_t nbOfSubEdges1;
+              mcIdType nbOfSubEdges1;
               for(std::vector<std::pair<mcIdType,std::pair<bool,mcIdType> > >::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<mcIdType>& subEdge1PossiblyAlreadyIn1=intersectEdges1[idIn1];
-                  nbOfSubEdges1=subEdge1PossiblyAlreadyIn1.size()/2;
+                  nbOfSubEdges1=ToIdType(subEdge1PossiblyAlreadyIn1.size()/2);
                   offset2=0;
-                  for(std::size_t k=0;k<nbOfSubEdges1 && !found;k++)
+                  for(mcIdType k=0;k<nbOfSubEdges1 && !found;k++)
                     {//perform a loop on all subedges of pol1 that includes edge 'edgeId' of pol2. For the moment we iterate only on subedges of ['idIn1']... To improve
                       if(subEdge1PossiblyAlreadyIn1[2*k]==idBg && subEdge1PossiblyAlreadyIn1[2*k+1]==idEnd)
                         { direction11=true; found=true; }
@@ -618,10 +618,10 @@ void QuadraticPolygon::updateLocOfEdgeFromCrudeDataArray2(const mcIdType *descBg
                   mcIdType idIn1=edgeId1;
                   bool direct1=descBg1[j]>0;
                   const std::vector<mcIdType>& 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<nbOfSubEdges1 && !found;kk++)
+                  for(mcIdType kk=0;kk<nbOfSubEdges1 && !found;kk++)
                     {
                       found=(subEdge1PossiblyAlreadyIn1[2*kk]==idBg && subEdge1PossiblyAlreadyIn1[2*kk+1]==idEnd) || (subEdge1PossiblyAlreadyIn1[2*kk]==idEnd && subEdge1PossiblyAlreadyIn1[2*kk+1]==idBg);
                       if(!found)
@@ -629,12 +629,12 @@ void QuadraticPolygon::updateLocOfEdgeFromCrudeDataArray2(const mcIdType *descBg
                     }
                   if(found)
                     {
-                      ElementaryEdge *e=pol1[FromIdType<int>(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
         }
     }
 }
index 326baa5cf912679453545f082762d55e787fde1c..028f61b5acac3b67a5c8d05db8adc946cbaf14e8 100644 (file)
@@ -182,7 +182,7 @@ INTERP_KERNEL::NormalizedCellType CellSimplify::tryToUnPoly3D(const mcIdType *co
   std::set<mcIdType> 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<mcIdType,mcIdType> >::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;
index d7453f5fd9ad51973d39a9c9a54f1ea7ff41f3a4..543ce3cbd35001801e98877816b0650f601d3722 100644 (file)
@@ -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<nbOfFaces;i++,tmp+=3)
+          for(unsigned int i=0;i<nbOfFaces;i++,tmp+=3)
             {
               tmp[0]=0.; tmp[1]=0.; tmp[2]=0.;
-              mcIdType nbOfNodesOfFace(std::distance(work,std::find(work,nodalConnEnd,-1)));
-              for(mcIdType j=0;j<nbOfNodesOfFace;j++,conn+=4)
+              std::size_t nbOfNodesOfFace(std::distance(work,std::find(work,nodalConnEnd,-1)));
+              for(unsigned int j=0;j<nbOfNodesOfFace;j++,conn+=4)
                 {
-                  conn[0]=work[j]; conn[1]=work[(j+1)%nbOfNodesOfFace]; conn[2]=-(i+1); conn[3]=-(nbOfFaces+1);
+                  conn[0]=work[j]; conn[1]=work[(j+1)%nbOfNodesOfFace]; conn[2]=-(i+1); conn[3]=ToIdType(-(nbOfFaces+1));
                   tmp[0]+=coords[3*work[j]+0]; tmp[1]+=coords[3*work[j]+1]; tmp[2]+=coords[3*work[j]+2];
                 }
-              double nbNF = FromIdType<double>(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<double>(nbOfFaces);
+          double nbF = (double)nbOfFaces;
           tmp2[0]/=nbF; tmp2[1]/=nbF; tmp2[2]/=nbF;
           return ;
         }