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.51 by gwlarson, Thu Aug 5 19:20:10 1999 UTC vs.
Revision 3.52 by greg, Sat Feb 22 02:07:25 2003 UTC

# Line 1 | Line 1
1 /* Copyright (c) 1999 Regents of the University of California */
2
1   #ifndef lint
2 < static char SCCSid[] = "$SunId$ SGI";
2 > static const char       RCSid[] = "$Id$";
3   #endif
6
4   /*
5   * Radiance holodeck generation controller
6   */
# Line 217 | Line 214 | initrholo()                    /* get our holodeck running */
214                  init_global();
215                                                  /* record disk space limit */
216          if (!vdef(DISKSPACE))
217 <                maxdisk = 0;
217 >                maxdisk = (1L<<(sizeof(long)*8-2)) - 1024;
218          else
219                  maxdisk = 1024.*1024.*vflt(DISKSPACE);
220                                                  /* set up memory cache */
# Line 278 | Line 275 | initrholo()                    /* get our holodeck running */
275          sigdie(SIGXFSZ, "File size exceeded");
276   #endif
277                                          /* protect holodeck file */
278 <        orig_mode = resfmode(hdlist[0]->fd, ncprocs>0 ? 0 : 0444);
278 >        orig_mode = resfmode(hdlist[0]->fd, ncprocs>0&force>=0 ? 0 : 0444);
279          return;
280   memerr:
281          error(SYSTEM, "out of memory in initrholo");
# Line 433 | Line 430 | HDGRID *gp;
430          putw(HOLOMAGIC, fp);            /* put magic number */
431          fd = dup(fileno(fp));
432          fclose(fp);                     /* flush and close stdio stream */
433 <        lastloc = lseek(fd, 0L, 2);
433 >        lastloc = lseek(fd, (off_t)0L, 2);
434          for (n = vdef(SECTION); n--; gp++) {    /* initialize each section */
435                  nextloc = 0L;
436                  write(fd, (char *)&nextloc, sizeof(nextloc));
# Line 441 | Line 438 | HDGRID *gp;
438                  if (!n)
439                          break;
440                  nextloc = hdfilen(fd);          /* write section pointer */
441 <                if (lseek(fd, (long)lastloc, 0) < 0)
441 >                if (lseek(fd, (off_t)lastloc, 0) < 0)
442                          error(SYSTEM,
443                                  "cannot seek on holodeck file in creatholo");
444                  write(fd, (char *)&nextloc, sizeof(nextloc));
445 <                lseek(fd, (long)(lastloc=nextloc), 0);
445 >                lseek(fd, (off_t)(lastloc=nextloc), 0);
446          }
447   }
448  
# Line 513 | Line 510 | loadholo()                     /* start loading a holodeck from fname */
510          fd = dup(fileno(fp));
511          fclose(fp);                             /* done with stdio */
512          for (n = 0; nextloc > 0L; n++) {        /* initialize each section */
513 <                lseek(fd, (long)nextloc, 0);
513 >                lseek(fd, (off_t)nextloc, 0);
514                  read(fd, (char *)&nextloc, sizeof(nextloc));
515                  hdinit(fd, NULL);
516          }
# Line 581 | Line 578 | int    vc;
578   }
579  
580  
581 + void
582   eputs(s)                        /* put error message to stderr */
583   register char  *s;
584   {
# Line 600 | Line 598 | register char  *s;
598   }
599  
600  
601 + void
602   quit(ec)                        /* exit program gracefully */
603   int     ec;
604   {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines