--- ray/src/hd/rhinfo.c 2004/09/09 01:06:19 3.11 +++ ray/src/hd/rhinfo.c 2018/10/05 19:19:16 3.14 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: rhinfo.c,v 3.11 2004/09/09 01:06:19 greg Exp $"; +static const char RCSid[] = "$Id: rhinfo.c,v 3.14 2018/10/05 19:19:16 greg Exp $"; #endif /* * Get general information on holodeck file @@ -49,7 +49,7 @@ gethdinfo( /* get information on holodeck */ FILE *fp; HOLO *hdsect; int fd; - int32 nextloc; + off_t nextloc, fsiz; int n; /* open holodeck file */ if ((fp = fopen(fname, "r")) == NULL) { @@ -64,20 +64,20 @@ gethdinfo( /* get information on holodeck */ fd = dup(fileno(fp)); /* dup file handle */ nextloc = ftell(fp); /* get stdio position */ fclose(fp); /* done with stdio */ - for (n = 0; nextloc > 0L; n++) { /* get the section(s) */ - lseek(fd, (off_t)nextloc, SEEK_SET); + for (n = 0; nextloc > 0; n++) { /* get the section(s) */ + lseek(fd, nextloc, SEEK_SET); read(fd, (char *)&nextloc, sizeof(nextloc)); fprintf(fout, "Section %d:\n", n); hdsect = hdinit(fd, NULL); /* load section directory */ psectstats(hdsect, fout); /* print section statistics */ } - nextloc = hdfilen(fd); /* print global statistics */ + fsiz = hdfilen(fd); /* print global statistics */ fputs("=====================================================\n", fout); fprintf(fout, "Total samples/beams: %ld/%ld (%.2f samples/beam)\n", samptot, beamtot, (double)samptot/beamtot); fprintf(fout, "%.1f Mbyte file, %.1f%% fragmentation\n", - nextloc/(1024.*1024.), - 100.*(nextloc-hdfiluse(fd))/nextloc); + fsiz/(1024.*1024.), + 100.*(fsiz-hdfiluse(fd))/fsiz); /* don't bother with cleanup */ #if 0 hddone(NULL); /* free sections */ @@ -88,7 +88,7 @@ gethdinfo( /* get information on holodeck */ static void psectstats( /* print statistical information for section */ - register HOLO *hp, + HOLO *hp, FILE *fp ) { @@ -97,7 +97,7 @@ psectstats( /* print statistical information for sect FVECT vt; double sqrtmaxp; int bmin, bmax, cnt; - register int i; + int i; fcross(vt, hp->xv[0], hp->xv[1]); fprintf(fp, "\tWorld volume: %g\n", fabs(DOT(vt,hp->xv[2])));