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

Comparing ray/src/hd/rhinfo.c (file contents):
Revision 3.11 by greg, Thu Sep 9 01:06:19 2004 UTC vs.
Revision 3.13 by greg, Thu Sep 30 17:02:00 2010 UTC

# Line 49 | Line 49 | gethdinfo(             /* get information on holodeck */
49          FILE    *fp;
50          HOLO    *hdsect;
51          int     fd;
52 <        int32   nextloc;
52 >        off_t   nextloc, fsiz;
53          int     n;
54                                          /* open holodeck file */
55          if ((fp = fopen(fname, "r")) == NULL) {
# Line 64 | Line 64 | gethdinfo(             /* get information on holodeck */
64          fd = dup(fileno(fp));                   /* dup file handle */
65          nextloc = ftell(fp);                    /* get stdio position */
66          fclose(fp);                             /* done with stdio */
67 <        for (n = 0; nextloc > 0L; n++) {        /* get the section(s) */
68 <                lseek(fd, (off_t)nextloc, SEEK_SET);
67 >        for (n = 0; nextloc > 0; n++) {         /* get the section(s) */
68 >                lseek(fd, nextloc, SEEK_SET);
69                  read(fd, (char *)&nextloc, sizeof(nextloc));
70                  fprintf(fout, "Section %d:\n", n);
71                  hdsect = hdinit(fd, NULL);      /* load section directory */
72                  psectstats(hdsect, fout);       /* print section statistics */
73          }
74 <        nextloc = hdfilen(fd);                  /* print global statistics */
74 >        fsiz = hdfilen(fd);                     /* print global statistics */
75          fputs("=====================================================\n", fout);
76          fprintf(fout, "Total samples/beams: %ld/%ld (%.2f samples/beam)\n",
77                          samptot, beamtot, (double)samptot/beamtot);
78          fprintf(fout, "%.1f Mbyte file, %.1f%% fragmentation\n",
79 <                        nextloc/(1024.*1024.),
80 <                        100.*(nextloc-hdfiluse(fd))/nextloc);
79 >                        fsiz/(1024.*1024.),
80 >                        100.*(fsiz-hdfiluse(fd))/fsiz);
81                                                  /* don't bother with cleanup */
82   #if 0
83          hddone(NULL);                           /* free sections */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines