From: emv Date: Fri, 18 Oct 2019 11:35:24 +0000 (+0300) Subject: Using size_t instead of int (where possible) in INTERP_KERNEL. X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=7541f58922ee9b4ec4f34c9b2dfa3aa05e68c692;p=tools%2Fmedcoupling.git Using size_t instead of int (where possible) in INTERP_KERNEL. --- diff --git a/src/INTERP_KERNEL/DirectedBoundingBox.cxx b/src/INTERP_KERNEL/DirectedBoundingBox.cxx index 8c06642f9..3fdf8ce06 100644 --- a/src/INTERP_KERNEL/DirectedBoundingBox.cxx +++ b/src/INTERP_KERNEL/DirectedBoundingBox.cxx @@ -617,7 +617,7 @@ namespace INTERP_KERNEL getCorners( corners, &cornerBox->_minmax[0] ); double globCorner[3]; - for ( int iC = 0, nC = corners.size()/_dim; iC < nC; ++iC) + for ( std::size_t iC = 0, nC = corners.size()/_dim; iC < nC; ++iC) { cornerBox->fromLocalCS( &corners[iC*_dim], globCorner ); mmBox.addPointToBox( globCorner ); @@ -649,7 +649,7 @@ namespace INTERP_KERNEL getCorners( cornersOther, box ); DirectedBoundingBox mmBox((double*)0,0,_dim); //!< empty box with CS == this->_axes mmBox._axes = this->_axes; - for ( int iC = 0, nC = cornersOther.size()/_dim; iC < nC; ++iC) + for ( std::size_t iC = 0, nC = cornersOther.size()/_dim; iC < nC; ++iC) mmBox.addPointToBox( &cornersOther[iC*_dim] ); if ( isMinMaxOut( &mmBox._minmax[0], &this->_minmax[0], _dim )) @@ -662,7 +662,7 @@ namespace INTERP_KERNEL getCorners( cornersThis, &_minmax[0] ); DirectedBoundingBox mmBox((double*)0,0,_dim); //!< initailized _minmax double globCorner[3]; - for ( int iC = 0, nC = cornersThis.size()/_dim; iC < nC; ++iC) + for ( std::size_t iC = 0, nC = cornersThis.size()/_dim; iC < nC; ++iC) { fromLocalCS( &cornersThis[iC*_dim], globCorner ); for ( int i = 0; i < (int)_dim; ++i ) diff --git a/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DAbstractEdge.cxx b/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DAbstractEdge.cxx index 2c5551988..bd12d34fd 100644 --- a/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DAbstractEdge.cxx +++ b/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DAbstractEdge.cxx @@ -107,11 +107,11 @@ void IteratorOnComposedEdge::insertElemEdges(ComposedEdge *elems, bool changeMyS *_deep_it=*iter; _deep_it++; iter++; - int sizeOfMyList=myListToInsert->size(); + std::size_t sizeOfMyList=myListToInsert->size(); _list_handle->insert(_deep_it,iter,myListToInsert->end()); if(!changeMySelf) { - for(int i=0;i::max(); for(int idim=0; idim deque1, std::deque< double > deque2, double epsilon) { - int size1 = deque1.size(); - int size2 = deque2.size(); + std::size_t size1 = deque1.size(); + std::size_t size2 = deque2.size(); bool are_equal = size1 == size2; if(are_equal) - for(int i = 0; i < size1 && are_equal; i++) + for(std::size_t i = 0; i < size1 && are_equal; i++) are_equal = fabs(deque1[i] - deque2[i]) < epsilon; return are_equal; @@ -72,19 +72,19 @@ namespace INTERP_TEST bool checkVectorsEqual(std::vector< double > vect1, std::vector< double > vect2, double epsilon) { - int size1 = vect1.size(); - int size2 = vect2.size(); + std::size_t size1 = vect1.size(); + std::size_t size2 = vect2.size(); bool are_equal = size1 == size2; if(are_equal) - for(int i = 0; i < size1 && are_equal; i++) + for(std::size_t i = 0; i < size1 && are_equal; i++) are_equal = fabs(vect1[i] - vect2[i]) < epsilon; return are_equal; } void dequePrintOut(std::deque< double > deque1) { - for(int i = 0; i< (int)deque1.size(); i++) + for(std::size_t i = 0; i< deque1.size(); i++) { std::cerr << deque1[i] << " "; } @@ -92,7 +92,7 @@ namespace INTERP_TEST } void vectPrintOut(std::vector< double > vect) { - for(int i = 0; i< (int)vect.size(); i++) + for(std::size_t i = 0; i< vect.size(); i++) { std::cerr << vect[i] << " "; }