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

Comparing ray/src/hd/rholo.c (file contents):
Revision 3.60 by schorsch, Sun Jul 27 22:12:02 2003 UTC vs.
Revision 3.61 by greg, Mon Oct 20 16:01:55 2003 UTC

# Line 10 | Line 10 | static const char      RCSid[] = "$Id$";
10   #include <string.h>
11  
12   #include "rholo.h"
13 + #include "platform.h"
14   #include "random.h"
15  
16   #ifndef FRAGWARN
# Line 433 | Line 434 | HDGRID *gp;
434          putw(HOLOMAGIC, fp);            /* put magic number */
435          fd = dup(fileno(fp));
436          fclose(fp);                     /* flush and close stdio stream */
437 <        lastloc = lseek(fd, (off_t)0, 2);
437 >        lastloc = lseek(fd, (off_t)0, SEEK_END);
438          for (n = vdef(SECTION); n--; gp++) {    /* initialize each section */
439                  nextloc = 0L;
440                  write(fd, (char *)&nextloc, sizeof(nextloc));
# Line 441 | Line 442 | HDGRID *gp;
442                  if (!n)
443                          break;
444                  nextloc = hdfilen(fd);          /* write section pointer */
445 <                if (lseek(fd, (off_t)lastloc, 0) < 0)
445 >                if (lseek(fd, (off_t)lastloc, SEEK_SET) < 0)
446                          error(SYSTEM,
447                                  "cannot seek on holodeck file in creatholo");
448                  write(fd, (char *)&nextloc, sizeof(nextloc));
449 <                lseek(fd, (off_t)(lastloc=nextloc), 0);
449 >                lseek(fd, (off_t)(lastloc=nextloc), SEEK_SET);
450          }
451   }
452  
# Line 512 | Line 513 | loadholo()                     /* start loading a holodeck from fname */
513          fd = dup(fileno(fp));
514          fclose(fp);                             /* done with stdio */
515          for (n = 0; nextloc > 0L; n++) {        /* initialize each section */
516 <                lseek(fd, (off_t)nextloc, 0);
516 >                lseek(fd, (off_t)nextloc, SEEK_SET);
517                  read(fd, (char *)&nextloc, sizeof(nextloc));
518                  hdinit(fd, NULL);
519          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines