From: abn Date: Tue, 22 Sep 2020 11:29:39 +0000 (+0200) Subject: On the way to de-warning-isation: missing breaks, shadow variable, etc ... X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=219aa80bc8741fe5eb70ffd15931486de894ef43;p=tools%2Fmedcoupling.git On the way to de-warning-isation: missing breaks, shadow variable, etc ... --- diff --git a/src/INTERP_KERNEL/GaussPoints/InterpKernelGaussCoords.cxx b/src/INTERP_KERNEL/GaussPoints/InterpKernelGaussCoords.cxx index 7e23b1967..3ee1df58f 100644 --- a/src/INTERP_KERNEL/GaussPoints/InterpKernelGaussCoords.cxx +++ b/src/INTERP_KERNEL/GaussPoints/InterpKernelGaussCoords.cxx @@ -637,8 +637,7 @@ void GaussInfo::initLocalInfo() break; } - - _my_local_ref_dim = 3; +/* _my_local_ref_dim = 3; _my_local_nb_ref = 6; penta6aInit(); aSatify = isSatisfy(); @@ -650,7 +649,7 @@ void GaussInfo::initLocalInfo() CHECK_MACRO; } break; - +*/ case NORM_PENTA15: { _my_local_ref_dim = 3; diff --git a/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DEdgeArcCircle.cxx b/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DEdgeArcCircle.cxx index bd63fe757..6693f5ee9 100644 --- a/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DEdgeArcCircle.cxx +++ b/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DEdgeArcCircle.cxx @@ -395,7 +395,6 @@ std::list< IntersectElement > ArcCSegIntersector::getIntersectionsCharacteristic // Check tangent vector of the arc circle at the common node with the linear segment. // There we can tell if the arc of circle is 'moving away' from the seg, or if it might intersect it twice const Node &n(*_earlyInter->getNodeOnly()); - const double * center(getE1().getCenter()); double tang[2] = {-(n[1]-center[1]), n[0]-center[0]}; // (-y, x) is the tangent vector in the trigo direction with (x,y) = (center->node) bool invSeg = _i1S2E || _i1E2E; diff --git a/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DEdgeLin.cxx b/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DEdgeLin.cxx index 989419f9d..ca7bdac70 100644 --- a/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DEdgeLin.cxx +++ b/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DEdgeLin.cxx @@ -27,7 +27,7 @@ using namespace INTERP_KERNEL; namespace INTERP_KERNEL { - extern const unsigned MAX_SIZE_OF_LINE_XFIG_FILE=1024; + const unsigned MAX_SIZE_OF_LINE_XFIG_FILE=1024; } SegSegIntersector::SegSegIntersector(const EdgeLin& e1, const EdgeLin& e2): diff --git a/src/INTERP_KERNEL/SplitterTetra.txx b/src/INTERP_KERNEL/SplitterTetra.txx index df1724ac0..c1a060a43 100644 --- a/src/INTERP_KERNEL/SplitterTetra.txx +++ b/src/INTERP_KERNEL/SplitterTetra.txx @@ -250,8 +250,7 @@ namespace INTERP_KERNEL else { faceType = cellModelCell.getSonType(ii); - const CellModel& faceModel=CellModel::GetCellModel(faceType); - assert(faceModel.getDimension() == 2); + assert(CellModel::GetCellModel(faceType).getDimension() == 2); nbFaceNodes = cellModelCell.getNumberOfNodesConstituentTheSon(ii); faceNodes = new ConnType[nbFaceNodes]; cellModelCell.fillSonCellNodalConnectivity(ii,cellNodes,faceNodes); @@ -1299,6 +1298,7 @@ namespace INTERP_KERNEL default: break; } + break; case 5: // NORM_PYRA5 break; diff --git a/src/INTERP_KERNELTest/PerfTest.cxx b/src/INTERP_KERNELTest/PerfTest.cxx index 5c191a2c1..4083addb3 100644 --- a/src/INTERP_KERNELTest/PerfTest.cxx +++ b/src/INTERP_KERNELTest/PerfTest.cxx @@ -80,7 +80,7 @@ namespace INTERP_TEST Interpolation3D interpolator; interpolator.interpolateMeshes(sMesh_wrapper, tMesh_wrapper,m,"P0P0"); - std::pair eff = countNumberOfMatrixEntries(m); +// std::pair eff = countNumberOfMatrixEntries(m); // LOG(1, eff.first << " of " << numTargetElems * numSrcElems << " intersections calculated : ratio = " // << double(eff.first) / double(numTargetElems * numSrcElems)); LOG(1, eff.second << " non-zero elements of " << eff.first << " total : filter efficiency = " diff --git a/src/INTERP_KERNELTest/QuadraticPlanarInterpTest5.cxx b/src/INTERP_KERNELTest/QuadraticPlanarInterpTest5.cxx index 509032cf5..aa75acb97 100644 --- a/src/INTERP_KERNELTest/QuadraticPlanarInterpTest5.cxx +++ b/src/INTERP_KERNELTest/QuadraticPlanarInterpTest5.cxx @@ -1177,7 +1177,6 @@ void QuadraticPlanarInterpTest::checkGetMiddleOfPoints() double p2[] = {0.0, 1.0}; double e_center[] = {-0.71, 2.0}; double mid[] = {0.0,0.0}; // out - double mide[] = {0.0,0.0}; // expected Node * start = new Node(0.,0.); Node * end = new Node(0.,0.); // unused // start, end, center_x, center_y, radius, angle0, angle diff --git a/src/INTERP_KERNELTest/SingleElementPlanarTests.cxx b/src/INTERP_KERNELTest/SingleElementPlanarTests.cxx index e8b24ac2c..7ef44a4a3 100644 --- a/src/INTERP_KERNELTest/SingleElementPlanarTests.cxx +++ b/src/INTERP_KERNELTest/SingleElementPlanarTests.cxx @@ -28,8 +28,6 @@ using namespace INTERP_KERNEL; namespace INTERP_TEST { - const double _Epsilon = 1.e-12; - const double _Precision = 1.e-12; const double _losange1[8] = { 1,0, 0,1, -1,0, 0,-1 }; const double _losange2[8] = { 2,0, 1,1, 0,0, 1,-1 }; const double _losange3[8] = {2.5,0.5,1.5,1.5,0.5,0.5,1.5,-0.5 }; diff --git a/src/MEDCoupling/MEDCoupling1GTUMesh.cxx b/src/MEDCoupling/MEDCoupling1GTUMesh.cxx index f029a4766..2f7a66e59 100644 --- a/src/MEDCoupling/MEDCoupling1GTUMesh.cxx +++ b/src/MEDCoupling/MEDCoupling1GTUMesh.cxx @@ -2302,14 +2302,6 @@ bool MEDCoupling1DGTUMesh::isEqualWithoutConsideringStr(const MEDCouplingMesh *o if(!c1->isEqualWithoutConsideringStr(*c2)) return false; return true; - c1=_conn_indx; c2=otherC->_conn_indx; - if(c1==c2) - return true; - if(!c1 || !c2) - return false; - if(!c1->isEqualWithoutConsideringStr(*c2)) - return false; - return true; } /*! diff --git a/src/MEDCoupling/MEDCouplingCurveLinearMesh.cxx b/src/MEDCoupling/MEDCouplingCurveLinearMesh.cxx index e5c4a5a2d..c265d7e5f 100755 --- a/src/MEDCoupling/MEDCouplingCurveLinearMesh.cxx +++ b/src/MEDCoupling/MEDCouplingCurveLinearMesh.cxx @@ -540,6 +540,7 @@ mcIdType MEDCouplingCurveLinearMesh::getCellContainingPoint(const double *pos, d return nodeId; } } + break; case 2: if(spaceDim==2) { @@ -569,6 +570,7 @@ mcIdType MEDCouplingCurveLinearMesh::getCellContainingPoint(const double *pos, d return nx+ny*_structure[0]; } } + break; case 3: { if(spaceDim==3) @@ -633,9 +635,11 @@ mcIdType MEDCouplingCurveLinearMesh::getCellContainingPoint(const double *pos, d } } } + break; default: throw INTERP_KERNEL::Exception("MEDCouplingCurveLinearMesh::getCellContainingPoint : mesh dimension managed are 1, 2 or 3 !"); } + return 0; } void MEDCouplingCurveLinearMesh::getCellsContainingPoint(const double *pos, double eps, std::vector& elts) const diff --git a/src/MEDCoupling/MEDCouplingGaussLocalization.cxx b/src/MEDCoupling/MEDCouplingGaussLocalization.cxx index e4e5ea051..990722c3d 100644 --- a/src/MEDCoupling/MEDCouplingGaussLocalization.cxx +++ b/src/MEDCoupling/MEDCouplingGaussLocalization.cxx @@ -213,7 +213,6 @@ MCAuto MEDCouplingGaussLocalization::localizePtsInRefCooForEach double *retPtr(ret->getPointer()); if(dim!=ToIdType(ptsInRefCoo->getNumberOfComponents())) throw INTERP_KERNEL::Exception("MEDCouplingGaussLocalization::localizePtsInRefCooForEachCell : number of components of input coo is not equal to dim of element !"); - const std::vector& wg(getWeights()); INTERP_KERNEL::GaussCoords calculator; calculator.addGaussInfo(typ,dim, ptsInRefCoo->begin(),nbPts,&_ref_coord[0],getNumberOfPtsInRefCell()); // diff --git a/src/MEDCoupling/MEDCouplingMemArray.cxx b/src/MEDCoupling/MEDCouplingMemArray.cxx index 0708ee57c..3d6cc18f9 100755 --- a/src/MEDCoupling/MEDCouplingMemArray.cxx +++ b/src/MEDCoupling/MEDCouplingMemArray.cxx @@ -1880,6 +1880,7 @@ DataArrayDouble *DataArrayDouble::cartesianize(MEDCouplingAxisType atOfThis) con { case AX_CART: ret=deepCopy(); + break; case AX_CYL: if(nbOfComp==3) { diff --git a/src/MEDCoupling/MEDCouplingMemArray.txx b/src/MEDCoupling/MEDCouplingMemArray.txx index 14b8b34b7..a53681098 100755 --- a/src/MEDCoupling/MEDCouplingMemArray.txx +++ b/src/MEDCoupling/MEDCouplingMemArray.txx @@ -5744,7 +5744,6 @@ struct NotInRange throw INTERP_KERNEL::Exception("DataArrayInt::indexOfSameConsecutiveValueGroups : only single component allowed !"); const T *pt(this->begin()); const T *const ptEnd(this->end()) , * const ptBg(this->begin()); - const T *oldPt(pt); // first find nb of different values in this std::size_t nbOfTuplesOut(0); while( pt != ptEnd ) diff --git a/src/MEDCoupling/MEDCouplingPointSet.cxx b/src/MEDCoupling/MEDCouplingPointSet.cxx index 85f87afe7..ee0bcfba3 100755 --- a/src/MEDCoupling/MEDCouplingPointSet.cxx +++ b/src/MEDCoupling/MEDCouplingPointSet.cxx @@ -217,7 +217,7 @@ bool MEDCouplingPointSet::areCoordsEqualWithoutConsideringStr(const MEDCouplingP /*! * Returns coordinates of \a nodeId-th node. * \param [in] nodeId - the ID of the node of interest. - * \param [in, out] coo - the array filled with coordinates of the \a nodeId-th + * \param [in,out] coo - the array filled with coordinates of the \a nodeId-th * node. This array is not cleared before filling in, the coordinates are * appended to its end. * \throw If the coordinates array is not set. diff --git a/src/MEDCoupling/MEDCouplingRemapper.cxx b/src/MEDCoupling/MEDCouplingRemapper.cxx index 400862793..7b495a338 100755 --- a/src/MEDCoupling/MEDCouplingRemapper.cxx +++ b/src/MEDCoupling/MEDCouplingRemapper.cxx @@ -1144,7 +1144,6 @@ void MEDCouplingRemapper::computeDeno(NatureOfField nat, const MEDCouplingFieldD void MEDCouplingRemapper::computeDenoFromScratch(NatureOfField nat, const MEDCouplingFieldDouble *srcField, const MEDCouplingFieldDouble *trgField) { _nature_of_deno=nat; - std::size_t _time_deno_update=getTimeOfThis(); switch(_nature_of_deno) { case IntensiveMaximum: diff --git a/src/MEDCoupling/MEDCouplingUMesh.cxx b/src/MEDCoupling/MEDCouplingUMesh.cxx index c022388b4..a890398e7 100755 --- a/src/MEDCoupling/MEDCouplingUMesh.cxx +++ b/src/MEDCoupling/MEDCouplingUMesh.cxx @@ -1246,7 +1246,7 @@ bool MEDCouplingUMesh::unPolyze() INTERP_KERNEL::NormalizedCellType type=(INTERP_KERNEL::NormalizedCellType)conn[posOfCurCell]; const INTERP_KERNEL::CellModel& cm=INTERP_KERNEL::CellModel::GetCellModel(type); INTERP_KERNEL::NormalizedCellType newType=INTERP_KERNEL::NORM_ERROR; - mcIdType newLgth; + mcIdType newLgth=0; if(cm.isDynamic()) { switch(cm.getDimension()) @@ -1265,11 +1265,12 @@ bool MEDCouplingUMesh::unPolyze() newType=INTERP_KERNEL::CellSimplify::tryToUnPoly3D(zipFullReprOfPolyh,nbOfFaces,lgthOfPolyhConn,conn+newPos+1,newLgth); break; } - case 1: + /* case 1: // Not supported yet { newType=(lgthOfCurCell==3)?INTERP_KERNEL::NORM_SEG2:INTERP_KERNEL::NORM_POLYL; break; } + */ } ret=ret || (newType!=type); conn[newPos]=newType; @@ -1663,8 +1664,6 @@ int MEDCouplingUMesh::AreCellsEqualPolicy7(const mcIdType *conn, const mcIdType else return 0; } - - return work!=tmp+sz1?1:0; } else {//case of SEG2 and SEG3 @@ -3337,8 +3336,8 @@ MEDCouplingFieldDouble *MEDCouplingUMesh::getMeasureFieldOnNode(bool isAbs) cons mcIdType nbNodes=getNumberOfNodes(); MCAuto nnpc; { - MCAuto tmp(computeNbOfNodesPerCell()); - nnpc=tmp->convertToDblArr(); + MCAuto tmp2(computeNbOfNodesPerCell()); + nnpc=tmp2->convertToDblArr(); } std::for_each(nnpc->rwBegin(),nnpc->rwEnd(),[](double& v) { v=1./v; }); const double *nnpcPtr(nnpc->begin()); diff --git a/src/MEDCoupling/MEDCouplingUMesh_internal.cxx b/src/MEDCoupling/MEDCouplingUMesh_internal.cxx index 9cc12330c..031a6d5ea 100755 --- a/src/MEDCoupling/MEDCouplingUMesh_internal.cxx +++ b/src/MEDCoupling/MEDCouplingUMesh_internal.cxx @@ -1818,7 +1818,7 @@ void MEDCouplingUMesh::attractSeg3MidPtsAroundNodesUnderground(double ratio, con auto ptToMove(nc[*nci+3]); auto attractor(aa?nc[*nci+1]:nc[*nci+2]),endPt(aa?nc[*nci+2]:nc[*nci+1]); std::transform(coords+spaceDim*attractor,coords+spaceDim*(attractor+1),coords+spaceDim*endPt, - coords+spaceDim*ptToMove,[ratio](const double& stPt, const double& endPt) { return stPt+ratio*(endPt-stPt); }); + coords+spaceDim*ptToMove,[ratio](const double& stPt2, const double& endPt2) { return stPt2+ratio*(endPt2-stPt2); }); } else continue;//both 2 boundary nodes of current seg3 are un nodeIds input list -> skip it. diff --git a/src/MEDCoupling/Test/MEDCouplingBasicsTest0.cxx b/src/MEDCoupling/Test/MEDCouplingBasicsTest0.cxx index 0427b166b..d2917ff00 100644 --- a/src/MEDCoupling/Test/MEDCouplingBasicsTest0.cxx +++ b/src/MEDCoupling/Test/MEDCouplingBasicsTest0.cxx @@ -1658,7 +1658,7 @@ void MEDCouplingBasicsTest::test2D1DMeshesIntersection(MEDCouplingUMesh *sourceM CPPUNIT_ASSERT_DOUBLES_EQUAL(correctLength, length, prec * std::max(correctLength, length)); INTERP_KERNEL::Interpolation2D3D::DuplicateFacesType duplicateFaces = myInterpolator.retrieveDuplicateFaces(); - int duplicateFacesNbr = duplicateFaces.size(); + int duplicateFacesNbr = (int)duplicateFaces.size(); LOG(1, "duplicateFacesNbr = " << duplicateFacesNbr <<" correctDuplicateFacesNbr = " << correctDuplicateFacesNbr); CPPUNIT_ASSERT_EQUAL(correctDuplicateFacesNbr, duplicateFacesNbr); @@ -1699,7 +1699,7 @@ void MEDCouplingBasicsTest::test3D2DMeshesIntersection(MEDCouplingUMesh *sourceM CPPUNIT_ASSERT_DOUBLES_EQUAL(correctSurf, surf, prec * std::max(correctSurf, surf)); INTERP_KERNEL::Interpolation2D3D::DuplicateFacesType duplicateFaces = myInterpolator.retrieveDuplicateFaces(); - int duplicateFacesNbr = duplicateFaces.size(); + int duplicateFacesNbr = (int)duplicateFaces.size(); LOG(1, "duplicateFacesNbr = " << duplicateFacesNbr <<" correctDuplicateFacesNbr = " << correctDuplicateFacesNbr); CPPUNIT_ASSERT_EQUAL(correctDuplicateFacesNbr, duplicateFacesNbr); diff --git a/src/MEDCoupling/Test/MEDCouplingBasicsTestData1.hxx b/src/MEDCoupling/Test/MEDCouplingBasicsTestData1.hxx index 4407bbaae..b2a364d34 100644 --- a/src/MEDCoupling/Test/MEDCouplingBasicsTestData1.hxx +++ b/src/MEDCoupling/Test/MEDCouplingBasicsTestData1.hxx @@ -18,7 +18,7 @@ // // Author : Anthony Geay (CEA/DEN) -mcIdType connITT[201]={0, 50, 100, 150, 200, 250, 300, 350, 400, 450, 500, 550, 600, 650, 700, 750, 800, 850, 900, 950, 1000, 1029, 1058, 1087, 1116, 1145, 1174, 1203, +static mcIdType connITT[201]={0, 50, 100, 150, 200, 250, 300, 350, 400, 450, 500, 550, 600, 650, 700, 750, 800, 850, 900, 950, 1000, 1029, 1058, 1087, 1116, 1145, 1174, 1203, 1232, 1261, 1290, 1319, 1348, 1377, 1406, 1435, 1464, 1493, 1522, 1551, 1580, 1609, 1638, 1667, 1696, 1725, 1754, 1783, 1812, 1841, 1870, 1899, 1928, 1957, 1986, 2015, 2044, 2073, 2102, 2131, 2160, 2189, 2218, 2247, 2276, 2305, 2334, 2363, 2392, 2421, 2450, 2479, 2508, 2537, 2566, 2595, 2624, 2653, 2682, 2711, 2740, 2769, 2798, 2827, 2856, 2885, 2914, 2943, 2972, 3001, 3030, 3059, 3088, 3117, 3146, 3175, 3204, 3233, 3262, 3291, @@ -27,7 +27,7 @@ mcIdType connITT[201]={0, 50, 100, 150, 200, 250, 300, 350, 400, 450, 500, 550, 4712, 4741, 4770, 4799, 4828, 4857, 4886, 4915, 4944, 4973, 5002, 5031, 5060, 5089, 5118, 5147, 5176, 5205, 5234, 5263, 5292, 5321, 5350, 5379, 5408, 5437, 5466, 5495, 5524, 5553, 5582, 5611, 5640, 5669, 5698, 5727, 5756, 5785, 5814, 5843, 5872, 5901, 5930, 5959, 5988, 6017, 6046, 6075, 6104, 6133, 6162, 6191, 6220}; - mcIdType connTT[6220]={0, 1, 2, 3, 4, 5, 6, -1, 0, 7, 8, 1, -1, 1, 8, 9, 2, -1, 2, 9, 10, 3, -1, 3, 10, 11, 4, -1, 4, 11, 12, 5, -1, 5, 12, 13, 6, -1, 6, 13, 7, 0, -1, 7, 13, 12, 11, 10, 9, 8, 14, 15, 16, 17, 18, 19, +static mcIdType connTT[6220]={0, 1, 2, 3, 4, 5, 6, -1, 0, 7, 8, 1, -1, 1, 8, 9, 2, -1, 2, 9, 10, 3, -1, 3, 10, 11, 4, -1, 4, 11, 12, 5, -1, 5, 12, 13, 6, -1, 6, 13, 7, 0, -1, 7, 13, 12, 11, 10, 9, 8, 14, 15, 16, 17, 18, 19, 20, -1, 14, 21, 22, 15, -1, 15, 22, 23, 16, -1, 16, 23, 24, 17, -1, 17, 24, 25, 18, -1, 18, 25, 26, 19, -1, 19, 26, 27, 20, -1, 20, 27, 21, 14, -1, 21, 27, 26, 25, 24, 23, 22, 28, 29, 30, 31, 32, 33, 34, -1, 28, 35, 36, 29, -1, 29, 36, 37, 30, -1, 30, 37, 38, 31, -1, 31, 38, 39, 32, -1, 32, 39, 40, 33, -1, 33, 40, 41, 34, -1, 34, 41, 35, 28, -1, 35, 41, 40, 39, 38, 37, 36, 42, 43, 44, 45, 46, 47, 48, -1, 42, 49, 50, 43, -1, 43, 50, 51, 44, -1, 44, 51, 52, 45, -1, 45, 52, 53, 46, -1, 46, 53, 54, 47, -1, 47, 54, 55, 48, -1, 48, 55, 49, 42, -1, 49, 55, 54, 53, 52, 51, 50, 56, 57, 58, @@ -191,7 +191,7 @@ mcIdType connITT[201]={0, 50, 100, 150, 200, 250, 300, 350, 400, 450, 500, 550, 1703, 1699, -1, 1699, 1703, 1700, 1696, -1, 1700, 1703, 1702, 1701, 1704, 1705, 1706, 1707, -1, 1704, 1708, 1709, 1705, -1, 1705, 1709, 1710, 1706, -1, 1706, 1710, 1711, 1707, -1, 1707, 1711, 1708, 1704, -1, 1708, 1711, 1710, 1709, 1712, 1713, 1714, 1715, -1, 1712, 1716, 1717, 1713, -1, 1713, 1717, 1718, 1714, -1, 1714, 1718, 1719, 1715, -1, 1715, 1719, 1716, 1712, -1, 1716, 1719, 1718, 1717}; -double coordsTT[5160]={ +static double coordsTT[5160]={ 0.0054015000000000044, 0.0054015000000000053, 0, 0.2106585, 0.0054015000000000053, 0, 0.2106585, 0.039611, 0, 0.2106585, 0.10803, 0, 0.2106585, 0.17644899999999999, 0, 0.2106585, 0.2106585, 0, 0.0054015000000000044, 0.2106585, 0, 0.0054015000000000044, 0.0054015000000000053, 0.21364999999999998, 0.2106585, 0.0054015000000000053, 0.21364999999999998, 0.2106585, 0.039611, 0.21364999999999998, 0.2106585, 0.10803, 0.21364999999999998, 0.2106585, @@ -906,7 +906,7 @@ double coordsTT[5160]={ }; -const mcIdType connTFH8[2560]={ +static const mcIdType connTFH8[2560]={ 1, 2, 7, 6, 28, 29, 34, 33, 2, 3, 8, 7, 29, 30, 35, 34, 3, 4, 9, 8, 30, 31, 36, 35, 4, 5, 10, 9, 31, 32, 37, 36, 6, 7, 12, 11, 33, 34, 39, 38, 7, 8, 13, 12, 34, 35, 40, 39, 8, 9, 14, 13, 35, 36, 41, 40, 9, 10, 15, 14, 36, 37, 42, 41, 11, 12, 17, 16, 38, 39, 44, 43, 12, 13, 18, 17, 39, 40, 45, 44, 13, 14, 19, 18, 40, 41, 46, 45, 14, 15, 20, 19, 41, 42, 47, 46, 16, 17, 21, 26, 43, 44, 48, 53, 17, 18, 22, 21, 44, 45, 49, 48, 18, 19, 23, 22, 45, 46, 50, 49, 19, 20, 24, 23, 46, 47, 51, 50, 28, 29, 34, 33, 55, 56, 61, 60, @@ -966,7 +966,7 @@ const mcIdType connTFH8[2560]={ 526, 531, 530, 552, 553, 558, 557, 526, 527, 532, 531, 553, 554, 559, 558, 527, 528, 533, 532, 554, 555, 560, 559, 529, 530, 534, 539, 556, 557, 561, 566, 530, 531, 535, 534, 557, 558, 562, 561, 531, 532, 536, 535, 558, 559, 563, 562, 532, 533, 537, 536, 559, 560, 564, 563}; -const mcIdType connTFPOLH[1000]={ +static const mcIdType connTFPOLH[1000]={ 0, 25, 26, 16, 11, 6, 1, -1, 27, 28, 33, 38, 43, 53, 52, -1, 0, 1, 28, 27, -1, 1, 6, 33, 28, -1, 6, 11, 38, 33, -1, 11, 16, 43, 38, -1, 16, 26, 53, 43, -1, 26, 25, 52, 53, -1, 25, 0, 27, 52, 27, 52, 53, 43, 38, 33, 28, -1, 54, 55, 60, 65, 70, 80, 79, -1, 27, 28, 55, 54, -1, 28, 33, 60, 55, -1, 33, 38, 65, 60, -1, 38, 43, 70, 65, -1, 43, 53, 80, 70, -1, 53, 52, 79, 80, -1, 52, 27, 54, 79, 54, 79, 80, 70, 65, 60, 55, -1, 81, 82, 87, 92, 97, 107, 106, -1, 54, 55, 82, 81, -1, 55, 60, 87, 82, -1, 60, 65, 92, 87, -1, 65, 70, 97, 92, -1, 70, 80, 107, 97, -1, 80, 79, 106, 107, -1, 79, 54, 81, 106, 81, 106, 107, 97, 92, 87, 82, -1, 108, 109, 114, 119, 124, 134, 133, -1, 81, 82, 109, 108, -1, @@ -989,7 +989,7 @@ const mcIdType connTFPOLH[1000]={ 538, 539, 529, 524, 519, 514, -1, 540, 541, 546, 551, 556, 566, 565, -1, 513, 514, 541, 540, -1, 514, 519, 546, 541, -1, 519, 524, 551, 546, -1, 524, 529, 556, 551, -1, 529, 539, 566, 556, -1, 539, 538, 565, 566, -1, 538, 513, 540, 565 }; -const double coordsTF[1701]={ +static const double coordsTF[1701]={ 0, 0, 0, 0.21606, 0, 0, 0.25207000000000002, 0, 0, 0.32408999999999999, 0, 0, 0.39610999999999996, 0, 0, 0.43212, 0, 0, 0.21606, 0.03601, 0, 0.25207000000000002, 0.03601, 0, 0.32408999999999999, 0.03601, 0, 0.39610999999999996, 0.03601, 0, 0.43212, 0.03601, 0, 0.21606, 0.10803, 0, 0.25207000000000002, 0.10803, 0, 0.32408999999999999, 0.10803, 0, 0.39610999999999996, 0.10803, 0, 0.43212, 0.10803, 0, 0.21606, 0.18004999999999999, 0, 0.25207000000000002, @@ -1164,4 +1164,4 @@ const double coordsTF[1701]={ 4.2729999999999997, 0, 0.21606, 4.2729999999999997, 0.21606, 0.21606, 4.2729999999999997 }; -const mcIdType connTFPOLH_I[21]={0, 50, 100, 150, 200, 250, 300, 350, 400, 450, 500, 550, 600, 650, 700, 750, 800, 850, 900, 950, 1000}; +static const mcIdType connTFPOLH_I[21]={0, 50, 100, 150, 200, 250, 300, 350, 400, 450, 500, 550, 600, 650, 700, 750, 800, 850, 900, 950, 1000}; diff --git a/src/MEDCoupling/Test/MEDCouplingExamplesTest.cxx b/src/MEDCoupling/Test/MEDCouplingExamplesTest.cxx index 036565cdc..e2e9c2914 100644 --- a/src/MEDCoupling/Test/MEDCouplingExamplesTest.cxx +++ b/src/MEDCoupling/Test/MEDCouplingExamplesTest.cxx @@ -143,7 +143,7 @@ void CppExample_MEDCouplingFieldDouble_substractInPlaceDM() mesh1->fillFromAnalytic( MEDCoupling::ON_NODES,1,"x"); // field1 values == coords1 MCAuto field2 = mesh2->fillFromAnalytic( MEDCoupling::ON_NODES,1,"x"); // field2 values == coords2 - const double levOfCheck = 10; // nodes can be permuted + const int levOfCheck = 10; // nodes can be permuted field1->substractInPlaceDM( field2, levOfCheck, 1e-13, 0 ); // values #0 and #2 must swap //! [CppSnippet_MEDCouplingFieldDouble_substractInPlaceDM_2] //! [CppSnippet_MEDCouplingFieldDouble_substractInPlaceDM_3] @@ -174,7 +174,7 @@ void CppExample_MEDCouplingFieldDouble_changeUnderlyingMesh() //! [CppSnippet_MEDCouplingFieldDouble_changeUnderlyingMesh_2] MCAuto field = mesh1->fillFromAnalytic( MEDCoupling::ON_NODES,1,"x"); // field values == coords1 - const double levOfCheck = 10; // nodes can be permuted + const int levOfCheck = 10; // nodes can be permuted field->changeUnderlyingMesh( mesh2, levOfCheck, 1e-13, 0 ); // values #0 and #2 must swap CPPUNIT_ASSERT( std::equal( coords2, coords2+4, field->getArray()->getConstPointer() )); //! [CppSnippet_MEDCouplingFieldDouble_changeUnderlyingMesh_2] diff --git a/src/MEDCoupling_Swig/MEDCouplingDataArrayTypemaps.i b/src/MEDCoupling_Swig/MEDCouplingDataArrayTypemaps.i index a3f52dec0..8fb267b85 100644 --- a/src/MEDCoupling_Swig/MEDCouplingDataArrayTypemaps.i +++ b/src/MEDCoupling_Swig/MEDCouplingDataArrayTypemaps.i @@ -2044,7 +2044,7 @@ static void convertObjToPossibleCpp6(PyObject *value, mcIdType& sw, char& cTyp, { vsType[i]=convertPyObjectToStr(o); } - catch(INTERP_KERNEL::Exception& e) + catch(INTERP_KERNEL::Exception& ) { std::ostringstream oss; oss << "Tuple as been detected but element #" << i << " is not a string ! only tuples of strings accepted !"; throw INTERP_KERNEL::Exception(oss.str().c_str()); @@ -2064,7 +2064,7 @@ static void convertObjToPossibleCpp6(PyObject *value, mcIdType& sw, char& cTyp, { vsType[i]=convertPyObjectToStr(o); } - catch(INTERP_KERNEL::Exception& e) + catch(INTERP_KERNEL::Exception& ) { std::ostringstream oss; oss << "List as been detected but element #" << i << " is not a string ! only tuples of strings accepted !"; throw INTERP_KERNEL::Exception(oss.str().c_str()); diff --git a/src/MEDLoader/MEDFileBlowStrEltUp.cxx b/src/MEDLoader/MEDFileBlowStrEltUp.cxx index f773a32ea..29dd40c0d 100644 --- a/src/MEDLoader/MEDFileBlowStrEltUp.cxx +++ b/src/MEDLoader/MEDFileBlowStrEltUp.cxx @@ -462,7 +462,7 @@ MCAuto LocInfo::BuildMeshFromEpaisseur(INTERP_KERNEL::Normalize { MCAuto ptsForLoc; MCAuto geoMesh(BuildMeshCommon(gt,pfl,loc,zeStr,mesh,section,globs,ptsForLoc)); - mcIdType nbSecPts(section->getNumberOfNodes()),nbCells(geoMesh->getNumberOfCells()),nbg(ToIdType(loc.getGaussWeights().size())); + mcIdType nbCells(geoMesh->getNumberOfCells()),nbg(ToIdType(loc.getGaussWeights().size())); MCConstAuto zeThickness; if(!pfl.empty()) { diff --git a/src/MEDLoader/MEDFileEquivalence.cxx b/src/MEDLoader/MEDFileEquivalence.cxx index 5e3489d19..cf9523f59 100644 --- a/src/MEDLoader/MEDFileEquivalence.cxx +++ b/src/MEDLoader/MEDFileEquivalence.cxx @@ -26,6 +26,7 @@ #include "MEDFileMesh.hxx" #include "InterpKernelAutoPtr.hxx" +// From MEDLOader.cxx TU extern med_geometry_type typmai[MED_N_CELL_FIXED_GEO]; extern INTERP_KERNEL::NormalizedCellType typmai2[MED_N_CELL_FIXED_GEO]; extern med_geometry_type typmai3[INTERP_KERNEL::NORM_MAXTYPE]; diff --git a/src/MEDLoader/MEDFileField.cxx b/src/MEDLoader/MEDFileField.cxx index 4cfee0c64..99ac6bb88 100644 --- a/src/MEDLoader/MEDFileField.cxx +++ b/src/MEDLoader/MEDFileField.cxx @@ -35,6 +35,7 @@ #include #include +// From MEDLoader.cxx TU: extern INTERP_KERNEL::NormalizedCellType typmai2[MED_N_CELL_FIXED_GEO]; extern med_geometry_type typmainoeud[1]; extern med_geometry_type typmai3[INTERP_KERNEL::NORM_MAXTYPE]; @@ -234,7 +235,7 @@ void MEDFileFields::simpleRepr(int bkOffset, std::ostream& oss) const for(std::vector< MCAuto >::const_iterator it=_fields.begin();it!=_fields.end();it++,i++) { const MEDFileAnyTypeFieldMultiTSWithoutSDA *cur=(*it); - std::string chapter(17,'0'+i); + std::string chapter(17,(char)('0'+i)); oss << startLine << chapter << std::endl; if(cur) { diff --git a/src/MEDLoader/MEDFileField1TS.cxx b/src/MEDLoader/MEDFileField1TS.cxx index aa655de53..8eea653c6 100644 --- a/src/MEDLoader/MEDFileField1TS.cxx +++ b/src/MEDLoader/MEDFileField1TS.cxx @@ -1258,6 +1258,7 @@ MEDCouplingFieldDouble *MEDFileAnyTypeField1TSWithoutSDA::getFieldOnMeshAtLevel( if(renumPol==1) return ret.retn(); } + [[clang::fallthrough]]; // yes no break here - silence clang warning. case 2: { //no need to test _field_per_mesh.empty() because geMeshName has already done it @@ -1278,9 +1279,11 @@ MEDCouplingFieldDouble *MEDFileAnyTypeField1TSWithoutSDA::getFieldOnMeshAtLevel( } return ret.retn(); } + break; default: throw INTERP_KERNEL::Exception("MEDFileField1TSWithoutSDA::getFieldOnMeshAtLevel : unsupported renum policy ! Dealing with policy 0 1 2 and 3 !"); } + return nullptr; } /*! @@ -2028,13 +2031,6 @@ int MEDFileAnyTypeField1TS::LocateField2(med_idt fid, int fieldIdCFormat, bool c /*! * This method throws an INTERP_KERNEL::Exception if \a fieldName field is not in file pointed by \a fid and with name \a fileName. * - * \param [in] fid - MED file handler - * \param [in] fieldName - name of the field - * \param [out] posCFormat - index of the field in the file(?) - * \param [out] typcha - type of the field - * \param [out] infos - informations on the field - * \param [out] dtunitOut - time unit description - * \param [out] meshName - name of the mesh supporting the field * \return in case of success the number of time steps available for the field with name \a fieldName. */ int MEDFileAnyTypeField1TS::LocateField(med_idt fid, const std::string& fieldName, int& posCFormat, med_field_type& typcha, std::vector& infos, std::string& dtunitOut, std::string& meshName) diff --git a/src/MEDLoader/MEDFileFieldInternal.cxx b/src/MEDLoader/MEDFileFieldInternal.cxx index 13688cddc..ec65b2c32 100644 --- a/src/MEDLoader/MEDFileFieldInternal.cxx +++ b/src/MEDLoader/MEDFileFieldInternal.cxx @@ -32,6 +32,7 @@ #include "CellModel.hxx" +// From MEDLOader.cxx TU extern med_geometry_type typmai[MED_N_CELL_FIXED_GEO]; extern INTERP_KERNEL::NormalizedCellType typmai2[MED_N_CELL_FIXED_GEO]; extern med_geometry_type typmai3[INTERP_KERNEL::NORM_MAXTYPE]; @@ -908,8 +909,6 @@ void MEDFileFieldPerMeshPerTypePerDisc::fillValues(int discId, mcIdType& startEn void MEDFileFieldPerMeshPerTypePerDisc::writeLL(med_idt fid, const MEDFileFieldNameScope& nasc) const { - TypeOfField type=getType(); - INTERP_KERNEL::NormalizedCellType geoType(getGeoType()); med_geometry_type mgeoti; med_entity_type menti; _father->entriesForMEDfile(getType(),mgeoti,menti); diff --git a/src/MEDLoader/MEDFileFieldMultiTS.cxx b/src/MEDLoader/MEDFileFieldMultiTS.cxx index 688e7fd6b..3d143bd32 100644 --- a/src/MEDLoader/MEDFileFieldMultiTS.cxx +++ b/src/MEDLoader/MEDFileFieldMultiTS.cxx @@ -414,7 +414,7 @@ void MEDFileAnyTypeFieldMultiTSWithoutSDA::simpleRepr(int bkOffset, std::ostream int i=0; for(std::vector< MCAuto >::const_iterator it=_time_steps.begin();it!=_time_steps.end();it++,i++) { - std::string chapter(17,'0'+i); + std::string chapter(17,(char)('0'+i)); oss << startLine << chapter << std::endl; const MEDFileAnyTypeField1TSWithoutSDA *cur=(*it); if(cur) diff --git a/src/MEDLoader/MEDFileJoint.cxx b/src/MEDLoader/MEDFileJoint.cxx index 7565e0603..2736504bf 100644 --- a/src/MEDLoader/MEDFileJoint.cxx +++ b/src/MEDLoader/MEDFileJoint.cxx @@ -26,9 +26,10 @@ #include "CellModel.hxx" #include "InterpKernelAutoPtr.hxx" -extern med_geometry_type typmai[MED_N_CELL_FIXED_GEO]; -extern INTERP_KERNEL::NormalizedCellType typmai2[MED_N_CELL_FIXED_GEO]; -extern med_geometry_type typmai3[INTERP_KERNEL::NORM_MAXTYPE]; +// From MEDLOader.cxx TU +extern const med_geometry_type typmai[MED_N_CELL_FIXED_GEO]; +extern const INTERP_KERNEL::NormalizedCellType typmai2[MED_N_CELL_FIXED_GEO]; +extern const med_geometry_type typmai3[INTERP_KERNEL::NORM_MAXTYPE]; using namespace MEDCoupling; diff --git a/src/MEDLoader/MEDFileMesh.cxx b/src/MEDLoader/MEDFileMesh.cxx index 193e068b9..076c7c177 100644 --- a/src/MEDLoader/MEDFileMesh.cxx +++ b/src/MEDLoader/MEDFileMesh.cxx @@ -35,6 +35,7 @@ #include #include +// From MEDLOader.cxx TU extern med_geometry_type typmai[MED_N_CELL_FIXED_GEO]; extern INTERP_KERNEL::NormalizedCellType typmai2[MED_N_CELL_FIXED_GEO]; extern med_geometry_type typmai3[INTERP_KERNEL::NORM_MAXTYPE]; @@ -695,10 +696,10 @@ void MEDFileMesh::removeGroupAtLevel(int meshDimRelToMaxExt, const std::string& if(idsToKill->empty()) return ; std::vector newFamsOnGrp; - for(std::vector::const_iterator it=famsOnGrp.begin();it!=famsOnGrp.end();it++) + for(std::vector::const_iterator itt=famsOnGrp.begin();itt!=famsOnGrp.end();itt++) { - if(!idsToKill->presenceOfValue(getFamilyId(*it))) - newFamsOnGrp.push_back(*it); + if(!idsToKill->presenceOfValue(getFamilyId(*itt))) + newFamsOnGrp.push_back(*itt); } (*it).second=newFamsOnGrp; } @@ -859,7 +860,7 @@ void MEDFileMesh::rearrangeFamilies() { fams=getFamilyFieldAtLevel(*it); } - catch(INTERP_KERNEL::Exception& e) { } + catch(INTERP_KERNEL::Exception& ) { } if(!fams) continue; std::vector v(fams->getNumberOfTuples(),false); @@ -942,7 +943,7 @@ void MEDFileMesh::zipFamilies() { fams=getFamilyFieldAtLevel(*it); } - catch(INTERP_KERNEL::Exception& e) { } + catch(INTERP_KERNEL::Exception& ) { } if(!fams) continue; MCAuto idsToModif(fams->findIdsEqualList(famIdsSubstSession.second.data(),famIdsSubstSession.second.data()+famIdsSubstSession.second.size())); @@ -6060,6 +6061,7 @@ void MEDFileStructuredMesh::setNameFieldAtLevel(int meshDimRelToMaxExt, DataArra mcIdType nbCells=mesh->getNumberOfCellsOfSubLevelMesh(); nameArr->checkNbOfTuplesAndComp(nbCells,MED_SNAME_SIZE,"MEDFileStructuredMesh::setNameFieldAtLevel : Problem in size of names arr ! Mismatch with number of faces of mesh !"); _names_faces=nameArr; + break; } default: throw INTERP_KERNEL::Exception("MEDFileStructuredMesh::setNameFieldAtLevel : Only available for levels 0 or 1 or -1 !"); diff --git a/src/MEDLoader/MEDFileMeshElt.cxx b/src/MEDLoader/MEDFileMeshElt.cxx index eb755f964..9a274cd7c 100644 --- a/src/MEDLoader/MEDFileMeshElt.cxx +++ b/src/MEDLoader/MEDFileMeshElt.cxx @@ -31,6 +31,7 @@ #include +// From MEDLOader.cxx TU extern med_geometry_type typmai3[INTERP_KERNEL::NORM_MAXTYPE]; using namespace MEDCoupling; diff --git a/src/MEDLoader/MEDFileMeshLL.cxx b/src/MEDLoader/MEDFileMeshLL.cxx index 72f4486e5..733d7e2b3 100644 --- a/src/MEDLoader/MEDFileMeshLL.cxx +++ b/src/MEDLoader/MEDFileMeshLL.cxx @@ -34,6 +34,7 @@ #include #include +// From MEDLOader.cxx TU extern med_geometry_type typmai[MED_N_CELL_FIXED_GEO]; extern INTERP_KERNEL::NormalizedCellType typmai2[MED_N_CELL_FIXED_GEO]; extern med_geometry_type typmainoeud[1]; @@ -298,10 +299,10 @@ void MEDFileMeshL2::ReadFamiliesAndGrps(med_idt fid, const std::string& meshName INTERP_KERNEL::AutoPtr gro=new char[MED_LNAME_SIZE*ngro+1]; MEDfamily23Info(fid,meshName.c_str(),i+1,nomfam,attide,attval,attdes,&numfam,gro); std::string famName(MEDLoaderBase::buildStringFromFortran(nomfam,MED_NAME_SIZE)); - std::vector grps(ngro); + std::vector grps2(ngro); for(int j=0;j > >(famName,std::pair >(numfam,grps)); + grps2[j]=MEDLoaderBase::buildStringFromFortran(gro+j*MED_LNAME_SIZE,MED_LNAME_SIZE); + crudeFams[i]=std::pair > >(famName,std::pair >(numfam,grps2)); } RenameFamiliesFromFileToMemInternal(crudeFams); for(std::vector< std::pair > > >::const_iterator it0=crudeFams.begin();it0!=crudeFams.end();it0++) diff --git a/src/MEDLoader/MEDLoader.cxx b/src/MEDLoader/MEDLoader.cxx index 4899e483c..eee04129a 100644 --- a/src/MEDLoader/MEDLoader.cxx +++ b/src/MEDLoader/MEDLoader.cxx @@ -49,6 +49,12 @@ #include #include +extern med_geometry_type typmai[MED_N_CELL_FIXED_GEO]; +extern med_geometry_type typmainoeud[1]; +extern INTERP_KERNEL::NormalizedCellType typmai2[MED_N_CELL_FIXED_GEO]; +extern med_geometry_type typmai3[INTERP_KERNEL::NORM_MAXTYPE]; + + med_geometry_type typmai[MED_N_CELL_FIXED_GEO] = { MED_POINT1, MED_SEG2, MED_SEG3, @@ -136,11 +142,11 @@ med_geometry_type typmai3[INTERP_KERNEL::NORM_MAXTYPE] = { MED_POINT1,//0 MED_POLYGON2//32 }; -double _EPS_FOR_NODE_COMP=1.e-12; - -int _COMP_FOR_CELL=0; +// Just for this translation unit: +static double _EPS_FOR_NODE_COMP=1.e-12; +static int _COMP_FOR_CELL=0; +static int _TOO_LONG_STR=0; -int _TOO_LONG_STR=0; using namespace MEDCoupling; diff --git a/src/ParaMEDMEM/CommInterface.hxx b/src/ParaMEDMEM/CommInterface.hxx index 6671c9703..6cdf1bfce 100644 --- a/src/ParaMEDMEM/CommInterface.hxx +++ b/src/ParaMEDMEM/CommInterface.hxx @@ -164,7 +164,6 @@ namespace MEDCoupling template int gatherArraysT(MPI_Comm comm, int root, const typename Traits::ArrayType *array, std::unique_ptr& result, std::unique_ptr& resultIndex, int& rank) const { - using DataArrayT = typename Traits::ArrayType; int size; this->commSize(comm,&size); rank = -1; @@ -214,7 +213,6 @@ namespace MEDCoupling template int allGatherArraysT(MPI_Comm comm, const typename Traits::ArrayType *array, std::unique_ptr& result, std::unique_ptr& resultIndex) const { - using DataArrayT = typename Traits::ArrayType; int size; this->commSize(comm,&size); std::unique_ptr nbOfElems(new mcIdType[size]); diff --git a/src/ParaMEDMEM/InterpKernelDEC.cxx b/src/ParaMEDMEM/InterpKernelDEC.cxx index afdb821f8..d379bf206 100644 --- a/src/ParaMEDMEM/InterpKernelDEC.cxx +++ b/src/ParaMEDMEM/InterpKernelDEC.cxx @@ -34,8 +34,7 @@ namespace MEDCoupling { InterpKernelDEC::InterpKernelDEC(): DisjointDEC(), - _nb_distant_points(0), _distant_coords(0), - _distant_locations(0), _interpolation_matrix(0) + _interpolation_matrix(0) { } @@ -52,8 +51,7 @@ namespace MEDCoupling */ InterpKernelDEC::InterpKernelDEC(ProcessorGroup& source_group, ProcessorGroup& target_group): DisjointDEC(source_group, target_group), - _nb_distant_points(0), _distant_coords(0), - _distant_locations(0), _interpolation_matrix(0) + _interpolation_matrix(0) { } @@ -67,8 +65,7 @@ namespace MEDCoupling InterpKernelDEC::InterpKernelDEC(const std::set& src_ids, const std::set& trg_ids, const MPI_Comm& world_comm): DisjointDEC(src_ids,trg_ids,world_comm), - _nb_distant_points(0), _distant_coords(0), - _distant_locations(0), _interpolation_matrix(0) + _interpolation_matrix(0) { } diff --git a/src/ParaMEDMEM/InterpKernelDEC.hxx b/src/ParaMEDMEM/InterpKernelDEC.hxx index 4e6976198..b92a663c8 100644 --- a/src/ParaMEDMEM/InterpKernelDEC.hxx +++ b/src/ParaMEDMEM/InterpKernelDEC.hxx @@ -141,12 +141,6 @@ namespace MEDCoupling void prepareSourceDE() { } void prepareTargetDE() { } private : - //Number of distant points to be located locally - int _nb_distant_points; - //coordinates of distant points - const double* _distant_coords; - //local element number containing the distant points - const int* _distant_locations; InterpolationMatrix* _interpolation_matrix; }; } diff --git a/src/ParaMEDMEM/MPIAccess.cxx b/src/ParaMEDMEM/MPIAccess.cxx index 55ea1baf5..8ddaf698c 100644 --- a/src/ParaMEDMEM/MPIAccess.cxx +++ b/src/ParaMEDMEM/MPIAccess.cxx @@ -407,8 +407,8 @@ namespace MEDCoupling int outcount = 0 ; if ( sts == MPI_SUCCESS ) { - MPI_Datatype datatype = MPIDatatype( RequestId ) ; - _comm_interface.getCount(MPIStatus( RequestId ), datatype, &outcount ) ; + MPI_Datatype datatype2 = MPIDatatype( RequestId ) ; + _comm_interface.getCount(MPIStatus( RequestId ), datatype2, &outcount ) ; setMPIOutCount( RequestId , outcount ) ; setMPICompleted( RequestId , true ) ; deleteStatus( RequestId ) ; diff --git a/src/ParaMEDMEM/OverlapInterpolationMatrix.cxx b/src/ParaMEDMEM/OverlapInterpolationMatrix.cxx index 1f81887ca..9ec73fd23 100644 --- a/src/ParaMEDMEM/OverlapInterpolationMatrix.cxx +++ b/src/ParaMEDMEM/OverlapInterpolationMatrix.cxx @@ -56,8 +56,7 @@ namespace MEDCoupling _target_field(target_field), _source_support(source_field->getSupport()->getCellMesh()), _target_support(target_field->getSupport()->getCellMesh()), - _mapping(group, locator), - _group(group) + _mapping(group, locator) { } diff --git a/src/ParaMEDMEM/OverlapInterpolationMatrix.hxx b/src/ParaMEDMEM/OverlapInterpolationMatrix.hxx index 1d89bf859..d884f963d 100644 --- a/src/ParaMEDMEM/OverlapInterpolationMatrix.hxx +++ b/src/ParaMEDMEM/OverlapInterpolationMatrix.hxx @@ -74,8 +74,6 @@ namespace MEDCoupling MEDCouplingPointSet *_source_support; MEDCouplingPointSet *_target_support; OverlapMapping _mapping; - - const ProcessorGroup& _group; }; } diff --git a/src/ParaMEDMEM/OverlapMapping.cxx b/src/ParaMEDMEM/OverlapMapping.cxx index bf25a6636..4fe0b6f89 100644 --- a/src/ParaMEDMEM/OverlapMapping.cxx +++ b/src/ParaMEDMEM/OverlapMapping.cxx @@ -279,10 +279,10 @@ void OverlapMapping::computeDenoConservativeVolumic(mcIdType nbOfTuplesTrg) denoM.resize(mat.size()); if(isItem1==_sent_trg_ids.end() || curSrcId==myProcId)//item1 of step2 main algo. Simple, because rowId of mat are directly target ids. { - mcIdType rowId=0; - for(std::vector< SparseDoubleVec >::const_iterator it1=mat.begin();it1!=mat.end();it1++,rowId++) + mcIdType rowId2=0; + for(std::vector< SparseDoubleVec >::const_iterator it1=mat.begin();it1!=mat.end();it1++,rowId2++) for(SparseDoubleVec::const_iterator it2=(*it1).begin();it2!=(*it1).end();it2++) - denoM[rowId][(*it2).first]=deno[rowId]; + denoM[rowId2][(*it2).first]=deno[rowId2]; } else { diff --git a/src/ParaMEDMEM/ParaGRID.cxx b/src/ParaMEDMEM/ParaGRID.cxx index 5dbb2323d..4928682c8 100644 --- a/src/ParaMEDMEM/ParaGRID.cxx +++ b/src/ParaMEDMEM/ParaGRID.cxx @@ -32,7 +32,7 @@ namespace MEDCoupling { ParaGRID::ParaGRID(MEDCouplingCMesh* global_grid, Topology* topology) : - _global_axis(), _my_domain_id(0) + _global_axis() { _block_topology = dynamic_cast(topology); if(_block_topology==0) diff --git a/src/ParaMEDMEM/ParaGRID.hxx b/src/ParaMEDMEM/ParaGRID.hxx index a5e7e7a7d..57c7afa0e 100644 --- a/src/ParaMEDMEM/ParaGRID.hxx +++ b/src/ParaMEDMEM/ParaGRID.hxx @@ -47,8 +47,6 @@ namespace MEDCoupling MEDCoupling::BlockTopology* _block_topology; // stores the x,y,z axes on the global grid std::vector > _global_axis; - //id of the local grid - int _my_domain_id; }; } diff --git a/src/ParaMEDMEM/ParaSkyLineArray.cxx b/src/ParaMEDMEM/ParaSkyLineArray.cxx index 586c0c4a8..4ae9e8765 100644 --- a/src/ParaMEDMEM/ParaSkyLineArray.cxx +++ b/src/ParaMEDMEM/ParaSkyLineArray.cxx @@ -132,4 +132,5 @@ MCAuto ParaSkyLineArray::equiRedistribute(mcIdType nbOfEntitie skOut = skOut->uniqueNotSortedByPack();//remove duplicates MCAuto ret(ParaSkyLineArray::New(skOut,globalIdsOut)); return ret.retn(); -} \ No newline at end of file +} + diff --git a/src/ParaMEDMEMTest/MPI2Connector.cxx b/src/ParaMEDMEMTest/MPI2Connector.cxx index 87b16bfb2..a8a5bc432 100644 --- a/src/ParaMEDMEMTest/MPI2Connector.cxx +++ b/src/ParaMEDMEMTest/MPI2Connector.cxx @@ -26,10 +26,13 @@ #include #endif -#if OMPI_MAJOR_VERSION >= 4 -#define MPI_ERROR_HANDLER(var) MPI_Comm_set_errhandler(MPI_COMM_WORLD, var); -#else -#define MPI_ERROR_HANDLER(var) MPI_Errhandler_set(MPI_COMM_WORLD, var); + +#ifdef OMPI_MAJOR_VERSION +# if OMPI_MAJOR_VERSION >= 4 +# define MPI_ERROR_HANDLER(var) MPI_Comm_set_errhandler(MPI_COMM_WORLD, var); +# endif +#else // MPICH and other versions: +# define MPI_ERROR_HANDLER(var) MPI_Errhandler_set(MPI_COMM_WORLD, var); #endif MPI2Connector::MPI2Connector() diff --git a/src/ParaMEDMEMTest/ParaMEDMEMTest_ICoco.cxx b/src/ParaMEDMEMTest/ParaMEDMEMTest_ICoco.cxx index 3a489e478..2650ce9ef 100644 --- a/src/ParaMEDMEMTest/ParaMEDMEMTest_ICoco.cxx +++ b/src/ParaMEDMEMTest/ParaMEDMEMTest_ICoco.cxx @@ -45,7 +45,7 @@ void synchronize_bool(bool& stop, synctype s) int my_stop_temp = stop?1:0; if (s==sync_and) MPI_Allreduce(&my_stop_temp,&my_stop,1,MPI_INTEGER,MPI_MIN,MPI_COMM_WORLD); - else if (s==sync_or) + else // if (s==sync_or) MPI_Allreduce(&my_stop_temp,&my_stop,1,MPI_INTEGER,MPI_MAX,MPI_COMM_WORLD); stop =(my_stop==1); } diff --git a/src/ParaMEDMEMTest/test_AllToAllTimeDEC.cxx b/src/ParaMEDMEMTest/test_AllToAllTimeDEC.cxx index c365cc203..b43e1bd66 100644 --- a/src/ParaMEDMEMTest/test_AllToAllTimeDEC.cxx +++ b/src/ParaMEDMEMTest/test_AllToAllTimeDEC.cxx @@ -152,7 +152,7 @@ void MPIAccessDECTest::test_AllToAllTimeDEC( bool Asynchronous ) { recvbuf[j] = -1 ; } - int sts = MyMPIAccessDEC->allToAllTime( sendbuf, sendcount , MPI_INT , + sts = MyMPIAccessDEC->allToAllTime( sendbuf, sendcount , MPI_INT , recvbuf, recvcount , MPI_INT ) ; chksts( sts , myrank , mpi_access ) ; diff --git a/src/ParaMEDMEMTest/test_AllToAllvTimeDEC.cxx b/src/ParaMEDMEMTest/test_AllToAllvTimeDEC.cxx index 4af2ead74..a35a1117a 100644 --- a/src/ParaMEDMEMTest/test_AllToAllvTimeDEC.cxx +++ b/src/ParaMEDMEMTest/test_AllToAllvTimeDEC.cxx @@ -210,9 +210,9 @@ void MPIAccessDECTest::test_AllToAllvTimeDEC( bool Asynchronous , bool UseMPINat delete [] sendbuf ; } else { - int sts = MyMPIAccessDEC->allToAllvTime( sendbuf, sendcounts , sdispls , MPI_INT , + int sts2 = MyMPIAccessDEC->allToAllvTime( sendbuf, sendcounts , sdispls , MPI_INT , recvbuf, recvcounts , rdispls , MPI_INT ) ; - chksts( sts , myrank , mpi_access ) ; + chksts( sts2 , myrank , mpi_access ) ; } // debugStream << "test_AllToAllvTimeDEC" << myrank << " recvbuf before CheckSent" ; @@ -242,10 +242,9 @@ void MPIAccessDECTest::test_AllToAllvTimeDEC( bool Asynchronous , bool UseMPINat // debugStream << "test_AllToAllvTimeDEC" << myrank << " check of recvbuf" << endl ; bool badrecvbuf = false ; for ( i = 0 ; i < size ; i++ ) { - int j ; - for ( j = 0 ; j < datamsglength ; j++ ) { - int index = i*datamsglength+j ; - if ( j < recvcounts[i] ) { + for ( int jj = 0 ; jj < datamsglength ; jj++ ) { + int index = i*datamsglength+jj ; + if ( jj < recvcounts[i] ) { if ( recvbuf[index] != (index/datamsglength)*1000000 + myrank*1000 + myrank*datamsglength+(index%datamsglength) ) { badrecvbuf = true ; diff --git a/src/ParaMEDMEMTest/test_AllToAllvTimeDoubleDEC.cxx b/src/ParaMEDMEMTest/test_AllToAllvTimeDoubleDEC.cxx index d15a81b16..ead0f9caa 100644 --- a/src/ParaMEDMEMTest/test_AllToAllvTimeDoubleDEC.cxx +++ b/src/ParaMEDMEMTest/test_AllToAllvTimeDoubleDEC.cxx @@ -189,7 +189,7 @@ void MPIAccessDECTest::test_AllToAllvTimeDoubleDEC( bool Asynchronous ) { //debugStream << endl ; } - int sts = MyMPIAccessDEC->allToAllvTime( sendbuf, sendcounts , sdispls , MPI_DOUBLE , + sts = MyMPIAccessDEC->allToAllvTime( sendbuf, sendcounts , sdispls , MPI_DOUBLE , recvbuf, recvcounts , rdispls , MPI_DOUBLE ) ; chksts( sts , myrank , mpi_access ) ; @@ -218,23 +218,22 @@ void MPIAccessDECTest::test_AllToAllvTimeDoubleDEC( bool Asynchronous ) { // debugStream << "test_AllToAllvTimeDoubleDEC" << myrank << " check of recvbuf" << endl ; bool badrecvbuf = false ; for ( target = 0 ; target < size ; target++ ) { - int j ; - for ( j = 0 ; j < datamsglength ; j++ ) { - int index = target*datamsglength+j ; - if ( j < recvcounts[target] ) { + for ( int jj = 0 ; jj < datamsglength ; jj++ ) { + int index = target*datamsglength+jj ; + if ( jj < recvcounts[target] ) { if ( fabs(recvbuf[index] - (target*1000000 + myrank*10000 + - (timeLoc[target]/deltatime[target])*100 + j)) > 101) { + (timeLoc[target]/deltatime[target])*100 + jj)) > 101) { badrecvbuf = true ; debugStream << "test_AllToAllvTimeDoubleDEC" << myrank << " target " << target << " timeLoc[target] " << timeLoc[target] << " recvbuf[" << index << "] " << (int ) recvbuf[index] << " # " << (int ) (target*1000000 + - myrank*10000 + (timeLoc[target]/deltatime[target])*100 + j) + myrank*10000 + (timeLoc[target]/deltatime[target])*100 + jj) << endl ; } else if ( badrecvbuf ) { debugStream << "test_AllToAllvTimeDoubleDEC" << myrank << " recvbuf[" << index << "] " << recvbuf[index] << " ~= " << (int ) (target*1000000 + - myrank*10000 + (timeLoc[target]/deltatime[target])*100 + j) << endl ; + myrank*10000 + (timeLoc[target]/deltatime[target])*100 + jj) << endl ; } } else if ( recvbuf[index] != -1 ) { diff --git a/src/ParaMEDMEMTest/test_MPI_Access_Cancel.cxx b/src/ParaMEDMEMTest/test_MPI_Access_Cancel.cxx index 99ba5c5ca..ccd7146f5 100644 --- a/src/ParaMEDMEMTest/test_MPI_Access_Cancel.cxx +++ b/src/ParaMEDMEMTest/test_MPI_Access_Cancel.cxx @@ -124,7 +124,7 @@ void MPIAccessTest::test_MPI_Access_Cancel() { sts = mpi_access.IRecv(&recvbuf,outcount,MPI_INT,source, RequestId[i] ) ; if ( datatype == MPI_INT ) { - int source, tag, error, outcount ; + int error; mpi_access.wait( RequestId[i] ) ; mpi_access.status( RequestId[i], source, tag, error, outcount, true ) ; diff --git a/src/ParaMEDMEMTest/test_MPI_Access_ISendRecv.cxx b/src/ParaMEDMEMTest/test_MPI_Access_ISendRecv.cxx index 295ac868d..a58d76563 100644 --- a/src/ParaMEDMEMTest/test_MPI_Access_ISendRecv.cxx +++ b/src/ParaMEDMEMTest/test_MPI_Access_ISendRecv.cxx @@ -109,7 +109,7 @@ void MPIAccessTest::test_MPI_Access_ISendRecv() { << ")" << endl ; mpi_access.test( SendRequestId[j], flag ) ; if ( flag ) { - int target, tag, error, outcount ; + int tag, error, outcount ; mpi_access.status( SendRequestId[j], target, tag, error, outcount, true ) ; debugStream << "test" << myrank << " Send RequestId " << SendRequestId[j] diff --git a/src/ParaMEDMEMTest/test_MPI_Access_ISend_IRecv.cxx b/src/ParaMEDMEMTest/test_MPI_Access_ISend_IRecv.cxx index 7c92eb347..99aaf640b 100644 --- a/src/ParaMEDMEMTest/test_MPI_Access_ISend_IRecv.cxx +++ b/src/ParaMEDMEMTest/test_MPI_Access_ISend_IRecv.cxx @@ -102,7 +102,7 @@ void MPIAccessTest::test_MPI_Access_ISend_IRecv() { mpi_access.test( RecvRequestId[j], flag ) ; } if ( flag ) { - int target,source, tag, error, outcount ; + int source, tag, error, outcount ; if ( myrank == 0 ) { mpi_access.status( SendRequestId[j], target, tag, error, outcount, true ) ; @@ -169,7 +169,6 @@ void MPIAccessTest::test_MPI_Access_ISend_IRecv() { if ( myrank == 0 ) { int sendrequests[maxreq] ; int sendreqsize = mpi_access.sendRequestIds( target , maxreq , sendrequests ) ; - int i ; if ( sendreqsize != 0 ) { ostringstream strstream ; strstream << "=========================================================" << endl diff --git a/src/ParaMEDMEMTest/test_MPI_Access_ISend_IRecv_BottleNeck.cxx b/src/ParaMEDMEMTest/test_MPI_Access_ISend_IRecv_BottleNeck.cxx index 208f7b55d..5a5263ac3 100644 --- a/src/ParaMEDMEMTest/test_MPI_Access_ISend_IRecv_BottleNeck.cxx +++ b/src/ParaMEDMEMTest/test_MPI_Access_ISend_IRecv_BottleNeck.cxx @@ -141,28 +141,26 @@ void MPIAccessTest::test_MPI_Access_ISend_IRecv_BottleNeck() { if(MPI_ACCESS_VERBOSE) mpi_access.check() ; if ( myrank == 0 ) { - int size = mpi_access.sendRequestIdsSize() ; - debugStream << "test" << myrank << " before WaitAll sendreqsize " << size << endl ; + int size2 = mpi_access.sendRequestIdsSize() ; + debugStream << "test" << myrank << " before WaitAll sendreqsize " << size2 << endl ; mpi_access.waitAll(maxreq, SendRequestId) ; - size = mpi_access.sendRequestIdsSize() ; - debugStream << "test" << myrank << " after WaitAll sendreqsize " << size << endl ; - int * ArrayOfSendRequests = new int[ size ] ; - int nSendRequest = mpi_access.sendRequestIds( size , ArrayOfSendRequests ) ; - int i ; + size2 = mpi_access.sendRequestIdsSize() ; + debugStream << "test" << myrank << " after WaitAll sendreqsize " << size2 << endl ; + int * ArrayOfSendRequests = new int[ size2 ] ; + int nSendRequest = mpi_access.sendRequestIds( size2 , ArrayOfSendRequests ) ; for ( i = 0 ; i < nSendRequest ; i++ ) { mpi_access.deleteRequest( ArrayOfSendRequests[i] ) ; } delete [] ArrayOfSendRequests ; } else { - int size = mpi_access.recvRequestIdsSize() ; - debugStream << "test" << myrank << " before WaitAll recvreqsize " << size << endl ; + int size2 = mpi_access.recvRequestIdsSize() ; + debugStream << "test" << myrank << " before WaitAll recvreqsize " << size2 << endl ; mpi_access.waitAll(maxreq, RecvRequestId) ; - size = mpi_access.recvRequestIdsSize() ; - debugStream << "test" << myrank << " after WaitAll recvreqsize " << size << endl ; - int * ArrayOfRecvRequests = new int[ size ] ; - int nRecvRequest = mpi_access.recvRequestIds( size , ArrayOfRecvRequests ) ; - int i ; + size2 = mpi_access.recvRequestIdsSize() ; + debugStream << "test" << myrank << " after WaitAll recvreqsize " << size2 << endl ; + int * ArrayOfRecvRequests = new int[ size2 ] ; + int nRecvRequest = mpi_access.recvRequestIds( size2 , ArrayOfRecvRequests ) ; for ( i = 0 ; i < nRecvRequest ; i++ ) { mpi_access.deleteRequest( ArrayOfRecvRequests[i] ) ; } @@ -173,7 +171,6 @@ void MPIAccessTest::test_MPI_Access_ISend_IRecv_BottleNeck() { if ( myrank == 0 ) { int sendrequests[maxreq] ; int sendreqsize = mpi_access.sendRequestIds( target , maxreq , sendrequests ) ; - int i ; if ( sendreqsize != 0 ) { ostringstream strstream ; strstream << "=========================================================" << endl diff --git a/src/ParaMEDMEMTest/test_MPI_Access_ISend_IRecv_Length.cxx b/src/ParaMEDMEMTest/test_MPI_Access_ISend_IRecv_Length.cxx index eb76b358d..5ba6afe14 100644 --- a/src/ParaMEDMEMTest/test_MPI_Access_ISend_IRecv_Length.cxx +++ b/src/ParaMEDMEMTest/test_MPI_Access_ISend_IRecv_Length.cxx @@ -107,12 +107,12 @@ void MPIAccessTest::test_MPI_Access_ISend_IRecv_Length() { mpi_access.test( RecvRequestId[j], flag ) ; } if ( flag ) { - int target,source, tag, error, outcount ; + int target2,source, tag, error, outcount ; if ( myrank == 0 ) { - mpi_access.status( SendRequestId[j], target, tag, error, outcount, + mpi_access.status( SendRequestId[j], target2, tag, error, outcount, true ) ; debugStream << "test" << myrank << " Test(Send RequestId " << SendRequestId[j] - << ") : target " << target << " tag " << tag << " error " << error + << ") : target " << target2 << " tag " << tag << " error " << error << " flag " << flag << endl ; } else { diff --git a/src/ParaMEDMEMTest/test_MPI_Access_ISend_IRecv_Length_1.cxx b/src/ParaMEDMEMTest/test_MPI_Access_ISend_IRecv_Length_1.cxx index 674d47e82..93a34cb51 100644 --- a/src/ParaMEDMEMTest/test_MPI_Access_ISend_IRecv_Length_1.cxx +++ b/src/ParaMEDMEMTest/test_MPI_Access_ISend_IRecv_Length_1.cxx @@ -94,7 +94,7 @@ void MPIAccessTest::test_MPI_Access_ISend_IRecv_Length_1() { } int j ; for (j = 1 ; j <= i ; j++) { - int source ; + int source = 0; MPI_Datatype datatype = 0; int outcount = 0; int flag ; @@ -125,7 +125,7 @@ void MPIAccessTest::test_MPI_Access_ISend_IRecv_Length_1() { } if ( flag ) { if ( myrank == 0 ) { - int target, tag, error, outcount ; + int tag, error ; mpi_access.status( SendRequestId[j], target, tag, error, outcount, true ) ; debugStream << "test" << myrank << " Test(Send RequestId " << SendRequestId[j] @@ -175,10 +175,8 @@ void MPIAccessTest::test_MPI_Access_ISend_IRecv_Length_1() { debugStream << "test" << myrank << " TestAll SendRequest flag " << flag << endl ; } else { - int i ; int source ; int outcount ; - int flag ; if ( maxirecv != maxreq ) { ostringstream strstream ; strstream << "===========================================================" diff --git a/src/ParaMEDMEMTest/test_MPI_Access_Time.cxx b/src/ParaMEDMEMTest/test_MPI_Access_Time.cxx index 684e8d057..a5067ea25 100644 --- a/src/ParaMEDMEMTest/test_MPI_Access_Time.cxx +++ b/src/ParaMEDMEMTest/test_MPI_Access_Time.cxx @@ -129,7 +129,7 @@ void MPIAccessTest::test_MPI_Access_Time() { mpi_access.test( RecvTimeRequestId[j], flag ) ; } if ( flag ) { - int target,source, tag, error, outcount ; + int source, tag, error, outcount ; if ( myrank == 0 ) { mpi_access.status( SendTimeRequestId[j], target, tag, error, outcount, true ) ; @@ -170,7 +170,7 @@ void MPIAccessTest::test_MPI_Access_Time() { mpi_access.test( RecvRequestId[j], flag ) ; } if ( flag ) { - int target,source, tag, error, outcount ; + int source, tag, error, outcount ; if ( myrank == 0 ) { mpi_access.status( SendRequestId[j], target, tag, error, outcount, true ) ; diff --git a/src/RENUMBER/RENUMBER_BOOSTRenumbering.cxx b/src/RENUMBER/RENUMBER_BOOSTRenumbering.cxx index d6e385ec7..8d78360ba 100644 --- a/src/RENUMBER/RENUMBER_BOOSTRenumbering.cxx +++ b/src/RENUMBER/RENUMBER_BOOSTRenumbering.cxx @@ -37,8 +37,6 @@ void BOOSTRenumbering::renumber(const mcIdType *graph, const mcIdType *index_gra typedef boost::adjacency_list > > Graph; - typedef boost::graph_traits::vertex_descriptor Vertex; - typedef boost::graph_traits::vertices_size_type size_type; Graph G(nbCell); for (mcIdType i=0;i