]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
LOT4: 1) fix tests in config=int64 2) fix warnings
authoreap <eap@opencascade.com>
Wed, 11 Dec 2019 12:14:01 +0000 (15:14 +0300)
committereap <eap@opencascade.com>
Wed, 11 Dec 2019 12:14:01 +0000 (15:14 +0300)
45 files changed:
src/INTERP_KERNEL/CMakeLists.txt
src/INTERP_KERNEL/CellModel.cxx
src/INTERP_KERNEL/ExprEval/InterpKernelAsmX86.cxx
src/INTERP_KERNEL/ExprEval/InterpKernelUnit.cxx
src/INTERP_KERNEL/GaussPoints/InterpKernelGaussCoords.cxx
src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DComposedEdge.cxx
src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DEdge.cxx
src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DElementaryEdge.cxx
src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DQuadraticPolygon.cxx
src/INTERP_KERNEL/InterpKernelCellSimplify.cxx
src/INTERP_KERNEL/InterpolationOptions.cxx
src/INTERP_KERNEL/InterpolationOptions.hxx
src/INTERP_KERNEL/SplitterTetra.cxx
src/INTERP_KERNEL/TransformedTriangleMath.cxx
src/MEDCoupling/MEDCouplingField.cxx
src/MEDCoupling/MEDCouplingField.hxx
src/MEDCoupling/MEDCouplingFieldDouble.cxx
src/MEDCoupling/MEDCouplingFieldDouble.hxx
src/MEDCoupling/MEDCouplingMemArray.hxx
src/MEDCoupling/MEDCouplingMemArray.txx
src/MEDCoupling/MEDCouplingMemArrayChar.cxx
src/MEDCoupling/MEDCouplingTraits.hxx
src/MEDCoupling/MEDCouplingUMesh.cxx
src/MEDCoupling/Test/MEDCouplingBasicsTest1.cxx
src/MEDCoupling/Test/MEDCouplingBasicsTest3.cxx
src/MEDCoupling/Test/MEDCouplingBasicsTest4.cxx
src/MEDCoupling/Test/MEDCouplingBasicsTest5.cxx
src/MEDCoupling/Test/MEDCouplingExamplesTest.cxx
src/MEDCoupling_Swig/CMakeLists.txt
src/MEDCoupling_Swig/DataArrayInt.i
src/MEDCoupling_Swig/MEDCouplingBasicsTest2.py
src/MEDCoupling_Swig/MEDCouplingBasicsTest3.py
src/MEDCoupling_Swig/MEDCouplingBasicsTest4.py
src/MEDCoupling_Swig/MEDCouplingBasicsTest5.py
src/MEDCoupling_Swig/MEDCouplingCommon.i
src/MEDCoupling_Swig/MEDCouplingDataArrayTraits.hxx
src/MEDCoupling_Swig/MEDCouplingDataArrayTypemaps.i
src/MEDCoupling_Swig/MEDCouplingFieldDiscretization.i
src/MEDCoupling_Swig/MEDCouplingMemArray.i
src/MEDCoupling_Swig/MEDCouplingNumPyTest.py
src/MEDCoupling_Swig/MEDCouplingPickleTest.py
src/MEDCoupling_Swig/MEDCouplingRemapperCommon.i
src/MEDCoupling_Swig/MEDCouplingRemapperTest.py
src/MEDCoupling_Swig/MEDCouplingTypemaps.i
src/MEDCoupling_Swig/UsersGuideExamplesTest_numpy.py

index 4b70eceba55bc0c49a5feb4c2b955b3164842a9f..6cf3b22ba012fccae549357315e5aeba9d3dc7a9 100644 (file)
@@ -72,6 +72,10 @@ INCLUDE_DIRECTORIES(
   ${CMAKE_CURRENT_SOURCE_DIR}/GaussPoints
   )
 
+IF (NOT DEFINED MSVC)
+  ADD_DEFINITIONS(-Wsign-compare -Wconversion)
+ENDIF()
+
 SET(PLATFORM_MMAP)
 IF(NOT WIN32)
   SET(PLATFORM_MMAP "-D_POSIX_MAPPED_FILES")
index e79822e62fbabf1780ae601876ba1a924bba0fe8..cf71d3a61eadc5e3cc4e65f1fc513d7b330a1842 100644 (file)
@@ -456,14 +456,14 @@ namespace INTERP_KERNEL
     if(_dim==2)
       {
         if(_type==NORM_POLYGON)
-          return lgth;
+          return FromIdType<unsigned>(lgth);
         else
-          return lgth/2;
+          return FromIdType<unsigned>(lgth/2);
       }
     else if(_dim==1)
-      return lgth;//NORM_POLYL
+      return FromIdType<unsigned>(lgth);//NORM_POLYL
     else
-      return std::count(conn,conn+lgth,-1)+1;
+      return (unsigned)std::count(conn,conn+lgth,-1)+1;
   }
 
   unsigned CellModel::getNumberOfEdgesIn3D(const mcIdType *conn, mcIdType lgth) const
@@ -471,7 +471,7 @@ namespace INTERP_KERNEL
     if(!isDynamic())
       return _nb_of_little_sons;
     else//polyhedron
-      return (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 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 where2-where;
+        return (unsigned)(where2-where);
       }
     else
       throw INTERP_KERNEL::Exception("CellModel::getNumberOfNodesConstituentTheSon2 : no sons on NORM_POLYL !");
@@ -805,7 +805,7 @@ namespace INTERP_KERNEL
           }
         else
           {
-            int p=(lgth+1)/2;
+            mcIdType p=(lgth+1)/2;
             std::vector<mcIdType> tmp(2*p);
             std::vector<mcIdType>::iterator it=std::copy(conn1,conn1+p,tmp.begin());
             std::copy(conn1,conn1+p,it);
index d040be703d737a6ab53e1be039ee4c9b016d6f85..794c664db95fd7f215dc19e6fb58505efe70c039 100644 (file)
@@ -45,7 +45,7 @@ std::vector<char> INTERP_KERNEL::AsmX86::convertIntoMachineLangage(const std::ve
 char *INTERP_KERNEL::AsmX86::copyToExecMemZone(const std::vector<char>& ml, unsigned& offset) const
 {
   char *ret=0;
-  int lgth=ml.size();
+  std::size_t lgth=ml.size();
 #ifdef _POSIX_MAPPED_FILES
 # ifdef __APPLE__
   ret=(char *)mmap(0,lgth,PROT_EXEC | PROT_WRITE,MAP_ANON | MAP_PRIVATE,-1,0);
@@ -492,7 +492,7 @@ void INTERP_KERNEL::AsmX86::appendAddress(const std::string& addr, int nbOfByte,
   for(int k=0;k<nbOfByte;k++)
     {
       j=i&255;
-      v=j;
+      v=(char)j;
       ml.push_back(v);
       i>>=8;
     }
index ab5e989d95f5a064db638abe2ca9d734a5159457..ab5a4a79bb34de2d754e666c5c41146d0c10bb50 100644 (file)
@@ -233,7 +233,8 @@ void DecompositionInUnitBase::tryToConvertInUnit(double val)
 
 DecompositionInUnitBase &DecompositionInUnitBase::operator*(const DecompositionInUnitBase& other)
 {
-  _value[0]+=other._value[0]; _value[1]+=other._value[1]; _value[2]+=other._value[2]; _value[3]+=other._value[3]; _value[4]+=other._value[4];
+  // += causes ' conversion to 'short int' from 'int' may alter its value [-Wconversion]'
+  _value[0]=(short)(_value[0]+other._value[0]); _value[1]=(short)(_value[1]+other._value[1]); _value[2]=(short)(_value[2]+other._value[2]); _value[3]=(short)(_value[3]+other._value[3]); _value[4]=(short)(_value[4]+other._value[4]);
   _mult_fact_to_base*=other._mult_fact_to_base;
   _add_to_base=0.;
   return *this;
@@ -241,7 +242,8 @@ DecompositionInUnitBase &DecompositionInUnitBase::operator*(const DecompositionI
 
 DecompositionInUnitBase &DecompositionInUnitBase::operator/(const DecompositionInUnitBase& other)
 {
-  _value[0]-=other._value[0]; _value[1]-=other._value[1]; _value[2]-=other._value[2]; _value[3]-=other._value[3]; _value[4]-=other._value[4];
+  // -= causes ' conversion to 'short int' from 'int' may alter its value [-Wconversion]'
+  _value[0]=(short)(_value[0]-other._value[0]); _value[1]=(short)(_value[1]-other._value[1]); _value[2]=(short)(_value[2]-other._value[2]); _value[3]=(short)(_value[3]-other._value[3]); _value[4]=(short)(_value[4]-other._value[4]);
   _mult_fact_to_base/=other._mult_fact_to_base;
  _add_to_base=0.;
  return *this;
@@ -252,7 +254,8 @@ DecompositionInUnitBase &DecompositionInUnitBase::operator^(const DecompositionI
   if(!other.isAdimensional())
     throw INTERP_KERNEL::Exception("Trying to execute operator ^ with a second member not adimensionnal");
   int exp=couldItBeConsideredAsInt(other._mult_fact_to_base);
-  _value[0]*=exp; _value[1]*=exp; _value[2]*=exp; _value[3]*=exp; _value[4]*=exp;
+  // *= causes ' conversion to 'short int' from 'int' may alter its value [-Wconversion]'
+  _value[0]=(short)(_value[0]*exp); _value[1]=(short)(_value[1]*exp); _value[2]=(short)(_value[2]*exp); _value[3]=(short)(_value[3]*exp); _value[4]=(short)(_value[4]*exp);
   _mult_fact_to_base=powInt(_mult_fact_to_base,exp);
   _add_to_base=0.;
   return *this;
index 6b699a584eff9fdbe7532fcce9147ed4f0737711..42adbc54c61b4177edbfad1bb243cfdd888966b1 100644 (file)
@@ -172,7 +172,7 @@ int GaussInfo::getGaussCoordDim() const
 {
   if( _my_nb_gauss ) 
     {
-      return _my_gauss_coord.size()/_my_nb_gauss;
+      return (int)_my_gauss_coord.size()/_my_nb_gauss;
     }
   else 
     {
@@ -187,7 +187,7 @@ int GaussInfo::getReferenceCoordDim() const
 {
   if( _my_nb_ref ) 
     {
-      return _my_reference_coord.size()/_my_nb_ref;
+      return (int)(_my_reference_coord.size()/_my_nb_ref);
     }
   else 
     {
@@ -2967,7 +2967,7 @@ void GaussCoords::addGaussInfo( NormalizedCellType theGeometry,
     aReferenceCoord.push_back(theReferenceCoord[i]);
 
 
-  GaussInfo* info = new GaussInfo( theGeometry, aGaussCoord, theNbGauss, aReferenceCoord, theNbRef);
+  GaussInfo* info = new GaussInfo( theGeometry, aGaussCoord, FromIdType<int>(theNbGauss), aReferenceCoord, FromIdType<int>(theNbRef));
   info->initLocalInfo();
 
   //If info with cell type doesn't exist add it
@@ -2979,7 +2979,7 @@ void GaussCoords::addGaussInfo( NormalizedCellType theGeometry,
     }
   else 
     {
-      int index = std::distance(_my_gauss_info.begin(),it);
+      std::size_t index = std::distance(_my_gauss_info.begin(),it);
       delete (*it);
       _my_gauss_info[index] = info;
     }
index 7357282391d8d583ba1eb336e8fac81edeb4c52e..a2f2fe97b8af075e77ad0afe922cad66bf1a722d 100644 (file)
@@ -587,7 +587,7 @@ double ComposedEdge::isInOrOutAlg(Node *nodeToTest, const std::set<Node*>& nodes
   std::vector<double> radialDistrib3(radialDistrib.size());
   std::transform(radialDistrib2.begin(),radialDistrib2.end(),radialDistrib.begin(),radialDistrib3.begin(),std::minus<double>());
   std::vector<double>::iterator iter3=max_element(radialDistrib3.begin(),radialDistrib3.end());
-  int i=iter3-radialDistrib3.begin();
+  std::size_t i=iter3-radialDistrib3.begin();
   // ok for e1 - Let's go.
   EdgeInfLin *e1=new EdgeInfLin(nodeToTest,radialDistrib[i]+radialDistrib3[i]/2.);
   double ref=e1->getCharactValue(*nodeToTest);
index 7617feb11cb5f99d8e8c0bb5360643312256670e..a3220bf615e38966a1ae131278bf1d85d94b0f5d 100644 (file)
@@ -684,17 +684,17 @@ bool Edge::IntersectOverlapped(const Edge *f1, const Edge *f2, EdgeIntersector *
  */
 void Edge::Interpolate1DLin(const std::vector<double>& distrib1, const std::vector<double>& distrib2, std::map<int, std::map<int,double> >& result)
 {
-  int nbOfV1=distrib1.size()-1;
-  int nbOfV2=distrib2.size()-1;
+  std::size_t nbOfV1=distrib1.size()-1;
+  std::size_t nbOfV2=distrib2.size()-1;
   Node *n1=new Node(0.,0.); Node *n3=new Node(0.,0.);
   Node *n2=new Node(0.,0.); Node *n4=new Node(0.,0.);
   MergePoints commonNode;
-  for(int i=0;i<nbOfV1;i++)
+  for(unsigned int i=0;i<nbOfV1;i++)
     {
       std::vector<double>::const_iterator iter=find_if(distrib2.begin()+1,distrib2.end(),bind2nd(std::greater_equal<double>(),distrib1[i]));
       if(iter!=distrib2.end())
         {
-          for(int j=(iter-1)-distrib2.begin();j<nbOfV2;j++)
+          for(unsigned int j=(unsigned)((iter-1)-distrib2.begin());j<nbOfV2;j++)
             {
               if(distrib2[j]<=distrib1[i+1])
                 {
@@ -1064,8 +1064,8 @@ void Edge::sortIdsAbs(const std::vector<INTERP_KERNEL::Node *>& addNodes, const
   tmpp2[tmpp.size()+1]=endId;
   std::vector<mcIdType>::iterator itt=std::unique(tmpp2.begin(),tmpp2.end());
   tmpp2.resize(std::distance(tmpp2.begin(),itt));
-  int nbOfEdges=tmpp2.size()-1;
-  for(int i=0;i<nbOfEdges;i++)
+  std::size_t nbOfEdges=tmpp2.size()-1;
+  for(std::size_t i=0;i<nbOfEdges;i++)
     {
       edgesThis.push_back(tmpp2[i]);
       edgesThis.push_back(tmpp2[i+1]);
index 76a54f14b434393169e3f6905945a8abe31fc6f0..f0237a7ab94ff90a0f49dcc832011ae91478f193 100644 (file)
@@ -234,7 +234,7 @@ void ElementaryEdge::fillGlobalInfoAbs2(const std::map<INTERP_KERNEL::Node *,mcI
                                         std::vector<mcIdType>& edgesOther, std::vector<double>& addCoo, std::map<INTERP_KERNEL::Node *,mcIdType>& mapAddCoo) const
 {
   if (!_direction)
-    skipStartOrEnd *= -1;  // invert value - see QuadraticPolygon::splitAbs()
+    skipStartOrEnd = (short)(-skipStartOrEnd);  // invert value - see QuadraticPolygon::splitAbs()
   _ptr->fillGlobalInfoAbs2(mapThis,mapOther,offset1,offset2,fact,baryX,baryY,skipStartOrEnd,edgesOther,addCoo,mapAddCoo);
 }
 
index 5ccc4c06b805783e4a81e14f7a00e116c338d6a5..7494e5328b275c1089b3c7f2b52eab84ba5392b6 100644 (file)
@@ -324,7 +324,7 @@ void QuadraticPolygon::splitAbs(QuadraticPolygon& other,
               //
               std::map<INTERP_KERNEL::Node *,mcIdType>::const_iterator thisStart(mapThis.find(curThis->getStartNode())),thisEnd(mapThis.find(curThis->getEndNode())),
                                                                   otherStart(mapOther.find(curOtherTmp->getStartNode())),otherEnd(mapOther.find(curOtherTmp->getEndNode()));
-              int thisStart2(thisStart==mapThis.end()?-1:(*thisStart).second), thisEnd2(thisEnd==mapThis.end()?-1:(*thisEnd).second),
+              mcIdType thisStart2(thisStart==mapThis.end()?-1:(*thisStart).second), thisEnd2(thisEnd==mapThis.end()?-1:(*thisEnd).second),
                   otherStart2(otherStart==mapOther.end()?-1:(*otherStart).second+offset1),otherEnd2(otherEnd==mapOther.end()?-1:(*otherEnd).second+offset1);
               //
               if(curThis->getPtr()->intersectWith(curOtherTmp->getPtr(),merge,*cThis,*cOther))
@@ -362,7 +362,7 @@ void QuadraticPolygon::splitAbs(QuadraticPolygon& other,
       // Converting back to integer connectivity:
       if(otherTmp._sub_edges.size()>1)   // only if a new point has been added (i.e. an actual intersection was done)
         {
-          int jj = 0, sz(otherTmp._sub_edges.size());
+          std::size_t jj = 0, sz(otherTmp._sub_edges.size());
           for(std::list<ElementaryEdge *>::const_iterator it=otherTmp._sub_edges.begin();it!=otherTmp._sub_edges.end();it++, jj++)
             {
               short skipStartOrEnd = jj == 0 ? -1 : (jj == sz-1 ? 1 : 0);  // -1 means START, 1 means END, 0 other
@@ -403,7 +403,7 @@ void QuadraticPolygon::appendEdgeFromCrudeDataArray(std::size_t edgePos, const s
   if(!isQuad)
     {
       bool direct=descBg[edgePos]>0;
-      mcIdType edgeId=abs(descBg[edgePos])-1; // back to C indexing mode
+      mcIdType edgeId=std::abs(descBg[edgePos])-1; // back to C indexing mode
       const std::vector<mcIdType>& subEdge=intersectEdges[edgeId];
       std::size_t nbOfSubEdges=subEdge.size()/2;
       for(std::size_t j=0;j<nbOfSubEdges;j++)
@@ -426,7 +426,7 @@ void QuadraticPolygon::appendEdgeFromCrudeDataArray(std::size_t edgePos, const s
       delete e1; delete e2;
       //
       bool direct=descBg[edgePos]>0;
-      mcIdType edgeId=abs(descBg[edgePos])-1;
+      mcIdType edgeId=std::abs(descBg[edgePos])-1;
       const std::vector<mcIdType>& subEdge=intersectEdges[edgeId];
       std::size_t nbOfSubEdges=subEdge.size()/2;
       if(colinearity)
@@ -478,7 +478,7 @@ void QuadraticPolygon::buildFromCrudeDataArray2(const std::map<mcIdType,INTERP_K
   for(std::size_t i=0;i<nbOfSeg;i++)//loop over all edges of pol2
     {
       bool direct=descBg[i]>0;
-      mcIdType edgeId=abs(descBg[i])-1;//current edge id of pol2
+      mcIdType edgeId=std::abs(descBg[i])-1;//current edge id of pol2
       std::map<mcIdType,std::vector<INTERP_KERNEL::ElementaryEdge *> >::const_iterator it1=alreadyExistingIn2.find(descBg[i]),it2=alreadyExistingIn2.find(-descBg[i]);
       if(it1!=alreadyExistingIn2.end() || it2!=alreadyExistingIn2.end())
         {
@@ -511,13 +511,13 @@ void QuadraticPolygon::buildFromCrudeDataArray2(const std::map<mcIdType,INTERP_K
           std::size_t nbOfEdgesIn1=std::distance(descBg1,descEnd1);
           for(std::size_t j=0;j<nbOfEdgesIn1;j++)
             {
-              mcIdType edgeId1=abs(descBg1[j])-1;
+              mcIdType edgeId1=std::abs(descBg1[j])-1;
               if(std::find(c.begin(),c.end(),edgeId1)!=c.end())
                 {
                   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; }
@@ -573,7 +573,7 @@ void QuadraticPolygon::buildFromCrudeDataArray2(const std::map<mcIdType,INTERP_K
                 }
               else
                 {//the current subedge of edge 'edgeId' of pol2 is part of the colinear edge 'idIn1' of pol1 -> reuse Edge instance of pol1
-                  ElementaryEdge *e=pol1[offset1+(direct1?offset2:nbOfSubEdges1-offset2-1)];
+                  ElementaryEdge *e=pol1[FromIdType<int>(offset1+(direct1?offset2:nbOfSubEdges1-offset2-1))];
                   Edge *ee=e->getPtr();
                   ee->incrRef();
                   ElementaryEdge *e2=new ElementaryEdge(ee,!(direct1^direction11));
@@ -597,7 +597,7 @@ void QuadraticPolygon::updateLocOfEdgeFromCrudeDataArray2(const mcIdType *descBg
   for(std::size_t i=0;i<nbOfSeg;i++)//loop over all edges of pol2
     {
       bool direct=descBg[i]>0;
-      mcIdType edgeId=abs(descBg[i])-1;//current edge id of pol2
+      mcIdType edgeId=std::abs(descBg[i])-1;//current edge id of pol2
       const std::vector<mcIdType>& c=colinear1[edgeId];
       if(c.empty())
         continue;
@@ -608,7 +608,7 @@ void QuadraticPolygon::updateLocOfEdgeFromCrudeDataArray2(const mcIdType *descBg
       mcIdType offset1=0;
       for(std::size_t j=0;j<nbOfEdgesIn1;j++)
         {
-          mcIdType edgeId1=abs(descBg1[j])-1;
+          mcIdType edgeId1=std::abs(descBg1[j])-1;
           if(std::find(c.begin(),c.end(),edgeId1)!=c.end())
             {
               for(std::size_t k=0;k<nbOfSubEdges;k++)
@@ -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[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 1fa6079c91513c950894050352db92234632338b..028f61b5acac3b67a5c8d05db8adc946cbaf14e8 100644 (file)
@@ -66,7 +66,7 @@ INTERP_KERNEL::NormalizedCellType CellSimplify::simplifyDegeneratedCell(INTERP_K
         }
       else
         {
-          int quadOff = lgth/2;
+          mcIdType quadOff = lgth/2;
           mcIdType *tmpQuad = new mcIdType[quadOff];
           for(int i = 0; i < quadOff; i++)
             if(conn[i] != conn[(i+1)%quadOff] || conn[i] != conn[i+quadOff])  // zip nul segments/arcs (quad point must match too)
@@ -181,8 +181,8 @@ INTERP_KERNEL::NormalizedCellType CellSimplify::tryToUnPoly3D(const mcIdType *co
 {
   std::set<mcIdType> nodes(conn,conn+lgth);
   nodes.erase(-1);
-  int nbOfNodes=(int)nodes.size();
-  int magicNumber=100*nbOfNodes+nbOfFaces;
+  std::size_t nbOfNodes=nodes.size();
+  std::size_t magicNumber=100*nbOfNodes+nbOfFaces;
   switch(magicNumber)
     {
     case 806:
@@ -260,8 +260,8 @@ 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;
-  int pos2=(int)std::distance(oppEdges.begin(),it);
-  int offset=pos-pos2;
+  mcIdType pos2=ToIdType(std::distance(oppEdges.begin(),it));
+  mcIdType offset=pos-pos2;
   if(offset<0)
     offset+=lgthBaseFace;
   //this is the end copy the result
@@ -451,7 +451,7 @@ INTERP_KERNEL::NormalizedCellType CellSimplify::tryToUnPolyPyra5(const mcIdType
       std::set<mcIdType> quad4S(quad4,quad4+4);
       w=conn;
       bool ok=true;
-      int point=-1;
+      mcIdType point=-1;
       for(std::size_t i=0;i<5 && ok;i++)
         {
           if(i!=quad4_pos)
@@ -496,7 +496,7 @@ INTERP_KERNEL::NormalizedCellType CellSimplify::tryToUnPolyTetra4(const mcIdType
   if(std::find_if(conn+lgth,conn+lgth+nbOfFaces,std::bind2nd(std::not_equal_to<mcIdType>(),ToIdType(INTERP_KERNEL::NORM_TRI3)))==conn+lgth+nbOfFaces)
     {
       std::set<mcIdType> tribase(conn,conn+3);
-      int point=-1;
+      mcIdType point=-1;
       bool ok=true;
       for(int i=1;i<4 && ok;i++)
         {
index 63998d9338e251920589a8ad365829aa221b656a..0d70a7d0ab28307a186ab1c190d710539075748f 100644 (file)
@@ -255,7 +255,7 @@ std::string INTERP_KERNEL::InterpolationOptions::filterInterpolationMethod(const
   return std::string(meth);
 }
 
-bool INTERP_KERNEL::InterpolationOptions::setInterpolationOptions(long print_level,
+bool INTERP_KERNEL::InterpolationOptions::setInterpolationOptions(int print_level,
                                                                   std::string intersection_type,
                                                                   double precision,
                                                                   double median_plane,
@@ -263,7 +263,7 @@ bool INTERP_KERNEL::InterpolationOptions::setInterpolationOptions(long print_lev
                                                                   double bounding_box_adjustment,
                                                                   double bounding_box_adjustment_abs,
                                                                   double max_distance_for_3Dsurf_intersect,
-                                                                  long orientation,
+                                                                  int orientation,
                                                                   bool measure_abs,
                                                                   std::string splitting_policy)
 {
index d06c50964a7daa38e228194ea9f27ade135afdce..f4fd8984d99b6d04f977fe31caa816b51048059c 100644 (file)
@@ -98,7 +98,7 @@ namespace INTERP_KERNEL
 
     void init();
     
-    bool setInterpolationOptions(long print_level,
+    bool setInterpolationOptions(int print_level,
                                  std::string intersection_type,
                                  double precision,
                                  double median_plane,
@@ -106,7 +106,7 @@ namespace INTERP_KERNEL
                                  double bounding_box_adjustment,
                                  double bounding_box_adjustment_abs,
                                  double max_distance_for_3Dsurf_intersect,
-                                 long orientation,
+                                 int orientation,
                                  bool measure_abs,
                                  std::string splitting_policy);
     void copyOptions(const InterpolationOptions & other) { *this = other; }
index 0d109f48d0bdeea1963bc9519a59153166ce3214..c906545d36f8d80b2262366bede14c42d91a60ee 100644 (file)
@@ -187,27 +187,29 @@ namespace INTERP_KERNEL
       case NORM_POLYHED:
         {
           mcIdType nbOfFaces(ToIdType(std::count(nodalConnBg,nodalConnEnd,-1)+1));
-          std::size_t nbOfTetra(std::distance(nodalConnBg,nodalConnEnd)-nbOfFaces+1);
+          mcIdType nbOfTetra(ToIdType(std::distance(nodalConnBg,nodalConnEnd)-nbOfFaces+1));
           addCoords.resize((nbOfFaces+1)*3);
           tetrasNodalConn.resize(nbOfTetra*4);
           mcIdType *conn(&tetrasNodalConn[0]);
           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(int i=0;i<nbOfFaces;i++,tmp+=3)
             {
               tmp[0]=0.; tmp[1]=0.; tmp[2]=0.;
-              mcIdType nbOfNodesOfFace(ToIdType(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(std::size_t 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];
                 }
-              tmp[0]/=nbOfNodesOfFace; tmp[1]/=nbOfNodesOfFace; tmp[2]/=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;
             }
-          tmp2[0]/=nbOfFaces; tmp2[1]/=nbOfFaces; tmp2[2]/=nbOfFaces;
+          double nbF = (double)nbOfFaces;
+          tmp2[0]/=nbF; tmp2[1]/=nbF; tmp2[2]/=nbF;
           return ;
         }
       default:
index 6f896d28da9b1e2ac1c51c7c6426df1332e41683..d55c994c98b91cd0cdedec733dd1e3455c601ce7 100644 (file)
@@ -146,7 +146,7 @@ namespace INTERP_KERNEL
 
             const long double delta = MULT_PREC_F * ( std::fabs(term1) + std::fabs(term2) );
          
-            if( epsilonEqual(_doubleProducts[8*seg + dp], 0.0, THRESHOLD_F * delta))
+            if( epsilonEqual(_doubleProducts[8*seg + dp], 0.0, (double)(THRESHOLD_F * delta)))
               {
                 // debug output
 #if LOG_LEVEL >= 5
@@ -485,7 +485,7 @@ namespace INTERP_KERNEL
     const long double delta = MULT_PREC_F * (std::fabs(p_term) + std::fabs(q_term) + std::fabs(r_term));
 #endif
 
-    if( epsilonEqual( p_term + q_term + r_term, 0.0, THRESHOLD_F * delta) )
+    if( epsilonEqual( p_term + q_term + r_term, 0.0, (double)(THRESHOLD_F * delta)) )
       {
         LOG(4, "Reset imprecise triple product for corner " << corner << " to zero" ); 
         return 0.0;
index 07d5c3562d978223588b2fba08013e36240a283a..167b4284fb1d15d86e98b06e7e6e37618ee58d21 100644 (file)
@@ -428,7 +428,7 @@ mcIdType MEDCouplingField::getNbOfGaussLocalization() const
  *  \throw If the spatial discretization of \a this field is NULL.
  *  \throw If no Gauss localization object found for the given cell.
  */
-mcIdType MEDCouplingField::getGaussLocalizationIdOfOneCell(int cellId) const
+mcIdType MEDCouplingField::getGaussLocalizationIdOfOneCell(mcIdType cellId) const
 {
   if(!((const MEDCouplingFieldDiscretization *)_type))
     throw INTERP_KERNEL::Exception("Spatial discretization not set ! Impossible to call getGaussLocalizationIdOfOneCell method !");
index 54d8252c0e8234036bb33f850576490a70e3261a..c472db057b2444fed48160ae029ecbebb6a345e4 100644 (file)
@@ -79,7 +79,7 @@ namespace MEDCoupling
     MEDCOUPLING_EXPORT mcIdType getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const;
     MEDCOUPLING_EXPORT std::set<mcIdType> getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const;
     MEDCOUPLING_EXPORT mcIdType getNbOfGaussLocalization() const;
-    MEDCOUPLING_EXPORT mcIdType getGaussLocalizationIdOfOneCell(int cellId) const;
+    MEDCOUPLING_EXPORT mcIdType getGaussLocalizationIdOfOneCell(mcIdType cellId) const;
     MEDCOUPLING_EXPORT void getCellIdsHavingGaussLocalization(int locId, std::vector<mcIdType>& cellIds) const;
     MEDCOUPLING_EXPORT const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const;
     MEDCOUPLING_EXPORT void updateTime() const;
index e2113c3e3b3a8f53e956c7bd858a7e712e8bd90a..b65b77a3b7de445a8949662d2055a0b5d5a5a39b 100755 (executable)
@@ -945,7 +945,7 @@ void MEDCouplingFieldDouble::integral(bool isWAbs, double *res) const
  *  \ref  py_mcfielddouble_getValueOnPos "Here is a Python example".
  *  \endif
  */
-void MEDCouplingFieldDouble::getValueOnPos(int i, int j, int k, double *res) const
+void MEDCouplingFieldDouble::getValueOnPos(mcIdType i, mcIdType j, mcIdType k, double *res) const
 {
   const DataArrayDouble *arr=timeDiscr()->getArray();
   if(!_mesh)
@@ -997,7 +997,7 @@ void MEDCouplingFieldDouble::getValueOn(const double *spaceLoc, double *res) con
  *  \ref  py_mcfielddouble_getValueOnMulti "Here is a Python example".
  *  \endif
  */
-DataArrayDouble *MEDCouplingFieldDouble::getValueOnMulti(const double *spaceLoc, int nbOfPoints) const
+DataArrayDouble *MEDCouplingFieldDouble::getValueOnMulti(const double *spaceLoc, mcIdType nbOfPoints) const
 {
   const DataArrayDouble *arr=timeDiscr()->getArray();
   if(!_mesh)
index 91ced90cbbe620b9e781054aca231f77a5575355..ee88df0b400b7fab26c105d5cc638b9ab64a1d94 100644 (file)
@@ -70,10 +70,10 @@ namespace MEDCoupling
     MEDCOUPLING_EXPORT void normMax(double *res) const;
     MEDCOUPLING_EXPORT double integral(int compId, bool isWAbs) const;
     MEDCOUPLING_EXPORT void integral(bool isWAbs, double *res) const;
-    MEDCOUPLING_EXPORT void getValueOnPos(int i, int j, int k, double *res) const;
+    MEDCOUPLING_EXPORT void getValueOnPos(mcIdType i, mcIdType j, mcIdType k, double *res) const;
     MEDCOUPLING_EXPORT void getValueOn(const double *spaceLoc, double *res) const;
     MEDCOUPLING_EXPORT void getValueOn(const double *spaceLoc, double time, double *res) const;
-    MEDCOUPLING_EXPORT DataArrayDouble *getValueOnMulti(const double *spaceLoc, int nbOfPoints) const;
+    MEDCOUPLING_EXPORT DataArrayDouble *getValueOnMulti(const double *spaceLoc, mcIdType nbOfPoints) const;
     MEDCOUPLING_EXPORT void applyLin(double a, double b, int compoId);
     MEDCOUPLING_EXPORT void applyLin(double a, double b);
     MEDCOUPLING_EXPORT MEDCouplingFieldDouble &operator=(double value);
index 28d3ddec4e3627c4ff950de1467c8b74db6a3131..549f3ca9b65d71197f5df415d4bff6b0199ed4b1 100755 (executable)
@@ -323,7 +323,7 @@ namespace MEDCoupling
   {
   public:
     MEDCOUPLING_EXPORT MCAuto<DataArrayDouble> convertToDblArr() const;
-    MEDCOUPLING_EXPORT MCAuto<DataArrayIdType> convertToIntArr() const;
+    MEDCOUPLING_EXPORT MCAuto<DataArrayInt> convertToIntArr() const;
     MEDCOUPLING_EXPORT MCAuto<DataArrayFloat> convertToFloatArr() const;
     MEDCOUPLING_EXPORT void applyLin(T a, T b, std::size_t compoId);
     MEDCOUPLING_EXPORT void applyLin(T a, T b);
@@ -761,7 +761,7 @@ namespace MEDCoupling
     MEDCOUPLING_EXPORT bool isEqualWithoutConsideringStr(const DataArrayChar& other) const;
     MEDCOUPLING_EXPORT std::string repr() const;
     MEDCOUPLING_EXPORT std::string reprZip() const;
-    MEDCOUPLING_EXPORT DataArrayIdType *convertToIntArr() const;
+    MEDCOUPLING_EXPORT DataArrayInt *convertToIntArr() const;
     MEDCOUPLING_EXPORT DataArrayChar *selectByTupleId(const mcIdType *new2OldBg, const mcIdType *new2OldEnd) const { return this->mySelectByTupleId(new2OldBg,new2OldEnd); }
     MEDCOUPLING_EXPORT DataArrayChar *selectByTupleId(const DataArrayIdType& di) const { return this->mySelectByTupleId(di); }
     MEDCOUPLING_EXPORT DataArrayChar *selectByTupleIdSafe(const mcIdType *new2OldBg, const mcIdType *new2OldEnd) const { return DataArrayTemplate<char>::mySelectByTupleIdSafe(new2OldBg,new2OldEnd); }
index 68980ddac227f23af4b018e35c853de10e34537b..e054290ad47941b35bb083c080a22c2fb818827c 100755 (executable)
@@ -2575,9 +2575,9 @@ namespace MEDCoupling
    *  \return DataArrayInt * - the new instance of DataArrayInt.
    */
   template<class T>
-  MCAuto<DataArrayIdType> DataArrayTemplateClassic<T>::convertToIntArr() const
+  MCAuto<DataArrayInt> DataArrayTemplateClassic<T>::convertToIntArr() const
   {
-    return convertToOtherTypeOfArr<mcIdType>();
+    return convertToOtherTypeOfArr<int>();
   }
 
   /*!
index 1c083670dd1bd8bc217b0c83dde9dcdf43909b07..965794bf801167233b2070f8b4bc3851875600ce 100755 (executable)
@@ -117,14 +117,14 @@ std::string DataArrayChar::reprZip() const
  * array to the new one.
  *  \return DataArrayIdType * - the new instance of DataArrayChar.
  */
-DataArrayIdType *DataArrayChar::convertToIntArr() const
+DataArrayInt *DataArrayChar::convertToIntArr() const
 {
   checkAllocated();
-  DataArrayIdType *ret=DataArrayIdType::New();
+  DataArrayInt *ret=DataArrayInt::New();
   ret->alloc(getNumberOfTuples(),getNumberOfComponents());
   std::size_t nbOfVals=getNbOfElems();
   const char *src=getConstPointer();
-  mcIdType *dest=ret->getPointer();
+  int *dest=ret->getPointer();
   std::copy(src,src+nbOfVals,dest);
   ret->copyStringInfoFrom(*this);
   return ret;
index d0d8f7446f7ab8565da57928d8221ac04dbe6050..9d10b48fa0ace35f974ea98c0afc647dc6bd3bf8 100644 (file)
@@ -46,8 +46,10 @@ namespace MEDCoupling
   class DataArrayInt64Tuple;
   class DataArrayFloatTuple;
   class DataArrayDoubleTuple;
+  class DataArrayByteTuple;
   class DataArrayInt32Iterator;
   class DataArrayInt64Iterator;
+  class DataArrayByteIterator;
   
   template<>
   struct MEDCOUPLING_EXPORT Traits<double>
@@ -111,6 +113,8 @@ namespace MEDCoupling
     static const char ArrayTypeName[];
     typedef DataArrayByte ArrayTypeCh;
     typedef DataArrayChar ArrayType;
+    typedef DataArrayByteTuple ArrayTuple;
+    typedef DataArrayByteIterator IteratorType;
   };
 }
 
index 603f7c5f7ede9d8a2c705a582f52dec2e45e948c..05eaf2661ff20381fc6c6d5738560d04e8cd5249 100755 (executable)
@@ -7564,11 +7564,12 @@ void MEDCouplingUMesh::writeVTKLL(std::ostream& ofs, const std::string& cellData
     }
   types->transformWithIndArr(MEDCOUPLING2VTKTYPETRADUCER,MEDCOUPLING2VTKTYPETRADUCER+INTERP_KERNEL::NORM_MAXTYPE+1);
   types->writeVTK(ofs,8,"UInt8","types",byteData);
-  offsets->writeVTK(ofs,8,"Int32","offsets",byteData);
+  std::string vtkTypeName = Traits<mcIdType>::VTKReprStr;
+  offsets->writeVTK(ofs,8,vtkTypeName,"offsets",byteData);
   if(szFaceOffsets!=0)
     {//presence of Polyhedra
       connectivity->reAlloc(szConn);
-      faceoffsets->writeVTK(ofs,8,"Int32","faceoffsets",byteData);
+      faceoffsets->writeVTK(ofs,8,vtkTypeName,"faceoffsets",byteData);
       MCAuto<DataArrayIdType> faces=DataArrayIdType::New(); faces->alloc(szFaceOffsets,1);
       w1=faces->getPointer();
       for(mcIdType i=0;i<nbOfCells;i++)
@@ -7585,9 +7586,9 @@ void MEDCouplingUMesh::writeVTKLL(std::ostream& ofs, const std::string& cellData
                 w6=w5+1;
               }
           }
-      faces->writeVTK(ofs,8,"Int32","faces",byteData);
+      faces->writeVTK(ofs,8,vtkTypeName,"faces",byteData);
     }
-  connectivity->writeVTK(ofs,8,"Int32","connectivity",byteData);
+  connectivity->writeVTK(ofs,8,vtkTypeName,"connectivity",byteData);
   ofs << "      </Cells>\n";
   ofs << "    </Piece>\n";
   ofs << "  </" << getVTKDataSetType() << ">\n";
index 2473089de136aa5d4e7034772c24a54f4b9d9074..417e6bbab940eaa2c76d9cc65528e9d16de99d4e 100644 (file)
@@ -72,7 +72,7 @@ void MEDCouplingBasicsTest1::testArray2()
   arr->setInfoOnComponent(1,"hhhh");
   arr->setInfoOnComponent(2,"jj");
   arr->setInfoOnComponent(3,"kkkkkk");
-  MCAuto<DataArrayIdType> arr2(arr->convertToIntArr());
+  MCAuto<DataArrayInt> arr2(arr->convertToIntArr());
   MCAuto<DataArrayDouble> arr3(arr2->convertToDblArr());
   CPPUNIT_ASSERT(arr->isEqual(*arr3,1e-14));
   arr->decrRef();
index 3841f4fd7a688cc1bf02c40f56503670186b1cad..52200697acaf81cc2a3dee22c627d8e47686fbd4 100644 (file)
@@ -24,6 +24,7 @@
 #include "MEDCouplingMappedExtrudedMesh.hxx"
 #include "MEDCouplingFieldDouble.hxx"
 #include "MEDCouplingMemArray.hxx"
+#include "MEDCouplingMemArray.txx"
 #include "MEDCouplingGaussLocalization.hxx"
 
 #include <cmath>
@@ -681,8 +682,8 @@ void MEDCouplingBasicsTest3::testKeepSetSelectedComponent1()
   const double expected1[30]={2.,3.,2.,3.,1.,1., 12.,13.,12.,13.,11.,11., 22.,23.,22.,23.,21.,21., 32.,33.,32.,33.,31.,31., 42.,43.,42.,43.,41.,41.};
   for(int i=0;i<30;i++)
     CPPUNIT_ASSERT_DOUBLES_EQUAL(expected1[i],a2->getIJ(0,i),1e-14);
-  MCAuto<DataArrayIdType> a3(a1->convertToIntArr());
-  DataArrayIdType *a4=static_cast<DataArrayIdType *>(a3->keepSelectedComponents(arr2V));
+  MCAuto<DataArrayInt> a3(a1->convertToIntArr());
+  DataArrayInt *a4=static_cast<DataArrayInt *>(a3->keepSelectedComponents(arr2V));
   CPPUNIT_ASSERT_EQUAL(6,(int)a4->getNumberOfComponents());
   CPPUNIT_ASSERT_EQUAL(5,(int)a4->getNumberOfTuples());
   CPPUNIT_ASSERT(std::string(a4->getInfoOnComponent(0))=="bbbb");
@@ -692,7 +693,7 @@ void MEDCouplingBasicsTest3::testKeepSetSelectedComponent1()
   CPPUNIT_ASSERT(std::string(a4->getInfoOnComponent(4))=="aaaa");
   CPPUNIT_ASSERT(std::string(a4->getInfoOnComponent(5))=="aaaa");
   for(int i=0;i<30;i++)
-    CPPUNIT_ASSERT_EQUAL(ToIdType(expected1[i]),a4->getIJ(0,i));
+    CPPUNIT_ASSERT_EQUAL((int)expected1[i],a4->getIJ(0,i));
   // setSelectedComponents
   const mcIdType arr3[2]={3,2};
   std::vector<std::size_t> arr3V(arr3,arr3+2);
@@ -713,7 +714,7 @@ void MEDCouplingBasicsTest3::testKeepSetSelectedComponent1()
   const double expected2[30]={2.,4.,3.,3.,1.,1., 12.,14.,13.,13.,11.,11., 22.,24.,23.,23.,21.,21., 32.,34.,33.,33.,31.,31., 42.,44.,43.,43.,41.,41.};
   for(int i=0;i<30;i++)
     CPPUNIT_ASSERT_DOUBLES_EQUAL(expected2[i],a2->getIJ(0,i),1e-14);
-  MCAuto<DataArrayIdType> a6=a5->convertToIntArr();
+  MCAuto<DataArrayInt> a6=a5->convertToIntArr();
   a6->setInfoOnComponent(0,"eeee");
   a6->setInfoOnComponent(1,"ffff");
   a4->setSelectedComponents(a6,arr4V);
@@ -1665,8 +1666,8 @@ void MEDCouplingBasicsTest3::testDAMeld1()
   for(int i=0;i<35;i++)
     CPPUNIT_ASSERT_DOUBLES_EQUAL(expected1[i],da1->getIJ(0,i),1e-10);
   //
-  MCAuto<DataArrayIdType> dai1=da1C->convertToIntArr();
-  MCAuto<DataArrayIdType> dai3=da3->convertToIntArr();
+  MCAuto<DataArrayInt> dai1=da1C->convertToIntArr();
+  MCAuto<DataArrayInt> dai3=da3->convertToIntArr();
   dai1->meldWith(dai3);
   CPPUNIT_ASSERT_EQUAL(5,(int)dai1->getNumberOfComponents());
   CPPUNIT_ASSERT_EQUAL(7,(int)dai1->getNumberOfTuples());
@@ -1676,7 +1677,7 @@ void MEDCouplingBasicsTest3::testDAMeld1()
   CPPUNIT_ASSERT(dai1->getInfoOnComponent(3)=="c1da3");
   CPPUNIT_ASSERT(dai1->getInfoOnComponent(4)=="c2da3");
   for(int i=0;i<35;i++)
-    CPPUNIT_ASSERT_EQUAL(ToIdType(expected1[i]),dai1->getIJ(0,i));
+    CPPUNIT_ASSERT_EQUAL((int)expected1[i],dai1->getIJ(0,i));
   // test of static method DataArrayDouble::meld
   DataArrayDouble *da4=DataArrayDouble::Meld(da1C,da3);
   CPPUNIT_ASSERT_EQUAL(5,(int)da4->getNumberOfComponents());
@@ -1690,7 +1691,7 @@ void MEDCouplingBasicsTest3::testDAMeld1()
     CPPUNIT_ASSERT_DOUBLES_EQUAL(expected1[i],da4->getIJ(0,i),1e-10);
   // test of static method DataArrayIdType::meld
   dai1=da1C->convertToIntArr();
-  DataArrayIdType *dai4=DataArrayIdType::Meld(dai1,dai3);
+  DataArrayInt *dai4=DataArrayInt::Meld(dai1,dai3);
   CPPUNIT_ASSERT_EQUAL(5,(int)dai4->getNumberOfComponents());
   CPPUNIT_ASSERT_EQUAL(7,(int)dai4->getNumberOfTuples());
   CPPUNIT_ASSERT(dai4->getInfoOnComponent(0)=="c0da1");
index 126a949e8c538830fa4eb770ad3aaaeb9ad1d22b..7eb6e13646fbd24320e392481c5ead957fde7142 100644 (file)
@@ -998,8 +998,8 @@ void MEDCouplingBasicsTest4::testDACpyFrom1()
   d1->deepCopyFrom(*d);
   CPPUNIT_ASSERT(d->isEqual(*d1,1e-12));
   //
-  MCAuto<DataArrayIdType> d2=d->convertToIntArr();
-  DataArrayIdType *d4=DataArrayIdType::New();
+  MCAuto<DataArrayInt> d2=d->convertToIntArr();
+  DataArrayInt *d4=DataArrayInt::New();
   CPPUNIT_ASSERT(!d2->isEqual(*d4));
   d4->deepCopyFrom(*d2);
   CPPUNIT_ASSERT(d2->isEqual(*d4));
index 935a25517197b98dc4fcec11d9884c67e7beca90..41a7cb6344bf4141319564f71d0f5511eef82ec4 100644 (file)
@@ -24,6 +24,7 @@
 #include "MEDCouplingMappedExtrudedMesh.hxx"
 #include "MEDCouplingFieldDouble.hxx"
 #include "MEDCouplingMemArray.hxx"
+#include "MEDCouplingMemArray.txx"
 #include "MEDCouplingGaussLocalization.hxx"
 #include "MEDCouplingMultiFields.hxx"
 #include "MEDCouplingFieldOverTime.hxx"
@@ -601,7 +602,7 @@ void MEDCouplingBasicsTest5::testDataArrayAbs1()
   const double expected1[12]={2.,3.,5.,6.,7.,8.,9.,10.,11.,12.,13.,15.};
   d1->alloc(6,2);
   std::copy(val1,val1+12,d1->getPointer());
-  MCAuto<DataArrayIdType> d2=d1->convertToIntArr();
+  MCAuto<DataArrayInt> d2=d1->convertToIntArr();
   //
   d1->abs();
   for(int i=0;i<12;i++)
@@ -610,7 +611,7 @@ void MEDCouplingBasicsTest5::testDataArrayAbs1()
   const mcIdType expected2[12]={2,3,5,6,7,8,9,10,11,12,13,15};
   d2->abs();
   for(int i=0;i<12;i++)
-    CPPUNIT_ASSERT_EQUAL(expected2[i],d2->getIJ(0,i));
+    CPPUNIT_ASSERT_EQUAL((int)expected2[i],d2->getIJ(0,i));
   //
   d1->decrRef();
 }
index 2549484ce58354717898e735606b06ed03ac4c5b..7e305f2195a10f47b969bd8b6b8375e5ec212754 100644 (file)
@@ -1697,7 +1697,7 @@ void CppExample_MEDCouplingUMesh_checkDeepEquivalWith()
   }
   //! [CppSnippet_MEDCouplingUMesh_checkDeepEquivalWith_1]
   //! [CppSnippet_MEDCouplingUMesh_checkDeepEquivalWith_2]
-  mcIdType cellCompPol = 1; // "permuted same orientation" - policy of medium severity
+  int cellCompPol = 1; // "permuted same orientation" - policy of medium severity
   DataArrayIdType *nOld2New, *cOld2New;
   mesh1->checkDeepEquivalWith( mesh2, cellCompPol, 0.002, cOld2New, nOld2New );
   const mcIdType nOld2NewExpected[4] = { 3, 0, 1, 2 };
index 81ca4a5018065ed83819d35b3c5c1fc4d4b7200c..a79ae5bc059aebbb4a538e05c067090a2ea5b68e 100644 (file)
@@ -23,6 +23,10 @@ INCLUDE(${SWIG_USE_FILE})
 
 ADD_DEFINITIONS(${PYTHON_DEFINITIONS} ${NUMPY_DEFINITIONS} ${SCIPY_DEFINITIONS})
 
+IF (NOT DEFINED MSVC)
+  ADD_DEFINITIONS(-Wsign-compare -Wconversion)
+ENDIF()
+
 SET_SOURCE_FILES_PROPERTIES(MEDCoupling.i PROPERTIES CPLUSPLUS ON)
 IF ("${PYTHON_VERSION_MAJOR}" STREQUAL "3")
   SET_SOURCE_FILES_PROPERTIES(MEDCoupling.i PROPERTIES SWIG_FLAGS "-py3")
index f24a21d1157c10647da1c313d29399d3d2dbcdd2..6017f1559e84c38988a50e3f0c5d19a6407d31a2 100644 (file)
     std::string repr() const;
     std::string reprZip() const;
     std::string reprNotTooLong() const;
-    ARRAY *invertArrayO2N2N2O(INT newNbOfElem) const;
-    ARRAY *invertArrayN2O2O2N(INT oldNbOfElem) const;
-    ARRAY *invertArrayO2N2N2OBis(INT newNbOfElem) const;
+    ARRAY *invertArrayO2N2N2O(mcIdType newNbOfElem) const;
+    ARRAY *invertArrayN2O2O2N(mcIdType oldNbOfElem) const;
+    ARRAY *invertArrayO2N2N2OBis(mcIdType newNbOfElem) const;
     DataArrayIdType *indicesOfSubPart(const ARRAY& partOfThis) const;
     ARRAY *fromNoInterlace() const;
     ARRAY *toNoInterlace() const;
-    ARRAY *selectByTupleIdSafeSlice(INT bg, INT end, INT step) const;
+    ARRAY *selectByTupleIdSafeSlice(mcIdType bg, mcIdType end, mcIdType step) const;
     DataArrayIdType *checkAndPreparePermutation() const;
     DataArrayIdType *buildPermArrPerLevel() const;
-    bool isIota(INT sizeExpected) const;
+    bool isIota(mcIdType sizeExpected) const;
     bool isUniform(INT val) const;
     INT checkUniformAndGuess() const;
     bool hasUniqueValues() const;
-    ARRAY *subArray(INT tupleIdBg, INT tupleIdEnd=-1) const;
+    ARRAY *subArray(mcIdType tupleIdBg, mcIdType tupleIdEnd=-1) const;
     void transpose();
     ARRAY *changeNbOfComponents(std::size_t newNbOfComp, INT dftValue) const;
     void meldWith(const ARRAY *other);
-    void setPartOfValues1(const ARRAY *a, INT bgTuples, INT endTuples, INT stepTuples, INT bgComp, INT endComp, INT stepComp, bool strictCompoCompare=true);
-    void setPartOfValuesSimple1(INT a, INT bgTuples, INT endTuples, INT stepTuples, INT bgComp, INT endComp, INT stepComp);
+    void setPartOfValues1(const ARRAY *a, mcIdType bgTuples, mcIdType endTuples, mcIdType stepTuples, mcIdType bgComp, mcIdType endComp, mcIdType stepComp, bool strictCompoCompare=true);
+    void setPartOfValuesSimple1(INT a, mcIdType bgTuples, mcIdType endTuples, mcIdType stepTuples, mcIdType bgComp, mcIdType endComp, mcIdType stepComp);
     void setPartOfValuesAdv(const ARRAY *a, const DataArrayIdType *tuplesSelec);
-    void getTuple(INT tupleId, INT *res) const;
+    void getTuple(mcIdType tupleId, INT *res) const;
     INT getIJ(std::size_t tupleId, std::size_t compoId) const;
-    INT getIJSafe(INT tupleId, INT compoId) const;
+    INT getIJSafe(std::size_t tupleId, std::size_t compoId) const;
     INT front() const;
     INT back() const;
-    void setIJ(INT tupleId, INT compoId, INT newVal);
-    void setIJSilent(INT tupleId, INT compoId, INT newVal);
+    void setIJ(mcIdType tupleId, mcIdType compoId, INT newVal);
+    void setIJSilent(mcIdType tupleId, mcIdType compoId, INT newVal);
     INT *getPointer();
     const INT *getConstPointer() const;
     ARRAY ## Iterator *iterator();
     DataArrayIdType *findRangeIdForEachTuple(const ARRAY *ranges) const;
     ARRAY *findIdInRangeForEachTuple(const ARRAY *ranges) const;
     void sortEachPairToMakeALinkedList();
-    ARRAY *duplicateEachTupleNTimes(INT nbTimes) const;
+    ARRAY *duplicateEachTupleNTimes(mcIdType nbTimes) const;
     ARRAY *getDifferentValues() const;
     static ARRAY *Add(const ARRAY *a1, const ARRAY *a2);
     void addEqual(const ARRAY *other);
               {
                 if(PyInt_Check(nbOfTuples))
                   {
-                    mcIdType nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
+                    mcIdType nbOfTuples1=ToIdType(PyInt_AS_LONG(nbOfTuples));
                     if(nbOfTuples1<0)
                       throw INTERP_KERNEL::Exception("ARRAY::New : should be a positive set of allocated memory !");
                     if(nbOfComp)
                       {
                         if(PyInt_Check(nbOfComp))
                           {//ARRAY.New([1,3,4,5],2,2)
-                            mcIdType nbOfCompo=PyInt_AS_LONG(nbOfComp);
+                            mcIdType nbOfCompo=ToIdType(PyInt_AS_LONG(nbOfComp));
                             if(nbOfCompo<0)
                               throw INTERP_KERNEL::Exception("ARRAY::New : should be a positive number of components !");
                             MCAuto<ARRAY> ret=ARRAY::New();
           }
         else if(PyInt_Check(elt0))
           {
-            INT nbOfTuples1=PyInt_AS_LONG(elt0);
+            INT nbOfTuples1=(INT)PyInt_AS_LONG(elt0);
             if(nbOfTuples1<0)
               throw INTERP_KERNEL::Exception("ARRAY::New : should be a positive set of allocated memory !");
             if(nbOfTuples)
                   {
                     if(PyInt_Check(nbOfTuples))
                       {//ARRAY.New(5,2)
-                        INT nbOfCompo=PyInt_AS_LONG(nbOfTuples);
+                        INT nbOfCompo=(INT)PyInt_AS_LONG(nbOfTuples);
                         if(nbOfCompo<0)
                           throw INTERP_KERNEL::Exception("ARRAY::New : should be a positive number of components !");
                         MCAuto<ARRAY> ret=ARRAY::New();
           }
         else if(MEDCouplingHasNumPyBindings() && PyArray_Check(elt0) && nbOfTuples==NULL && nbOfComp==NULL)
           {//ARRAY.New(numpyArray)
-            return BuildNewInstance<ARRAY,INT>(elt0,NPY_INT32,&PyCallBackDataArrayInt_RefType,"INT32");
+            return BuildNewInstance<ARRAY,INT>(elt0,NPYTraits<INT>::NPYObjectType,NPYTraits<INT>::NPYFunc,MEDCoupling::Traits<INT>::NPYStr);
           }
         else
           throw INTERP_KERNEL::Exception(msg.c_str());
         return self->reprNotTooLong();
       }
 
-      INT __len__() const
+      mcIdType __len__() const
       {
         if(self->isAllocated())
           {
    
       PyObject *accumulate() const
       {
-        mcIdType sz=self->getNumberOfComponents();
+        mcIdType sz=ToIdType(self->getNumberOfComponents());
         INTERP_KERNEL::AutoPtr<INT> tmp=new INT[sz];
         self->accumulate((INT *)tmp);
         return convertIntArrToPyList((const INT *)tmp,sz);
         GetIndicesOfSliceExplicitely(slic,&strt,&stp,&step,"ARRAY::buildExplicitArrOfSliceOnScaledArr (wrap) : the input slice is invalid !");
         if(strt==std::numeric_limits<INT>::max() || stp==std::numeric_limits<INT>::max())
           throw INTERP_KERNEL::Exception("ARRAY::buildExplicitArrOfSliceOnScaledArr (wrap) : the input slice contains some unknowns that can't be determined in static method ! Call DataArray::getSlice (non static) instead !");
-        return self->buildExplicitArrOfSliceOnScaledArr(strt,stp,step);
+        return self->buildExplicitArrOfSliceOnScaledArr((INT)strt,(INT)stp,(INT)step);
       }
 
       PyObject *getMinMaxValues() const
               {
                 if(PyInt_Check(nbOfTuples))
                   {
-                    mcIdType nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
+                    mcIdType nbOfTuples1=ToIdType(PyInt_AS_LONG(nbOfTuples));
                     if(nbOfTuples1<0)
                       throw INTERP_KERNEL::Exception("ARRAY::setValue : should be a positive set of allocated memory !");
                     if(nbOfComp && nbOfComp != Py_None)
                       {
                         if(PyInt_Check(nbOfComp))
                           {//ARRAY.setValues([1,3,4,5],2,2)
-                            mcIdType nbOfCompo=PyInt_AS_LONG(nbOfComp);
+                            mcIdType nbOfCompo=ToIdType(PyInt_AS_LONG(nbOfComp));
                             if(nbOfCompo<0)
                               throw INTERP_KERNEL::Exception("ARRAY::setValue : should be a positive number of components !");
                             std::vector<INT> tmp=fillArrayWithPyListInt2<INT>(li,nbOfTuples1,nbOfCompo);
       PyObject *getValuesAsTuple() const
       {
         const INT *vals=self->getConstPointer();
-        mcIdType nbOfComp=self->getNumberOfComponents();
+        mcIdType nbOfComp=ToIdType(self->getNumberOfComponents());
         mcIdType nbOfTuples=self->getNumberOfTuples();
         return convertIntArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
       }
         DataArrayIdType *ret0=MEDCoupling::ARRAY::MakePartition(groups,newNb,fidsOfGroups);
         PyObject *ret = PyList_New(2);
         PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
-        mcIdType sz=fidsOfGroups.size();
+        std::size_t sz=fidsOfGroups.size();
         PyObject *ret1 = PyList_New(sz);
-        for(mcIdType i=0;i<sz;i++)
+        for(std::size_t i=0;i<sz;i++)
           PyList_SetItem(ret1,i,convertIntArrToPyList2(fidsOfGroups[i]));
         PyList_SetItem(ret,1,ret1);
         return ret;
 
       PyObject *getTuple(mcIdType tupleId)
       {
-        mcIdType sz=self->getNumberOfComponents();
+        mcIdType sz=ToIdType(self->getNumberOfComponents());
         INTERP_KERNEL::AutoPtr<INT> tmp=new INT[sz];
         self->getTuple(tupleId,tmp);
         return convertIntArrToPyList((const INT*)tmp,sz);
 
       mcIdType index(PyObject *obj) const
       {
-        mcIdType nbOfCompo=self->getNumberOfComponents();
+        std::size_t nbOfCompo=self->getNumberOfComponents();
         switch(nbOfCompo)
           {
           case 1:
 
       bool __contains__(PyObject *obj) const
       {
-        mcIdType nbOfCompo=self->getNumberOfComponents();
+        std::size_t nbOfCompo=self->getNumberOfComponents();
         switch(nbOfCompo)
           {
           case 0:
         const char msg2[]="ARRAY::__getitem__ : Mismatch of slice values in 2nd parameter (components) !";
         self->checkAllocated();
         mcIdType nbOfTuples=self->getNumberOfTuples();
-        mcIdType nbOfComponents=self->getNumberOfComponents();
+        std::size_t nbOfComponents=self->getNumberOfComponents();
         mcIdType it1;
         std::size_t ic1;
         std::vector<mcIdType> vt1;
         std::pair<mcIdType, std::pair<mcIdType,mcIdType> > pt1,pc1;
         DataArrayIdType *dt1=0,*dc1=0;
         mcIdType sw;
-        convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
+        convertObjToPossibleCpp3(obj,nbOfTuples,(int)nbOfComponents,sw,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
         MCAuto<ARRAY> ret;
         switch(sw)
           {
         self->checkAllocated();
         const char msg[]="Unexpected situation in __setitem__ !";
         mcIdType nbOfTuples=self->getNumberOfTuples();
-        mcIdType nbOfComponents=self->getNumberOfComponents();
+        int nbOfComponents=(int)self->getNumberOfComponents();
         mcIdType sw1,sw2;
         INT i1;
         std::vector<INT> v1;
       {
         const char msg2[]="ARRAY ## Tuple::__getitem__ : Mismatch of slice values in 2nd parameter (components) !";
         mcIdType sw;
-        mcIdType singleVal;
-        std::vector<mcIdType> multiVal;
+        INT singleVal;
+        std::vector<INT> multiVal;
         std::pair<mcIdType, std::pair<mcIdType,mcIdType> > slic;
         MEDCoupling::DataArrayIdType *daIntTyypp=0;
         const INT *pt=self->getConstPointer();
-        INT nbc=self->getNumberOfCompo();
-        convertIntStarOrSliceLikePyObjToCppWithNegIntInterp(obj,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
+        INT nbc=(INT)self->getNumberOfCompo();
+        convertIntStarOrSliceLikePyObjToCppWithNegIntInterp(obj,ToIdType(nbc),sw,singleVal,multiVal,slic,daIntTyypp);
         switch(sw)
           {
           case 1:
             {
-              if(singleVal>=nbc)
+              if(singleVal>=(INT)nbc)
                 {
                   std::ostringstream oss;
                   oss << "Requesting for id " << singleVal << " having only " << nbc << " components !";
           case 2:
             {
               PyObject *t=PyTuple_New(multiVal.size());
-              for(INT j=0;j<(INT)multiVal.size();j++)
+              for(std::size_t j=0;j<multiVal.size();j++)
                 {
                   INT cid=multiVal[j];
-                  if(cid>=nbc)
+                  if(cid>=(INT)nbc)
                     {
                       std::ostringstream oss;
                       oss << "Requesting for id #" << cid << " having only " << nbc << " components !";
             }
           case 3:
             {
-              INT sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,msg2);
+              mcIdType sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,msg2);
               PyObject *t=PyTuple_New(sz);
               for(INT j=0;j<sz;j++)
                 PyTuple_SetItem(t,j,PyInt_FromLong(pt[slic.first+j*slic.second.second]));
         std::vector<mcIdType> multiValV;
         std::pair<mcIdType, std::pair<mcIdType,mcIdType> > slicV;
         MEDCoupling::ARRAY ## Tuple *daIntTyyppV=0;
-        INT nbc=self->getNumberOfCompo();
+        mcIdType nbc=ToIdType(self->getNumberOfCompo());
         convertObjToPossibleCpp22<INT>(value,nbc,sw1,singleValV,multiValV,slicV,daIntTyyppV);
         INT singleVal;
         std::vector<INT> multiVal;
                 {
                 case 1:
                   {
-                    pt[singleVal]=singleValV;
+                    pt[singleVal]=(INT)singleValV;
                     return self;
                   }
                 case 2:
                         oss << "Requesting for setting id # " << singleVal << " with a list or tuple with size != 1 ! ";
                         throw INTERP_KERNEL::Exception(oss.str().c_str());
                       }
-                    pt[singleVal]=multiValV[0];
+                    pt[singleVal]=(INT)multiValV[0];
                     return self;
                   }
                 case 4:
                             oss << "Requesting for setting id # " << *it << " having only " << nbc << " components !";
                             throw INTERP_KERNEL::Exception(oss.str().c_str());
                           }
-                        pt[*it]=singleValV;
+                        pt[*it]=(INT)singleValV;
                       }
                     return self;
                   }
                             oss << "Requesting for setting id # " << pos << " having only " << nbc << " components !";
                             throw INTERP_KERNEL::Exception(oss.str().c_str());
                           }
-                        pt[multiVal[i]]=multiValV[i];
+                        pt[multiVal[i]]=(INT)multiValV[i];
                       }
                     return self;
                   }
             }
           case 3:
             {
-              INT sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,msg2);
+              std::size_t sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,msg2);
               switch(sw1)
                 {
                 case 1:
                   {
-                    for(INT j=0;j<sz;j++)
-                      pt[slic.first+j*slic.second.second]=singleValV;
+                    for(std::size_t j=0;j<sz;j++)
+                      pt[slic.first+j*slic.second.second]=(INT)singleValV;
                     return self;
                   }
                 case 2:
                   {
-                    if(sz!=(INT)multiValV.size())
+                    if(sz!=multiValV.size())
                       {
                         std::ostringstream oss;
                         oss << "Mismatch length of during assignment : " << multiValV.size() << " != " << sz << " !";
                         throw INTERP_KERNEL::Exception(oss.str().c_str());
                       }
-                    for(INT j=0;j<sz;j++)
-                      pt[slic.first+j*slic.second.second]=multiValV[j];
+                    for(std::size_t j=0;j<sz;j++)
+                      pt[slic.first+j*slic.second.second]=(INT)multiValV[j];
                     return self;
                   }
                 case 4:
                   {
                     const INT *ptV=daIntTyyppV->getConstPointer();
-                    if(sz>(INT)daIntTyyppV->getNumberOfCompo())
+                    if(sz>daIntTyyppV->getNumberOfCompo())
                       {
                         std::ostringstream oss;
                         oss << "Mismatch length of during assignment : " << nbc << " != " << daIntTyyppV->getNumberOfCompo() << " !";
                         throw INTERP_KERNEL::Exception(oss.str().c_str());
                       }
-                    for(INT j=0;j<sz;j++)
+                    for(std::size_t j=0;j<sz;j++)
                       pt[slic.first+j*slic.second.second]=ptV[j];
                     return self;
                   }
index 332270c83f45893d58e3c6993153c412261ba252..188dcf5f958c4e661661ae33548c09356ac32a0b 100644 (file)
@@ -2404,8 +2404,8 @@ class MEDCouplingBasicsTest2(unittest.TestCase):
             pass
         # test of static method DataArrayInt::meld
         dai1=da1C.convertToIntArr();
-        dai4=DataArrayInt.Meld(dai1,dai3);
-        tmp=DataArrayInt.Meld([dai1,dai3]);
+        dai4=DataArrayInt32.Meld(dai1,dai3);
+        tmp=DataArrayInt32.Meld([dai1,dai3]);
         self.assertTrue(dai4.isEqual(tmp))
         self.assertEqual(5,dai4.getNumberOfComponents());
         self.assertEqual(7,dai4.getNumberOfTuples());
index 94ec01b7330aaee17f41549ed1769d0db4ce0a26..0ad6b84217fa8544362185857bd47fde1484d769 100644 (file)
@@ -1499,7 +1499,7 @@ class MEDCouplingBasicsTest3(unittest.TestCase):
         self.assertTrue(d.isEqual(d1,1e-12));
         #
         d2=d.convertToIntArr();
-        d4=DataArrayInt.New();
+        d4=DataArrayInt32.New();
         self.assertTrue(not d2.isEqual(d4));
         d4.deepCopyFrom(d2);
         self.assertTrue(d2.isEqual(d4));
index 3bca65eeba86a804964cc5f63323d4232a3679e4..cea4720db7abdd3762e08a1f1a56bcd4e442e639 100644 (file)
@@ -2809,7 +2809,7 @@ class MEDCouplingBasicsTest4(unittest.TestCase):
 
     @unittest.skipUnless(checkFreeMemory((223456789*16)/(1024)), "Not enough memory")
     def testSwig2BigMem(self):
-        if MEDCouplingSizeOfVoidStar()==64:
+        if MEDCouplingSizeOfVoidStar()==64 and MEDCouplingSizeOfIDs()==32:
             d=DataArrayAsciiChar(223456789,16)
             self.assertTrue(d.getNumberOfTuples(),223456789)
             self.assertTrue(d.getNumberOfComponents(),16)
index f8cb7ca8ffbfb3057ab4ea399687b99a6c2f1a6c..b1dc1d3bd514540fd329b5c3f778990fb39ef1ca 100644 (file)
@@ -606,7 +606,7 @@ class MEDCouplingBasicsTest5(unittest.TestCase):
         m=MEDCoupling1SGTUMesh("m",NORM_QUAD4)
         mem_m=m.getHeapMemorySize()
         m.allocateCells(5)
-        self.assertIn(m.getHeapMemorySize() - mem_m, list(range(5 * 4 * 4, 5 * 4 * 4 + 32)))
+        self.assertIn(m.getHeapMemorySize() - mem_m, list(range(5 * 4 * MEDCouplingSizeOfIDs()//8, 5 * 4 * MEDCouplingSizeOfIDs()//8 + 32)))
         self.assertEqual(m.getNodalConnectivity().getNbOfElemAllocated(),20)
         m.setCoords(um.getCoords())
         m.insertNextCell([1,0,6,7])
@@ -1019,7 +1019,7 @@ class MEDCouplingBasicsTest5(unittest.TestCase):
         self.assertEqual(d.getInfoOnComponents(),["aa","bbb"])
         ref=d.getHeapMemorySize()
         d.desallocate()
-        self.assertEqual(ref-d.getHeapMemorySize(),6*4)
+        self.assertEqual(ref-d.getHeapMemorySize(),6*MEDCouplingSizeOfIDs()//8)
         self.assertTrue(not d.isAllocated())
         self.assertEqual(d.getInfoOnComponents(),["aa","bbb"])
         self.assertRaises(InterpKernelException,d.checkAllocated)
@@ -3885,9 +3885,9 @@ class MEDCouplingBasicsTest5(unittest.TestCase):
         m.setCoords(arrX,arrX)
         f=MEDCouplingFieldInt(ON_CELLS)
         f.setMesh(m)
-        arr=DataArrayInt(8) ; arr.iota() ;f.setArray(arr)
+        arr=DataArrayInt32(8) ; arr.iota() ;f.setArray(arr)
         self.assertRaises(InterpKernelException,f.checkConsistencyLight)
-        arr=DataArrayInt(9) ; arr.iota() ;f.setArray(arr)
+        arr=DataArrayInt32(9) ; arr.iota() ;f.setArray(arr)
         f.checkConsistencyLight()
         f.setTimeUnit("ms")
         self.assertEqual(f.getTimeUnit(),"ms")
@@ -3935,13 +3935,13 @@ class MEDCouplingBasicsTest5(unittest.TestCase):
         m1=MEDCouplingCMesh() ; m1.setCoords(DataArrayDouble([0,1,2,3]),DataArrayDouble([0,1,2,3,4]))
         m1=m1.buildUnstructured() ; m1.setName("mesh")
         f1=MEDCouplingFieldInt(ON_CELLS) ; f1.setMesh(m1)
-        arr1=DataArrayInt([(0,1),(2,3),(4,5),(6,7),(8,9),(10,11),(12,13),(14,15),(16,17),(18,19),(20,21),(22,23)]) ; arr1.setInfoOnComponents(["aa","bbb"])
+        arr1=DataArrayInt32([(0,1),(2,3),(4,5),(6,7),(8,9),(10,11),(12,13),(14,15),(16,17),(18,19),(20,21),(22,23)]) ; arr1.setInfoOnComponents(["aa","bbb"])
         f1.setArray(arr1) ; f1.setName("f1") ; f1.setTime(2.,3,4)
         #
         m2=MEDCouplingCMesh() ; m2.setCoords(DataArrayDouble([0,1,2,3]),DataArrayDouble([0,1,2,3,4]))
         m2=m2.buildUnstructured() ; m2.setName("mesh")
         f2=MEDCouplingFieldInt(ON_CELLS) ; f2.setMesh(m2)
-        arr2=DataArrayInt([(0,1),(2,3),(4,5),(6,7),(8,9),(10,11),(12,13),(14,15),(16,17),(18,19),(20,21),(22,23)]) ; arr2.setInfoOnComponents(["aa","bbb"])
+        arr2=DataArrayInt32([(0,1),(2,3),(4,5),(6,7),(8,9),(10,11),(12,13),(14,15),(16,17),(18,19),(20,21),(22,23)]) ; arr2.setInfoOnComponents(["aa","bbb"])
         f2.setArray(arr2) ; f2.setName("f1") ; f2.setTime(2.,3,4)
         #
         self.assertTrue(f1.isEqual(f2,1e-12,0))
@@ -3967,7 +3967,7 @@ class MEDCouplingBasicsTest5(unittest.TestCase):
         #
         for fd,expected in ((ON_NODES,False),(ON_CELLS,True)):
             f4=MEDCouplingFieldInt(fd) ; f4.setMesh(m2) ; f4.setTime(2.,3,4)
-            arr4=DataArrayInt([(0,1),(2,3),(4,5),(6,7),(8,9),(10,11),(12,13),(14,15),(16,17),(18,19),(20,21),(22,23)]) ; arr4.setInfoOnComponents(["aa","bbb"])
+            arr4=DataArrayInt32([(0,1),(2,3),(4,5),(6,7),(8,9),(10,11),(12,13),(14,15),(16,17),(18,19),(20,21),(22,23)]) ; arr4.setInfoOnComponents(["aa","bbb"])
             f4.setArray(arr4) ; f4.setName("f1")
             self.assertEqual(f1.isEqual(f4,1e-12,0),expected)
             pass
@@ -4687,14 +4687,14 @@ class MEDCouplingBasicsTest5(unittest.TestCase):
         """Test focused of new wrapped methods for MEDCouplingFieldInt thanks to code factorization."""
         d=DataArrayDouble(7) ; d.iota()
         m=MEDCouplingUMesh.Build1DMeshFromCoords(d)
-        f=MEDCouplingFieldInt(ON_CELLS) ; f.setMesh(m) ; arr=DataArrayInt(6) ; arr.iota() ; f.setArray(arr) ; f.checkConsistencyLight()
+        f=MEDCouplingFieldInt(ON_CELLS) ; f.setMesh(m) ; arr=DataArrayInt32(6) ; arr.iota() ; f.setArray(arr) ; f.checkConsistencyLight()
         f_0=f[::2] # test is here
-        self.assertTrue(f_0.getArray().isEqual(DataArrayInt([0,2,4])))
+        self.assertTrue(f_0.getArray().isEqual(DataArrayInt32([0,2,4])))
         self.assertTrue(f_0.getMesh().isEqual(m[[0,2,4]],1e-12))
         #
-        f2=MEDCouplingFieldInt(ON_NODES) ; f2.setMesh(m) ; arr=DataArrayInt(7) ; arr.iota() ; f2.setArray(arr) ; f2.checkConsistencyLight()
+        f2=MEDCouplingFieldInt(ON_NODES) ; f2.setMesh(m) ; arr=DataArrayInt32(7) ; arr.iota() ; f2.setArray(arr) ; f2.checkConsistencyLight()
         f_1=f2[::2] # test is here
-        self.assertTrue(f_1.getArray().isEqual(DataArrayInt([0,1,2,3,4,5])))
+        self.assertTrue(f_1.getArray().isEqual(DataArrayInt32([0,1,2,3,4,5])))
         m_1=m[[0,2,4]] ; m_1.zipCoords()
         self.assertTrue(f_1.getMesh().isEqual(m_1,1e-12))
         pass
index ca1dd0943343f0de343b0e0dfda6ab3f1a5687a4..a79ce8306208a0c04ffe58d7adee8db14cbd86d2 100644 (file)
@@ -61,8 +61,6 @@ using namespace INTERP_KERNEL;
 
 %}
 
-%template(ivec) std::vector<int>;
-%template(lvec) std::vector<long>;
 %template(dvec) std::vector<double>;
 %template(svec) std::vector<std::string>;
 
@@ -72,10 +70,14 @@ using namespace INTERP_KERNEL;
 //typedef std::int32_t mcIdType;
 typedef int mcIdType;
 typedef DataArrayInt32 DataArrayIdType;
+%template(ivec) std::vector<int>;
+%template(i64vec) std::vector<long>;
 #else
 //typedef std::int64_t mcIdType;
 typedef long int mcIdType;
 typedef DataArrayInt64 DataArrayIdType;
+%template(ivec) std::vector<long>;
+%template(i32vec) std::vector<int>;
 #endif
 
 
@@ -541,7 +543,7 @@ typedef DataArrayInt64 DataArrayIdType;
     Py_ssize_t sz(sizeof(MEDCouplingUMesh::MEDCOUPLING2VTKTYPETRADUCER)/sizeof(decltype(MEDCouplingUMesh::MEDCOUPLING2VTKTYPETRADUCER[0])));
     auto maxElt(*std::max_element(MEDCouplingUMesh::MEDCOUPLING2VTKTYPETRADUCER,MEDCouplingUMesh::MEDCOUPLING2VTKTYPETRADUCER+sz));
     auto szOut(maxElt+1);
-    std::vector< int > retCpp(szOut,-1);
+    std::vector< mcIdType > retCpp(szOut,-1);
     mcIdType id(0);
     for(const mcIdType *it=MEDCouplingUMesh::MEDCOUPLING2VTKTYPETRADUCER;it!=MEDCouplingUMesh::MEDCOUPLING2VTKTYPETRADUCER+sz;it++,id++)
       {
@@ -739,7 +741,7 @@ namespace MEDCoupling
            return ret2;
          }
          
-         int getCellContainingPoint(PyObject *p, double eps) const
+         mcIdType getCellContainingPoint(PyObject *p, double eps) const
          {
            double val;
            DataArrayDouble *a;
@@ -998,9 +1000,9 @@ namespace MEDCoupling
           for(std::size_t j=0;j<vals.size()/3;j++)
              {
                PyObject *ret1=PyList_New(3);
-               PyList_SetItem(ret1,0,SWIG_From_int(vals[3*j]));
-               PyList_SetItem(ret1,1,SWIG_From_int(vals[3*j+1]));
-               PyList_SetItem(ret1,2,SWIG_From_int(vals[3*j+2]));
+               PyList_SetItem(ret1,0,PyInt_FromLong(vals[3*j]));
+               PyList_SetItem(ret1,1,PyInt_FromLong(vals[3*j+1]));
+               PyList_SetItem(ret1,2,PyInt_FromLong(vals[3*j+2]));
                PyList_SetItem(ret,j,ret1);
              }
           return ret;
@@ -1029,9 +1031,9 @@ namespace MEDCoupling
           for(std::size_t j=0;j<code.size()/3;j++)
              {
                PyObject *ret00=PyList_New(3);
-               PyList_SetItem(ret00,0,SWIG_From_int(code[3*j]));
-               PyList_SetItem(ret00,1,SWIG_From_int(code[3*j+1]));
-               PyList_SetItem(ret00,2,SWIG_From_int(code[3*j+2]));
+               PyList_SetItem(ret00,0,PyInt_FromLong(code[3*j]));
+               PyList_SetItem(ret00,1,PyInt_FromLong(code[3*j+1]));
+               PyList_SetItem(ret00,2,PyInt_FromLong(code[3*j+2]));
                PyList_SetItem(ret0,j,ret00);
              }
           PyTuple_SetItem(ret,0,ret0);
@@ -1107,10 +1109,10 @@ namespace MEDCoupling
            PyObject *ret(PyTuple_New(3));
            PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
            PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
-           mcIdType sz(a2.size());
+           std::size_t sz(a2.size());
            PyObject *ret2(PyList_New(sz));
            {
-             for(mcIdType i=0;i<sz;i++)
+             for(std::size_t i=0;i<sz;i++)
                PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
            }
            PyTuple_SetItem(ret,2,ret2);
@@ -1149,7 +1151,7 @@ namespace MEDCoupling
            static const char MSG[]="MEDCouplingMesh.__setstate__ : expected input is a tuple of size 2 !";
            if(!PyTuple_Check(inp))
              throw INTERP_KERNEL::Exception(MSG);
-           mcIdType sz(PyTuple_Size(inp));
+           std::size_t sz(PyTuple_Size(inp));
            if(sz!=2)
              throw INTERP_KERNEL::Exception(MSG);
            PyObject *elt0(PyTuple_GetItem(inp,0));
@@ -1443,7 +1445,7 @@ namespace MEDCoupling
              DataArrayIdType *ret0=self->buildNewNumberingFromCommonNodesFormat(comm,commIndex,newNbOfNodes);
              PyObject *res = PyList_New(2);
              PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
-             PyList_SetItem(res,1,SWIG_From_int(newNbOfNodes));
+             PyList_SetItem(res,1,PyInt_FromLong(newNbOfNodes));
              return res;
            }
            
@@ -1751,7 +1753,7 @@ namespace MEDCoupling
              PyObject *res = PyList_New(3);
              PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
              PyList_SetItem(res,1,SWIG_From_bool(ret1));
-             PyList_SetItem(res,2,SWIG_From_int(ret2));
+             PyList_SetItem(res,2,PyInt_FromLong(ret2));
              return res;
            }
            
@@ -1763,7 +1765,7 @@ namespace MEDCoupling
              PyObject *res = PyList_New(3);
              PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
              PyList_SetItem(res,1,SWIG_From_bool(ret1));
-             PyList_SetItem(res,2,SWIG_From_int(ret2));
+             PyList_SetItem(res,2,PyInt_FromLong(ret2));
              return res;
            }
            
@@ -2506,14 +2508,14 @@ namespace MEDCoupling
 
       static PyObject *FuseUMeshesOnSameCoords(PyObject *ms, int compType)
       {
-        mcIdType sz;
+        std::size_t sz;
         std::vector<const MEDCouplingUMesh *> meshes;
         convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingUMesh *>(ms,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh,"MEDCouplingUMesh",meshes);
         std::vector<DataArrayIdType *> corr;
         MEDCouplingUMesh *um=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,compType,corr);
         sz=corr.size();
         PyObject *ret1=PyList_New(sz);
-        for(int i=0;i<sz;i++)
+        for(std::size_t i=0;i<sz;i++)
           PyList_SetItem(ret1,i,SWIG_NewPointerObj(SWIG_as_voidptr(corr[i]),SWIGTITraits<mcIdType>::TI, SWIG_POINTER_OWN | 0 ));
         PyObject *ret=PyList_New(2);
         PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(um),SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh, SWIG_POINTER_OWN | 0 ));
@@ -3586,7 +3588,7 @@ namespace MEDCoupling
       {
         return MEDCouplingIMesh::New();
       }
-      static MEDCouplingIMesh *New(const std::string& meshName, mcIdType spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz)
+      static MEDCouplingIMesh *New(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz)
       {
         static const char msg0[]="MEDCouplingIMesh::New : error on 'origin' parameter !";
         static const char msg1[]="MEDCouplingIMesh::New : error on 'dxyz' parameter !";
@@ -3605,7 +3607,7 @@ namespace MEDCoupling
         return MEDCouplingIMesh::New(meshName,spaceDim,nodeStrctPtr,nodeStrctPtr+sz,originPtr,originPtr+sz1,dxyzPtr,dxyzPtr+sz2);
       }
 
-      MEDCouplingIMesh(const std::string& meshName, mcIdType spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz)
+      MEDCouplingIMesh(const std::string& meshName, int spaceDim, PyObject *nodeStrct, PyObject *origin, PyObject *dxyz)
       {
         return MEDCoupling_MEDCouplingIMesh_New__SWIG_1(meshName,spaceDim,nodeStrct,origin,dxyz);
       }
@@ -3713,10 +3715,10 @@ namespace MEDCoupling
     void setGaussLocalizationOnType(INTERP_KERNEL::NormalizedCellType type, const std::vector<double>& refCoo,
                                     const std::vector<double>& gsCoo, const std::vector<double>& wg);
     void clearGaussLocalizations();
-    MEDCouplingGaussLocalization& getGaussLocalization(mcIdType locId);
+    MEDCouplingGaussLocalization& getGaussLocalization(int locId);
     mcIdType getNbOfGaussLocalization() const;
     mcIdType getGaussLocalizationIdOfOneCell(mcIdType cellId) const;
-    const MEDCouplingGaussLocalization& getGaussLocalization(mcIdType locId) const;
+    const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const;
     mcIdType getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const;
     void setDiscretization(MEDCouplingFieldDiscretization *newDisc);
     %extend {
@@ -3814,7 +3816,7 @@ namespace MEDCoupling
           }
       }
 
-      PyObject *getCellIdsHavingGaussLocalization(mcIdType locId) const
+      PyObject *getCellIdsHavingGaussLocalization(int locId) const
       {
         std::vector<mcIdType> tmp;
         self->getCellIdsHavingGaussLocalization(locId,tmp);
@@ -4086,9 +4088,9 @@ namespace MEDCoupling
         for(std::vector<DataArrayDouble *>::iterator it=arrs.begin();it!=arrs.end();it++)
           if(*it)
             (*it)->incrRef();
-        int sz=arrs.size();
+        std::size_t sz=arrs.size();
         PyObject *ret=PyTuple_New(sz);
-        for(int i=0;i<sz;i++)
+        for(std::size_t i=0;i<sz;i++)
           {
             if(arrs[i])
               PyTuple_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(arrs[i]),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
@@ -4131,7 +4133,7 @@ namespace MEDCoupling
         const char msg[]="Python wrap of MEDCouplingFieldDouble::getValueOn : ";
         const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
         //
-        int sz=self->getNumberOfComponents();
+        mcIdType sz=ToIdType(self->getNumberOfComponents());
         INTERP_KERNEL::AutoPtr<double> res=new double[sz];
         self->getValueOn(spaceLoc,res);
         return convertDblArrToPyList<double>(res,sz);
@@ -4139,7 +4141,7 @@ namespace MEDCoupling
 
        PyObject *getValueOnPos(mcIdType i, mcIdType j, mcIdType k) const
        {
-         int sz=self->getNumberOfComponents();
+         mcIdType sz=ToIdType(self->getNumberOfComponents());
          INTERP_KERNEL::AutoPtr<double> res=new double[sz];
          self->getValueOnPos(i,j,k,res);
          return convertDblArrToPyList<double>(res,sz);
@@ -4155,7 +4157,7 @@ namespace MEDCoupling
         double v0; MEDCoupling::DataArrayDouble *v1(0); MEDCoupling::DataArrayDoubleTuple *v2(0); std::vector<double> v3;
         const double *inp=convertObjToPossibleCpp5_Safe2(locs,sw,v0,v1,v2,v3,"wrap of MEDCouplingFieldDouble::getValueOnMulti",
                                                          mesh->getSpaceDimension(),true,nbPts);
-        return self->getValueOnMulti(inp,nbPts);
+        return self->getValueOnMulti(inp,(int)nbPts);
       }
 
       PyObject *getValueOn(PyObject *sl, double time) const
@@ -4173,7 +4175,7 @@ namespace MEDCoupling
         const double *spaceLoc=convertObjToPossibleCpp5_Safe(sl,sw,val,a,aa,bb,msg,1,spaceDim,true);
         //
         //
-        int sz=self->getNumberOfComponents();
+        mcIdType sz=ToIdType(self->getNumberOfComponents());
         INTERP_KERNEL::AutoPtr<double> res=new double[sz];
         self->getValueOn(spaceLoc,time,res);
         return convertDblArrToPyList<double>(res,sz);
@@ -4225,42 +4227,42 @@ namespace MEDCoupling
       }
       PyObject *accumulate() const
       {
-        int sz=self->getNumberOfComponents();
+        mcIdType sz=ToIdType(self->getNumberOfComponents());
         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
         self->accumulate(tmp);
         return convertDblArrToPyList<double>(tmp,sz);
       }
       PyObject *integral(bool isWAbs) const
       {
-        int sz=self->getNumberOfComponents();
+        mcIdType sz=ToIdType(self->getNumberOfComponents());
         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
         self->integral(isWAbs,tmp);
         return convertDblArrToPyList<double>(tmp,sz);
       }
       PyObject *getWeightedAverageValue(bool isWAbs=true) const
       {
-        int sz=self->getNumberOfComponents();
+        mcIdType sz=ToIdType(self->getNumberOfComponents());
         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
         self->getWeightedAverageValue(tmp,isWAbs);
         return convertDblArrToPyList<double>(tmp,sz);
       }
       PyObject *normL1() const
       {
-        int sz=self->getNumberOfComponents();
+        mcIdType sz=ToIdType(self->getNumberOfComponents());
         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
         self->normL1(tmp);
         return convertDblArrToPyList<double>(tmp,sz);
       }
       PyObject *normL2() const
       {
-        int sz=self->getNumberOfComponents();
+        mcIdType sz=ToIdType(self->getNumberOfComponents());
         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
         self->normL2(tmp);
         return convertDblArrToPyList<double>(tmp,sz);
       }
       PyObject *normMax() const
       {
-        int sz=self->getNumberOfComponents();
+        mcIdType sz=ToIdType(self->getNumberOfComponents());
         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
         self->normMax(tmp);
         return convertDblArrToPyList<double>(tmp,sz);
@@ -4348,7 +4350,7 @@ namespace MEDCoupling
         DataArrayDoubleTuple *aa,*aa2;
         std::vector<double> bb,bb2;
         mcIdType sw;
-        mcIdType spaceDim=3;
+        int spaceDim=3;
         const char msg[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 1st parameter for origin.";
         const char msg2[]="Python wrap of MEDCouplingFieldDouble::extractSlice3D : 2nd parameter for vector.";
         const double *orig=convertObjToPossibleCpp5_Safe(origin,sw,val,a,aa,bb,msg,1,spaceDim,true);
@@ -4983,9 +4985,9 @@ namespace MEDCoupling
          {
            std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
            convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
-           int sz=tmp.size();
+           std::size_t sz=tmp.size();
            std::vector<MEDCouplingFieldDouble *> fs(sz);
-           for(int i=0;i<sz;i++)
+           for(std::size_t i=0;i<sz;i++)
              fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
            return MEDCouplingMultiFields::New(fs);
          }
@@ -4993,18 +4995,18 @@ namespace MEDCoupling
          {
            std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
            convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
-           int sz=tmp.size();
+           std::size_t sz=tmp.size();
            std::vector<MEDCouplingFieldDouble *> fs(sz);
-           for(int i=0;i<sz;i++)
+           for(std::size_t i=0;i<sz;i++)
              fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
            return MEDCouplingMultiFields::New(fs);
          }
          PyObject *getFields() const
          {
            std::vector<const MEDCouplingFieldDouble *> fields=self->getFields();
-           int sz=fields.size();
+           std::size_t sz=fields.size();
            PyObject *res = PyList_New(sz);
-           for(int i=0;i<sz;i++)
+           for(std::size_t i=0;i<sz;i++)
              {
                if(fields[i])
                  {
@@ -5032,9 +5034,9 @@ namespace MEDCoupling
          PyObject *getMeshes() const
          {
            std::vector<MEDCouplingMesh *> ms=self->getMeshes();
-           int sz=ms.size();
+           std::size_t sz=ms.size();
            PyObject *res = PyList_New(sz);
-           for(int i=0;i<sz;i++)
+           for(std::size_t i=0;i<sz;i++)
              {
                if(ms[i])
                  {
@@ -5052,9 +5054,9 @@ namespace MEDCoupling
          {
            std::vector<int> refs;
            std::vector<MEDCouplingMesh *> ms=self->getDifferentMeshes(refs);
-           int sz=ms.size();
+           std::size_t sz=ms.size();
            PyObject *res = PyList_New(sz);
-           for(int i=0;i<sz;i++)
+           for(std::size_t i=0;i<sz;i++)
              {
                if(ms[i])
                  {
@@ -5075,9 +5077,9 @@ namespace MEDCoupling
          PyObject *getArrays() const
          {
            std::vector<DataArrayDouble *> ms=self->getArrays();
-           int sz=ms.size();
+           std::size_t sz=ms.size();
            PyObject *res = PyList_New(sz);
-           for(int i=0;i<sz;i++)
+           for(std::size_t i=0;i<sz;i++)
              {
                if(ms[i])
                  {
@@ -5095,10 +5097,10 @@ namespace MEDCoupling
          {
            std::vector< std::vector<int> > refs;
            std::vector<DataArrayDouble *> ms=self->getDifferentArrays(refs);
-           int sz=ms.size();
+           std::size_t sz=ms.size();
            PyObject *res = PyList_New(sz);
            PyObject *res2 = PyList_New(sz);
-           for(int i=0;i<sz;i++)
+           for(std::size_t i=0;i<sz;i++)
              {
                if(ms[i])
                  {
@@ -5379,9 +5381,9 @@ namespace MEDCoupling
           {
             std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
             convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
-            int sz=tmp.size();
+            std::size_t sz=tmp.size();
             std::vector<MEDCouplingFieldDouble *> fs(sz);
-            for(int i=0;i<sz;i++)
+            for(std::size_t i=0;i<sz;i++)
               fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
             return MEDCouplingFieldOverTime::New(fs);
           }
@@ -5390,15 +5392,15 @@ namespace MEDCoupling
             return self->simpleRepr();
           }
         static MEDCouplingFieldOverTime *New(PyObject *li)
-        {
-          std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
-          convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
-           int sz=tmp.size();
-           std::vector<MEDCouplingFieldDouble *> fs(sz);
-           for(int i=0;i<sz;i++)
-             fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
-           return MEDCouplingFieldOverTime::New(fs);
-         }
+          {
+            std::vector<const MEDCoupling::MEDCouplingFieldDouble *> tmp;
+            convertFromPyObjVectorOfObj<const MEDCoupling::MEDCouplingFieldDouble *>(li,SWIGTYPE_p_MEDCoupling__MEDCouplingFieldDouble,"MEDCouplingFieldDouble",tmp);
+            std::size_t sz=tmp.size();
+            std::vector<MEDCouplingFieldDouble *> fs(sz);
+            for(std::size_t i=0;i<sz;i++)
+              fs[i]=const_cast<MEDCouplingFieldDouble *>(tmp[i]);
+            return MEDCouplingFieldOverTime::New(fs);
+          }
       }
   };
 
@@ -5538,9 +5540,9 @@ namespace MEDCoupling
       PyObject *getPatches() const
       {
         std::vector< const MEDCouplingCartesianAMRPatch *> ps(self->getPatches());
-        mcIdType sz(ps.size());
+        std::size_t sz(ps.size());
         PyObject *ret = PyList_New(sz);
-        for(mcIdType i=0;i<sz;i++)
+        for(std::size_t i=0;i<sz;i++)
           {
             MEDCouplingCartesianAMRPatch *elt(const_cast<MEDCouplingCartesianAMRPatch *>(ps[i]));
             if(elt)
@@ -5587,9 +5589,9 @@ namespace MEDCoupling
       virtual PyObject *retrieveGridsAt(mcIdType absoluteLev) const
       {
         std::vector<MEDCouplingCartesianAMRPatchGen *> ps(self->retrieveGridsAt(absoluteLev));
-        mcIdType sz(ps.size());
+        std::size_t sz(ps.size());
         PyObject *ret = PyList_New(sz);
-        for(mcIdType i=0;i<sz;i++)
+        for(std::size_t i=0;i<sz;i++)
           PyList_SetItem(ret,i,convertCartesianAMRPatch(ps[i], SWIG_POINTER_OWN | 0 ));
         return ret;
       }
@@ -5962,13 +5964,13 @@ def MEDCouplingFieldTemplateReduce(self):
 #
 # Forwarding DataArrayInt functions to MEDCouplingUMesh:
 #
-MEDCouplingUMesh.ExtractFromIndexedArrays           = DataArrayInt32.ExtractFromIndexedArrays
-MEDCouplingUMesh.ExtractFromIndexedArraysSlice      = DataArrayInt32.ExtractFromIndexedArraysSlice
-MEDCouplingUMesh.SetPartOfIndexedArrays             = DataArrayInt32.SetPartOfIndexedArrays
-##MEDCouplingUMesh.SetPartOfIndexedArraysSlice        = DataArrayInt32.SetPartOfIndexedArraysSlice
-MEDCouplingUMesh.SetPartOfIndexedArraysSameIdx      = DataArrayInt32.SetPartOfIndexedArraysSameIdx
-MEDCouplingUMesh.RemoveIdsFromIndexedArrays         = DataArrayInt32.RemoveIdsFromIndexedArrays
-##MEDCouplingUMesh.SetPartOfIndexedArraysSameIdxSlice = DataArrayInt32.SetPartOfIndexedArraysSameIdxSlice
+MEDCouplingUMesh.ExtractFromIndexedArrays           = DataArrayInt.ExtractFromIndexedArrays
+MEDCouplingUMesh.ExtractFromIndexedArraysSlice      = DataArrayInt.ExtractFromIndexedArraysSlice
+MEDCouplingUMesh.SetPartOfIndexedArrays             = DataArrayInt.SetPartOfIndexedArrays
+##MEDCouplingUMesh.SetPartOfIndexedArraysSlice        = DataArrayInt.SetPartOfIndexedArraysSlice
+MEDCouplingUMesh.SetPartOfIndexedArraysSameIdx      = DataArrayInt.SetPartOfIndexedArraysSameIdx
+MEDCouplingUMesh.RemoveIdsFromIndexedArrays         = DataArrayInt.RemoveIdsFromIndexedArrays
+##MEDCouplingUMesh.SetPartOfIndexedArraysSameIdxSlice = DataArrayInt.SetPartOfIndexedArraysSameIdxSlice
 
 %}
 
index ee04ca39a261df1c143aa37a157f2a882e215288..3187b80eb8e52152247ac079cbf25c09012c1cf1 100644 (file)
@@ -71,7 +71,8 @@ struct PyCallBackDataArraySt {
 };
 
 typedef struct PyCallBackDataArraySt<MEDCoupling::DataArrayByte> PyCallBackDataArrayChar;
-typedef struct PyCallBackDataArraySt<MEDCoupling::DataArrayInt> PyCallBackDataArrayInt;
+typedef struct PyCallBackDataArraySt<MEDCoupling::DataArrayInt32> PyCallBackDataArrayInt32;
+typedef struct PyCallBackDataArraySt<MEDCoupling::DataArrayInt64> PyCallBackDataArrayInt64;
 typedef struct PyCallBackDataArraySt<MEDCoupling::DataArrayFloat> PyCallBackDataArrayFloat;
 typedef struct PyCallBackDataArraySt<MEDCoupling::DataArrayDouble> PyCallBackDataArrayDouble;
 
@@ -85,9 +86,15 @@ extern "C"
     return (PyObject *)self;
   }
 
-  static PyObject *callbackmcdataarrayint___new__(PyTypeObject *type, PyObject *args, PyObject *kwargs)
+  static PyObject *callbackmcdataarrayint32___new__(PyTypeObject *type, PyObject *args, PyObject *kwargs)
   {
-    PyCallBackDataArrayInt *self = (PyCallBackDataArrayInt *) ( type->tp_alloc(type, 0) );
+    PyCallBackDataArrayInt32 *self = (PyCallBackDataArrayInt32 *) ( type->tp_alloc(type, 0) );
+    return (PyObject *)self;
+  }
+  
+  static PyObject *callbackmcdataarrayint64___new__(PyTypeObject *type, PyObject *args, PyObject *kwargs)
+  {
+    PyCallBackDataArrayInt64 *self = (PyCallBackDataArrayInt64 *) ( type->tp_alloc(type, 0) );
     return (PyObject *)self;
   }
   
@@ -124,7 +131,7 @@ extern "C"
 
   // real callback called when a numpy arr having more than one DataArray instance client on it is destroyed.
   // In this case, all the "weak" clients, except the first one, invoke this call back that desable the content of these "weak" clients.
-  static PyObject *callbackmcdataarrayint_call(PyCallBackDataArrayInt *self, PyObject *args, PyObject *kw)
+  static PyObject *callbackmcdataarrayint32_call(PyCallBackDataArrayInt32 *self, PyObject *args, PyObject *kw)
   {
     if(self->_pt_mc)
       {
@@ -135,6 +142,19 @@ extern "C"
     return Py_None;
   }
 
+  // real callback called when a numpy arr having more than one DataArray instance client on it is destroyed.
+  // In this case, all the "weak" clients, except the first one, invoke this call back that desable the content of these "weak" clients.
+  static PyObject *callbackmcdataarrayint64_call(PyCallBackDataArrayInt64 *self, PyObject *args, PyObject *kw)
+  {
+    if(self->_pt_mc)
+      {
+        MEDCoupling::MemArray<long>& mma=self->_pt_mc->accessToMemArray();
+        mma.destroy();
+      }
+    Py_XINCREF(Py_None);
+    return Py_None;
+  }
+
   // real callback called when a numpy arr having more than one DataArray instance client on it is destroyed.
   // In this case, all the "weak" clients, except the first one, invoke this call back that desable the content of these "weak" clients.
   static PyObject *callbackmcdataarrayfloat_call(PyCallBackDataArrayFloat *self, PyObject *args, PyObject *kw)
@@ -205,10 +225,10 @@ PyTypeObject PyCallBackDataArrayChar_RefType = {
 };
 
 
-PyTypeObject PyCallBackDataArrayInt_RefType = {
+PyTypeObject PyCallBackDataArrayInt32_RefType = {
   PyVarObject_HEAD_INIT(&PyType_Type, 0)
-  "callbackmcdataarrayint",
-  sizeof(PyCallBackDataArrayInt),
+  "callbackmcdataarrayint32",
+  sizeof(PyCallBackDataArrayInt32),
   0,
   callbackmcdataarray_dealloc,            /*tp_dealloc*/
   0,                          /*tp_print*/
@@ -220,7 +240,7 @@ PyTypeObject PyCallBackDataArrayInt_RefType = {
   0,                          /*tp_as_sequence*/
   0,                          /*tp_as_mapping*/
   0,                          /*tp_hash*/
-  (ternaryfunc)callbackmcdataarrayint_call,  /*tp_call*/
+  (ternaryfunc)callbackmcdataarrayint32_call,  /*tp_call*/
   0,                          /*tp_str*/
   0,                          /*tp_getattro*/
   0,                          /*tp_setattro*/
@@ -243,7 +263,50 @@ PyTypeObject PyCallBackDataArrayInt_RefType = {
   0,                          /*tp_dictoffset*/
   callbackmcdataarray___init__,           /*tp_init*/
   PyType_GenericAlloc,        /*tp_alloc*/
-  callbackmcdataarrayint___new__,            /*tp_new*/
+  callbackmcdataarrayint32___new__,            /*tp_new*/
+  PyObject_GC_Del,            /*tp_free*/
+};
+
+
+PyTypeObject PyCallBackDataArrayInt64_RefType = {
+  PyVarObject_HEAD_INIT(&PyType_Type, 0)
+  "callbackmcdataarrayint64",
+  sizeof(PyCallBackDataArrayInt64),
+  0,
+  callbackmcdataarray_dealloc,            /*tp_dealloc*/
+  0,                          /*tp_print*/
+  0,                          /*tp_getattr*/
+  0,                          /*tp_setattr*/
+  0,                          /*tp_compare*/
+  0,                          /*tp_repr*/
+  0,                          /*tp_as_number*/
+  0,                          /*tp_as_sequence*/
+  0,                          /*tp_as_mapping*/
+  0,                          /*tp_hash*/
+  (ternaryfunc)callbackmcdataarrayint64_call,  /*tp_call*/
+  0,                          /*tp_str*/
+  0,                          /*tp_getattro*/
+  0,                          /*tp_setattro*/
+  0,                          /*tp_as_buffer*/
+  Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,  /*tp_flags*/
+  0,                          /*tp_doc*/
+  0,                          /*tp_traverse*/
+  0,                          /*tp_clear*/
+  0,                          /*tp_richcompare*/
+  0,                          /*tp_weaklistoffset*/
+  0,                          /*tp_iter*/
+  0,                          /*tp_iternext*/
+  0,                          /*tp_methods*/
+  0,                          /*tp_members*/
+  0,                          /*tp_getset*/
+  0,                          /*tp_base*/
+  0,                          /*tp_dict*/
+  0,                          /*tp_descr_get*/
+  0,                          /*tp_descr_set*/
+  0,                          /*tp_dictoffset*/
+  callbackmcdataarray___init__,           /*tp_init*/
+  PyType_GenericAlloc,        /*tp_alloc*/
+  callbackmcdataarrayint64___new__,            /*tp_new*/
   PyObject_GC_Del,            /*tp_free*/
 };
 
@@ -352,6 +415,22 @@ struct NPYTraits<float>
   static PyTypeObject *NPYFunc;
   static PyObject *Array_SWIGTYPE;
 };
+
+template<>
+struct NPYTraits<int>
+{
+  static const int NPYObjectType=NPY_INT32;
+  static PyTypeObject *NPYFunc;
+  static PyObject *Array_SWIGTYPE;
+};
+
+template<>
+struct NPYTraits<long>
+{
+  static const int NPYObjectType=NPY_INT64;
+  static PyTypeObject *NPYFunc;
+  static PyObject *Array_SWIGTYPE;
+};
 #endif
 
 #endif
index b23df939f42bbbd66cac47fdeb5f2ea29d3ac02a..cc99dc9bbd7c50f5a96e099b2df78ac9d4571cd6 100644 (file)
@@ -126,11 +126,11 @@ void GetIndicesOfSliceExplicitely(PyObject *slice, Py_ssize_t *start, Py_ssize_t
   throw INTERP_KERNEL::Exception(msgInCaseOfFailure);
 }
 
-int InterpreteNegativeInt(int val, int nbelem)
+int InterpreteNegativeInt(long val, mcIdType nbelem)
 {
   if(val<0)
     {
-      int newVal(nbelem+val);
+      int newVal((int)(nbelem+val));
       if(newVal<0)
         {
           std::ostringstream oss; oss << "interpreteNegativeInt : request for negative int=" << val << " but number of elems is equal to " << nbelem << " !";
@@ -139,7 +139,7 @@ int InterpreteNegativeInt(int val, int nbelem)
       return newVal;
     }
   else
-    return val;
+    return (int)val;
 }
 
 #ifdef WITH_NUMPY
@@ -167,6 +167,9 @@ MCData *BuildNewInstance(PyObject *elt0, int npyObjectType, PyTypeObject *pytype
   if(PyArray_DESCR(elt0)->type_num != npyObjectType)
     {
       std::ostringstream oss; oss << "Input numpy array has not the type " << msg << "!";
+#ifdef _DEBUG_
+      oss << " type_num == " << PyArray_DESCR(elt0)->type_num;
+#endif
       throw INTERP_KERNEL::Exception(oss.str().c_str());
     }
   npy_intp sz0=PyArray_DIM(elt0,0);
@@ -323,7 +326,7 @@ int NumpyArrSetBaseObjectExt(PyArrayObject *arr, PyObject *obj)
 }
 
 template<class MCData, class T>
-PyObject *ToNumPyArrayUnderground(MCData *self, int npyObjectType, const char *MCDataStr, int nbTuples, int nbComp)
+PyObject *ToNumPyArrayUnderground(MCData *self, int npyObjectType, const char *MCDataStr, mcIdType nbTuples, std::size_t nbComp)
 {
   if(!self->isAllocated())
     {
@@ -338,7 +341,7 @@ PyObject *ToNumPyArrayUnderground(MCData *self, int npyObjectType, const char *M
     }
   int nbDims=nbComp==1?1:2;
   npy_intp dim[2];
-  dim[0]=(npy_intp)nbTuples; dim[1]=nbComp;
+  dim[0]=(npy_intp)nbTuples; dim[1]=(npy_intp)nbComp;
   const T *bg=self->getConstPointer();
   PyObject *ret(PyArray_SimpleNewFromData(nbDims,dim,npyObjectType,const_cast<T *>(bg)));
   if(mem.isDeallocatorCalled())
@@ -489,9 +492,9 @@ static PyObject *convertIntArrToPyList(const T *ptr, mcIdType size)
 template<class T>
 static PyObject *convertIntArrToPyList2(const std::vector<T>& v)
 {
-  T size=v.size();
+  std::size_t size=v.size();
   PyObject *ret=PyList_New(size);
-  for(T i=0;i<size;i++)
+  for(std::size_t i=0;i<size;i++)
     PyList_SetItem(ret,i,PyInt_FromLong(v[i]));
   return ret;
 }
@@ -499,10 +502,10 @@ static PyObject *convertIntArrToPyList2(const std::vector<T>& v)
 template<class T>
 static PyObject *convertIntArrToPyList3(const std::set<T>& v)
 {
-  T size=v.size();
+  std::size_t size=v.size();
   PyObject *ret=PyList_New(size);
   typename std::set<T>::const_iterator it=v.begin();
-  for(T i=0;i<size;i++,it++)
+  for(std::size_t i=0;i<size;i++,it++)
     PyList_SetItem(ret,i,PyInt_FromLong(*it));
   return ret;
 }
@@ -564,7 +567,7 @@ static T *convertPyToNewIntArr2(PyObject *pyLi, mcIdType *size)
 {
   if(PyList_Check(pyLi))
     {
-      *size=PyList_Size(pyLi);
+      *size=ToIdType(PyList_Size(pyLi));
       T *tmp=new T[*size];
       for(mcIdType i=0;i<*size;i++)
         {
@@ -584,7 +587,7 @@ static T *convertPyToNewIntArr2(PyObject *pyLi, mcIdType *size)
     }
   else if(PyTuple_Check(pyLi))
     {
-      *size=PyTuple_Size(pyLi);
+      *size=ToIdType(PyTuple_Size(pyLi));
       T *tmp=new T[*size];
       for(mcIdType i=0;i<*size;i++)
         {
@@ -626,14 +629,14 @@ static void convertPyToVectorPairInt(PyObject *pyLi, std::vector< std::pair<mcId
   const char msg[]="list must contain tuples of 2 integers only or tuple must contain tuples of 2 integers only !";
   if(PyList_Check(pyLi))
     {
-      mcIdType size=PyList_Size(pyLi);
+      std::size_t size=PyList_Size(pyLi);
       arr.resize(size);
-      for(mcIdType i=0;i<size;i++)
+      for(std::size_t i=0;i<size;i++)
         {
           PyObject *o=PyList_GetItem(pyLi,i);
           if(PyTuple_Check(o))
             {
-              mcIdType sz2=PyTuple_Size(o);
+              std::size_t sz2=PyTuple_Size(o);
               if(sz2!=2)
                 throw INTERP_KERNEL::Exception(msg);
               PyObject *o_0=PyTuple_GetItem(o,0);
@@ -651,14 +654,14 @@ static void convertPyToVectorPairInt(PyObject *pyLi, std::vector< std::pair<mcId
     }
   else if(PyTuple_Check(pyLi))
     {
-      mcIdType size=PyTuple_Size(pyLi);
+      std::size_t size=PyTuple_Size(pyLi);
       arr.resize(size);
-      for(mcIdType i=0;i<size;i++)
+      for(std::size_t i=0;i<size;i++)
         {
           PyObject *o=PyTuple_GetItem(pyLi,i);
           if(PyTuple_Check(o))
             {
-              mcIdType sz2=PyTuple_Size(o);
+              std::size_t sz2=PyTuple_Size(o);
               if(sz2!=2)
                 throw INTERP_KERNEL::Exception(msg);
               PyObject *o_0=PyTuple_GetItem(o,0);
@@ -683,14 +686,14 @@ static void convertPyToVectorPairStringInt(PyObject *pyLi, std::vector< std::pai
   const char msg[]="convertPyToVectorPairStringInt : list must contain tuples of 2 integers only or tuple must contain tuples of 1 string and 1 integer only !";
   if(PyList_Check(pyLi))
     {
-      mcIdType size=PyList_Size(pyLi);
+      std::size_t size=PyList_Size(pyLi);
       arr.resize(size);
-      for(mcIdType i=0;i<size;i++)
+      for(std::size_t i=0;i<size;i++)
         {
           PyObject *o=PyList_GetItem(pyLi,i);
           if(PyTuple_Check(o))
             {
-              mcIdType sz2=PyTuple_Size(o);
+              std::size_t sz2=PyTuple_Size(o);
               if(sz2!=2)
                 throw INTERP_KERNEL::Exception(msg);
               PyObject *o_0=PyTuple_GetItem(o,0);
@@ -698,7 +701,7 @@ static void convertPyToVectorPairStringInt(PyObject *pyLi, std::vector< std::pai
               arr[i].first=convertPyObjectToStr(o_0,msg);
               if(!PyInt_Check(o_1))
                 throw INTERP_KERNEL::Exception(msg);
-              arr[i].second=(mcIdType)PyInt_AS_LONG(o_1);
+              arr[i].second=(int)PyInt_AS_LONG(o_1);
             }
           else
             throw INTERP_KERNEL::Exception(msg);
@@ -706,14 +709,14 @@ static void convertPyToVectorPairStringInt(PyObject *pyLi, std::vector< std::pai
     }
   else if(PyTuple_Check(pyLi))
     {
-      mcIdType size=PyTuple_Size(pyLi);
+      std::size_t size=PyTuple_Size(pyLi);
       arr.resize(size);
-      for(mcIdType i=0;i<size;i++)
+      for(std::size_t i=0;i<size;i++)
         {
           PyObject *o=PyTuple_GetItem(pyLi,i);
           if(PyTuple_Check(o))
             {
-              mcIdType sz2=PyTuple_Size(o);
+              std::size_t sz2=PyTuple_Size(o);
               if(sz2!=2)
                 throw INTERP_KERNEL::Exception(msg);
               PyObject *o_0=PyTuple_GetItem(o,0);
@@ -721,7 +724,7 @@ static void convertPyToVectorPairStringInt(PyObject *pyLi, std::vector< std::pai
               arr[i].first=convertPyObjectToStr(o_0,msg);
               if(!PyInt_Check(o_1))
                 throw INTERP_KERNEL::Exception(msg);
-              arr[i].second=(mcIdType)PyInt_AS_LONG(o_1);
+              arr[i].second=(int)PyInt_AS_LONG(o_1);
             }
           else
             throw INTERP_KERNEL::Exception(msg);
@@ -779,8 +782,8 @@ static void convertPyToNewIntArr4(PyObject *pyLi, mcIdType recurseLev, mcIdType
   arr.clear();
   if(PyList_Check(pyLi))
     {
-      mcIdType size=PyList_Size(pyLi);
-      for(mcIdType i=0;i<size;i++)
+      std::size_t size=PyList_Size(pyLi);
+      for(std::size_t i=0;i<size;i++)
         {
           PyObject *o=PyList_GetItem(pyLi,i);
           if(PyInt_Check(o))
@@ -803,13 +806,13 @@ static void convertPyToNewIntArr4(PyObject *pyLi, mcIdType recurseLev, mcIdType
     }
   else if(PyTuple_Check(pyLi))
     {
-      mcIdType size=PyTuple_Size(pyLi);
-      for(mcIdType i=0;i<size;i++)
+      std::size_t size=PyTuple_Size(pyLi);
+      for(std::size_t i=0;i<size;i++)
         {
           PyObject *o=PyTuple_GetItem(pyLi,i);
           if(PyInt_Check(o))
             {
-              mcIdType val=(int)PyInt_AS_LONG(o);
+              mcIdType val=ToIdType(PyInt_AS_LONG(o));
               arr.push_back(val);
             }
           else
@@ -875,7 +878,7 @@ static void fillArrayWithPyListInt3(PyObject *pyLi, mcIdType& nbOfElt, std::vect
   static const char MSG[]="fillArrayWithPyListInt3 : It appears that the input list or tuple is composed by elts having different sizes !";
   if(PyInt_Check(pyLi))
     {
-      T val=PyInt_AS_LONG(pyLi);
+      T val=(T)PyInt_AS_LONG(pyLi);
       if(nbOfElt==-1)
         nbOfElt=1;
       else
@@ -885,9 +888,9 @@ static void fillArrayWithPyListInt3(PyObject *pyLi, mcIdType& nbOfElt, std::vect
     }
   else if(PyList_Check(pyLi))
     {
-      mcIdType size=PyList_Size(pyLi);
+      std::size_t size=PyList_Size(pyLi);
       mcIdType tmp=0;
-      for(mcIdType i=0;i<size;i++)
+      for(std::size_t i=0;i<size;i++)
         {
           PyObject *o=PyList_GetItem(pyLi,i);
           mcIdType tmp1=-1;
@@ -904,9 +907,9 @@ static void fillArrayWithPyListInt3(PyObject *pyLi, mcIdType& nbOfElt, std::vect
     }
   else if(PyTuple_Check(pyLi))
     {
-      mcIdType size=PyTuple_Size(pyLi);
+      std::size_t size=PyTuple_Size(pyLi);
       mcIdType tmp=0;
-      for(mcIdType i=0;i<size;i++)
+      for(std::size_t i=0;i<size;i++)
         {
           PyObject *o=PyTuple_GetItem(pyLi,i);
           mcIdType tmp1=-1;
@@ -932,7 +935,7 @@ static std::vector<T> fillArrayWithPyListInt2(PyObject *pyLi, mcIdType& nbOfTupl
   mcIdType size1=-1,size2=-1;
   if(PyList_Check(pyLi))
     {
-      size1=PyList_Size(pyLi);
+      size1=ToIdType(PyList_Size(pyLi));
       for(mcIdType i=0;i<size1;i++)
         {
           PyObject *o=PyList_GetItem(pyLi,i);
@@ -943,7 +946,7 @@ static std::vector<T> fillArrayWithPyListInt2(PyObject *pyLi, mcIdType& nbOfTupl
     }
   else if(PyTuple_Check(pyLi))
     {
-      size1=PyTuple_Size(pyLi);
+      size1=ToIdType(PyTuple_Size(pyLi));
       for(mcIdType i=0;i<size1;i++)
         {
           PyObject *o=PyTuple_GetItem(pyLi,i);
@@ -1027,7 +1030,7 @@ static bool fillIntVector(PyObject *pyLi, std::vector<mcIdType>& vec)
         {
           PyObject *o=PyList_GetItem(pyLi,i);
           if(PyInt_Check(o))
-            vec[i]=PyInt_AS_LONG(o);
+            vec[i]=ToIdType(PyInt_AS_LONG(o));
           else
             return false;
         }
@@ -1041,7 +1044,7 @@ static bool fillIntVector(PyObject *pyLi, std::vector<mcIdType>& vec)
         {
           PyObject *o=PyTuple_GetItem(pyLi,i);
           if(PyInt_Check(o))
-            vec[i]=PyInt_AS_LONG(o);
+            vec[i]=ToIdType(PyInt_AS_LONG(o));
           else
             return false;
         }
@@ -1092,7 +1095,7 @@ static void convertPyToVectorPairStringVecString(PyObject *pyLi, std::vector< st
           PyObject *o=PyList_GetItem(pyLi,i);
           if(PyTuple_Check(o))
             {
-              mcIdType sz2=PyTuple_Size(o);
+              std::size_t sz2=PyTuple_Size(o);
               if(sz2!=2)
                 throw INTERP_KERNEL::Exception(msg);
               std::pair<std::string, std::vector<std::string> > item;
@@ -1111,12 +1114,12 @@ static void convertPyToVectorPairStringVecString(PyObject *pyLi, std::vector< st
     {
       Py_ssize_t sz=PyTuple_Size(pyLi);
       arr.resize(sz);
-      for(mcIdType i=0;i<sz;i++)
+      for(Py_ssize_t i=0;i<sz;i++)
         {
           PyObject *o=PyTuple_GetItem(pyLi,i);
           if(PyTuple_Check(o))
             {
-              mcIdType sz2=PyTuple_Size(o);
+              std::size_t sz2=PyTuple_Size(o);
               if(sz2!=2)
                 throw INTERP_KERNEL::Exception(msg);
               std::pair<std::string, std::vector<std::string> > item;
@@ -1136,31 +1139,31 @@ static void convertPyToVectorPairStringVecString(PyObject *pyLi, std::vector< st
 }
 
 template<class T>
-PyObject *convertDblArrToPyList(const T *ptr, mcIdType size)
+PyObject *convertDblArrToPyList(const T *ptr, std::size_t size)
 {
   PyObject *ret(PyList_New(size));
-  for(mcIdType i=0;i<size;i++)
+  for(std::size_t i=0;i<size;i++)
     PyList_SetItem(ret,i,PyFloat_FromDouble(ptr[i]));
   return ret;
 }
 
 static PyObject *convertDblArrToPyList2(const std::vector<double>& v)
 {
-  mcIdType size(v.size());
+  std::size_t size(v.size());
   PyObject *ret(PyList_New(size));
-  for(mcIdType i=0;i<size;i++)
+  for(std::size_t i=0;i<size;i++)
     PyList_SetItem(ret,i,PyFloat_FromDouble(v[i]));
   return ret;
 }
 
 template<class T>
-PyObject *convertDblArrToPyListOfTuple(const T *vals, int nbOfComp, mcIdType nbOfTuples)
+PyObject *convertDblArrToPyListOfTuple(const T *vals, std::size_t nbOfComp, mcIdType nbOfTuples)
 {
   PyObject *ret(PyList_New(nbOfTuples));
   for(mcIdType i=0;i<nbOfTuples;i++)
     {
       PyObject *t=PyTuple_New(nbOfComp);
-      for(mcIdType j=0;j<nbOfComp;j++)
+      for(std::size_t j=0;j<nbOfComp;j++)
         PyTuple_SetItem(t,j,PyFloat_FromDouble(vals[i*nbOfComp+j]));
       PyList_SetItem(ret,i,t);
     }
@@ -1183,7 +1186,7 @@ static double *convertPyToNewDblArr2(PyObject *pyLi, mcIdType *size)
 {
   if(PyList_Check(pyLi))
     {
-      *size=PyList_Size(pyLi);
+      *size=ToIdType(PyList_Size(pyLi));
       double *tmp=(double *)malloc((*size)*sizeof(double));
       for(mcIdType i=0;i<*size;i++)
         {
@@ -1195,8 +1198,8 @@ static double *convertPyToNewDblArr2(PyObject *pyLi, mcIdType *size)
             }
           else if(PyInt_Check(o))
             {
-              mcIdType val0=PyInt_AS_LONG(o);
-              double val=val0;
+              long val0=PyInt_AS_LONG(o);
+              double val=(double)val0;
               tmp[i]=val;
             }
           else
@@ -1209,7 +1212,7 @@ static double *convertPyToNewDblArr2(PyObject *pyLi, mcIdType *size)
     }
   else if(PyTuple_Check(pyLi))
     {
-      *size=PyTuple_Size(pyLi);
+      *size=ToIdType(PyTuple_Size(pyLi));
       double *tmp=(double *)malloc((*size)*sizeof(double));
       for(mcIdType i=0;i<*size;i++)
         {
@@ -1221,8 +1224,8 @@ static double *convertPyToNewDblArr2(PyObject *pyLi, mcIdType *size)
             }
           else if(PyInt_Check(o))
             {
-              mcIdType val0=PyInt_AS_LONG(o);
-              double val=val0;
+              long val0=PyInt_AS_LONG(o);
+              double val=(double)val0;
               tmp[i]=val;
             }
           else
@@ -1252,8 +1255,8 @@ static void fillArrayWithPyListDbl3(PyObject *pyLi, mcIdType& nbOfElt, std::vect
     }
   else if(PyInt_Check(pyLi))
     {
-      mcIdType val0=PyInt_AS_LONG(pyLi);
-      double val=val0;
+      mcIdType val0=ToIdType(PyInt_AS_LONG(pyLi));
+      double val=(double)val0;
       if(nbOfElt==-1)
         nbOfElt=1;
       else
@@ -1263,9 +1266,9 @@ static void fillArrayWithPyListDbl3(PyObject *pyLi, mcIdType& nbOfElt, std::vect
     }
   else if(PyList_Check(pyLi))
     {
-      mcIdType size=PyList_Size(pyLi);
+      std::size_t size=PyList_Size(pyLi);
       mcIdType tmp=0;
-      for(mcIdType i=0;i<size;i++)
+      for(std::size_t i=0;i<size;i++)
         {
           PyObject *o=PyList_GetItem(pyLi,i);
           mcIdType tmp1=-1;
@@ -1282,9 +1285,9 @@ static void fillArrayWithPyListDbl3(PyObject *pyLi, mcIdType& nbOfElt, std::vect
     }
   else if(PyTuple_Check(pyLi))
     {
-      mcIdType size=PyTuple_Size(pyLi);
+      std::size_t size=PyTuple_Size(pyLi);
       mcIdType tmp=0;
-      for(mcIdType i=0;i<size;i++)
+      for(std::size_t i=0;i<size;i++)
         {
           PyObject *o=PyTuple_GetItem(pyLi,i);
           mcIdType tmp1=-1;
@@ -1306,11 +1309,12 @@ static void fillArrayWithPyListDbl3(PyObject *pyLi, mcIdType& nbOfElt, std::vect
 static std::vector<double> fillArrayWithPyListDbl2(PyObject *pyLi, mcIdType& nbOfTuples, mcIdType& nbOfComp)
 {
   std::vector<double> ret;
-  mcIdType size1=-1,size2=-1;
+  std::size_t size1=-1;
+  mcIdType size2=-1;
   if(PyList_Check(pyLi))
     {
       size1=PyList_Size(pyLi);
-      for(mcIdType i=0;i<size1;i++)
+      for(std::size_t i=0;i<size1;i++)
         {
           PyObject *o=PyList_GetItem(pyLi,i);
           fillArrayWithPyListDbl3(o,size2,ret);
@@ -1321,7 +1325,7 @@ static std::vector<double> fillArrayWithPyListDbl2(PyObject *pyLi, mcIdType& nbO
   else if(PyTuple_Check(pyLi))
     {
       size1=PyTuple_Size(pyLi);
-      for(mcIdType i=0;i<size1;i++)
+      for(std::size_t i=0;i<size1;i++)
         {
           PyObject *o=PyTuple_GetItem(pyLi,i);
           fillArrayWithPyListDbl3(o,size2,ret);
@@ -1332,7 +1336,7 @@ static std::vector<double> fillArrayWithPyListDbl2(PyObject *pyLi, mcIdType& nbO
   else
     throw INTERP_KERNEL::Exception("fillArrayWithPyListDbl2 : Unrecognized type ! Should be a tuple or a list !");
   //
-  checkFillArrayWithPyList(size1,size2,nbOfTuples,nbOfComp);
+  checkFillArrayWithPyList(ToIdType(size1),ToIdType(size2),nbOfTuples,nbOfComp);
   return ret;
 }
 
@@ -1343,9 +1347,9 @@ static void convertFromPyObjVectorOfObj(PyObject *pyLi, swig_type_info *ty, cons
   void *argp=0;
   if(PyList_Check(pyLi))
     {
-      mcIdType size=PyList_Size(pyLi);
+      std::size_t size=PyList_Size(pyLi);
       ret.resize(size);
-      for(mcIdType i=0;i<size;i++)
+      for(std::size_t i=0;i<size;i++)
         {
           PyObject *obj=PyList_GetItem(pyLi,i);
           int status=SWIG_ConvertPtr(obj,&argp,ty,0|0);
@@ -1360,9 +1364,9 @@ static void convertFromPyObjVectorOfObj(PyObject *pyLi, swig_type_info *ty, cons
     }
   else if(PyTuple_Check(pyLi))
     {
-      mcIdType size=PyTuple_Size(pyLi);
+      std::size_t size=PyTuple_Size(pyLi);
       ret.resize(size);
-      for(mcIdType i=0;i<size;i++)
+      for(std::size_t i=0;i<size;i++)
         {
           PyObject *obj=PyTuple_GetItem(pyLi,i);
           int status=SWIG_ConvertPtr(obj,&argp,ty,0|0);
@@ -1406,9 +1410,9 @@ static void convertIntStarLikePyObjToCpp(PyObject *value, mcIdType& sw, T& iTyyp
     }
   if(PyTuple_Check(value))
     {
-      mcIdType size=PyTuple_Size(value);
+      std::size_t size=PyTuple_Size(value);
       stdvecTyypp.resize(size);
-      for(mcIdType i=0;i<size;i++)
+      for(std::size_t i=0;i<size;i++)
         {
           PyObject *o=PyTuple_GetItem(value,i);
           if(PyInt_Check(o))
@@ -1424,9 +1428,9 @@ static void convertIntStarLikePyObjToCpp(PyObject *value, mcIdType& sw, T& iTyyp
     }
   if(PyList_Check(value))
     {
-      mcIdType size=PyList_Size(value);
+      std::size_t size=PyList_Size(value);
       stdvecTyypp.resize(size);
-      for(mcIdType i=0;i<size;i++)
+      for(std::size_t i=0;i<size;i++)
         {
           PyObject *o=PyList_GetItem(value,i);
           if(PyInt_Check(o))
@@ -1479,9 +1483,9 @@ static const T *convertIntStarLikePyObjToCppIntStar(PyObject *value, mcIdType& s
     }
   if(PyTuple_Check(value))
     {
-      mcIdType size=PyTuple_Size(value);
+      std::size_t size=PyTuple_Size(value);
       stdvecTyypp.resize(size);
-      for(mcIdType i=0;i<size;i++)
+      for(std::size_t i=0;i<size;i++)
         {
           PyObject *o=PyTuple_GetItem(value,i);
           if(PyInt_Check(o))
@@ -1492,14 +1496,14 @@ static const T *convertIntStarLikePyObjToCppIntStar(PyObject *value, mcIdType& s
               throw INTERP_KERNEL::Exception(oss.str().c_str());
             }
         }
-      sw=2; sz=size;
+      sw=2; sz=ToIdType(size);
       return &stdvecTyypp[0];
     }
   if(PyList_Check(value))
     {
-      mcIdType size=PyList_Size(value);
+      std::size_t size=PyList_Size(value);
       stdvecTyypp.resize(size);
-      for(mcIdType i=0;i<size;i++)
+      for(std::size_t i=0;i<size;i++)
         {
           PyObject *o=PyList_GetItem(value,i);
           if(PyInt_Check(o))
@@ -1510,7 +1514,7 @@ static const T *convertIntStarLikePyObjToCppIntStar(PyObject *value, mcIdType& s
               throw INTERP_KERNEL::Exception(oss.str().c_str());
             }
         }
-      sw=2; sz=size;
+      sw=2; sz=ToIdType(size);
       return &stdvecTyypp[0];
     }
   void *argp;
@@ -1535,7 +1539,7 @@ static const T *convertIntStarLikePyObjToCppIntStar(PyObject *value, mcIdType& s
     {
       typedef typename MEDCoupling::Traits< T >::ArrayTuple ARRAYTUPLE;
       ARRAYTUPLE *daIntTuple=reinterpret_cast< ARRAYTUPLE * >(argp);
-      sw=4; sz=daIntTuple->getNumberOfCompo();
+      sw=4; sz=ToIdType(daIntTuple->getNumberOfCompo());
       return daIntTuple->getConstPointer();
     }
   throw INTERP_KERNEL::Exception("5 types accepted : integer, tuple of integer, list of integer, DataArrayIdType, DataArrayIdTypeTuple");
@@ -1570,9 +1574,9 @@ void considerPyObjAsATStarLikeObject(PyObject *value, mcIdType& sw, T& iTyypp, s
     }
   if(PyTuple_Check(value))
     {
-      mcIdType size=PyTuple_Size(value);
+      std::size_t size=PyTuple_Size(value);
       stdvecTyypp.resize(size);
-      for(mcIdType i=0;i<size;i++)
+      for(std::size_t i=0;i<size;i++)
         {
           PyObject *o=PyTuple_GetItem(value,i);
           if(PyFloat_Check(o))
@@ -1590,9 +1594,9 @@ void considerPyObjAsATStarLikeObject(PyObject *value, mcIdType& sw, T& iTyypp, s
     }
   if(PyList_Check(value))
     {
-      mcIdType size=PyList_Size(value);
+      std::size_t size=PyList_Size(value);
       stdvecTyypp.resize(size);
-      for(mcIdType i=0;i<size;i++)
+      for(std::size_t i=0;i<size;i++)
         {
           PyObject *o=PyList_GetItem(value,i);
           if(PyFloat_Check(o))
@@ -1644,9 +1648,9 @@ static void convertDoubleStarLikePyObjToCpp(PyObject *value, mcIdType& sw, doubl
     }
   if(PyTuple_Check(value))
     {
-      mcIdType size=PyTuple_Size(value);
+      std::size_t size=PyTuple_Size(value);
       stdvecTyypp.resize(size);
-      for(mcIdType i=0;i<size;i++)
+      for(std::size_t i=0;i<size;i++)
         {
           PyObject *o=PyTuple_GetItem(value,i);
           if(PyFloat_Check(o))
@@ -1664,9 +1668,9 @@ static void convertDoubleStarLikePyObjToCpp(PyObject *value, mcIdType& sw, doubl
     }
   if(PyList_Check(value))
     {
-      mcIdType size=PyList_Size(value);
+      std::size_t size=PyList_Size(value);
       stdvecTyypp.resize(size);
-      for(mcIdType i=0;i<size;i++)
+      for(std::size_t i=0;i<size;i++)
         {
           PyObject *o=PyList_GetItem(value,i);
           if(PyFloat_Check(o))
@@ -1696,7 +1700,7 @@ void convertFPStarLikePyObjToCpp_2(PyObject *value, mcIdType& sw, T& val, typena
   sw=-1;
   if(PyFloat_Check(value))
     {
-      val=PyFloat_AS_DOUBLE(value);
+      val=(T)PyFloat_AS_DOUBLE(value);
       sw=1;
       return;
     }
@@ -1708,13 +1712,13 @@ void convertFPStarLikePyObjToCpp_2(PyObject *value, mcIdType& sw, T& val, typena
     }
   if(PyTuple_Check(value))
     {
-      mcIdType size=PyTuple_Size(value);
+      std::size_t size=PyTuple_Size(value);
       f.resize(size);
-      for(mcIdType i=0;i<size;i++)
+      for(std::size_t i=0;i<size;i++)
         {
           PyObject *o=PyTuple_GetItem(value,i);
           if(PyFloat_Check(o))
-            f[i]=PyFloat_AS_DOUBLE(o);
+            f[i]=(T)PyFloat_AS_DOUBLE(o);
           else if(PyInt_Check(o))
             f[i]=(T)PyInt_AS_LONG(o);
           else
@@ -1728,13 +1732,13 @@ void convertFPStarLikePyObjToCpp_2(PyObject *value, mcIdType& sw, T& val, typena
     }
   if(PyList_Check(value))
     {
-      mcIdType size=PyList_Size(value);
+      std::size_t size=PyList_Size(value);
       f.resize(size);
-      for(mcIdType i=0;i<size;i++)
+      for(std::size_t i=0;i<size;i++)
         {
           PyObject *o=PyList_GetItem(value,i);
           if(PyFloat_Check(o))
-            f[i]=PyFloat_AS_DOUBLE(o);
+            f[i]=(T)PyFloat_AS_DOUBLE(o);
           else if(PyInt_Check(o))
             f[i]=(T)PyInt_AS_LONG(o);
           else
@@ -1806,19 +1810,19 @@ static void convertIntStarOrSliceLikePyObjToCpp(PyObject *value, mcIdType nbelem
   sw=-1;
   if(PyInt_Check(value))
     {
-      iTyypp=(mcIdType)PyInt_AS_LONG(value);
+      iTyypp=(T)PyInt_AS_LONG(value);
       sw=1;
       return;
     }
   if(PyTuple_Check(value))
     {
-      mcIdType size=PyTuple_Size(value);
+      std::size_t size=PyTuple_Size(value);
       stdvecTyypp.resize(size);
-      for(mcIdType i=0;i<size;i++)
+      for(std::size_t i=0;i<size;i++)
         {
           PyObject *o=PyTuple_GetItem(value,i);
           if(PyInt_Check(o))
-            stdvecTyypp[i]=(mcIdType)PyInt_AS_LONG(o);
+            stdvecTyypp[i]=(T)PyInt_AS_LONG(o);
           else
             {
               std::ostringstream oss; oss << "Tuple as been detected but element #" << i << " is not integer ! only tuples of integers accepted !";
@@ -1830,13 +1834,13 @@ static void convertIntStarOrSliceLikePyObjToCpp(PyObject *value, mcIdType nbelem
     }
   if(PyList_Check(value))
     {
-      mcIdType size=PyList_Size(value);
+      std::size_t size=PyList_Size(value);
       stdvecTyypp.resize(size);
-      for(mcIdType i=0;i<size;i++)
+      for(std::size_t i=0;i<size;i++)
         {
           PyObject *o=PyList_GetItem(value,i);
           if(PyInt_Check(o))
-            stdvecTyypp[i]=(mcIdType)PyInt_AS_LONG(o);
+            stdvecTyypp[i]=(T)PyInt_AS_LONG(o);
           else
             {
               std::ostringstream oss; oss << "List as been detected but element #" << i << " is not integer ! only lists of integers accepted !";
@@ -1850,9 +1854,9 @@ static void convertIntStarOrSliceLikePyObjToCpp(PyObject *value, mcIdType nbelem
     {
       Py_ssize_t strt=2,stp=2,step=2;
       GetIndicesOfSlice(value,nbelem,&strt,&stp,&step,"Slice in subscriptable object DataArray invalid !");
-      p.first=strt;
-      p.second.first=stp;
-      p.second.second=step;
+      p.first=ToIdType(strt);
+      p.second.first=ToIdType(stp);
+      p.second.second=ToIdType(step);
       sw=3;
       return ;
     }
@@ -1896,7 +1900,7 @@ static void convertIntStarOrSliceLikePyObjToCppWithNegIntInterp(PyObject *value,
   convertIntStarOrSliceLikePyObjToCpp(value,nbelem,sw,iTyypp,stdvecTyypp,p,daIntTyypp);
   if(sw==1)
     {
-      iTyypp=InterpreteNegativeInt(iTyypp,nbelem);
+      iTyypp=(T)InterpreteNegativeInt(iTyypp,nbelem);
     }
 }
 
@@ -1913,15 +1917,15 @@ static void convertObjToPossibleCpp22(PyObject *value, mcIdType nbelem, mcIdType
   sw=-1;
   if(PyInt_Check(value))
     {
-      iTyypp=(mcIdType)PyInt_AS_LONG(value);
+      iTyypp=ToIdType(PyInt_AS_LONG(value));
       sw=1;
       return;
     }
   if(PyTuple_Check(value))
     {
-      mcIdType size=PyTuple_Size(value);
+      std::size_t size=PyTuple_Size(value);
       stdvecTyypp.resize(size);
-      for(mcIdType i=0;i<size;i++)
+      for(std::size_t i=0;i<size;i++)
         {
           PyObject *o=PyTuple_GetItem(value,i);
           if(PyInt_Check(o))
@@ -1937,9 +1941,9 @@ static void convertObjToPossibleCpp22(PyObject *value, mcIdType nbelem, mcIdType
     }
   if(PyList_Check(value))
     {
-      mcIdType size=PyList_Size(value);
+      std::size_t size=PyList_Size(value);
       stdvecTyypp.resize(size);
-      for(mcIdType i=0;i<size;i++)
+      for(std::size_t i=0;i<size;i++)
         {
           PyObject *o=PyList_GetItem(value,i);
           if(PyInt_Check(o))
@@ -1957,9 +1961,9 @@ static void convertObjToPossibleCpp22(PyObject *value, mcIdType nbelem, mcIdType
     {
       Py_ssize_t strt=2,stp=2,step=2;
       GetIndicesOfSlice(value,nbelem,&strt,&stp,&step,"Slice in subscriptable object DataArray invalid !");
-      p.first=strt;
-      p.second.first=stp;
-      p.second.second=step;
+      p.first=ToIdType(strt);
+      p.second.first=ToIdType(stp);
+      p.second.second=ToIdType(step);
       sw=3;
       return ;
     }
@@ -2020,9 +2024,9 @@ static void convertObjToPossibleCpp6(PyObject *value, mcIdType& sw, char& cTyp,
 #endif
   if(PyTuple_Check(value))
     {
-      mcIdType size=PyTuple_Size(value);
+      std::size_t size=PyTuple_Size(value);
       vsType.resize(size);
-      for(mcIdType i=0;i<size;i++)
+      for(std::size_t i=0;i<size;i++)
         {
           PyObject *o=PyTuple_GetItem(value,i);
           try
@@ -2040,9 +2044,9 @@ static void convertObjToPossibleCpp6(PyObject *value, mcIdType& sw, char& cTyp,
     }
   if(PyList_Check(value))
     {
-      mcIdType size=PyList_Size(value);
+      std::size_t size=PyList_Size(value);
       vsType.resize(size);
-      for(mcIdType i=0;i<size;i++)
+      for(std::size_t i=0;i<size;i++)
         {
           PyObject *o=PyList_GetItem(value,i);
           try
@@ -2115,7 +2119,7 @@ static void convertObjToPossibleCpp3(PyObject *value, mcIdType nbTuple, int nbCo
     }
   else
     {
-      mcIdType sz=PyTuple_Size(value);
+      std::size_t sz=PyTuple_Size(value);
       if(sz!=2)
         throw INTERP_KERNEL::Exception("Unexpected nb of slice element : 1 or 2 expected !\n1st is for tuple selection, 2nd for component selection !");
       PyObject *ob0=PyTuple_GetItem(value,0);
@@ -2272,9 +2276,9 @@ static const double *convertObjToPossibleCpp5_Safe2(PyObject *value, mcIdType& s
     }
   if(PyTuple_Check(value))
     {
-      mcIdType size=PyTuple_Size(value);
+      std::size_t size=PyTuple_Size(value);
       f.resize(size);
-      for(mcIdType i=0;i<size;i++)
+      for(std::size_t i=0;i<size;i++)
         {
           PyObject *o=PyTuple_GetItem(value,i);
           if(PyFloat_Check(o))
@@ -2293,14 +2297,14 @@ static const double *convertObjToPossibleCpp5_Safe2(PyObject *value, mcIdType& s
           std::ostringstream oss; oss << msg << "dimension expected to be a multiple of " << nbCompExpected << " , and your data in input has dimension " << f.size() << " !";
           throw INTERP_KERNEL::Exception(oss.str().c_str());
         }
-      nbTuples=size/nbCompExpected;
+      nbTuples=ToIdType(size/nbCompExpected);
       return &f[0];
     }
   if(PyList_Check(value))
     {
-      mcIdType size=PyList_Size(value);
+      std::size_t size=PyList_Size(value);
       f.resize(size);
-      for(mcIdType i=0;i<size;i++)
+      for(std::size_t i=0;i<size;i++)
         {
           PyObject *o=PyList_GetItem(value,i);
           if(PyFloat_Check(o))
@@ -2319,7 +2323,7 @@ static const double *convertObjToPossibleCpp5_Safe2(PyObject *value, mcIdType& s
           std::ostringstream oss; oss << msg << "dimension expected to be a multiple of " << nbCompExpected << " , and your data in input has dimension " << f.size() << " !";
           throw INTERP_KERNEL::Exception(oss.str().c_str());
         }
-      nbTuples=size/nbCompExpected;
+      nbTuples=ToIdType(size/nbCompExpected);
       return &f[0];
     }
   void *argp;
@@ -2414,9 +2418,9 @@ static const double *convertObjToPossibleCpp5_SingleCompo(PyObject *value, mcIdT
     }
   if(PyTuple_Check(value))
     {
-      mcIdType size=PyTuple_Size(value);
+      std::size_t size=PyTuple_Size(value);
       f.resize(size);
-      for(mcIdType i=0;i<size;i++)
+      for(std::size_t i=0;i<size;i++)
         {
           PyObject *o=PyTuple_GetItem(value,i);
           if(PyFloat_Check(o))
@@ -2430,14 +2434,14 @@ static const double *convertObjToPossibleCpp5_SingleCompo(PyObject *value, mcIdT
             }
         }
       sw=4;
-      nbTuples=size;
+      nbTuples=ToIdType(size);
       return &f[0];
     }
   if(PyList_Check(value))
     {
-      mcIdType size=PyList_Size(value);
+      std::size_t size=PyList_Size(value);
       f.resize(size);
-      for(mcIdType i=0;i<size;i++)
+      for(std::size_t i=0;i<size;i++)
         {
           PyObject *o=PyList_GetItem(value,i);
           if(PyFloat_Check(o))
@@ -2451,7 +2455,7 @@ static const double *convertObjToPossibleCpp5_SingleCompo(PyObject *value, mcIdT
             }
         }
       sw=4;
-      nbTuples=size;
+      nbTuples=ToIdType(size);
       return &f[0];
     }
   void *argp;
@@ -2491,7 +2495,7 @@ static const double *convertObjToPossibleCpp5_SingleCompo(PyObject *value, mcIdT
       sw=3;
       if(e)
         {
-          nbTuples=e->getNumberOfCompo();
+          nbTuples=ToIdType(e->getNumberOfCompo());
           return e->getConstPointer();
         }
       else
@@ -2567,14 +2571,14 @@ static typename MEDCoupling::Traits<T>::ArrayType *DataArrayT_New(PyObject *elt0
         {
           if(PyInt_Check(nbOfTuples))
             {
-              mcIdType nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
+              mcIdType nbOfTuples1=ToIdType(PyInt_AS_LONG(nbOfTuples));
               if(nbOfTuples1<0)
                 throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive set of allocated memory !");
               if(elt2)
                 {
                   if(PyInt_Check(elt2))
                     {//DataArrayDouble.New([1.,3.,4.,5.],2,2)
-                      mcIdType nbOfCompo=PyInt_AS_LONG(elt2);
+                      mcIdType nbOfCompo=ToIdType(PyInt_AS_LONG(elt2));
                       if(nbOfCompo<0)
                         throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive number of components !");
                       MEDCoupling::MCAuto< typename MEDCoupling::Traits<T>::ArrayType > ret(MEDCoupling::Traits<T>::ArrayType::New());
@@ -2608,7 +2612,7 @@ static typename MEDCoupling::Traits<T>::ArrayType *DataArrayT_New(PyObject *elt0
     }
   else if(PyInt_Check(elt0))
     {
-      mcIdType nbOfTuples1(PyInt_AS_LONG(elt0));
+      mcIdType nbOfTuples1(ToIdType(PyInt_AS_LONG(elt0)));
       if(nbOfTuples1<0)
         throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive set of allocated memory !");
       if(nbOfTuples)
@@ -2617,7 +2621,7 @@ static typename MEDCoupling::Traits<T>::ArrayType *DataArrayT_New(PyObject *elt0
             {
               if(PyInt_Check(nbOfTuples))
                 {//DataArrayDouble.New(5,2)
-                  mcIdType nbOfCompo=PyInt_AS_LONG(nbOfTuples);
+                  mcIdType nbOfCompo=ToIdType(PyInt_AS_LONG(nbOfTuples));
                   if(nbOfCompo<0)
                     throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive number of components !");
                   MEDCoupling::MCAuto< typename MEDCoupling::Traits<T>::ArrayType > ret(MEDCoupling::Traits<T>::ArrayType::New());
@@ -2653,7 +2657,8 @@ typename MEDCoupling::Traits<T>::ArrayType *DataArrayT__setitem__internal(typena
 {
   self->checkAllocated();
   const char msg[]="Unexpected situation in DataArrayDouble::__setitem__ !";
-  mcIdType nbOfTuples(self->getNumberOfTuples()),nbOfComponents(self->getNumberOfComponents());
+  mcIdType nbOfTuples(self->getNumberOfTuples());
+  int nbOfComponents((int)(self->getNumberOfComponents()));
   mcIdType sw1,sw2;
   T i1;
   std::vector<T> v1;
@@ -3000,7 +3005,8 @@ PyObject *DataArrayT__getitem__internal(const typename MEDCoupling::Traits<T>::A
   const char msg[]="Unexpected situation in DataArrayDouble::__getitem__ !";
   const char msg2[]="DataArrayDouble::__getitem__ : Mismatch of slice values in 2nd parameter (components) !";
   self->checkAllocated();
-  mcIdType nbOfTuples(self->getNumberOfTuples()),nbOfComponents(self->getNumberOfComponents());
+  mcIdType nbOfTuples(self->getNumberOfTuples());
+  int nbOfComponents((int)(self->getNumberOfComponents()));
   mcIdType it1;
   std::size_t ic1;
   std::vector<mcIdType> vt1;
@@ -3065,7 +3071,7 @@ PyObject *DataArrayT__getitem__internal(const typename MEDCoupling::Traits<T>::A
     case 13:
       {
         ret=self->selectByTupleIdSafe(&it1,&it1+1);
-        int nbOfComp(MEDCoupling::DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2));
+        mcIdType nbOfComp(MEDCoupling::DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2));
         std::vector<std::size_t> v2(nbOfComp);
         for(mcIdType i=0;i<nbOfComp;i++)
           v2[i]=pc1.first+i*pc1.second.second;
@@ -3074,7 +3080,7 @@ PyObject *DataArrayT__getitem__internal(const typename MEDCoupling::Traits<T>::A
     case 14:
       {
         ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
-        int nbOfComp(MEDCoupling::DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2));
+        mcIdType nbOfComp(MEDCoupling::DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2));
         std::vector<std::size_t> v2(nbOfComp);
         for(int i=0;i<nbOfComp;i++)
           v2[i]=pc1.first+i*pc1.second.second;
@@ -3083,7 +3089,7 @@ PyObject *DataArrayT__getitem__internal(const typename MEDCoupling::Traits<T>::A
     case 15:
       {
         ret=self->selectByTupleIdSafeSlice(pt1.first,pt1.second.first,pt1.second.second);
-        int nbOfComp(MEDCoupling::DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2));
+        mcIdType nbOfComp(MEDCoupling::DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2));
         std::vector<std::size_t> v2(nbOfComp);
         for(int i=0;i<nbOfComp;i++)
           v2[i]=pc1.first+i*pc1.second.second;
@@ -3092,7 +3098,7 @@ PyObject *DataArrayT__getitem__internal(const typename MEDCoupling::Traits<T>::A
     case 16:
       {
         ret=self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems());
-        int nbOfComp(MEDCoupling::DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2));
+        mcIdType nbOfComp(MEDCoupling::DataArray::GetNumberOfItemGivenBESRelative(pc1.first,pc1.second.first,pc1.second.second,msg2));
         std::vector<std::size_t> v2(nbOfComp);
         for(int i=0;i<nbOfComp;i++)
           v2[i]=pc1.first+i*pc1.second.second;
@@ -3122,7 +3128,7 @@ bool isCSRMatrix(PyObject *m)
 #endif
 }
 
-void convertCSR_MCDataToVectMapIntDouble(const MEDCoupling::DataArrayIdType *indptrPtr, const MEDCoupling::DataArrayIdType *indicesPtr, const MEDCoupling::DataArrayDouble *dataPtr, std::vector<std::map<mcIdType,double> >& mCpp)
+void convertCSR_MCDataToVectMapIntDouble(const MEDCoupling::DataArrayInt32 *indptrPtr, const MEDCoupling::DataArrayInt32 *indicesPtr, const MEDCoupling::DataArrayDouble *dataPtr, std::vector<std::map<mcIdType,double> >& mCpp)
 {
   auto nbOfRows(indptrPtr->getNumberOfTuples()-1);
   if(nbOfRows<0)
@@ -3171,7 +3177,7 @@ void convertToVectMapIntDouble(PyObject *pyobj, std::vector<std::map<mcIdType,do
               std::ostringstream oss; oss << "convertToVectMapIntDouble : at pos # " << i << " of pylist the dict contains at pos " << pos << " the value not mappable to pyfloat !";
               throw INTERP_KERNEL::Exception(oss.str());
             }
-          mapCpp[(mcIdType)PyInt_AS_LONG(key)]=PyFloat_AS_DOUBLE(value);
+          mapCpp[ToIdType(PyInt_AS_LONG(key))]=PyFloat_AS_DOUBLE(value);
         }
     }
 }
@@ -3235,7 +3241,7 @@ PyObject *DataArrayT_idiv__internal(PyObject *trueSelf, PyObject *obj, typename
       {
         if(val==0.)
           throw INTERP_KERNEL::Exception("DataArrayDouble::__div__ : trying to divide by zero !");
-        self->applyLin(1./val,0.);
+        self->applyLin((T)(1./val),(T)0.);
         Py_XINCREF(trueSelf);
         return trueSelf;
       }
@@ -3354,6 +3360,10 @@ PyObject *DataArrayT_isub__internal(PyObject *trueSelf, PyObject *obj, typename
 PyTypeObject *NPYTraits<double>::NPYFunc=&PyCallBackDataArrayDouble_RefType;
 
 PyTypeObject *NPYTraits<float>::NPYFunc=&PyCallBackDataArrayFloat_RefType;
+
+PyTypeObject *NPYTraits<int>::NPYFunc=&PyCallBackDataArrayInt32_RefType;
+
+PyTypeObject *NPYTraits<long>::NPYFunc=&PyCallBackDataArrayInt64_RefType;
 #endif
 
 template<class T>
index 12420612022cfed62cd201ba1ca1b16c890c63e2..c70d046f73a01ba7712048bdfa1910a1f2ea0dee 100644 (file)
@@ -118,7 +118,7 @@ namespace MEDCoupling
       {
         if(!arr)
           throw INTERP_KERNEL::Exception("wrap of MEDCouplingFieldDiscretization::normL1 : input array is null !");
-        int sz(arr->getNumberOfComponents());
+        std::size_t sz(arr->getNumberOfComponents());
         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
         self->normL1(mesh,arr,tmp);
         return convertDblArrToPyList<double>(tmp,sz);
@@ -128,7 +128,7 @@ namespace MEDCoupling
       {
         if(!arr)
           throw INTERP_KERNEL::Exception("wrap of MEDCouplingFieldDiscretization::normL2 : input array is null !");
-        int sz(arr->getNumberOfComponents());
+        std::size_t sz(arr->getNumberOfComponents());
         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
         self->normL2(mesh,arr,tmp);
         return convertDblArrToPyList<double>(tmp,sz);
@@ -138,7 +138,7 @@ namespace MEDCoupling
       {
         if(!arr)
           throw INTERP_KERNEL::Exception("wrap of MEDCouplingFieldDiscretization::integral : input array is null !");
-        int sz(arr->getNumberOfComponents());
+        std::size_t sz(arr->getNumberOfComponents());
         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
         self->integral(mesh,arr,isWAbs,tmp);
         return convertDblArrToPyList<double>(tmp,sz);
@@ -203,7 +203,7 @@ namespace MEDCoupling
       {
         if(!arr)
           throw INTERP_KERNEL::Exception("wrap of MEDCouplingFieldDiscretization::getValueOnPos : input array is null !");
-        int sz(arr->getNumberOfComponents());
+        std::size_t sz(arr->getNumberOfComponents());
         INTERP_KERNEL::AutoPtr<double> res=new double[sz];
         self->getValueOnPos(arr,mesh,i,j,k,res);
         return convertDblArrToPyList<double>(res,sz);
@@ -353,21 +353,21 @@ namespace MEDCoupling
       {
         std::size_t sz(0);
         const double *ret(MEDCouplingFieldDiscretizationGaussNE::GetWeightArrayFromGeometricType(geoType,sz));
-        return convertDblArrToPyList<double>(ret,sz);
+        return convertDblArrToPyList<double>(ret,ToIdType(sz));
       }
       
       static PyObject *GetRefCoordsFromGeometricType(INTERP_KERNEL::NormalizedCellType geoType)
       {
         std::size_t sz(0);
         const double *ret(MEDCouplingFieldDiscretizationGaussNE::GetRefCoordsFromGeometricType(geoType,sz));
-        return convertDblArrToPyList<double>(ret,sz);
+        return convertDblArrToPyList<double>(ret,ToIdType(sz));
       }
       
       static PyObject *GetLocsFromGeometricType(INTERP_KERNEL::NormalizedCellType geoType)
       {
         std::size_t sz(0);
         const double *ret(MEDCouplingFieldDiscretizationGaussNE::GetLocsFromGeometricType(geoType,sz));
-        return convertDblArrToPyList<double>(ret,sz);
+        return convertDblArrToPyList<double>(ret,ToIdType(sz));
       }
     }
   };
index d999ded1a660415fe1756df56704e02dd017f51f..4c988d334bcfea69ae7b5e4e0fbdb6c6604824f1 100644 (file)
@@ -497,7 +497,7 @@ typedef DataArrayInt64 DataArrayIdType;
     void checkNbOfComps(int nbOfCompo, const std::string& msg) const;
     void checkNbOfTuplesAndComp(const DataArray& other, const std::string& msg) const;
     void checkNbOfTuplesAndComp(int nbOfTuples, int nbOfCompo, const std::string& msg) const;
-    void checkNbOfElems(std::size_t nbOfElems, const std::string& msg) const;
+    void checkNbOfElems(mcIdType nbOfElems, const std::string& msg) const;
     static int GetNumberOfItemGivenBES(int begin, int end, int step, const std::string& msg);
     static int GetNumberOfItemGivenBESRelative(int begin, int end, int step, const std::string& msg);
     static int GetPosOfItemGivenBESRelativeNoThrow(int value, int begin, int end, int step);
@@ -673,7 +673,7 @@ typedef DataArrayInt64 DataArrayIdType;
         Py_ssize_t strt=2,stp=2,step=2;
         GetIndicesOfSliceExplicitely(slic,&strt,&stp,&step,"DataArray::GetSlice (wrap) : the input slice is invalid !");
         mcIdType a,b;
-        DataArray::GetSlice(strt,stp,step,sliceId,nbOfSlices,a,b);
+        DataArray::GetSlice(ToIdType(strt),ToIdType(stp),ToIdType(step),sliceId,nbOfSlices,a,b);
         return PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(step));
       }
 
@@ -684,7 +684,7 @@ typedef DataArrayInt64 DataArrayIdType;
         Py_ssize_t strt=2,stp=2,step=2;
         GetIndicesOfSlice(slic,self->getNumberOfTuples(),&strt,&stp,&step,"DataArray::getSlice (wrap) : the input slice is invalid !");
         mcIdType a,b;
-        DataArray::GetSlice(strt,stp,step,sliceId,nbOfSlices,a,b);
+        DataArray::GetSlice(ToIdType(strt),ToIdType(stp),ToIdType(step),sliceId,nbOfSlices,a,b);
         return PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(step));
       }
 
@@ -694,7 +694,7 @@ typedef DataArrayInt64 DataArrayIdType;
           throw INTERP_KERNEL::Exception("DataArray::GetNumberOfItemGivenBES (wrap) : expecting a pyslice as second (first) parameter !");
         Py_ssize_t strt=2,stp=2,step=2;
         GetIndicesOfSliceExplicitely(slic,&strt,&stp,&step,"DataArray::GetNumberOfItemGivenBES (wrap) : the input slice is invalid !");
-        return DataArray::GetNumberOfItemGivenBES(strt,stp,step,"");
+        return DataArray::GetNumberOfItemGivenBES(ToIdType(strt),ToIdType(stp),ToIdType(step),"");
       }
 
       static mcIdType GetNumberOfItemGivenBESRelative(PyObject *slic)
@@ -703,7 +703,7 @@ typedef DataArrayInt64 DataArrayIdType;
           throw INTERP_KERNEL::Exception("DataArray::GetNumberOfItemGivenBESRelative (wrap) : expecting a pyslice as second (first) parameter !");
         Py_ssize_t strt=2,stp=2,step=2;
         GetIndicesOfSliceExplicitely(slic,&strt,&stp,&step,"DataArray::GetNumberOfItemGivenBESRelative (wrap) : the input slice is invalid !");
-        return DataArray::GetNumberOfItemGivenBESRelative(strt,stp,step,"");
+        return DataArray::GetNumberOfItemGivenBESRelative(ToIdType(strt),ToIdType(stp),ToIdType(step),"");
       }
       
       static DataArray *Aggregate(PyObject *arrs)
@@ -719,7 +719,7 @@ typedef DataArrayInt64 DataArrayIdType;
           throw INTERP_KERNEL::Exception("DataArray::getNumberOfItemGivenBES (wrap) : expecting a pyslice as second (first) parameter !");
         Py_ssize_t strt=2,stp=2,step=2;
         GetIndicesOfSlice(slic,self->getNumberOfTuples(),&strt,&stp,&step,"DataArray::getNumberOfItemGivenBES (wrap) : the input slice is invalid !");
-        return DataArray::GetNumberOfItemGivenBES(strt,stp,step,"");
+        return DataArray::GetNumberOfItemGivenBES(ToIdType(strt),ToIdType(stp),ToIdType(step),"");
       }
 
       mcIdType getNumberOfItemGivenBESRelative(PyObject *slic)
@@ -728,7 +728,7 @@ typedef DataArrayInt64 DataArrayIdType;
           throw INTERP_KERNEL::Exception("DataArray::getNumberOfItemGivenBESRelative (wrap) : expecting a pyslice as second (first) parameter !");
         Py_ssize_t strt=2,stp=2,step=2;
         GetIndicesOfSlice(slic,self->getNumberOfTuples(),&strt,&stp,&step,"DataArray::getNumberOfItemGivenBESRelative (wrap) : the input slice is invalid !");
-        return DataArray::GetNumberOfItemGivenBESRelative(strt,stp,step,"");
+        return DataArray::GetNumberOfItemGivenBESRelative(ToIdType(strt),ToIdType(stp),ToIdType(step),"");
       }
 
       PyObject *__getstate__() const
@@ -738,9 +738,9 @@ typedef DataArrayInt64 DataArrayIdType;
         const std::vector<std::string> &a1(self->getInfoOnComponents());
         PyTuple_SetItem(ret,0,PyString_FromString(a0.c_str()));
         //
-        mcIdType sz(a1.size());
+        std::size_t sz(a1.size());
         PyObject *ret1(PyList_New(sz));
-        for(mcIdType i=0;i<sz;i++)
+        for(std::size_t i=0;i<sz;i++)
           PyList_SetItem(ret1,i,PyString_FromString(a1[i].c_str()));
         PyTuple_SetItem(ret,1,ret1);
         //
@@ -752,7 +752,7 @@ typedef DataArrayInt64 DataArrayIdType;
         static const char MSG[]="DataArrayDouble.__setstate__ : expected input is a tuple of size 2 with string as 1st arg and list of string as 2nd arg !";
         if(!PyTuple_Check(inp))
           throw INTERP_KERNEL::Exception("DataArrayDouble.__setstate__ : invalid input ! Invalid overwrite of __getstate__ ?");
-        mcIdType sz(PyTuple_Size(inp));
+        std::size_t sz(PyTuple_Size(inp));
         if(sz!=2)
           throw INTERP_KERNEL::Exception("DataArrayDouble.__setstate__ : invalid tuple in input ! Should be of size 2 ! Invalid overwrite of __getstate__ ?");
         PyObject *a0(PyTuple_GetItem(inp,0));
@@ -836,7 +836,8 @@ typedef DataArrayInt64 DataArrayIdType;
       PyObject *getValuesAsTuple() const
       {
         const float *vals(self->begin());
-        mcIdType nbOfComp(self->getNumberOfComponents()),nbOfTuples(self->getNumberOfTuples());
+        std::size_t nbOfComp(self->getNumberOfComponents());
+        mcIdType nbOfTuples(self->getNumberOfTuples());
         return convertDblArrToPyListOfTuple<float>(vals,nbOfComp,nbOfTuples);
       }
 
@@ -996,7 +997,7 @@ typedef DataArrayInt64 DataArrayIdType;
     DataArrayIdType *findClosestTupleId(const DataArrayDouble *other) const;
     DataArrayIdType *computeNbOfInteractionsWith(const DataArrayDouble *otherBBoxFrmt, double eps) const;
     void setPartOfValues1(const DataArrayDouble *a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp, bool strictCompoCompare=true);
-    void setPartOfValuesSimple1(double a, int bgTuples, int endTuples, int stepTuples, int bgComp, int endComp, int stepComp);
+    void setPartOfValuesSimple1(double a, mcIdType bgTuples, mcIdType endTuples, mcIdType stepTuples, mcIdType bgComp, mcIdType endComp, mcIdType stepComp);
     void setPartOfValuesAdv(const DataArrayDouble *a, const DataArrayIdType *tuplesSelec);
     double getIJ(int tupleId, int compoId) const;
     double front() const;
@@ -1076,7 +1077,7 @@ typedef DataArrayInt64 DataArrayIdType;
     MCAuto<DataArrayIdType> findIdsGreaterThan(double val) const;
     MCAuto<DataArrayIdType> findIdsLowerOrEqualTo(double val) const;
     MCAuto<DataArrayIdType> findIdsLowerThan(double val) const;
-    MCAuto<DataArrayIdType> convertToIntArr() const;
+    MCAuto<DataArrayInt32> convertToIntArr() const;
     MCAuto<DataArrayDouble> selectPartDef(const PartDefinition* pd) const;
     MCAuto<DataArrayDouble> cumSum() const;
     MCAuto<DataArrayFloat> convertToFloatArr() const;
@@ -1124,7 +1125,7 @@ typedef DataArrayInt64 DataArrayIdType;
         return self->doubleValue();
       }
 
-      int __len__() const
+      mcIdType __len__() const
       {
         if(self->isAllocated())
           {
@@ -1166,14 +1167,14 @@ typedef DataArrayInt64 DataArrayIdType;
               {
                 if(PyInt_Check(nbOfTuples))
                   {
-                    mcIdType nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
+                    mcIdType nbOfTuples1=ToIdType(PyInt_AS_LONG(nbOfTuples));
                     if(nbOfTuples1<0)
                       throw INTERP_KERNEL::Exception("DataArrayDouble::setValues : should be a positive set of allocated memory !");
                     if(nbOfComp && nbOfComp != Py_None)
                       {
                         if(PyInt_Check(nbOfComp))
                           {//DataArrayDouble.setValues([1.,3.,4.,5.],2,2)
-                            mcIdType nbOfCompo=PyInt_AS_LONG(nbOfComp);
+                            mcIdType nbOfCompo=ToIdType(PyInt_AS_LONG(nbOfComp));
                             if(nbOfCompo<0)
                               throw INTERP_KERNEL::Exception("DataArrayDouble::setValues : should be a positive number of components !");
                             std::vector<double> tmp=fillArrayWithPyListDbl2(li,nbOfTuples1,nbOfCompo);
@@ -1231,7 +1232,8 @@ typedef DataArrayInt64 DataArrayIdType;
       PyObject *getValuesAsTuple() const
       {
         const double *vals(self->begin());
-        mcIdType nbOfComp(self->getNumberOfComponents()),nbOfTuples(self->getNumberOfTuples());
+        std::size_t nbOfComp(self->getNumberOfComponents());
+        mcIdType nbOfTuples(self->getNumberOfTuples());
         return convertDblArrToPyListOfTuple<double>(vals,nbOfComp,nbOfTuples);
       }
 
@@ -1451,7 +1453,7 @@ typedef DataArrayInt64 DataArrayIdType;
         std::size_t nbOfCompo(self->getNumberOfComponents());
         INTERP_KERNEL::AutoPtr<double> tmp(new double[2*nbOfCompo]);
         self->getMinMaxPerComponent(tmp);
-        PyObject *ret=convertDblArrToPyListOfTuple<double>(tmp,2,nbOfCompo);
+        PyObject *ret=convertDblArrToPyListOfTuple<double>(tmp,2,ToIdType(nbOfCompo));
         return ret;
       }
       
@@ -1460,7 +1462,7 @@ typedef DataArrayInt64 DataArrayIdType;
         std::size_t nbOfCompo(self->getNumberOfComponents());
         INTERP_KERNEL::AutoPtr<double> tmp(new double[nbOfCompo]);
         self->normMaxPerComponent(tmp);
-        return convertDblArrToPyList<double>(tmp,nbOfCompo);
+        return convertDblArrToPyList<double>(tmp,ToIdType(nbOfCompo));
       }
 
       PyObject *accumulate() const
@@ -1468,7 +1470,7 @@ typedef DataArrayInt64 DataArrayIdType;
         std::size_t sz=self->getNumberOfComponents();
         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
         self->accumulate(tmp);
-        return convertDblArrToPyList<double>(tmp,sz);
+        return convertDblArrToPyList<double>(tmp,ToIdType(sz));
       }
 
       DataArrayDouble *accumulatePerChunck(PyObject *indexArr) const
@@ -1496,8 +1498,9 @@ typedef DataArrayInt64 DataArrayIdType;
         DataArrayDoubleTuple *aa;
         std::vector<double> bb;
         mcIdType sw;
-        mcIdType tupleId=-1,nbOfCompo=self->getNumberOfComponents();
-        const double *pt=convertObjToPossibleCpp5_Safe(tuple,sw,val,a,aa,bb,"Python wrap of DataArrayDouble::distanceToTuple",1,nbOfCompo,true);
+        mcIdType tupleId=-1;
+        std::size_t nbOfCompo=self->getNumberOfComponents();
+        const double *pt=convertObjToPossibleCpp5_Safe(tuple,sw,val,a,aa,bb,"Python wrap of DataArrayDouble::distanceToTuple",1,(int)nbOfCompo,true);
         //
         double ret0=self->distanceToTuple(pt,pt+nbOfCompo,tupleId);
         PyObject *ret=PyTuple_New(2);
@@ -1528,7 +1531,7 @@ typedef DataArrayInt64 DataArrayIdType;
         std::size_t sz=self->getNumberOfComponents();
         INTERP_KERNEL::AutoPtr<double> tmp=new double[sz];
         self->getTuple(tupleId,tmp);
-        return convertDblArrToPyList<double>(tmp,sz);
+        return convertDblArrToPyList<double>(tmp,ToIdType(sz));
       }
 
       static DataArrayDouble *Aggregate(PyObject *li)
@@ -1552,9 +1555,10 @@ typedef DataArrayInt64 DataArrayIdType;
         DataArrayDoubleTuple *aa;
         std::vector<double> bb;
         mcIdType sw;
-        mcIdType nbComp=self->getNumberOfComponents(),nbTuples=-1;
+        std::size_t nbComp=self->getNumberOfComponents();
+        mcIdType nbTuples=-1;
         const char msg[]="Python wrap of DataArrayDouble::computeTupleIdsNearTuples : ";
-        const double *pos=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,msg,nbComp,true,nbTuples);
+        const double *pos=convertObjToPossibleCpp5_Safe2(pt,sw,val,a,aa,bb,msg,(int)nbComp,true,nbTuples);
         MCAuto<DataArrayDouble> inpu=DataArrayDouble::New(); inpu->useArray(pos,false,DeallocType::CPP_DEALLOC,nbTuples,nbComp);
         DataArrayIdType *c=0,*cI=0;
         self->computeTupleIdsNearTuples(inpu,eps,c,cI);
@@ -2154,7 +2158,7 @@ typedef DataArrayInt64 DataArrayIdType;
         std::pair<mcIdType, std::pair<mcIdType,mcIdType> > slic;
         MEDCoupling::DataArrayIdType *daIntTyypp=0;
         const double *pt=self->getConstPointer();
-        mcIdType nbc=self->getNumberOfCompo();
+        mcIdType nbc=ToIdType(self->getNumberOfCompo());
         convertIntStarOrSliceLikePyObjToCppWithNegIntInterp(obj,nbc,sw,singleVal,multiVal,slic,daIntTyypp);
         switch(sw)
           {
@@ -2218,7 +2222,7 @@ typedef DataArrayInt64 DataArrayIdType;
         double singleValV;
         std::vector<double> multiValV;
         MEDCoupling::DataArrayDoubleTuple *daIntTyyppV=0;
-        mcIdType nbc=self->getNumberOfCompo();
+        mcIdType nbc=ToIdType(self->getNumberOfCompo());
         convertDoubleStarLikePyObjToCpp(value,sw1,singleValV,multiValV,daIntTyyppV);
         mcIdType singleVal;
         std::vector<mcIdType> multiVal;
@@ -2384,7 +2388,7 @@ typedef DataArrayInt64 DataArrayIdType;
     void fillWithValue(char val);
     std::string repr() const;
     std::string reprZip() const;
-    DataArrayIdType *convertToIntArr() const;
+    DataArrayInt *convertToIntArr() const;
     DataArrayChar *renumber(const mcIdType *old2New) const;
     DataArrayChar *renumberR(const mcIdType *new2Old) const;
     DataArrayChar *renumberAndReduce(const mcIdType *old2NewBg, mcIdType newNbOfTuple) const;
@@ -2564,14 +2568,14 @@ typedef DataArrayInt64 DataArrayIdType;
               {
                 if(PyInt_Check(nbOfTuples))
                   {
-                    mcIdType nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
+                    mcIdType nbOfTuples1=ToIdType(PyInt_AS_LONG(nbOfTuples));
                     if(nbOfTuples1<0)
                       throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive set of allocated memory !");
                     if(nbOfComp)
                       {
                         if(PyInt_Check(nbOfComp))
                           {//DataArrayByte.New([1,3,4,5],2,2)
-                            mcIdType nbOfCompo=PyInt_AS_LONG(nbOfComp);
+                            mcIdType nbOfCompo=ToIdType(PyInt_AS_LONG(nbOfComp));
                             if(nbOfCompo<0)
                               throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive number of components !");
                             MCAuto<DataArrayByte> ret=DataArrayByte::New();
@@ -2605,7 +2609,7 @@ typedef DataArrayInt64 DataArrayIdType;
           }
         else if(PyInt_Check(elt0))
           {
-            mcIdType nbOfTuples1=PyInt_AS_LONG(elt0);
+            mcIdType nbOfTuples1=ToIdType(PyInt_AS_LONG(elt0));
             if(nbOfTuples1<0)
               throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive set of allocated memory !");
             if(nbOfTuples)
@@ -2614,7 +2618,7 @@ typedef DataArrayInt64 DataArrayIdType;
                   {
                     if(PyInt_Check(nbOfTuples))
                       {//DataArrayByte.New(5,2)
-                        mcIdType nbOfCompo=PyInt_AS_LONG(nbOfTuples);
+                        mcIdType nbOfCompo=ToIdType(PyInt_AS_LONG(nbOfTuples));
                         if(nbOfCompo<0)
                           throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive number of components !");
                         MCAuto<DataArrayByte> ret=DataArrayByte::New();
@@ -2684,9 +2688,9 @@ typedef DataArrayInt64 DataArrayIdType;
       PyObject *toStrList() const
       {
         const char *vals=self->getConstPointer();
-        mcIdType nbOfComp=self->getNumberOfComponents();
+        std::size_t nbOfComp=self->getNumberOfComponents();
         mcIdType nbOfTuples=self->getNumberOfTuples();
-        return convertCharArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
+        return convertCharArrToPyListOfTuple(vals,(int)nbOfComp,nbOfTuples);
       }
    
       bool presenceOfTuple(PyObject *tupl) const
@@ -2741,11 +2745,11 @@ typedef DataArrayInt64 DataArrayIdType;
 
       PyObject *getTuple(mcIdType tupleId)
       {
-        mcIdType sz=self->getNumberOfComponents();
+        std::size_t sz=self->getNumberOfComponents();
         INTERP_KERNEL::AutoPtr<char> tmp=new char[sz];
         self->getTuple(tupleId,tmp);
         PyObject *ret=PyTuple_New(sz);
-        for(mcIdType i=0;i<sz;i++) PyTuple_SetItem(ret,i,PyInt_FromLong((mcIdType)tmp[i]));
+        for(std::size_t i=0;i<sz;i++) PyTuple_SetItem(ret,i,PyInt_FromLong((mcIdType)tmp[i]));
         return ret;
       }
 
@@ -2771,14 +2775,14 @@ typedef DataArrayInt64 DataArrayIdType;
 
       mcIdType index(PyObject *obj) const
       {
-        mcIdType nbOfCompo=self->getNumberOfComponents();
+        std::size_t nbOfCompo=self->getNumberOfComponents();
         switch(nbOfCompo)
           {
           case 1:
             {
               if(PyInt_Check(obj))
                 {
-                  mcIdType val=(mcIdType)PyInt_AS_LONG(obj);
+                  char val=(char)PyInt_AS_LONG(obj);
                   return self->findIdFirstEqual(val);
                 }
               else
@@ -2791,7 +2795,7 @@ typedef DataArrayInt64 DataArrayIdType;
 
       bool __contains__(PyObject *obj) const
       {
-        mcIdType nbOfCompo=self->getNumberOfComponents();
+        std::size_t nbOfCompo=self->getNumberOfComponents();
         switch(nbOfCompo)
           {
           case 0:
@@ -2800,7 +2804,7 @@ typedef DataArrayInt64 DataArrayIdType;
             {
               if(PyInt_Check(obj))
                 {
-                  mcIdType val=(mcIdType)PyInt_AS_LONG(obj);
+                  char val=(char)PyInt_AS_LONG(obj);
                   return self->presenceOfValue(val);
                 }
               else
@@ -2822,19 +2826,21 @@ typedef DataArrayInt64 DataArrayIdType;
       {
         self->checkAllocated();
         const char msg[]="Unexpected situation in __setitem__ !";
-        mcIdType nbOfTuples(self->getNumberOfTuples()),nbOfComponents(self->getNumberOfComponents());
+        mcIdType nbOfTuples(self->getNumberOfTuples());
+        int nbOfComponents((int)self->getNumberOfComponents());
         mcIdType sw1,sw2;
-        mcIdType i1;
-        std::vector<mcIdType> v1;
+        int int1;
+        std::vector<int> v1;
         DataArrayIdType *d1=0;
-        DataArrayIdTypeTuple *dd1=0;
-        convertIntStarLikePyObjToCpp(value,sw1,i1,v1,d1,dd1);
+        DataArrayIntTuple *dd1=0;
+        convertIntStarLikePyObjToCpp(value,sw1,int1,v1,d1,dd1);
         mcIdType it1,ic1;
         std::vector<mcIdType> vt1,vc1;
         std::pair<mcIdType, std::pair<mcIdType,mcIdType> > pt1,pc1;
         DataArrayIdType *dt1=0,*dc1=0;
         convertObjToPossibleCpp3(obj,nbOfTuples,nbOfComponents,sw2,it1,ic1,vt1,vc1,pt1,pc1,dt1,dc1);
         MCAuto<DataArrayIdType> tmp;
+        char i1 = (char)int1;
         switch(sw2)
           {
           case 1:
@@ -3095,14 +3101,14 @@ typedef DataArrayInt64 DataArrayIdType;
               {
                 if(PyInt_Check(nbOfTuples))
                   {
-                    mcIdType nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
+                    mcIdType nbOfTuples1=ToIdType(PyInt_AS_LONG(nbOfTuples));
                     if(nbOfTuples1<0)
                       throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive set of allocated memory !");
                     if(nbOfComp)
                       {
                         if(PyInt_Check(nbOfComp))
                           {//DataArrayAsciiChar.New([1,3,4,5],2,2)
-                            mcIdType nbOfCompo=PyInt_AS_LONG(nbOfComp);
+                            mcIdType nbOfCompo=ToIdType(PyInt_AS_LONG(nbOfComp));
                             if(nbOfCompo<0)
                               throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive number of components !");
                             MCAuto<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
@@ -3168,7 +3174,7 @@ typedef DataArrayInt64 DataArrayIdType;
           }
         else if(PyInt_Check(elt0))
           {
-            mcIdType nbOfTuples1=PyInt_AS_LONG(elt0);
+            mcIdType nbOfTuples1=ToIdType(PyInt_AS_LONG(elt0));
             if(nbOfTuples1<0)
               throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive set of allocated memory !");
             if(nbOfTuples)
@@ -3177,7 +3183,7 @@ typedef DataArrayInt64 DataArrayIdType;
                   {
                     if(PyInt_Check(nbOfTuples))
                       {//DataArrayAsciiChar.New(5,2)
-                        mcIdType nbOfCompo=PyInt_AS_LONG(nbOfTuples);
+                        mcIdType nbOfCompo=ToIdType(PyInt_AS_LONG(nbOfTuples));
                         if(nbOfCompo<0)
                           throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive number of components !");
                         MCAuto<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
@@ -3240,9 +3246,9 @@ typedef DataArrayInt64 DataArrayIdType;
       PyObject *toStrList() const
       {
         const char *vals=self->getConstPointer();
-        mcIdType nbOfComp=self->getNumberOfComponents();
+        std::size_t nbOfComp=self->getNumberOfComponents();
         mcIdType nbOfTuples=self->getNumberOfTuples();
-        return convertCharArrToPyListOfTuple(vals,nbOfComp,nbOfTuples);
+        return convertCharArrToPyListOfTuple(vals,(int)nbOfComp,nbOfTuples);
       }
 
       bool presenceOfTuple(PyObject *tupl) const
@@ -3357,7 +3363,7 @@ typedef DataArrayInt64 DataArrayIdType;
    
       PyObject *getTuple(mcIdType tupleId) const
       {
-        mcIdType sz=self->getNumberOfComponents();
+        std::size_t sz=self->getNumberOfComponents();
         INTERP_KERNEL::AutoPtr<char> tmp=new char[sz+1]; tmp[sz]='\0';
         self->getTuple(tupleId,tmp);
         return PyString_FromString(tmp);
@@ -3387,7 +3393,7 @@ typedef DataArrayInt64 DataArrayIdType;
 
       mcIdType index(PyObject *obj) const
       {
-        mcIdType nbOfCompo=self->getNumberOfComponents();
+        std::size_t nbOfCompo=self->getNumberOfComponents();
         switch(nbOfCompo)
           {
           case 1:
@@ -3422,7 +3428,7 @@ typedef DataArrayInt64 DataArrayIdType;
 
       bool __contains__(PyObject *obj) const
       {
-        mcIdType nbOfCompo=self->getNumberOfComponents();
+        std::size_t nbOfCompo=self->getNumberOfComponents();
         switch(nbOfCompo)
           {
           case 0:
@@ -3486,7 +3492,7 @@ typedef DataArrayInt64 DataArrayIdType;
         std::vector<mcIdType> stdvecTyyppArr;
         std::pair<mcIdType, std::pair<mcIdType,mcIdType> > sTyyppArr;
         MEDCoupling::DataArrayIdType *daIntTyypp=0;
-        mcIdType nbOfCompo=self->getNumberOfComponents();
+        mcIdType nbOfCompo=ToIdType(self->getNumberOfComponents());
         mcIdType nbOfTuples=self->getNumberOfTuples();
         convertIntStarOrSliceLikePyObjToCppWithNegIntInterp(obj,nbOfTuples,sw1,iTypppArr,stdvecTyyppArr,sTyyppArr,daIntTyypp);
         mcIdType sw2;
index a76432a4a1e8167d838b4a6ce45c2fa4241c3fa7..b35f9ecdb94b9d00cc8ed7864e12ff1d673b97ef 100644 (file)
@@ -46,10 +46,10 @@ class MEDCouplingNumPyTest(unittest.TestCase):
         a=a.cumsum(dtype=int32)
         a=array(a,dtype=int64) ; a=array(a,dtype=int32)
         self.assertEqual(getrefcount(a),2)
-        d=DataArrayInt(a)
+        d=DataArrayInt32(a)
         d[:]=2
         #
-        e=DataArrayInt(sz) ; e.fillWithValue(2)
+        e=DataArrayInt32(sz) ; e.fillWithValue(2)
         self.assertTrue(d.isEqual(e))
         #
         a[:]=4 ; e.fillWithValue(4)
@@ -66,9 +66,9 @@ class MEDCouplingNumPyTest(unittest.TestCase):
         self.assertEqual(getrefcount(a),3)
         self.assertEqual(getrefcount(b),2)
         b[:]=5
-        d=DataArrayInt(b)
+        d=DataArrayInt32(b)
         #
-        e=DataArrayInt(sz*2) ; e.fillWithValue(5)
+        e=DataArrayInt32(sz*2) ; e.fillWithValue(5)
         self.assertTrue(d.isEqual(e))
         pass
     
@@ -81,16 +81,16 @@ class MEDCouplingNumPyTest(unittest.TestCase):
         c=a.reshape(2,sz)
         b[:]=6
         b[7:17]=7
-        d=DataArrayInt(b)
-        self.assertTrue(d.isEqual(DataArrayInt([6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,6,6,6])))
+        d=DataArrayInt32(b)
+        self.assertTrue(d.isEqual(DataArrayInt32([6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,6,6,6])))
         #
         a=zeros((10,2),dtype=int32)
         b=a.T
         c=b.view()
         a.shape=20
         a[3:]=10.
-        d=DataArrayInt(a)
-        self.assertTrue(d.isEqual(DataArrayInt([0,0,0,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10])))
+        d=DataArrayInt32(a)
+        self.assertTrue(d.isEqual(DataArrayInt32([0,0,0,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10])))
         pass
     
     @unittest.skipUnless(MEDCouplingHasNumPyBindings(),"requires numpy")
@@ -104,7 +104,7 @@ class MEDCouplingNumPyTest(unittest.TestCase):
     def test5(self):
         a=arange(20,dtype=int32)
         self.assertEqual(weakref.getweakrefcount(a),0)
-        d=DataArrayInt(a)
+        d=DataArrayInt32(a)
         self.assertEqual(weakref.getweakrefcount(a),1)
         self.assertTrue(not a.flags["OWNDATA"])
         self.assertTrue(d.isIota(20))
@@ -116,14 +116,14 @@ class MEDCouplingNumPyTest(unittest.TestCase):
         gc.collect()
         self.assertTrue(a.flags["OWNDATA"])
         a[:]=4 # a can be used has usual
-        self.assertTrue(DataArrayInt(a).isUniform(4))
+        self.assertTrue(DataArrayInt32(a).isUniform(4))
         pass
     
     @unittest.skipUnless(MEDCouplingHasNumPyBindings(),"requires numpy")
     def test6(self):
         a=arange(20,dtype=int32)
-        d=DataArrayInt(a) # d owns data of a
-        e=DataArrayInt(a) # a not owned -> e only an access to chunk of a 
+        d=DataArrayInt32(a) # d owns data of a
+        e=DataArrayInt32(a) # a not owned -> e only an access to chunk of a 
         self.assertTrue(d.isIota(d.getNumberOfTuples()))
         self.assertTrue(e.isIota(e.getNumberOfTuples()))
         a[:]=6
@@ -142,9 +142,9 @@ class MEDCouplingNumPyTest(unittest.TestCase):
         a=array(0,dtype=int32) ; a.resize(10,2)
         b=a.reshape(20)
         c=a.reshape(2,10)
-        d=DataArrayInt(b) # d owns data of a
-        e=DataArrayInt(b) # a not owned -> e only an access to chunk of a
-        f=DataArrayInt(b) # a not owned -> e only an access to chunk of a
+        d=DataArrayInt32(b) # d owns data of a
+        e=DataArrayInt32(b) # a not owned -> e only an access to chunk of a
+        f=DataArrayInt32(b) # a not owned -> e only an access to chunk of a
         del d # d removed -> a ownes again data
         ##@@ Ensure a pass of the garbage collector so that the de-allocator of d is called 
         import gc
@@ -177,11 +177,11 @@ class MEDCouplingNumPyTest(unittest.TestCase):
     def test8(self):
         a=arange(20,dtype=int32)
         self.assertTrue(a.flags["OWNDATA"])
-        d=DataArrayInt(a) # d owns data of a
+        d=DataArrayInt32(a) # d owns data of a
         self.assertTrue(not a.flags["OWNDATA"])
         d.pushBackSilent(20)# d pushBack so release of chunk of data -> a becomes owner of its data again
         self.assertTrue(a.flags["OWNDATA"])
-        self.assertTrue(d.isEqual(DataArrayInt([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20])))
+        self.assertTrue(d.isEqual(DataArrayInt32([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20])))
         self.assertEqual(a.tolist(),[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19])
         pass
 
@@ -394,13 +394,13 @@ class MEDCouplingNumPyTest(unittest.TestCase):
         a.resize(sz//2,2)
         a[:]=4
         self.assertEqual(getrefcount(a),2)
-        d=DataArrayInt(a)
+        d=DataArrayInt32(a)
         self.assertEqual(10,d.getNumberOfTuples())
         self.assertEqual(2,d.getNumberOfComponents())
         self.assertEqual(sz,d.getNbOfElems())
-        self.assertTrue(d.isEqual(DataArrayInt([(4,4),(4,4),(4,4),(4,4),(4,4),(4,4),(4,4),(4,4),(4,4),(4,4)])))
+        self.assertTrue(d.isEqual(DataArrayInt32([(4,4),(4,4),(4,4),(4,4),(4,4),(4,4),(4,4),(4,4),(4,4),(4,4)])))
         a[:]=7
-        self.assertTrue(d.isEqual(DataArrayInt([(7,7),(7,7),(7,7),(7,7),(7,7),(7,7),(7,7),(7,7),(7,7),(7,7)])))
+        self.assertTrue(d.isEqual(DataArrayInt32([(7,7),(7,7),(7,7),(7,7),(7,7),(7,7),(7,7),(7,7),(7,7),(7,7)])))
         #
         b=a.reshape((2,5,2))
         self.assertRaises(InterpKernelException,DataArrayInt.New,b) # b has not dimension in [0,1] !
@@ -430,7 +430,7 @@ class MEDCouplingNumPyTest(unittest.TestCase):
         #tests that only DataArray*(npArray) constructor is available
         a=array(0,dtype=int32)
         a.resize(20)
-        DataArrayInt(a)
+        DataArrayInt32(a)
         self.assertRaises(InterpKernelException,DataArrayInt.New,a,20)
         self.assertRaises(InterpKernelException,DataArrayInt.New,a,20,1)
         a=array(0,dtype=float64)
@@ -564,9 +564,9 @@ class MEDCouplingNumPyTest(unittest.TestCase):
     @unittest.skipUnless(MEDCouplingHasNumPyBindings(),"requires numpy")
     def test25(self):
         a=arange(10,dtype=int32)
-        b=DataArrayInt(a)
-        c=DataArrayInt(a)
-        d=DataArrayInt(a)
+        b=DataArrayInt32(a)
+        c=DataArrayInt32(a)
+        d=DataArrayInt32(a)
         self.assertTrue(b.isIota(10))
         self.assertTrue(c.isIota(10))
         self.assertTrue(d.isIota(10))
@@ -584,8 +584,8 @@ class MEDCouplingNumPyTest(unittest.TestCase):
         self.assertTrue(c.isIota(11))
         #
         a=arange(10,dtype=int32)
-        b=DataArrayInt(a)
-        c=DataArrayInt(a)
+        b=DataArrayInt32(a)
+        c=DataArrayInt32(a)
         self.assertTrue(b.isIota(10))
         self.assertTrue(c.isIota(10))
         b.pushBackSilent(10) # c and a,b are dissociated
@@ -644,9 +644,9 @@ class MEDCouplingNumPyTest(unittest.TestCase):
         self.assertEqual(a.ndim,2)
         self.assertEqual(a.size,15)
         self.assertEqual(a.shape,(5,3))
-        self.assertEqual(a.strides,(12,4))
-        self.assertEqual(a.nbytes,60)
-        self.assertEqual(a.itemsize,4)
+        self.assertEqual(a.strides,(3*MEDCouplingSizeOfIDs()//8,MEDCouplingSizeOfIDs()//8))
+        self.assertEqual(a.nbytes,15*MEDCouplingSizeOfIDs()//8)
+        self.assertEqual(a.itemsize,MEDCouplingSizeOfIDs()//8)
         self.assertEqual(a.tolist(),[[0,1,2],[3,4,5],[6,7,8],[9,10,11],[12,13,14]])
         #
         d2=d.convertToDblArr()
index e5f6bb732227071af260d0bf08a921b354555900..c0c633e1ae7e6d78d25e37022e3a0ed639275155 100644 (file)
@@ -347,7 +347,7 @@ class MEDCouplingPickleTest(unittest.TestCase):
         f.setName("aname")
         a=f.getArray()
         b=a[:] ; b.iota(7000)
-        f.setArray(DataArrayInt.Meld(a,b))
+        f.setArray(DataArrayInt32.Meld(a,b))
         f.getArray().setInfoOnComponents(["u1","vv2"])
         f.checkConsistencyLight();
         #
index 6c4e27c31d8c3fa1feb230e751aa0f1abff169c1..4c0c0188bf3a7e6305acbdafcf823f9c6dbe74e8 100644 (file)
@@ -97,14 +97,15 @@ namespace MEDCoupling
                  PyObject *indptr(PyObject_GetAttrString(m,"indptr"));
                  PyObject *indices(PyObject_GetAttrString(m,"indices"));
                  PyObject *data(PyObject_GetAttrString(m,"data"));
-                 MCAuto<DataArrayIdType> indptrPtr, indicesPtr;
-#if defined(MEDCOUPLING_USE_64BIT_IDS)
-                 indptrPtr = MEDCoupling_DataArrayInt64_New__SWIG_1(indptr,NULL,NULL);
-                 indicesPtr = MEDCoupling_DataArrayInt64_New__SWIG_1(indices,NULL,NULL);
-#else
+                 MCAuto<DataArrayInt32> indptrPtr, indicesPtr;
+                 // csr_matrix.indptr and csr_matrix.indices are always dtype==int32
+// #if defined(MEDCOUPLING_USE_64BIT_IDS)
+//                  indptrPtr = MEDCoupling_DataArrayInt64_New__SWIG_1(indptr,NULL,NULL);
+//                  indicesPtr = MEDCoupling_DataArrayInt64_New__SWIG_1(indices,NULL,NULL);
+// #else
                  indptrPtr = MEDCoupling_DataArrayInt32_New__SWIG_1(indptr,NULL,NULL);
                  indicesPtr = MEDCoupling_DataArrayInt32_New__SWIG_1(indices,NULL,NULL);
-#endif
+//#endif
                  MCAuto<DataArrayDouble> dataPtr(MEDCoupling_DataArrayDouble_New__SWIG_1(data,NULL,NULL));
                  convertCSR_MCDataToVectMapIntDouble(indptrPtr,indicesPtr,dataPtr,mCpp);
                  Py_XDECREF(data); Py_XDECREF(indptr); Py_XDECREF(indices);
index e6aedde615fbfcc1cbbc554f4e30aeff62ebd260..58054d5192bf4d97490c27f447c95b37b7042a08 100644 (file)
@@ -806,8 +806,8 @@ class MEDCouplingBasicsTest(unittest.TestCase):
         vals*=1e-5
         eps0=DataArrayDouble(m0.data)-vals ; eps0.abs()
         self.assertTrue(eps0.findIdsInRange(1e-17,1e300).empty())
-        self.assertTrue(DataArrayInt(m0.indices).isEqual(DataArrayInt([0,1,3,1,4,5,4,6,7,6,8,9,8,10,11,10,12,13,12,14,15,14,16,17,16,18,19,18,20,21,20,22,23,22,24,25,24,26,27,0,2,3,1,3,5,4,5,7,6,7,9,8,9,11,10,11,13,12,13,15,14,15,17,16,17,19,18,19,21,20,21,23,22,23,25,24,25,27,0,2,3,1,3,5,4,5,7,6,7,9,8,9,11,10,11,13,12,13,15,14,15,17,16,17,19,18,19,21,20,21,23,22,23,25,24,25,27,0,2,3,1,3,5,4,5,7,6,7,9,8,9,11,10,11,13,12,13,15,14,15,17,16,17,19,18,19,21,20,21,23,22,23,25,24,25,27,0,2,3,1,3,5,4,5,7,6,7,9,8,9,11,10,11,13,12,13,15,14,15,17,16,17,19,18,19,21,20,21,23,22,23,25,24,25,27,0,1,3,1,4,5,4,6,7,6,8,9,8,10,11,10,12,13,12,14,15,14,16,17,16,18,19,18,20,21,20,22,23,22,24,25,24,26,27,0,1,3,1,4,5,4,6,7,6,8,9,8,10,11,10,12,13,12,14,15,14,16,17,16,18,19,18,20,21,20,22,23,22,24,25,24,26,27,0,1,3,1,4,5,4,6,7,6,8,9,8,10,11,10,12,13,12,14,15,14,16,17,16,18,19,18,20,21,20,22,23,22,24,25,24,26,27])))
-        self.assertTrue(DataArrayInt(m0.indptr).isEqual(DataArrayInt([0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57,60,63,66,69,72,75,78,81,84,87,90,93,96,99,102,105,108,111,114,117,120,123,126,129,132,135,138,141,144,147,150,153,156,159,162,165,168,171,174,177,180,183,186,189,192,195,198,201,204,207,210,213,216,219,222,225,228,231,234,237,240,243,246,249,252,255,258,261,264,267,270,273,276,279,282,285,288,291,294,297,300,303,306,309,312])))
+        self.assertTrue(DataArrayInt32(m0.indices).isEqual(DataArrayInt32([0,1,3,1,4,5,4,6,7,6,8,9,8,10,11,10,12,13,12,14,15,14,16,17,16,18,19,18,20,21,20,22,23,22,24,25,24,26,27,0,2,3,1,3,5,4,5,7,6,7,9,8,9,11,10,11,13,12,13,15,14,15,17,16,17,19,18,19,21,20,21,23,22,23,25,24,25,27,0,2,3,1,3,5,4,5,7,6,7,9,8,9,11,10,11,13,12,13,15,14,15,17,16,17,19,18,19,21,20,21,23,22,23,25,24,25,27,0,2,3,1,3,5,4,5,7,6,7,9,8,9,11,10,11,13,12,13,15,14,15,17,16,17,19,18,19,21,20,21,23,22,23,25,24,25,27,0,2,3,1,3,5,4,5,7,6,7,9,8,9,11,10,11,13,12,13,15,14,15,17,16,17,19,18,19,21,20,21,23,22,23,25,24,25,27,0,1,3,1,4,5,4,6,7,6,8,9,8,10,11,10,12,13,12,14,15,14,16,17,16,18,19,18,20,21,20,22,23,22,24,25,24,26,27,0,1,3,1,4,5,4,6,7,6,8,9,8,10,11,10,12,13,12,14,15,14,16,17,16,18,19,18,20,21,20,22,23,22,24,25,24,26,27,0,1,3,1,4,5,4,6,7,6,8,9,8,10,11,10,12,13,12,14,15,14,16,17,16,18,19,18,20,21,20,22,23,22,24,25,24,26,27])))
+        self.assertTrue(DataArrayInt32(m0.indptr).isEqual(DataArrayInt32([0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57,60,63,66,69,72,75,78,81,84,87,90,93,96,99,102,105,108,111,114,117,120,123,126,129,132,135,138,141,144,147,150,153,156,159,162,165,168,171,174,177,180,183,186,189,192,195,198,201,204,207,210,213,216,219,222,225,228,231,234,237,240,243,246,249,252,255,258,261,264,267,270,273,276,279,282,285,288,291,294,297,300,303,306,309,312])))
         #
         rem2=MEDCouplingRemapper() ; rem2.setIntersectionType(Barycentric)
         rem2.prepare(b,a,"P0P1")
@@ -839,7 +839,7 @@ class MEDCouplingBasicsTest(unittest.TestCase):
         rem.setMinDotBtwPlane3DSurfIntersect(0.99)# this line is important it is to tell to remapper to select only cells with very close orientation
         rem.prepare(skinAndNonConformCells,skinAndNonConformCells,"P0P0")
         mat=rem.getCrudeCSRMatrix()
-        indptr=DataArrayInt(mat.indptr)
+        indptr=DataArrayInt32(mat.indptr) #not depend on MEDCouplingUse64BitIDs()
         indptr2=indptr.deltaShiftIndex()
         cellIdsOfNonConformCells=indptr2.findIdsNotEqual(1)
         cellIdsOfSkin=indptr2.findIdsEqual(1)
index e38e5c7ffa956c753a13a092084f0dbbe73e48d5..080def392e194fdb24ac8161717d7251b2596e22 100644 (file)
@@ -523,7 +523,7 @@ typename MEDCoupling::Traits<T>::FieldType *fieldT__getitem__(const MEDCoupling:
       if(!self->getArray())
         throw INTERP_KERNEL::Exception("MEDCouplingFieldDouble::__getitem__ : no array set on field to deduce number of components !");
       try
-        { convertIntStarOrSliceLikePyObjToCpp(elt1,self->getArray()->getNumberOfComponents(),sw,singleVal,multiVal,slic,daIntTyypp); }
+      { convertIntStarOrSliceLikePyObjToCpp(elt1,ToIdType(self->getArray()->getNumberOfComponents()),sw,singleVal,multiVal,slic,daIntTyypp); }
       catch(INTERP_KERNEL::Exception& e)
         { std::ostringstream oss; oss << "MEDCouplingFieldDouble::__getitem__ : invalid type in 2nd parameter (compo) !" << e.what(); throw INTERP_KERNEL::Exception(oss.str().c_str()); }
       typename MEDCoupling::MCAuto< typename MEDCoupling::Traits<T>::FieldType > ret0(fieldT_buildSubPart<T>(self,elt0));
@@ -576,10 +576,10 @@ PyObject *field_getTinySerializationInformation(const FIELDT *self)
   PyObject *ret(PyTuple_New(3));
   PyTuple_SetItem(ret,0,convertDblArrToPyList2(a0));
   PyTuple_SetItem(ret,1,convertIntArrToPyList2(a1));
-  mcIdType sz(a2.size());
+  std::size_t sz(a2.size());
   PyObject *ret2(PyList_New(sz));
   {
-    for(mcIdType i=0;i<sz;i++)
+    for(std::size_t i=0;i<sz;i++)
       PyList_SetItem(ret2,i,PyString_FromString(a2[i].c_str()));
   }
   PyTuple_SetItem(ret,2,ret2);
@@ -646,7 +646,7 @@ void field__setstate__(typename MEDCoupling::Traits<T>::FieldType *self, PyObjec
   static const char MSG[]="MEDCouplingFieldDouble.__setstate__ : expected input is a tuple of size 3 !";
   if(!PyTuple_Check(inp))
     throw INTERP_KERNEL::Exception(MSG);
-  mcIdType sz(PyTuple_Size(inp));
+  std::size_t sz(PyTuple_Size(inp));
   if(sz!=3)
     throw INTERP_KERNEL::Exception(MSG);
   // mesh
@@ -713,7 +713,7 @@ PyObject *Mesh_getCellsContainingPointsLike(PyObject *p, double eps, const MEDCo
         throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Not null DataArrayDouble instance expected !");
       da2->checkAllocated();
       mcIdType size=da2->getNumberOfTuples();
-      mcIdType nbOfCompo=da2->getNumberOfComponents();
+      mcIdType nbOfCompo=ToIdType(da2->getNumberOfComponents());
       if(nbOfCompo!=spaceDim)
         {
           throw INTERP_KERNEL::Exception("MEDCouplingMesh::getCellsContainingPoints : Invalid DataArrayDouble nb of components ! Expected same as self.getSpaceDimension() !");
index 6ad489506ebd66f9c51068333cb1b4fb22397c85..cdca7ec5f7c7463418eac0d50b6905150f6fa998 100644 (file)
@@ -35,7 +35,7 @@ else:
 # NumPy is an optional pre-requisite!
 assert(MEDCoupling.MEDCouplingHasNumPyBindings())
 a=numpy.arange(20,dtype=numpy.int32)
-d=DataArrayInt(a) # d owns data of a
-e=DataArrayInt(a) # a not owned -> e only an access to chunk of a
+d=DataArrayInt32(a) # d owns data of a
+e=DataArrayInt32(a) # a not owned -> e only an access to chunk of a
 a1=d.toNumPyArray()
 #! [UG_DataArrayNumpy_0]