Skip to content

Commit

Permalink
Merge pull request #13 from ISCDtoolbox/feature/fix-compilation-with-…
Browse files Browse the repository at this point in the history
…gcc14

Feature/fix compilation with gcc14
  • Loading branch information
dapogny authored Oct 8, 2024
2 parents fc49872 + 3f0d1a4 commit 3f2714e
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 24 deletions.
15 changes: 9 additions & 6 deletions sources/mshdis1_2d.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ int iniredist_2d(Info info, pMesh mesh, pSol sol){
pTria pt;
pPoint p0,p1,p2,pa;
double *solTmp,d;
int *bndy,i,j,nb,nc,i0,i1,i2,proj;
int *bndy,i,j,nb,nc,i0,i1,i2;
char proj;

nb = 0;
bndy = (int*)calloc(mesh->nt+1,sizeof(int));
Expand Down Expand Up @@ -191,7 +192,8 @@ int inidist_2d(Info info,pMesh mesh1,pMesh mesh2,pSol sol1,pBucket bucket) {
pEdge pe;
pPoint p1,p2,pa,pb;
double cb[3],d;
int *adja,*list,base,iadr,ilist,i,j,k,ia,ib,iel,jel,ier,cur,nc,tag,npp,i0,i1;
int *adja,*list,base,iadr,ilist,i,j,k,ia,ib,iel,jel,ier,cur,nc,npp,i0,i1;
char tag;

for (k=1; k<=sol1->np; k++)
sol1->val[k] = INIVAL_2d;
Expand Down Expand Up @@ -679,8 +681,8 @@ int iniencdomain_2d(Info info,pMesh mesh, pSol sol){
pPoint pa,pb,p0,p1,p2;
double d;
int ied,ier,*actiedg,nb,k,l,ip0,ip1,ip2,ia,*adja,iel,jel;
int ilist,*list,base,cur,nc,iadr,ib,tag;
char i,i0,i1,i2;
int ilist,*list,base,cur,nc,iadr,ib;
char tag,i,i0,i1,i2;

/* Hash edges of the mesh */
ier = hashEdge_2d(mesh);
Expand Down Expand Up @@ -1077,7 +1079,7 @@ double actival_2d(pMesh mesh,pSol sol,int k,int i) {
}

/* Propagation of the signed distance field by the Fast Marching Method */
int ppgdistfmm_2d(pMesh mesh,pSol sol){
int ppgdistfmm_2d(Info info,pMesh mesh,pSol sol){
Queue q;
pQueue pq;
pTria pt,pt1;
Expand Down Expand Up @@ -1442,11 +1444,12 @@ int ppgdist_2d(Info info,pMesh mesh,pSol sol) {

/* Compute L^1,L^2 and L^\infty errors when compared to interpolation of real sdf */
int errdist(pMesh mesh, pMesh mesh2, pSol sol){
int k,l,proj,i0,i1,i2;
int k,l,i0,i1,i2;
pTria pt;
pEdge pe;
pPoint p0,p1,p2;
double errLInfty,errL1,errL2,*dist,area;
char proj;

errLInfty = 0.0;
errL1 = 0.0;
Expand Down
2 changes: 1 addition & 1 deletion sources/mshdis1_3d.c
Original file line number Diff line number Diff line change
Expand Up @@ -1446,7 +1446,7 @@ double actival_3d(pMesh mesh,pSol sol,int k,int i) {
}

/* Propagation of the signed distance function by the Fast Marching Method */
int ppgdistfmm_3d(pMesh mesh,pSol sol) {
int ppgdistfmm_3d(Info info,pMesh mesh,pSol sol) {
Queue q;
pQueue pq;
pTetra pt,pt1;
Expand Down
5 changes: 3 additions & 2 deletions sources/mshdis1_s.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ int iniredist_s(Info info, pMesh mesh, pSol sol){
pTria pt;
pPoint p0,p1,p2;
double *solTmp,d;
int *bndy,i,j,nb,nc,i0,i1,i2,proj;
int *bndy,i,j,nb,nc,i0,i1,i2;
char proj;

nb = 0;
bndy = (int*)calloc(mesh->nt+1,sizeof(int));
Expand Down Expand Up @@ -546,7 +547,7 @@ double actival_s(pMesh mesh,pSol sol,int start,int i) {
}

/* Propagation of the signed distance function by the Fast Marching Method */
int ppgdistfmm_s(pMesh mesh,pSol sol) {
int ppgdistfmm_s(Info info,pMesh mesh,pSol sol) {
Queue q;
pQueue pq;
pTria pt,pt1;
Expand Down
2 changes: 1 addition & 1 deletion sources/mshdist.c
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ static int mshdis1(Info info,pMesh mesh1,pMesh mesh2,pSol sol1) {
if ( info.imprim ) fprintf(stdout," ** Propagation [%d cpu]\n",info.ncpu);

if ( info.fmm )
ier = ppgdistfmm(mesh1,sol1);
ier = ppgdistfmm(info,mesh1,sol1);
else
ier = ppgdist(info,mesh1,sol1);
chrono(OFF,&info.ctim[4]);
Expand Down
14 changes: 7 additions & 7 deletions sources/mshdist.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,12 +166,12 @@ int eqquad(double*,double*);
int intersec_2d(pPoint,pPoint,pPoint,pPoint);
int intersec_3d(pPoint p1,pPoint q1,pPoint r1,pPoint p2,pPoint q2,pPoint r2);
int interSegTria(pMesh mesh,pPoint pa,pPoint pb,pTria pt);
double distpt_2d(pPoint,pPoint,pPoint,int*);
double distnv0_2d(pMesh,pSol,int,pPoint,int*);
double distnv0_s(pMesh,pSol,int,pPoint,int*);
double distpt_2d(pPoint,pPoint,pPoint,char*);
double distnv0_2d(pMesh,pSol,int,pPoint,char*);
double distnv0_s(pMesh,pSol,int,pPoint,char*);
int buildcircum_3d(pMesh,double *);
int circumcoords(pPoint,pPoint,pPoint,double *);
double distpt_s(pPoint,pPoint,pPoint,int*);
double distpt_s(pPoint,pPoint,pPoint,char*);
double distptplan(pPoint,pPoint,pPoint,pPoint);
double distpt_3d(pPoint p0,pPoint p1,pPoint p2,pPoint pq,char *proj);
double distnv0_3d(pMesh,pSol,int,pPoint,char*);
Expand Down Expand Up @@ -207,9 +207,9 @@ int pack_s(pMesh ,pSol ,int *);
int unpack_s(pMesh ,pSol ,int *);
int ppgdist_2d(Info info,pMesh mesh, pSol sol);
int ppgdist_3d(Info info,pMesh mesh, pSol sol);
int ppgdistfmm_2d(pMesh mesh, pSol sol);
int ppgdistfmm_s(pMesh mesh, pSol sol);
int ppgdistfmm_3d(pMesh mesh, pSol sol);
int ppgdistfmm_2d(Info info,pMesh mesh, pSol sol);
int ppgdistfmm_s(Info info,pMesh mesh, pSol sol);
int ppgdistfmm_3d(Info info,pMesh mesh, pSol sol);
int iniencdomain_2d(Info info,pMesh mesh, pSol sol);
int iniencdomain_s(Info info,pMesh mesh, pSol sol);
int iniencdomain_3d(Info info,pMesh mesh, pSol sol);
Expand Down
2 changes: 1 addition & 1 deletion sources/mshdistexterns.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ extern int (*iniredist)(Info ,pMesh ,pSol ) = NULL;
extern int (*iniencdomain)(Info ,pMesh ,pSol ) = NULL;
extern int (*inireftrias)(Info ,pMesh, pSol) = NULL;
extern int (*ppgdist)(Info info,pMesh mesh, pSol sol) = NULL;
extern int (*ppgdistfmm)(pMesh mesh, pSol sol) = NULL;
extern int (*ppgdistfmm)(Info info,pMesh mesh, pSol sol) = NULL;
2 changes: 1 addition & 1 deletion sources/mshdistexterns.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ extern int (*iniredist)(Info ,pMesh ,pSol );
extern int (*iniencdomain)(Info ,pMesh ,pSol );
extern int (*inireftrias)(Info ,pMesh, pSol);
extern int (*ppgdist)(Info info,pMesh mesh, pSol sol);
extern int (*ppgdistfmm)(pMesh mesh, pSol sol);
extern int (*ppgdistfmm)(Info info,pMesh mesh, pSol sol);

#endif
7 changes: 4 additions & 3 deletions sources/tools_2d.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ int intersec_2d(pPoint p1,pPoint p2,pPoint pa,pPoint pb) {
/* Return (squared) distance from point pa to segment (p1,p2);
proj = 2 if distance is realized by p1 or p2,
1 if it is realized by the orthogonal projection of pa on (p1p2) */
double distpt_2d(pPoint p1,pPoint p2,pPoint pa,int *proj) {
double distpt_2d(pPoint p1,pPoint p2,pPoint pa,char *proj) {
double a,b,c,d,dd,ux,uy,vx,vy,wx,wy,xp,yp,lambda;

*proj = 1;
Expand Down Expand Up @@ -138,7 +138,7 @@ double distpt_2d(pPoint p1,pPoint p2,pPoint pa,int *proj) {
}

/* compute (squared) distance from pa to the 0 level set in triangle ntria ; same use of proj as before */
double distnv0_2d(pMesh mesh, pSol sol, int ntria, pPoint pa, int *proj) {
double distnv0_2d(pMesh mesh, pSol sol, int ntria, pPoint pa, char *proj) {
pTria pt;
pPoint p0,p1,p2;
Point q,r;
Expand Down Expand Up @@ -251,7 +251,8 @@ double hausdorff(pMesh mesh1, pMesh mesh2){
pPoint p0,p1,pmil,p2,p3;
Point mil;
double rho1,rho2,haus,d, d0,d1,dmil;
int k,j,proj,nac1,nac2;
int k,j,nac1,nac2;
char proj;

rho1 = 0.0;
rho2 = 0.0;
Expand Down
4 changes: 2 additions & 2 deletions sources/tools_s.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ extern unsigned char inxt2[5];
/* Return (squared) distance from point pa to segment (p1,p2);
proj = 2 if distance is realized by p1 or p2,
1 if it is realized by the orthogonal projection of pa on (p1p2) */
double distpt_s(pPoint p0,pPoint p1,pPoint pa,int *proj) {
double distpt_s(pPoint p0,pPoint p1,pPoint pa,char *proj) {
double ux,uy,uz,p1p0,pap0,ps,lambda;

ux = p1->c[0] - p0->c[0];
Expand Down Expand Up @@ -39,7 +39,7 @@ double distpt_s(pPoint p0,pPoint p1,pPoint pa,int *proj) {
}

/* Compute (squared) distance from pa to the 0 level set in triangle k */
double distnv0_s(pMesh mesh, pSol sol, int k, pPoint pa, int *proj) {
double distnv0_s(pMesh mesh, pSol sol, int k, pPoint pa, char *proj) {
pTria pt;
pPoint p0,p1,p2;
Point q,r;
Expand Down

0 comments on commit 3f2714e

Please sign in to comment.