230 |
|
initrholo(void) /* get our holodeck running */ |
231 |
|
{ |
232 |
|
extern int global_packet(); |
233 |
< |
register int i; |
233 |
> |
int i; |
234 |
|
/* close holodeck on exec() */ |
235 |
|
fcntl(hdlist[0]->fd, F_SETFD, FD_CLOEXEC); |
236 |
|
|
250 |
|
hdcachesize = 1024.*1024.*vflt(CACHE); |
251 |
|
/* open report file */ |
252 |
|
if (vdef(REPORT)) { |
253 |
< |
register char *s = sskip2(vval(REPORT), 1); |
253 |
> |
char *s = sskip2(vval(REPORT), 1); |
254 |
|
if (*s && freopen(s, "a", stderr) == NULL) |
255 |
|
quit(2); |
256 |
|
} |
324 |
|
PACKET *pl = NULL, *plend; |
325 |
|
off_t fsiz; |
326 |
|
int pksiz; |
327 |
< |
register PACKET *p; |
327 |
> |
PACKET *p; |
328 |
|
time_t t; |
329 |
|
/* check display */ |
330 |
|
if (nprocs <= 0) |
391 |
|
|
392 |
|
static void |
393 |
|
setdefaults( /* set default values */ |
394 |
< |
register HDGRID *gp |
394 |
> |
HDGRID *gp |
395 |
|
) |
396 |
|
{ |
397 |
|
extern char *atos(); |
398 |
< |
register int i; |
398 |
> |
int i; |
399 |
|
int n; |
400 |
|
double len[3], d; |
401 |
|
|
458 |
|
int fd; |
459 |
|
FILE *fp; |
460 |
|
/* open & truncate file */ |
461 |
< |
if ((fp = fopen(hdkfile, "w+")) == NULL) { |
461 |
> |
if ((fp = fopen(hdkfile, "wb+")) == NULL) { |
462 |
|
sprintf(errmsg, "cannot open \"%s\" for writing", hdkfile); |
463 |
|
error(SYSTEM, errmsg); |
464 |
|
} |
466 |
|
newheader("RADIANCE", fp); |
467 |
|
fprintf(fp, "SOFTWARE= %s\n", VersionID); |
468 |
|
printvars(fp); |
469 |
+ |
fputendian(fp); |
470 |
|
fputformat(HOLOFMT, fp); |
471 |
|
fputc('\n', fp); |
472 |
|
putw(HOLOMAGIC, fp); /* put magic number */ |
496 |
|
) |
497 |
|
{ |
498 |
|
extern char FMTSTR[]; |
499 |
< |
register char *cp; |
500 |
< |
char fmt[32]; |
499 |
> |
char *cp; |
500 |
> |
char fmt[MAXFMTLEN]; |
501 |
|
|
502 |
|
if (formatval(fmt, s)) { |
503 |
|
if (strcmp(fmt, HOLOFMT)) { |
526 |
|
off_t nextloc; |
527 |
|
|
528 |
|
if ((ncprocs > 0) & (force >= 0)) |
529 |
< |
fp = fopen(hdkfile, "r+"); |
529 |
> |
fp = fopen(hdkfile, "rb+"); |
530 |
|
else |
531 |
|
fp = NULL; |
532 |
|
if (fp == NULL) { |
533 |
< |
if ((fp = fopen(hdkfile, "r")) == NULL) { |
533 |
> |
if ((fp = fopen(hdkfile, "rb")) == NULL) { |
534 |
|
sprintf(errmsg, "cannot open \"%s\"", hdkfile); |
535 |
|
error(SYSTEM, errmsg); |
536 |
|
} |
567 |
|
} |
568 |
|
|
569 |
|
|
570 |
< |
extern void |
570 |
> |
void |
571 |
|
done_packets( /* handle finished packets */ |
572 |
|
PACKET *pl |
573 |
|
) |
574 |
|
{ |
575 |
|
static int n2flush = 0; |
576 |
< |
register PACKET *p; |
576 |
> |
PACKET *p; |
577 |
|
|
578 |
|
while (pl != NULL) { |
579 |
|
p = pl; pl = p->next; p->next = NULL; |
604 |
|
|
605 |
|
static void |
606 |
|
rootname( /* remove tail from end of fn */ |
607 |
< |
register char *rn, |
608 |
< |
register char *fn |
607 |
> |
char *rn, |
608 |
> |
char *fn |
609 |
|
) |
610 |
|
{ |
611 |
|
char *tp, *dp; |
632 |
|
|
633 |
|
|
634 |
|
void |
635 |
< |
eputs(s) /* put error message to stderr */ |
635 |
< |
register char *s; |
635 |
> |
eputs(const char *s) /* put error message to stderr */ |
636 |
|
{ |
637 |
|
static int midline = 0; |
638 |
|
|
651 |
|
|
652 |
|
|
653 |
|
void |
654 |
< |
quit(ec) /* exit program gracefully */ |
655 |
< |
int ec; |
654 |
> |
quit(int ec) /* exit program gracefully */ |
655 |
|
{ |
656 |
|
int status = 0; |
657 |
|
|