--- ray/src/hd/rhinfo.c 2010/09/30 14:45:10 3.12 +++ ray/src/hd/rhinfo.c 2019/10/21 18:19:32 3.15 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: rhinfo.c,v 3.12 2010/09/30 14:45:10 greg Exp $"; +static const char RCSid[] = "$Id: rhinfo.c,v 3.15 2019/10/21 18:19:32 greg Exp $"; #endif /* * Get general information on holodeck file @@ -49,11 +49,10 @@ gethdinfo( /* get information on holodeck */ FILE *fp; HOLO *hdsect; int fd; - int32 nextloc; - off_t fsiz; + off_t nextloc, fsiz; int n; /* open holodeck file */ - if ((fp = fopen(fname, "r")) == NULL) { + if ((fp = fopen(fname, "rb")) == NULL) { sprintf(errmsg, "cannot open \"%s\"", fname); error(SYSTEM, errmsg); } @@ -65,8 +64,8 @@ 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 */ @@ -89,7 +88,7 @@ gethdinfo( /* get information on holodeck */ static void psectstats( /* print statistical information for section */ - register HOLO *hp, + HOLO *hp, FILE *fp ) { @@ -98,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])));