From: eap Date: Fri, 8 Oct 2010 14:50:42 +0000 (+0000) Subject: Preparation of MEDMEM for SALOME 6x X-Git-Tag: V2_MEDMEM_PreparedForV6~3 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=5abcd1c3bec1cf36b1a5487cd861f22d3ed8b647;p=tools%2Fmedcoupling.git Preparation of MEDMEM for SALOME 6x suppress compilation warnings with -Wall -pedantic --- diff --git a/src/INTERP_KERNEL/CurveIntersectorP0P1.txx b/src/INTERP_KERNEL/CurveIntersectorP0P1.txx index c25136b5d..6c71c78ff 100644 --- a/src/INTERP_KERNEL/CurveIntersectorP0P1.txx +++ b/src/INTERP_KERNEL/CurveIntersectorP0P1.txx @@ -60,7 +60,7 @@ namespace INTERP_KERNEL { std::vector segmentsT; BASE_INTERSECTOR::getDualSegments( icellT, BASE_INTERSECTOR::_meshT, segmentsT); - for ( int t = 0; t < segmentsT.size(); ++t ) + for ( unsigned t = 0; t < segmentsT.size(); ++t ) { typename MyMatrix::value_type& resRow = res[ OTT::ind2C( segmentsT[t]._nodeId )]; for(typename std::vector::const_iterator diff --git a/src/INTERP_KERNEL/CurveIntersectorP1P0.txx b/src/INTERP_KERNEL/CurveIntersectorP1P0.txx index bafd3ad9e..375cbe877 100644 --- a/src/INTERP_KERNEL/CurveIntersectorP1P0.txx +++ b/src/INTERP_KERNEL/CurveIntersectorP1P0.txx @@ -69,7 +69,7 @@ namespace INTERP_KERNEL int iS = *iter; BASE_INTERSECTOR::getDualSegments( OTT::ind2C(iS), BASE_INTERSECTOR::_meshS, segmentsS); - for ( int s = 0; s < segmentsS.size(); ++s ) + for ( unsigned s = 0; s < segmentsS.size(); ++s ) { double surf = BASE_INTERSECTOR::intersectSegments(&segmentsS[s]._coords[0], &coordsT[0] + t*SPACEDIM); diff --git a/src/INTERP_KERNEL/CurveIntersectorP1P1.txx b/src/INTERP_KERNEL/CurveIntersectorP1P1.txx index fd43fe7fc..88057acda 100644 --- a/src/INTERP_KERNEL/CurveIntersectorP1P1.txx +++ b/src/INTERP_KERNEL/CurveIntersectorP1P1.txx @@ -54,7 +54,7 @@ namespace INTERP_KERNEL { std::vector segmentsT, segmentsS; BASE_INTERSECTOR::getDualSegments( icellT, BASE_INTERSECTOR::_meshT, segmentsT); - for ( int t = 0; t < segmentsT.size(); ++t ) + for ( unsigned t = 0; t < segmentsT.size(); ++t ) { typename MyMatrix::value_type& resRow = res[ OTT::ind2C( segmentsT[t]._nodeId )]; for(typename std::vector::const_iterator @@ -63,7 +63,7 @@ namespace INTERP_KERNEL int iS = *iter; BASE_INTERSECTOR::getDualSegments( OTT::ind2C(iS), BASE_INTERSECTOR::_meshS, segmentsS); - for ( int s = 0; s < segmentsS.size(); ++s ) + for ( unsigned s = 0; s < segmentsS.size(); ++s ) { double surf = BASE_INTERSECTOR::intersectSegments(&segmentsT[t]._coords[0], &segmentsS[s]._coords[0]); diff --git a/src/INTERP_KERNEL/DirectedBoundingBox.cxx b/src/INTERP_KERNEL/DirectedBoundingBox.cxx index 72b5c5101..311c9d210 100644 --- a/src/INTERP_KERNEL/DirectedBoundingBox.cxx +++ b/src/INTERP_KERNEL/DirectedBoundingBox.cxx @@ -237,9 +237,9 @@ namespace INTERP_KERNEL if ( dim > 1 ) { for ( coord = pts; coord < coordEnd; ) - for ( int i = 0; i < dim; ++i ) + for ( unsigned i = 0; i < dim; ++i ) gc[i] += *coord++; - for ( int j = 0; j < dim; ++j ) + for ( unsigned j = 0; j < dim; ++j ) gc[j] /= numPts; } @@ -309,9 +309,9 @@ namespace INTERP_KERNEL if ( dim > 1 ) { for ( unsigned i = 0; i < numPts; ++i ) - for ( int j = 0; j < dim; ++j ) + for ( unsigned j = 0; j < dim; ++j ) gc[j] += pts[i][j]; - for ( int j = 0; j < dim; ++j ) + for ( unsigned j = 0; j < dim; ++j ) gc[j] /= numPts; } @@ -568,7 +568,7 @@ namespace INTERP_KERNEL const double* minmax) const { int iC, nbCorners = 1; - for ( int i=0;i<_dim;++i ) nbCorners *= 2; + for ( unsigned i=0;i<_dim;++i ) nbCorners *= 2; corners.resize( nbCorners * _dim ); // each coordinate is filled with either min or max, nbSwap is number of corners // after which min and max swap @@ -657,7 +657,7 @@ namespace INTERP_KERNEL for ( int iC = 0, nC = cornersThis.size()/_dim; iC < nC; ++iC) { fromLocalCS( &cornersThis[iC*_dim], globCorner ); - for ( int i = 0; i < _dim; ++i ) + for ( unsigned i = 0; i < _dim; ++i ) { if ( globCorner[i] < mmBox._minmax[i*2] ) mmBox._minmax[i*2] = globCorner[i]; if ( globCorner[i] > mmBox._minmax[i*2+1] ) mmBox._minmax[i*2+1] = globCorner[i]; @@ -710,7 +710,7 @@ namespace INTERP_KERNEL data.insert( data.end(), &_axes[0], &_axes[0] + _axes.size()); data.insert( data.end(), &_minmax[0], &_minmax[0] + _minmax.size()); } - if ( data.size() < dataSize( _dim )) + if ( int(data.size()) < dataSize( _dim )) data.resize( dataSize( _dim ), 0 ); return data; } diff --git a/src/INTERP_KERNEL/DirectedBoundingBox.hxx b/src/INTERP_KERNEL/DirectedBoundingBox.hxx index 93874acdb..8d0b3ce78 100644 --- a/src/INTERP_KERNEL/DirectedBoundingBox.hxx +++ b/src/INTERP_KERNEL/DirectedBoundingBox.hxx @@ -92,7 +92,7 @@ namespace INTERP_KERNEL inline bool DirectedBoundingBox::isLocalOut(const double* pLoc) const { - for ( int i = 0; i < _dim; ++i ) + for ( unsigned i = 0; i < _dim; ++i ) if ( pLoc[i] < _minmax[i*2] || pLoc[i] > _minmax[i*2+1] ) return true; return false; @@ -106,10 +106,10 @@ namespace INTERP_KERNEL inline void DirectedBoundingBox::addPointToBox(const double* coord) { - for ( int i = 0; i < _dim; ++i ) + for ( unsigned i = 0; i < _dim; ++i ) { double c = 0; - for ( int j = 0; j < _dim; ++j ) c += coord[j]*_axes[i*_dim+j]; + for ( unsigned j = 0; j < _dim; ++j ) c += coord[j]*_axes[i*_dim+j]; if ( c < _minmax[i*2] ) _minmax[i*2] = c; if ( c > _minmax[i*2+1] ) _minmax[i*2+1] = c; } diff --git a/src/INTERP_KERNEL/InterpolationUtils.hxx b/src/INTERP_KERNEL/InterpolationUtils.hxx index 2d5ca00df..cf6e283df 100644 --- a/src/INTERP_KERNEL/InterpolationUtils.hxx +++ b/src/INTERP_KERNEL/InterpolationUtils.hxx @@ -208,7 +208,7 @@ namespace INTERP_KERNEL } /*! - * \brief Solve system equation in matrix form using Gaussian elimination algorithm + * \brief Solve system of equations in matrix form using Gaussian elimination algorithm * \param M - N x N+1 matrix * \param sol - vector of N solutions * \retval bool - true if succeeded @@ -221,13 +221,13 @@ namespace INTERP_KERNEL // make upper triangular matrix (forward elimination) int iR[nbRow];// = { 0, 1, 2 }; - for ( int i = 0; i < nbRow; ++i ) iR[i] = i; + for ( int i = 0; i < int(nbRow); ++i ) iR[i] = i; - for ( int i = 0; i < nbRow-1; ++i ) // nullify nbRow-1 rows + for ( int i = 0; i < int(nbRow)-1; ++i ) // nullify nbRow-1 rows { // swap rows to have max value of i-th column in i-th row double max = std::fabs( M[ iR[i] ][i] ); - for ( int r = i+1; r < nbRow; ++r ) { + for ( int r = i+1; r < int(nbRow); ++r ) { double m = std::fabs( M[ iR[r] ][i] ); if ( m > max ) { max = m; @@ -240,7 +240,7 @@ namespace INTERP_KERNEL } // make 0 below M[i][i] (actually we do not modify i-th column) double* tUpRow = M[ iR[i] ]; - for ( int r = i+1; r < nbRow; ++r ) { + for ( int r = i+1; r < int(nbRow); ++r ) { double* mRow = M[ iR[r] ]; double coef = mRow[ i ] / tUpRow[ i ]; for ( int c = i+1; c < nbCol; ++c ) diff --git a/src/MEDLoader/MEDLoader.cxx b/src/MEDLoader/MEDLoader.cxx index f68192850..a4d22d0d4 100644 --- a/src/MEDLoader/MEDLoader.cxx +++ b/src/MEDLoader/MEDLoader.cxx @@ -171,8 +171,7 @@ const char WHITE_SPACES[]=" \n"; */ MEDLoader::MEDConnOfOneElemType::MEDConnOfOneElemType(INTERP_KERNEL::NormalizedCellType type, int *conn, int *index, int *fam, int lgth, int connLgth):_lgth(lgth),_fam(fam), _conn(conn),_index(index), - _global(0),_type(type), - _conn_lgth(connLgth) + _global(0),_conn_lgth(connLgth), _type(type) { }