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

Comparing ray/src/hd/holofile.c (file contents):
Revision 3.46 by greg, Thu May 29 16:26:21 2003 UTC vs.
Revision 3.47 by greg, Fri Jun 13 15:27:04 2003 UTC

# Line 129 | Line 129 | int    wr;
129          }
130          hdfragl[fd].nlinks++;
131          hdfragl[fd].writable = wr;              /* set writable flag */
132 <        hdfragl[fd].flen = lseek(fd, (off_t)0L, 2);     /* get file length */
132 >        hdfragl[fd].flen = lseek(fd, (off_t)0, 2);      /* get file length */
133   }
134  
135  
# Line 161 | Line 161 | HDGRID *hproto;                /* holodeck section grid */
161          register int    n;
162                                          /* prepare for system errors */
163          errno = 0;
164 <        if ((fpos = lseek(fd, (off_t)0L, 1)) < 0)
164 >        if ((fpos = lseek(fd, (off_t)0, 1)) < 0)
165                  error(SYSTEM, "cannot determine holodeck file position");
166          if (hproto == NULL) {           /* assume we're loading it */
167                  HDGRID  hpr;
# Line 355 | Line 355 | int    fd;
355          if (fd < 0)
356                  return(-1);
357          if (fd >= nhdfragls || !hdfragl[fd].nlinks) {
358 <                if ((fpos = lseek(fd, (off_t)0L, 1)) < 0)
358 >                if ((fpos = lseek(fd, (off_t)0, 1)) < 0)
359                          return(-1);
360 <                flen = lseek(fd, (off_t)0L, 2);
360 >                flen = lseek(fd, (off_t)0, 2);
361                  lseek(fd, fpos, 0);
362                  return(flen);
363          }
# Line 469 | Line 469 | int
469   hdfilord(hb1, hb2)      /* order beams for quick loading */
470   register HDBEAMI        *hb1, *hb2;
471   {
472 <        register long   c;
472 >        register off_t  c;
473                                  /* residents go first */
474          if (hb2->h->bl[hb2->b] != NULL)
475                  return(hb1->h->bl[hb1->b] == NULL);
476          if (hb1->h->bl[hb1->b] != NULL)
477                  return(-1);
478                                  /* otherwise sort by file descriptor */
479 <        if ((c = hb1->h->fd - hb2->h->fd))
480 <                return(c);
479 >        if (hb1->h->fd != hb2->h->fd)
480 >                return(hb1->h->fd - hb2->h->fd);
481                                  /* then by position in file */
482          c = hb1->h->bi[hb1->b].fo - hb2->h->bi[hb2->b].fo;
483          return(c > 0 ? 1 : c < 0 ? -1 : 0);
# Line 602 | Line 602 | int    i;
602                  }
603          biglob(hp)->nrd -= bi->nrd;             /* tell fragment it's free */
604          bi->nrd = 0;
605 <        bi->fo = 0L;
605 >        bi->fo = 0;
606          hdmarkdirty(hp, i);                     /* assume we'll reallocate */
607          return(1);
608   }
# Line 693 | Line 693 | register int   i;
693                  }
694                  hp->bi[i].fo = nfo;
695          } else
696 <                hp->bi[i].fo = 0L;
696 >                hp->bi[i].fo = 0;
697          biglob(hp)->nrd += nrays - hp->bi[i].nrd;
698          hp->bi[i].nrd = nrays;
699          if (!fragfreed)
# Line 781 | Line 781 | register int   i;
781          if (hp->bi[i].nrd && !(hdfragflags&FF_KILL && hdfreefrag(hp,i))) {
782                  biglob(hp)->nrd -= hp->bi[i].nrd;       /* free failed */
783                  hp->bi[i].nrd = 0;
784 <                hp->bi[i].fo = 0L;
784 >                hp->bi[i].fo = 0;
785                  hdmarkdirty(hp, i);
786          }
787          return(nchanged);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines