82 |
|
extern long time(); |
83 |
|
extern long tstart; /* starting time */ |
84 |
|
|
85 |
< |
extern long nrays; /* number of rays traced */ |
85 |
> |
extern unsigned long nrays; /* number of rays traced */ |
86 |
|
|
87 |
|
#define MAXDIV 16 /* maximum sample size */ |
88 |
|
|
119 |
|
t += (rubuf.ru_utime.tv_usec + rubuf.ru_stime.tv_usec) / 1e6; |
120 |
|
t += rubuf.ru_utime.tv_sec + rubuf.ru_stime.tv_sec; |
121 |
|
|
122 |
< |
sprintf(errmsg, "%ld rays, %4.2f%% done after %5.4f CPU hours\n", |
122 |
> |
sprintf(errmsg, "%lu rays, %4.2f%% done after %5.4f CPU hours\n", |
123 |
|
nrays, pctdone, t/3600.0); |
124 |
|
eputs(errmsg); |
125 |
|
tlastrept = time((long *)0); |
128 |
|
report() /* report progress */ |
129 |
|
{ |
130 |
|
tlastrept = time((long *)0); |
131 |
< |
sprintf(errmsg, "%ld rays, %4.2f%% done after %5.4f hours\n", |
131 |
> |
sprintf(errmsg, "%lu rays, %4.2f%% done after %5.4f hours\n", |
132 |
|
nrays, pctdone, (tlastrept-tstart)/3600.0); |
133 |
|
eputs(errmsg); |
134 |
|
signal(SIGCONT, report); |
201 |
|
do { |
202 |
|
if (seq && nextview(stdin) == EOF) |
203 |
|
break; |
204 |
+ |
pctdone = 0.0; |
205 |
|
if (pout != NULL) { |
206 |
|
sprintf(fbuf, pout, seq); |
207 |
|
if (freopen(fbuf, "w", stdout) == NULL) { |
394 |
|
pctdone = 100.0; |
395 |
|
if (ralrm > 0) |
396 |
|
report(); |
397 |
+ |
signal(SIGCONT, SIG_DFL); |
398 |
|
return; |
399 |
|
writerr: |
400 |
|
error(SYSTEM, "write error in render"); |