Skip to content

Commit 0397bfb

Browse files
committed
Rename the quad field of the mesh structure to avoid errors due to the preprocessor redefinition of the 'quad' word with cygwin on Windows.
1 parent 9475dd4 commit 0397bfb

14 files changed

+49
-49
lines changed

CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ PROJECT (mmg)
3232
###############################################################################
3333
SET (CMAKE_RELEASE_VERSION_MAJOR "5" )
3434
SET (CMAKE_RELEASE_VERSION_MINOR "2" )
35-
SET (CMAKE_RELEASE_VERSION_PATCH "3" )
36-
SET (CMAKE_RELEASE_DATE "Mar 17, 2017" )
35+
SET (CMAKE_RELEASE_VERSION_PATCH "4" )
36+
SET (CMAKE_RELEASE_DATE "Mar 22, 2017" )
3737

3838
SET (CMAKE_RELEASE_VERSION
3939
"${CMAKE_RELEASE_VERSION_MAJOR}.${CMAKE_RELEASE_VERSION_MINOR}.${CMAKE_RELEASE_VERSION_PATCH}")

src/common/inout.c

+9-9
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,10 @@ int _MMG5_countBinaryElts(FILE **inm, const int nelts,const int iswp,
147147
for ( idx=0; idx<num; ++idx ) {
148148
fread(&i,sw,1,(*inm));
149149
for ( l=0; l<tagNum; ++l ) fread(&i,sw,1,(*inm));
150-
fread(&i,sw,1,(*inm)); // quad->v[0]
151-
fread(&i,sw,1,(*inm)); // quad->v[1]
152-
fread(&i,sw,1,(*inm)); // quad->v[2]
153-
fread(&i,sw,1,(*inm)); // quad->v[3]
150+
fread(&i,sw,1,(*inm)); // quadra->v[0]
151+
fread(&i,sw,1,(*inm)); // quadra->v[1]
152+
fread(&i,sw,1,(*inm)); // quadra->v[2]
153+
fread(&i,sw,1,(*inm)); // quadra->v[3]
154154
}
155155
(*nq) += num;
156156
k += num;
@@ -606,7 +606,7 @@ int MMG5_loadMshMesh_part2(MMG5_pMesh mesh,MMG5_pSol sol,FILE **inm,
606606
break;
607607
case 3:
608608
/* Quad */
609-
pq1 = &mesh->quad[++nq];
609+
pq1 = &mesh->quadra[++nq];
610610
fscanf((*inm),"%d %d %d %d ",&pq1->v[0],&pq1->v[1],&pq1->v[2],&pq1->v[3]);
611611
pq1->ref = ref;
612612
assert( nq<=mesh->nquad );
@@ -800,13 +800,13 @@ int MMG5_loadMshMesh_part2(MMG5_pMesh mesh,MMG5_pSol sol,FILE **inm,
800800
fread(&i,sw,1,(*inm));
801801
break;
802802
default:
803-
fprintf(stderr," ## Error: elt (quad) %%d: Expected 2 or 3 tags (%d given).\n",
803+
fprintf(stderr," ## Error: elt (quadrangle) %%d: Expected 2 or 3 tags (%d given).\n",
804804
tagNum);
805805
return(-1);
806806
}
807807
if(iswp) ref = _MMG5_swapbin(ref);
808808

809-
pq1 = &mesh->quad[++nq];
809+
pq1 = &mesh->quadra[++nq];
810810
for ( i=0; i<4 ; ++i ) {
811811
fread(&l,sw,1,(*inm));
812812
if ( iswp ) l = _MMG5_swapbin(l);
@@ -1417,7 +1417,7 @@ int MMG5_saveMshMesh(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename) {
14171417
}
14181418
nq = 0;
14191419
for (k=1; k<=mesh->nquad; k++) {
1420-
pq = &mesh->quad[k];
1420+
pq = &mesh->quadra[k];
14211421
if ( !MG_EOK(pq) ) continue;
14221422
nq++;
14231423
}
@@ -1531,7 +1531,7 @@ int MMG5_saveMshMesh(MMG5_pMesh mesh,MMG5_pSol sol,const char *filename) {
15311531
}
15321532

15331533
for (k=1; k<=mesh->nquad; ++k) {
1534-
pq = &mesh->quad[k];
1534+
pq = &mesh->quadra[k];
15351535
if ( !MG_EOK(pq) ) continue;
15361536
++nelts;
15371537

src/common/libmmgtypes.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ typedef struct {
484484
MMG5_pPrism prism; /*!< Pointer toward the \ref MMG5_Prism structure */
485485
MMG5_pxPrism xprism; /*!< Pointer toward the \ref MMG5_pxPrism structure */
486486
MMG5_pTria tria; /*!< Pointer toward the \ref MMG5_Tria structure */
487-
MMG5_pQuad quad; /*!< Pointer toward the \ref MMG5_Quad structure */
487+
MMG5_pQuad quadra; /*!< Pointer toward the \ref MMG5_Quad structure */
488488
MMG5_pEdge edge; /*!< Pointer toward the \ref MMG5_Edge structure */
489489
MMG5_HGeom htab; /*!< \ref MMG5_HGeom structure */
490490
MMG5_Info info; /*!< \ref MMG5_Info structure */

src/common/libmmgtypesf.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@
532532
! MMG5_pPrism prism; /*!< Pointer toward the \ref MMG5_Prism structure */
533533
! MMG5_pxPrism xprism; /*!< Pointer toward the \ref MMG5_pxPrism structure */
534534
! MMG5_pTria tria; /*!< Pointer toward the \ref MMG5_Tria structure */
535-
! MMG5_pQuad quad; /*!< Pointer toward the \ref MMG5_Quad structure */
535+
! MMG5_pQuad quadra; /*!< Pointer toward the \ref MMG5_Quad structure */
536536
! MMG5_pEdge edge; /*!< Pointer toward the \ref MMG5_Edge structure */
537537
! MMG5_HGeom htab; /*!< \ref MMG5_HGeom structure */
538538
! MMG5_Info info; /*!< \ref MMG5_Info structure */

src/mmg2d/libmmg2d.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -819,7 +819,7 @@ int MMG2D_loadMesh(MMG5_pMesh mesh,const char * filename);
819819
* \return 0 if failed, 1 otherwise.
820820
*
821821
* Read mesh and sol at MSH file format (.msh extension). We read only
822-
* low-order points, edges, tria, quad, tetra and prisms.
822+
* low-order points, edges, tria, quadra, tetra and prisms.
823823
*
824824
* \remark Fortran interface:
825825
* > SUBROUTINE MMG2D_LOADMSHMESH(mesh,sol,filename,strlen,retval)\n

src/mmg2d/libmmg2df.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -988,7 +988,7 @@ END INTERFACE
988988
! * \return 0 if failed, 1 otherwise.
989989
! *
990990
! * Read mesh and sol at MSH file format (.msh extension). We read only
991-
! * low-order points, edges, tria, quad, tetra and prisms.
991+
! * low-order points, edges, tria, quadra, tetra and prisms.
992992
! *
993993
! * \remark Fortran interface:
994994
! */

src/mmg3d/API_functions_3d.c

+11-11
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,8 @@ int MMG3D_Set_meshSize(MMG5_pMesh mesh, int np, int ne, int nprism,
170170
_MMG5_DEL_MEM(mesh,mesh->prism,(mesh->nprism+1)*sizeof(MMG5_Prism));
171171
if ( mesh->tria )
172172
_MMG5_DEL_MEM(mesh,mesh->tria,(mesh->nt+1)*sizeof(MMG5_Tria));
173-
if ( mesh->quad )
174-
_MMG5_DEL_MEM(mesh,mesh->quad,(mesh->nquad+1)*sizeof(MMG5_Quad));
173+
if ( mesh->quadra )
174+
_MMG5_DEL_MEM(mesh,mesh->quadra,(mesh->nquad+1)*sizeof(MMG5_Quad));
175175
if ( mesh->edge )
176176
_MMG5_DEL_MEM(mesh,mesh->edge,(mesh->na+1)*sizeof(MMG5_Edge));
177177

@@ -233,7 +233,7 @@ int MMG3D_Set_meshSize(MMG5_pMesh mesh, int np, int ne, int nprism,
233233

234234
if ( mesh->nquad ) {
235235
_MMG5_ADD_MEM(mesh,(mesh->nquad+1)*sizeof(MMG5_Quad),"initial quadrilaterals",return(0));
236-
_MMG5_SAFE_CALLOC(mesh->quad,(mesh->nquad+1),MMG5_Quad);
236+
_MMG5_SAFE_CALLOC(mesh->quadra,(mesh->nquad+1),MMG5_Quad);
237237
}
238238

239239
mesh->namax = mesh->na;
@@ -920,11 +920,11 @@ int MMG3D_Set_quadrilateral(MMG5_pMesh mesh, int v0, int v1, int v2, int v3,
920920
return(0);
921921
}
922922

923-
mesh->quad[pos].v[0] = v0;
924-
mesh->quad[pos].v[1] = v1;
925-
mesh->quad[pos].v[2] = v2;
926-
mesh->quad[pos].v[3] = v3;
927-
mesh->quad[pos].ref = ref;
923+
mesh->quadra[pos].v[0] = v0;
924+
mesh->quadra[pos].v[1] = v1;
925+
mesh->quadra[pos].v[2] = v2;
926+
mesh->quadra[pos].v[3] = v3;
927+
mesh->quadra[pos].ref = ref;
928928

929929
return(1);
930930
}
@@ -954,7 +954,7 @@ int MMG3D_Get_quadrilateral(MMG5_pMesh mesh, int* v0, int* v1, int* v2, int* v3,
954954
return(0);
955955
}
956956

957-
pq = &mesh->quad[nqi];
957+
pq = &mesh->quadra[nqi];
958958
*v0 = pq->v[0];
959959
*v1 = pq->v[1];
960960
*v2 = pq->v[2];
@@ -980,7 +980,7 @@ int MMG3D_Set_quadrilaterals(MMG5_pMesh mesh, int *quads, int *refs) {
980980
for (i=1;i<=mesh->nquad;i++)
981981
{
982982
j = (i-1)*4;
983-
pq = &mesh->quad[i];
983+
pq = &mesh->quadra[i];
984984
pq->v[0] = quads[j] ;
985985
pq->v[1] = quads[j+1];
986986
pq->v[2] = quads[j+2];
@@ -998,7 +998,7 @@ int MMG3D_Get_quadrilaterals(MMG5_pMesh mesh, int *quads, int *refs, int *areRe
998998
for (i=1;i<=mesh->nquad;i++)
999999
{
10001000
j = (i-1)*4;
1001-
pq = &mesh->quad[i];
1001+
pq = &mesh->quadra[i];
10021002
quads[j] = pq->v[0];
10031003
quads[j+1] = pq->v[1];
10041004
quads[j+2] = pq->v[2];

src/mmg3d/inout_3d.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ int MMG3D_loadMesh(MMG5_pMesh mesh,const char *filename) {
591591
fseek(inm,posnq,SEEK_SET);
592592

593593
for (k=1; k<=mesh->nquad; k++) {
594-
pq1 = &mesh->quad[k];
594+
pq1 = &mesh->quadra[k];
595595
if (!bin)
596596
fscanf(inm,"%d %d %d %d %d",&pq1->v[0],&pq1->v[1],&pq1->v[2],
597597
&pq1->v[3],&pq1->ref);
@@ -620,7 +620,7 @@ int MMG3D_loadMesh(MMG5_pMesh mesh,const char *filename) {
620620
fprintf(stdout," Warning: required quadrilaterals number"
621621
" %8d IGNORED\n",i);
622622
} else {
623-
pq1 = &mesh->quad[i];
623+
pq1 = &mesh->quadra[i];
624624
pq1->tag[0] |= MG_REQ;
625625
pq1->tag[1] |= MG_REQ;
626626
pq1->tag[2] |= MG_REQ;
@@ -1438,7 +1438,7 @@ int MMG3D_saveMesh(MMG5_pMesh mesh, const char *filename) {
14381438
if ( mesh->nquad ) {
14391439

14401440
for (k=1; k<=mesh->nquad; k++) {
1441-
pq = &mesh->quad[k];
1441+
pq = &mesh->quadra[k];
14421442
if ( !MG_EOK(pq) ) {
14431443
continue;
14441444
}
@@ -1463,7 +1463,7 @@ int MMG3D_saveMesh(MMG5_pMesh mesh, const char *filename) {
14631463
fwrite(&nq,sw,1,inm);
14641464
}
14651465
for (k=1; k<=mesh->nquad; k++) {
1466-
pq = &mesh->quad[k];
1466+
pq = &mesh->quadra[k];
14671467
if ( !MG_EOK(pq) ) continue;
14681468

14691469
if(!bin) {
@@ -1491,7 +1491,7 @@ int MMG3D_saveMesh(MMG5_pMesh mesh, const char *filename) {
14911491
fwrite(&nqreq,sw,1,inm);
14921492
}
14931493
for (k=0; k<=mesh->nquad; k++) {
1494-
pq = &mesh->quad[k];
1494+
pq = &mesh->quadra[k];
14951495
if ( (pq->tag[0] & MG_REQ) && (pq->tag[1] & MG_REQ)
14961496
&& pq->tag[2] & MG_REQ && pq->tag[3] & MG_REQ ) {
14971497
if(!bin) {

src/mmg3d/libmmg3d.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ int _MMG3D_packMesh(MMG5_pMesh mesh,MMG5_pSol met,MMG5_pSol disp) {
243243
pp->v[5] = mesh->point[pp->v[5]].tmp;
244244
}
245245
for (k=1; k<=mesh->nquad; k++) {
246-
pq = &mesh->quad[k];
246+
pq = &mesh->quadra[k];
247247
if ( !MG_EOK(pq) ) continue;
248248

249249
pq->v[0] = mesh->point[pq->v[0]].tmp;

src/mmg3d/libmmg3d.h

+6-6
Original file line numberDiff line numberDiff line change
@@ -478,9 +478,9 @@ int MMG3D_Set_quadrilateral(MMG5_pMesh mesh, int v0, int v1,
478478
/**
479479
* \param mesh pointer toward the mesh structure.
480480
* \param quads pointer toward the table of the quads vertices
481-
* Vertices of the \f$i^{th}\f$ quad are stored in quads[(i-1)*3]\@3.
481+
* Vertices of the \f$i^{th}\f$ quadra are stored in quads[(i-1)*3]\@3.
482482
* \param refs pointer toward the table of the quadrilateral references.
483-
* refs[i-1] is the ref of the \f$i^{th}\f$ quad.
483+
* refs[i-1] is the ref of the \f$i^{th}\f$ quadra.
484484
* \return 0 if failed, 1 otherwise.
485485
*
486486
* Set vertices and references of the mesh quadrilaterals.
@@ -1176,11 +1176,11 @@ int MMG3D_Get_quadrilateral(MMG5_pMesh mesh, int* v0, int* v1, int* v2,int* v3,
11761176
/**
11771177
* \param mesh pointer toward the mesh structure.
11781178
* \param quads pointer toward the table of the quadrilaterals vertices
1179-
* Vertices of the \f$i^{th}\f$ quad are stored in tria[(i-1)*4]\@4.
1179+
* Vertices of the \f$i^{th}\f$ quadra are stored in tria[(i-1)*4]\@4.
11801180
* \param refs pointer toward the table of the quadrilaterals references.
1181-
* refs[i-1] is the ref of the \f$i^{th}\f$ quad.
1181+
* refs[i-1] is the ref of the \f$i^{th}\f$ quadra.
11821182
* \param areRequired pointer toward table of the flags saying if quadrilaterals
1183-
* are required. areRequired[i-1]=1 if the \f$i^{th}\f$ quad
1183+
* are required. areRequired[i-1]=1 if the \f$i^{th}\f$ quadra
11841184
* is required.
11851185
* \return 0 if failed, 1 otherwise.
11861186
*
@@ -1393,7 +1393,7 @@ int MMG3D_loadMesh(MMG5_pMesh mesh,const char *filename);
13931393
* \return 0 if failed, 1 otherwise.
13941394
*
13951395
* Read mesh and sol at MSH file format (.msh extension). We read only
1396-
* low-order points, edges, tria, quad, tetra and prisms.
1396+
* low-order points, edges, tria, quadra, tetra and prisms.
13971397
*
13981398
* \remark Fortran interface:
13991399
* > SUBROUTINE MMG3D_LOADMSHMESH(mesh,sol,filename,strlen,retval)\n

src/mmg3d/libmmg3df.h

+6-6
Original file line numberDiff line numberDiff line change
@@ -586,9 +586,9 @@ END INTERFACE
586586
! /**
587587
! * \param mesh pointer toward the mesh structure.
588588
! * \param quads pointer toward the table of the quads vertices
589-
! * Vertices of the \f$i^{th}\f$ quad are stored in quads[(i-1)*3]\@3.
589+
! * Vertices of the \f$i^{th}\f$ quadra are stored in quads[(i-1)*3]\@3.
590590
! * \param refs pointer toward the table of the quadrilateral references.
591-
! * refs[i-1] is the ref of the \f$i^{th}\f$ quad.
591+
! * refs[i-1] is the ref of the \f$i^{th}\f$ quadra.
592592
! * \return 0 if failed, 1 otherwise.
593593
! *
594594
! * Set vertices and references of the mesh quadrilaterals.
@@ -1416,11 +1416,11 @@ END INTERFACE
14161416
! /**
14171417
! * \param mesh pointer toward the mesh structure.
14181418
! * \param quads pointer toward the table of the quadrilaterals vertices
1419-
! * Vertices of the \f$i^{th}\f$ quad are stored in tria[(i-1)*4]\@4.
1419+
! * Vertices of the \f$i^{th}\f$ quadra are stored in tria[(i-1)*4]\@4.
14201420
! * \param refs pointer toward the table of the quadrilaterals references.
1421-
! * refs[i-1] is the ref of the \f$i^{th}\f$ quad.
1421+
! * refs[i-1] is the ref of the \f$i^{th}\f$ quadra.
14221422
! * \param areRequired pointer toward table of the flags saying if quadrilaterals
1423-
! * are required. areRequired[i-1]=1 if the \f$i^{th}\f$ quad
1423+
! * are required. areRequired[i-1]=1 if the \f$i^{th}\f$ quadra
14241424
! * is required.
14251425
! * \return 0 if failed, 1 otherwise.
14261426
! *
@@ -1677,7 +1677,7 @@ END INTERFACE
16771677
! * \return 0 if failed, 1 otherwise.
16781678
! *
16791679
! * Read mesh and sol at MSH file format (.msh extension). We read only
1680-
! * low-order points, edges, tria, quad, tetra and prisms.
1680+
! * low-order points, edges, tria, quadra, tetra and prisms.
16811681
! *
16821682
! * \remark Fortran interface:
16831683
! */

src/mmg3d/librnbg_3d.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -432,10 +432,10 @@ int _MMG5_mmg3dRenumbering(int boxVertNbr, MMG5_pMesh mesh, MMG5_pSol sol) {
432432
}
433433
}
434434

435-
/* Modify the numbering of the nodes of each quad */
435+
/* Modify the numbering of the nodes of each quadra */
436436
for( k = 1; k <= mesh->nquad; ++k) {
437437
for(j = 0; j<4 ; j++) {
438-
mesh->quad[k].v[j] = permNodTab[mesh->quad[k].v[j]];
438+
mesh->quadra[k].v[j] = permNodTab[mesh->quadra[k].v[j]];
439439
}
440440
}
441441

src/mmg3d/variadic_3d.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -417,8 +417,8 @@ void _MMG3D_Free_structures_var(va_list argptr)
417417
if ( (*mesh)->tria )
418418
_MMG5_DEL_MEM((*mesh),(*mesh)->tria,((*mesh)->nt+1)*sizeof(MMG5_Tria));
419419

420-
if ( (*mesh)->quad )
421-
_MMG5_DEL_MEM((*mesh),(*mesh)->quad,((*mesh)->nquad+1)*sizeof(MMG5_Quad));
420+
if ( (*mesh)->quadra )
421+
_MMG5_DEL_MEM((*mesh),(*mesh)->quadra,((*mesh)->nquad+1)*sizeof(MMG5_Quad));
422422

423423
if ( (*mesh)->xtetra )
424424
_MMG5_DEL_MEM((*mesh),(*mesh)->xtetra,((*mesh)->xtmax+1)*sizeof(MMG5_xTetra));

src/mmg3d/zaldy_3d.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ int _MMG3D_zaldy(MMG5_pMesh mesh) {
246246
}
247247
if ( mesh->nquad ) {
248248
_MMG5_ADD_MEM(mesh,(mesh->nquad+1)*sizeof(MMG5_Quad),"initial quadrilaterals",return(0));
249-
_MMG5_SAFE_CALLOC(mesh->quad,(mesh->nquad+1),MMG5_Quad);
249+
_MMG5_SAFE_CALLOC(mesh->quadra,(mesh->nquad+1),MMG5_Quad);
250250
}
251251

252252

0 commit comments

Comments
 (0)