From: ageay Date: Fri, 24 Feb 2012 12:06:05 +0000 (+0000) Subject: Warning hunting X-Git-Tag: V6_main_FINAL~822 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b4de705539ffcd680503bdaaceb7da6204b6db09;p=tools%2Fmedcoupling.git Warning hunting --- diff --git a/src/MEDCoupling/MEDCouplingCMesh.cxx b/src/MEDCoupling/MEDCouplingCMesh.cxx index cddd1b819..69b2db7c4 100644 --- a/src/MEDCoupling/MEDCouplingCMesh.cxx +++ b/src/MEDCoupling/MEDCouplingCMesh.cxx @@ -544,7 +544,7 @@ DataArrayInt *MEDCouplingCMesh::checkTypeConsistencyAndContig(const std::vector< { if(code[2]<-1) throw INTERP_KERNEL::Exception("MEDCouplingCMesh::checkTypeConsistencyAndContig : code[2]<-1 mismatch !"); - if(code[2]>=idsPerType.size()) + if(code[2]>=(int)idsPerType.size()) throw INTERP_KERNEL::Exception("MEDCouplingCMesh::checkTypeConsistencyAndContig : code[2]>size idsPerType !"); return idsPerType[code[2]]->deepCpy(); } diff --git a/src/MEDCoupling/MEDCouplingMemArray.cxx b/src/MEDCoupling/MEDCouplingMemArray.cxx index 850c40a8e..393c5b4a3 100644 --- a/src/MEDCoupling/MEDCouplingMemArray.cxx +++ b/src/MEDCoupling/MEDCouplingMemArray.cxx @@ -478,14 +478,16 @@ void DataArrayDouble::reverse() throw(INTERP_KERNEL::Exception) void DataArrayDouble::checkMonotonic(bool increasing, double eps) const throw(INTERP_KERNEL::Exception) { if(!isMonotonic(increasing, eps)) - if (increasing) - { - throw INTERP_KERNEL::Exception("DataArrayDouble::checkMonotonic : 'this' is not INCREASING monotonic !"); - } - else - { - throw INTERP_KERNEL::Exception("DataArrayDouble::checkMonotonic : 'this' is not DECREASING monotonic !"); - } + { + if (increasing) + { + throw INTERP_KERNEL::Exception("DataArrayDouble::checkMonotonic : 'this' is not INCREASING monotonic !"); + } + else + { + throw INTERP_KERNEL::Exception("DataArrayDouble::checkMonotonic : 'this' is not DECREASING monotonic !"); + } + } } /*! @@ -804,9 +806,7 @@ DataArrayDouble *DataArrayDouble::selectByTupleRanges(const std::vectorcopyStringInfoFrom(*this); return ret; } - int st=ranges.front().first; - int endd=ranges.back().second; - int ref=st; + int ref=ranges.front().first; int nbOfTuples=0; bool isIncreasing=true; for(std::vector >::const_iterator it=ranges.begin();it!=ranges.end();it++) @@ -3121,9 +3121,7 @@ DataArrayInt *DataArrayInt::selectByTupleRanges(const std::vectorcopyStringInfoFrom(*this); return ret; } - int st=ranges.front().first; - int endd=ranges.back().second; - int ref=st; + int ref=ranges.front().first; int nbOfTuples=0; bool isIncreasing=true; for(std::vector >::const_iterator it=ranges.begin();it!=ranges.end();it++) diff --git a/src/MEDCoupling/MEDCouplingUMesh.cxx b/src/MEDCoupling/MEDCouplingUMesh.cxx index 9707fa9aa..1af037e16 100644 --- a/src/MEDCoupling/MEDCouplingUMesh.cxx +++ b/src/MEDCoupling/MEDCouplingUMesh.cxx @@ -2424,7 +2424,6 @@ MEDCouplingUMesh *MEDCouplingUMesh::buildSlice3D(const double *origin, const dou std::vector nodes; std::vector cellIds2D,cellIds1D; MEDCouplingAutoRefCountObjectPtr subMesh=static_cast(buildPartOfMySelf(candidates->begin(),candidates->end(),false)); - int nbNodes1=subMesh->getNumberOfNodes(); subMesh->findNodesOnPlane(origin,vec,eps,nodes); MEDCouplingAutoRefCountObjectPtr desc1=DataArrayInt::New(),desc2=DataArrayInt::New(); MEDCouplingAutoRefCountObjectPtr descIndx1=DataArrayInt::New(),descIndx2=DataArrayInt::New(); @@ -2487,7 +2486,6 @@ MEDCouplingUMesh *MEDCouplingUMesh::buildSlice3DSurf(const double *origin, const std::vector nodes; std::vector cellIds1D; MEDCouplingAutoRefCountObjectPtr subMesh=static_cast(buildPartOfMySelf(candidates->begin(),candidates->end(),false)); - int nbNodes1=subMesh->getNumberOfNodes(); subMesh->findNodesOnPlane(origin,vec,eps,nodes); MEDCouplingAutoRefCountObjectPtr desc1=DataArrayInt::New(); MEDCouplingAutoRefCountObjectPtr descIndx1=DataArrayInt::New(); @@ -3492,7 +3490,7 @@ void MEDCouplingUMesh::tessellate2DCurve(double eps) throw(INTERP_KERNEL::Except newConnIPtr[1]=newConnIPtr[0]+3; } } - if(addCoo.empty() && newConn.size()==_nodal_connec->getNumberOfTuples())//nothing happens during tasselation : no update needed + if(addCoo.empty() && ((int)newConn.size())==_nodal_connec->getNumberOfTuples())//nothing happens during tasselation : no update needed return ; _types=types; DataArrayInt::SetArrayIn(newConnI,_nodal_connec_index); @@ -5531,7 +5529,7 @@ void MEDCouplingUMesh::AssemblyForSplitFrom3DCurve(const std::vector& cut3D } default: {// case when plane is on a multi colinear edge of a polyhedron - if(res.size()==2*nbOfSeg) + if((int)res.size()==2*nbOfSeg) { cut3DSurf[i].first=-2; cut3DSurf[i].second=i; } @@ -5583,7 +5581,6 @@ void MEDCouplingUMesh::assemblyForSplitFrom3DSurf(const std::vector< std::pair tmp=new int[sz]; INTERP_KERNEL::NormalizedCellType cmsId; unsigned nbOfNodesSon=cm.fillSonCellNodalConnectivity2(j,nodal3D+nodalIndx3D[i]+1,sz,tmp,cmsId); diff --git a/src/MEDCoupling/Test/MEDCouplingBasicsTest3.cxx b/src/MEDCoupling/Test/MEDCouplingBasicsTest3.cxx index 3fb0d3d99..4f0c98d51 100644 --- a/src/MEDCoupling/Test/MEDCouplingBasicsTest3.cxx +++ b/src/MEDCoupling/Test/MEDCouplingBasicsTest3.cxx @@ -1409,13 +1409,13 @@ void MEDCouplingBasicsTest3::testExtrudedMesh5() CPPUNIT_ASSERT_EQUAL(24,i->getNumberOfCellsWithType(INTERP_KERNEL::NORM_QUAD4)); const double expected1[3]={0.25,0.75,2.0625}; MEDCouplingFieldDouble *j=i->getMeasureField(true); - for(int i=0;i<12;i++) + for(int ii=0;ii<12;ii++) for(int k=0;k<3;k++) - CPPUNIT_ASSERT_DOUBLES_EQUAL(expected1[k],j->getIJ(0,i*3+k),1e-10); + CPPUNIT_ASSERT_DOUBLES_EQUAL(expected1[k],j->getIJ(0,ii*3+k),1e-10); const double expected2[72]={0.62200846792814113, 0.16666666666681595, 1.4513530918323276, 0.38888888888923495, 2.6293994326053212, 0.7045454545460802, 0.45534180126145435, 0.45534180126150181, 1.0624642029433926, 1.0624642029435025, 1.9248539780597826, 1.9248539780599816, 0.16666666666661334, 0.62200846792815856, 0.38888888888876294, 1.4513530918323678, 0.70454545454522521, 2.629399432605394, -0.16666666666674007, 0.62200846792812436, -0.38888888888906142, 1.4513530918322881, -0.70454545454576778, 2.6293994326052488, -0.45534180126154766, 0.45534180126140844, -1.0624642029436118, 1.0624642029432834, -1.9248539780601803, 1.9248539780595841, -0.62200846792817499, 0.1666666666665495, -1.451353091832408, 0.388888888888613, -2.6293994326054668, 0.70454545454495332, -0.62200846792810593, -0.16666666666680507, -1.451353091832247, -0.38888888888921297, -2.6293994326051746, -0.70454545454604123, -0.45534180126135926, -0.45534180126159562, -1.0624642029431723, -1.0624642029437235, -1.9248539780593836, -1.9248539780603811, -0.1666666666664828, -0.62200846792819242, -0.38888888888846079, -1.4513530918324489, -0.70454545454467987, -2.6293994326055397, 0.16666666666687083, -0.62200846792808862, 0.38888888888936374, -1.4513530918322073, 0.70454545454631357, -2.6293994326051022, 0.45534180126164348, -0.45534180126131207, 1.0624642029438327, -1.0624642029430627, 1.9248539780605791, -1.9248539780591853, 0.62200846792821063, -0.16666666666641802, 1.4513530918324888, -0.38888888888831086, 2.6293994326056125, -0.70454545454440853}; DataArrayDouble *m=i->getBarycenterAndOwner(); - for(int i=0;i<72;i++) - CPPUNIT_ASSERT_DOUBLES_EQUAL(expected2[i],m->getIJ(0,i),1e-10); + for(int ii=0;ii<72;ii++) + CPPUNIT_ASSERT_DOUBLES_EQUAL(expected2[ii],m->getIJ(0,ii),1e-10); // m->decrRef(); j->decrRef(); diff --git a/src/MEDCoupling/Test/MEDCouplingBasicsTest4.cxx b/src/MEDCoupling/Test/MEDCouplingBasicsTest4.cxx index d9c0829d1..ad4c6097e 100644 --- a/src/MEDCoupling/Test/MEDCouplingBasicsTest4.cxx +++ b/src/MEDCoupling/Test/MEDCouplingBasicsTest4.cxx @@ -1286,10 +1286,10 @@ void MEDCouplingBasicsTest4::testDAISplitByValueRange1() DataArrayInt *d=DataArrayInt::New(); d->alloc(9,1); std::copy(val1,val1+9,d->getPointer()); - DataArrayInt *e=0,*f=0,*g=0; - d->splitByValueRange(val2,val2+3,e,f,g); - CPPUNIT_ASSERT_EQUAL(9,e->getNumberOfTuples()); - CPPUNIT_ASSERT_EQUAL(1,e->getNumberOfComponents()); + DataArrayInt *ee=0,*f=0,*g=0; + d->splitByValueRange(val2,val2+3,ee,f,g); + CPPUNIT_ASSERT_EQUAL(9,ee->getNumberOfTuples()); + CPPUNIT_ASSERT_EQUAL(1,ee->getNumberOfComponents()); CPPUNIT_ASSERT_EQUAL(9,f->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(1,f->getNumberOfComponents()); CPPUNIT_ASSERT_EQUAL(2,g->getNumberOfTuples()); @@ -1299,18 +1299,18 @@ void MEDCouplingBasicsTest4::testDAISplitByValueRange1() const int expected2[9]={2,1,0,3,2,3,4,1,0}; for(int i=0;i<9;i++) { - CPPUNIT_ASSERT_EQUAL(expected1[i],e->getIJ(i,0)); + CPPUNIT_ASSERT_EQUAL(expected1[i],ee->getIJ(i,0)); CPPUNIT_ASSERT_EQUAL(expected2[i],f->getIJ(i,0)); } CPPUNIT_ASSERT_EQUAL(0,g->getIJ(0,0)); CPPUNIT_ASSERT_EQUAL(1,g->getIJ(1,0)); // - e->decrRef(); + ee->decrRef(); f->decrRef(); g->decrRef(); // d->setIJ(6,0,9); - CPPUNIT_ASSERT_THROW(d->splitByValueRange(val2,val2+3,e,f,g),INTERP_KERNEL::Exception); + CPPUNIT_ASSERT_THROW(d->splitByValueRange(val2,val2+3,ee,f,g),INTERP_KERNEL::Exception); // d->decrRef(); }