--- ray/src/hd/rholo.c 2003/05/29 16:26:22 3.54 +++ ray/src/hd/rholo.c 2003/06/30 14:59:12 3.59 @@ -1,15 +1,17 @@ #ifndef lint -static const char RCSid[] = "$Id: rholo.c,v 3.54 2003/05/29 16:26:22 greg Exp $"; +static const char RCSid[] = "$Id: rholo.c,v 3.59 2003/06/30 14:59:12 schorsch Exp $"; #endif /* * Radiance holodeck generation controller */ -#include "rholo.h" -#include "random.h" #include #include +#include +#include "rholo.h" +#include "random.h" + #ifndef FRAGWARN #define FRAGWARN 20 /* fragmentation for warning (%) */ #endif @@ -152,6 +154,7 @@ userr: } +void onsig(signo) /* fatal signal */ int signo; { @@ -214,7 +217,7 @@ initrholo() /* get our holodeck running */ init_global(); /* record disk space limit */ if (!vdef(DISKSPACE)) - maxdisk = (1L<<(sizeof(off_t)*8-2)) - 1024; + maxdisk = ((off_t)1<<(sizeof(off_t)*8-2)) - 1024; else maxdisk = 1024.*1024.*vflt(DISKSPACE); /* set up memory cache */ @@ -412,7 +415,7 @@ creatholo(gp) /* create a holodeck output file */ HDGRID *gp; { extern char VersionID[]; - int4 lastloc, nextloc; + int32 lastloc, nextloc; int n; int fd; FILE *fp; @@ -430,7 +433,7 @@ HDGRID *gp; putw(HOLOMAGIC, fp); /* put magic number */ fd = dup(fileno(fp)); fclose(fp); /* flush and close stdio stream */ - lastloc = lseek(fd, (off_t)0L, 2); + lastloc = lseek(fd, (off_t)0, 2); for (n = vdef(SECTION); n--; gp++) { /* initialize each section */ nextloc = 0L; write(fd, (char *)&nextloc, sizeof(nextloc)); @@ -478,7 +481,7 @@ loadholo() /* start loading a holodeck from fname */ FILE *fp; int fd; int n; - int4 nextloc; + int32 nextloc; if (ncprocs > 0 & force >= 0) fp = fopen(hdkfile, "r+"); @@ -530,8 +533,8 @@ PACKET *pl; while (pl != NULL) { p = pl; pl = p->next; p->next = NULL; if (p->nr > 0) { /* add to holodeck */ - bcopy((void *)p->ra, - (void *)hdnewrays(hdlist[p->hd],p->bi,p->nr), + memcpy( (void *)hdnewrays(hdlist[p->hd],p->bi,p->nr), + (void *)p->ra, p->nr*sizeof(RAYVAL)); if (outdev != NULL) /* display it */ disp_packet((PACKHEAD *)p);