20 |
|
#include <sys/types.h> |
21 |
|
#include <sys/times.h> |
22 |
|
#include <limits.h> |
23 |
+ |
extern time_t time(); |
24 |
|
#endif |
25 |
+ |
#else |
26 |
+ |
extern unsigned long time(); |
27 |
|
#endif |
28 |
|
|
29 |
|
#include <signal.h> |
86 |
|
|
87 |
|
double pctdone = 0.0; /* percentage done */ |
88 |
|
|
89 |
< |
long tlastrept = 0L; /* time at last report */ |
89 |
> |
unsigned long tlastrept = 0L; /* time at last report */ |
90 |
|
|
91 |
< |
extern long time(); |
89 |
< |
extern long tstart; /* starting time */ |
91 |
> |
extern unsigned long tstart; /* starting time */ |
92 |
|
|
93 |
|
extern unsigned long nrays; /* number of rays traced */ |
94 |
|
|
140 |
|
struct tms tbuf; |
141 |
|
#endif |
142 |
|
|
143 |
< |
tlastrept = time((long *)0); |
143 |
> |
tlastrept = time((unsigned long *)NULL); |
144 |
|
#ifdef BSD |
145 |
|
getrusage(RUSAGE_SELF, &rubuf); |
146 |
|
u = rubuf.ru_utime.tv_sec + rubuf.ru_utime.tv_usec/1e6; |
164 |
|
#else |
165 |
|
report() /* report progress */ |
166 |
|
{ |
167 |
< |
tlastrept = time((long *)0); |
167 |
> |
tlastrept = time((unsigned long *)NULL); |
168 |
|
sprintf(errmsg, "%lu rays, %4.2f%% after %5.4f hours\n", |
169 |
|
nrays, pctdone, (tlastrept-tstart)/3600.0); |
170 |
|
eputs(errmsg); |
424 |
|
goto writerr; |
425 |
|
/* record progress */ |
426 |
|
pctdone = 100.0*(vres-1-ypos)/vres; |
427 |
< |
if (ralrm > 0 && time((long *)0) >= tlastrept+ralrm) |
427 |
> |
if (ralrm > 0 && time((unsigned long *)NULL) >= tlastrept+ralrm) |
428 |
|
report(); |
429 |
|
#ifndef BSD |
430 |
|
else |