Changeset 329

Show
Ignore:
Timestamp:
03/26/08 15:14:16 (8 months ago)
Author:
powell
Message:

Little debugging to eliminate the former segfault.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/matml/src/ternary/qhull.c

    r328 r329  
    5050      qpoints[3*i]   = (coordT) points[i].C2; 
    5151      qpoints[3*i+1] = (coordT) points[i].C3; 
     52      /* TODO: find corners and clip at that plane, not just G=0 */ 
    5253      qpoints[3*i+2] = (coordT) fmin (points[i].G, 0.); 
    5354    } 
     
    6364  printf ("%d total facets\n", *numfacets); 
    6465  printf ("facetverts: pre-realloc 0x%lx, ", *facetverts); 
    65   if (!(*facetverts = realloc (*facetverts, *numfacets * sizeof (int)))) 
     66  if (!(*facetverts = realloc (*facetverts, *numfacets * 3 * sizeof (int)))) 
    6667    { printf ("qhullCalcHull: could not reallocate memory for vertices\n"); 
    6768      return -1; } 
     
    8384 
    8485          if (j<3) 
    85             facetverts [3*i+j] = thepoint; 
     86            (*facetverts) [3*i+j] = thepoint; 
    8687#ifdef DEBUG 
    8788          printf ("  vertex %d, coords %g %g %g\n", thepoint,