--- ray/src/hd/rholo.c 2004/09/09 00:25:59 3.66 +++ ray/src/hd/rholo.c 2004/09/09 01:41:21 3.68 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: rholo.c,v 3.66 2004/09/09 00:25:59 greg Exp $"; +static const char RCSid[] = "$Id: rholo.c,v 3.68 2004/09/09 01:41:21 greg Exp $"; #endif /* * Radiance holodeck generation controller @@ -320,7 +320,7 @@ memerr: static int rholo(void) /* holodeck main loop */ { - static long nextfragwarn = 100*(1L<<20); + static long nextfragwarn = 100L<<20; static int idle = 0; PACKET *pl = NULL, *plend; off_t fsiz; @@ -344,15 +344,15 @@ rholo(void) /* holodeck main loop */ return(1); /* comes back */ } #if FRAGWARN - if (fsiz >= nextfragwarn && - (fsiz-hdfiluse(hdlist[0]->fd,0))/(fsiz/100) > FRAGWARN) { - double pctfrag = 100.*(fsiz-hdfiluse(hdlist[0]->fd,1))/fsiz; - if (pctfrag >= (double)FRAGWARN) { + if (fsiz >= nextfragwarn) { + double pctfrag = 100.*(fsiz-hdfiluse(hdlist[0]->fd))/fsiz; + if (pctfrag >= (double)FRAGWARN) { sprintf(errmsg, "holodeck file fragmentation is %.0f%%", pctfrag); error(WARNING, errmsg); nextfragwarn = fsiz + (fsiz>>2); - } + } else + nextfragwarn = fsiz + (10L<<20); } #endif t = time(NULL); /* check time */ @@ -662,7 +662,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.),