Skip to content

Commit

Permalink
Merge pull request #16 from coprigent/feature/fix-int64
Browse files Browse the repository at this point in the history
Converted some ints to MMG5_int to fix some overflows
  • Loading branch information
Algiane authored Mar 5, 2024
2 parents 146bc04 + 082078a commit e9e6f14
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/API_functions_h2t.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ int _H2T_Init_mesh_var(va_list argptr) {
}

int H2T_Set_meshSize(MMG5_pMesh mesh,int np,int nhexa,int nquad,int na) {
int ne,k;

int ne;
MMG5_int k;
ne = 6*nhexa;

/* in the output there will be 2*nquad triangles */
Expand Down
5 changes: 3 additions & 2 deletions src/chk.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,15 @@ double H2T_quickvol(double *c1,double *c2,double *c3,double *c4) {
*
*/
int H2T_chkorient(MMG5_pMesh mmgMesh,int* hexa,int nhex) {
int nbado,k,i,iadr,ph[8];
int nbado,k,i,ph[8];
double volref,volhex;
MMG5_int iadr;

nbado = 0;
volref = 1;

for (k=1; k<=nhex; k++) {
iadr = 9*k;
iadr = (MMG5_int)9*k;
for(i=0 ; i<8 ; i++)
ph[i] = hexa[iadr+i];

Expand Down
3 changes: 2 additions & 1 deletion src/cut.c
Original file line number Diff line number Diff line change
Expand Up @@ -260,11 +260,12 @@ int H2T_chkAdja(MMG5_pMesh mesh,int* listhexa,MMG5_int* adjahex,int nhex) {
*/
int H2T_cuthex(MMG5_pMesh mesh,pHedge hed,int* listhexa,MMG5_int* adjahex,int nhex) {
MMG5_pPoint ppt;
int i,ih,k,nu1,nu2,nu3,nu4,adj,icas0,icasopp,nncut;
int i,ih,nu1,nu2,nu3,nu4,adj,icas0,icasopp,nncut;
int *list,*mark,p[8],ipil,icurc,iface,iadr;
int iel,ip,ph[8];
double c[3];
int ddebug,ncut;
MMG5_int k;

if ( mesh->info.ddebug ) {
int count = H2T_chkAdja(mesh,listhexa,adjahex,nhex);
Expand Down
4 changes: 2 additions & 2 deletions src/hashhexa.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,8 @@ int H2T_hashQuad(MMG5_pMesh mesh,MMG5_Hash *hash) {
*/
int H2T_hashGetRef(MMG5_pMesh mesh,MMG5_Hash *hash) {
MMG5_pTetra pt;
MMG5_int *adja;
int ie,i,nt,ia,ib,ic,k,ref;
MMG5_int *adja, ie;
int i,nt,ia,ib,ic,k,ref;

/* Create tetrahedra adjacency */
if( !MMG3D_hashTetra(mesh,0) ) return 0;
Expand Down

0 comments on commit e9e6f14

Please sign in to comment.