]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
LOT4: fix -Wconversion in INTERP_KERNEL
authoreap <eap@opencascade.com>
Fri, 6 Dec 2019 12:43:49 +0000 (15:43 +0300)
committereap <eap@opencascade.com>
Fri, 6 Dec 2019 12:43:49 +0000 (15:43 +0300)
14 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

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..ff27642f08826317583cd218e2d04ac40f8fdecb 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-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 FromIdType<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 FromIdType<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..c18c70791f87a69c133102386f082fb938608e4f 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,7 +511,7 @@ 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
@@ -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++)
@@ -629,7 +629,7 @@ void QuadraticPolygon::updateLocOfEdgeFromCrudeDataArray2(const mcIdType *descBg
                     }
                   if(found)
                     {
-                      ElementaryEdge *e=pol1[offset1+(direct1?offset2:nbOfSubEdges1-offset2-1)];
+                      ElementaryEdge *e=pol1[FromIdType<int>(offset1+(direct1?offset2:nbOfSubEdges1-offset2-1))];
                       e->getPtr()->declareOn();
                     }
                 }
index 1fa6079c91513c950894050352db92234632338b..326baa5cf912679453545f082762d55e787fde1c 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();
+  mcIdType 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=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..d7453f5fd9ad51973d39a9c9a54f1ea7ff41f3a4 100644 (file)
@@ -197,17 +197,19 @@ namespace INTERP_KERNEL
           for(mcIdType 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))));
+              mcIdType nbOfNodesOfFace(std::distance(work,std::find(work,nodalConnEnd,-1)));
               for(mcIdType 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);
                   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 = FromIdType<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 = FromIdType<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;