--- ray/src/hd/rholo.c 2004/01/01 11:21:55 3.64 +++ ray/src/hd/rholo.c 2004/09/09 01:06:19 3.67 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: rholo.c,v 3.64 2004/01/01 11:21:55 schorsch Exp $"; +static const char RCSid[] = "$Id: rholo.c,v 3.67 2004/09/09 01:06:19 greg Exp $"; #endif /* * Radiance holodeck generation controller @@ -76,7 +76,7 @@ static void initrholo(void); static int rholo(void); static void setdefaults(HDGRID *gp); static void creatholo(HDGRID *gp); -static int headline(char *s); +static gethfunc headline; static void loadholo(void); static void rootname(char *rn, char *fn); static void badvalue(int vc); @@ -323,7 +323,7 @@ rholo(void) /* holodeck main loop */ static long nextfragwarn = 100*(1L<<20); static int idle = 0; PACKET *pl = NULL, *plend; - off_t fsiz; + off_t fsiz, fuse; int pksiz; register PACKET *p; time_t t; @@ -345,11 +345,11 @@ rholo(void) /* holodeck main loop */ } #if FRAGWARN if (fsiz >= nextfragwarn && - (fsiz-hdfiluse(hdlist[0]->fd,0))/(fsiz/100) > FRAGWARN) { + (fsiz-(fuse=hdfiluse(hdlist[0]->fd)))/(fsiz/100) > FRAGWARN) { sprintf(errmsg, "holodeck file fragmentation is %.0f%%", - 100.*(fsiz-hdfiluse(hdlist[0]->fd,1))/fsiz); + 100.*(fsiz-fuse)/fsiz); error(WARNING, errmsg); - nextfragwarn = fsiz + (fsiz>>2); /* decent interval */ + nextfragwarn = fsiz + (fsiz>>2); } #endif t = time(NULL); /* check time */ @@ -488,7 +488,8 @@ creatholo( /* create a holodeck output file */ static int headline( /* process information header line */ - char *s + char *s, + void *p ) { extern char FMTSTR[]; @@ -658,7 +659,7 @@ int ec; if ((ncprocs > 0) & (force >= 0) && vdef(REPORT)) { off_t fsiz, fuse; fsiz = hdfilen(hdlist[0]->fd); - fuse = hdfiluse(hdlist[0]->fd, 1); + fuse = hdfiluse(hdlist[0]->fd); fprintf(stderr, "%s: %.1f Mbyte holodeck file, %.1f%% fragmentation\n", hdkfile, fsiz/(1024.*1024.),