ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/util/rpiece.c
(Generate patch)

Comparing ray/src/util/rpiece.c (file contents):
Revision 2.55 by greg, Fri Nov 8 18:08:07 2013 UTC vs.
Revision 2.56 by greg, Thu Dec 5 03:02:56 2013 UTC

# Line 402 | Line 402 | rvrpiece(              /* check for recoverable pieces */
402   {
403          static char  *pdone = NULL;     /* which pieces are done */
404          static long  readpos = -1;      /* how far we've read */
405 <        int  i;
405 >        int  px, py, i;
406          /*
407           * This routine is called by nextpiece() with an
408           * exclusive lock on syncfp and the file pointer at the
# Line 411 | Line 411 | rvrpiece(              /* check for recoverable pieces */
411          if (rvrlim < 0)
412                  return(0);              /* only check if asked */
413          if (pdone == NULL)              /* first call */
414 <                pdone = calloc(hmult*vmult, sizeof(char));
414 >                pdone = (char *)calloc(hmult*vmult, sizeof(char));
415          if (pdone == NULL) {
416                  fprintf(stderr, "%s: out of memory\n", progname);
417                  exit(1);
418          }
419          if (readpos != -1)              /* mark what's been done */
420                  fseek(syncfp, readpos, 0);
421 <        while (fscanf(syncfp, "%d %d", xp, yp) == 2)
422 <                pdone[*xp*vmult+*yp] = 1;
421 >        while (fscanf(syncfp, "%d %d", &px, &py) == 2)
422 >                pdone[px*vmult+py] = 1;
423          if (!feof(syncfp)) {
424                  fprintf(stderr, "%s: format error in sync file\n", progname);
425                  exit(1);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines