From fa9f8a6224c054eaf431ebde7f0e785b562758b9 Mon Sep 17 00:00:00 2001 From: eap Date: Thu, 19 Dec 2019 16:34:19 +0300 Subject: [PATCH] LOT7: fix compilation at med_int==int64 --- src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx | 2 +- src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx | 1 + src/DriverMED/DriverMED_W_SMESHDS_Mesh.h | 2 +- src/MEDWrapper/MED_Common.hxx | 13 +++++++------ src/SMESH_I/CMakeLists.txt | 1 + src/SMESH_I/SMESH_PreMeshInfo.cxx | 2 +- src/Tools/MeshCut/MeshCut_DC.cxx | 4 ++-- src/Tools/MeshCut/MeshCut_Fonctions.cxx | 2 +- src/Tools/MeshCut/MeshCut_Maillage.cxx | 8 ++++---- src/Tools/MeshCut/MeshCut_Maillage.hxx | 2 +- src/Tools/MeshCut/MeshCut_Utils.cxx | 2 +- src/Tools/MeshCut/MeshCut_Utils.hxx | 2 +- 12 files changed, 22 insertions(+), 19 deletions(-) diff --git a/src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx b/src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx index a8ed41c9c..68f17df38 100644 --- a/src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx +++ b/src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx @@ -266,7 +266,7 @@ Driver_Mesh::Status DriverMED_R_SMESHDS_Mesh::Perform() } #endif if ( !anIsNodeNum ) - aNodeIds.swap( *(aBallInfo->myConn )); + aNodeIds.assign( aBallInfo->myConn->begin(), aBallInfo->myConn->end()); // allocate array of diameters vtkIdType maxID = myMesh->MaxElementID() + aNbBalls; diff --git a/src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx b/src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx index a4774fe23..30f3ac4a3 100644 --- a/src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx +++ b/src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx @@ -34,6 +34,7 @@ #include "SMDS_MeshNode.hxx" #include "SMDS_SetIterator.hxx" #include "SMESHDS_Mesh.hxx" +#include "MED_Common.hxx" #include diff --git a/src/DriverMED/DriverMED_W_SMESHDS_Mesh.h b/src/DriverMED/DriverMED_W_SMESHDS_Mesh.h index 76d85a0ff..d36b2169a 100644 --- a/src/DriverMED/DriverMED_W_SMESHDS_Mesh.h +++ b/src/DriverMED/DriverMED_W_SMESHDS_Mesh.h @@ -30,7 +30,7 @@ #include "SMESH_DriverMED.hxx" #include "Driver_SMESHDS_Mesh.h" -#include "MED_Common.hxx" +//#include "MED_Common.hxx" #include #include diff --git a/src/MEDWrapper/MED_Common.hxx b/src/MEDWrapper/MED_Common.hxx index f5bb08e40..26596f8b2 100644 --- a/src/MEDWrapper/MED_Common.hxx +++ b/src/MEDWrapper/MED_Common.hxx @@ -31,7 +31,7 @@ #include #include -#include +#include #ifdef WIN32 #pragma warning(disable:4099) @@ -41,11 +41,12 @@ namespace MED { typedef enum {eFAUX, eVRAI} EBooleen; typedef double TFloat; -#if defined(HAVE_F77INT64) - typedef long TInt; -#else - typedef int TInt; -#endif +// #if defined(HAVE_F77INT64) +// typedef long TInt; +// #else +// typedef int TInt; +// #endif + typedef med_int TInt; typedef hid_t TIdt; typedef herr_t TErr; diff --git a/src/SMESH_I/CMakeLists.txt b/src/SMESH_I/CMakeLists.txt index e274c7728..9bb707929 100644 --- a/src/SMESH_I/CMakeLists.txt +++ b/src/SMESH_I/CMakeLists.txt @@ -23,6 +23,7 @@ INCLUDE_DIRECTORIES( ${OMNIORB_INCLUDE_DIR} ${OpenCASCADE_INCLUDE_DIR} ${HDF5_INCLUDE_DIRS} + ${MEDFILE_INCLUDE_DIRS} ${VTK_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${KERNEL_INCLUDE_DIRS} diff --git a/src/SMESH_I/SMESH_PreMeshInfo.cxx b/src/SMESH_I/SMESH_PreMeshInfo.cxx index 58701b123..275acb043 100644 --- a/src/SMESH_I/SMESH_PreMeshInfo.cxx +++ b/src/SMESH_I/SMESH_PreMeshInfo.cxx @@ -479,7 +479,7 @@ bool SMESH_PreMeshInfo::readMeshInfo() MED::PMeshInfo medMeshInfo = aMed->CrMeshInfo(3,3,SMESH_Comment( _meshID )); // read nb nodes - int nbNodes = std::max( 0, aMed->GetNbNodes( medMeshInfo )); + int nbNodes = Max( 0, aMed->GetNbNodes( medMeshInfo )); if ( nbNodes > 0 ) { setNb( SMDSEntity_Node, nbNodes); diff --git a/src/Tools/MeshCut/MeshCut_DC.cxx b/src/Tools/MeshCut/MeshCut_DC.cxx index fb80f4696..224667f60 100644 --- a/src/Tools/MeshCut/MeshCut_DC.cxx +++ b/src/Tools/MeshCut/MeshCut_DC.cxx @@ -211,7 +211,7 @@ int main(int argc, char *argv[]) { bool plus = false; bool moins = false; - int *offset = MAILLAGE1->CNX[TETRA4] + 4 * it4; + med_int *offset = MAILLAGE1->CNX[TETRA4] + 4 * it4; for (int is = 0; is < 4; is++) { int ng = *(offset + is); @@ -1065,7 +1065,7 @@ int main(int argc, char *argv[]) // cout << "Legacy " << tm << " effectif " << MAILLAGE1->EFFECTIFS_TYPES[tm] << endl; int tailleType = Nnoeuds(tm); - MAILLAGE2->CNX[tm] = (int*) malloc(sizeof(int) * tailleType * (MAILLAGE1->EFFECTIFS_TYPES[tm] + MAILLAGE2->CNX[tm] = (med_int*) malloc(sizeof(med_int) * tailleType * (MAILLAGE1->EFFECTIFS_TYPES[tm] + cptNouvellesMailles[tm])); for (int i = 0; i < MAILLAGE1->EFFECTIFS_TYPES[tm]; i++) for (int j = 0; j < tailleType; j++) diff --git a/src/Tools/MeshCut/MeshCut_Fonctions.cxx b/src/Tools/MeshCut/MeshCut_Fonctions.cxx index ba8284d0d..e99da4fc5 100644 --- a/src/Tools/MeshCut/MeshCut_Fonctions.cxx +++ b/src/Tools/MeshCut/MeshCut_Fonctions.cxx @@ -89,7 +89,7 @@ int MESHCUT::intersectionSegmentPlan(int it4, int na) float A[3], B[3]; // Détermination des ng des extrémités de l'arête passée en argument na - int * offset = MAILLAGE1->CNX[TETRA4] + 4 * it4; + med_int * offset = MAILLAGE1->CNX[TETRA4] + 4 * it4; if (na == 0) { ngA = *(offset + 0); diff --git a/src/Tools/MeshCut/MeshCut_Maillage.cxx b/src/Tools/MeshCut/MeshCut_Maillage.cxx index c6cc137dd..d7e41ccb6 100644 --- a/src/Tools/MeshCut/MeshCut_Maillage.cxx +++ b/src/Tools/MeshCut/MeshCut_Maillage.cxx @@ -66,7 +66,7 @@ void Maillage::afficheMailles(TYPE_MAILLE tm) { cout << "\tMaille " << i << " :" << endl; //Boucle sur les noeuds de la maille de numéro local i dans le type tm - int * offset = CNX[tm] + nnoeuds * i; + med_int * offset = CNX[tm] + nnoeuds * i; for (int j = 0; j < nnoeuds; j++) { int ngnoeud = *(offset + j); @@ -868,7 +868,7 @@ void Maillage::acquisitionTYPE_inputMED(TYPE_MAILLE TYPE, int nTYPE, med_idt fid med_int *famTYPE = (med_int*) malloc(sizeof(med_int) * nTYPE); //med_int *conTYPE = (med_int*) malloc(sizeof(med_int)*tTYPE*nTYPE); - CNX[TYPE] = (int*) malloc(sizeof(int) * tTYPE * nTYPE); + CNX[TYPE] = (med_int*) malloc(sizeof(med_int) * tTYPE * nTYPE); med_bool inomTYPE, inumTYPE, ifamTYPE; med_geometry_type typeBanaliseMED = InstanceMGE(TYPE); @@ -1705,10 +1705,10 @@ void Maillage::eliminationMailles(TYPE_MAILLE tm, vector listeMaillesSuppr) // ************* Modification de la connectivité du type concerné - int* CNX2; + med_int* CNX2; int nNoeudsType = Nnoeuds(tm); int tailleCNX2 = nNoeudsType * (EFFECTIFS_TYPES[tm] - listeMaillesSuppr.size()); - CNX2 = (int*) malloc(sizeof(int) * tailleCNX2); + CNX2 = (med_int*) malloc(sizeof(med_int) * tailleCNX2); // Recopie sélective des connectivités int isuppr = 0; // indice dans listeMaillesSuppr int ih2 = 0; // nouveau numéro local ( remarque: ih2 = ih1 - isuppr ) diff --git a/src/Tools/MeshCut/MeshCut_Maillage.hxx b/src/Tools/MeshCut/MeshCut_Maillage.hxx index 7ec14de78..6f984dd09 100644 --- a/src/Tools/MeshCut/MeshCut_Maillage.hxx +++ b/src/Tools/MeshCut/MeshCut_Maillage.hxx @@ -75,7 +75,7 @@ namespace MESHCUT // Le numéro global du j-ième noeud de la maille de numéro global i est stocké à l'adresse // CNX[tm]+t*(i-1)+(j-1) // (t = taille du type, i.e. nombre de noeuds de l'élément) - std::map CNX; // ****** MED-OBLIGATOIRE ****** + std::map CNX; // ****** MED-OBLIGATOIRE ****** // Enveloppes cubiques std::map EC; diff --git a/src/Tools/MeshCut/MeshCut_Utils.cxx b/src/Tools/MeshCut/MeshCut_Utils.cxx index 5aa78dbb6..059ca3c8b 100644 --- a/src/Tools/MeshCut/MeshCut_Utils.cxx +++ b/src/Tools/MeshCut/MeshCut_Utils.cxx @@ -1035,7 +1035,7 @@ float MESHCUT::distance2(float x1, float y1, float z1, float x2, float y2, float /*! * Conversion HL-MED d'une table de connectivités */ -void MESHCUT::conversionCNX(int *CNXtm, TYPE_MAILLE tm, int N) +void MESHCUT::conversionCNX(med_int *CNXtm, TYPE_MAILLE tm, int N) { int n = Nnoeuds(tm); diff --git a/src/Tools/MeshCut/MeshCut_Utils.hxx b/src/Tools/MeshCut/MeshCut_Utils.hxx index 94b3eb968..72b9bfd4e 100644 --- a/src/Tools/MeshCut/MeshCut_Utils.hxx +++ b/src/Tools/MeshCut/MeshCut_Utils.hxx @@ -71,7 +71,7 @@ namespace MESHCUT std::string nomMaille(TYPE_MAILLE tm, int nl); bool appartientVN(int n, std::vector V); float distance2(float x1, float y1, float z1, float x2, float y2, float z2); - void conversionCNX(int *CNXtm, TYPE_MAILLE tm, int N); + void conversionCNX(med_int *CNXtm, TYPE_MAILLE tm, int N); } -- 2.30.2