--- ray/src/rt/rpict.c 2003/02/25 02:47:23 2.53 +++ ray/src/rt/rpict.c 2003/06/05 19:29:34 2.55 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: rpict.c,v 2.53 2003/02/25 02:47:23 greg Exp $"; +static const char RCSid[] = "$Id"; #endif /* * rpict.c - routines and variables for picture generation. @@ -21,16 +21,15 @@ static const char RCSid[] = "$Id: rpict.c,v 2.53 2003/ #endif #endif -extern time_t time(); - +#include #include +#include "platform.h" #include "view.h" - #include "random.h" - #include "paths.h" + #define RFTEMPLATE "rfXXXXXX" #ifndef SIGCONT @@ -108,7 +107,7 @@ int hres, vres; /* resolution for this frame */ static VIEW lastview; /* the previous view input */ -extern char *mktemp(); +extern char *mktemp(); /* XXX should be in stdlib.h or unistd.h */ void report(); @@ -213,7 +212,6 @@ char *pout, *zout, *prvr; * sequenced file naming. */ { - extern char *rindex(), *strncpy(), *strcat(), *strcpy(); char fbuf[128], fbuf2[128]; int npicts; register char *cp; @@ -290,9 +288,7 @@ char *pout, *zout, *prvr; "cannot open output file \"%s\"", fbuf); error(SYSTEM, errmsg); } -#ifdef MSDOS - setmode(fileno(stdout), O_BINARY); -#endif + SET_FILE_BINARY(stdout); dupheader(); } hres = hresolu; vres = vresolu; pa = pixaspect; @@ -394,9 +390,7 @@ char *zfile, *oldfile; sprintf(errmsg, "cannot open z-file \"%s\"", zfile); error(SYSTEM, errmsg); } -#ifdef MSDOS - setmode(zfd, O_BINARY); -#endif + SET_FD_BINARY(zfd); for (i = 0; i <= psample; i++) { zbar[i] = (float *)malloc(hres*sizeof(float)); if (zbar[i] == NULL) @@ -678,9 +672,7 @@ char *oldfile; error(WARNING, errmsg); goto gotzip; } -#ifdef MSDOS - setmode(fileno(fp), O_BINARY); -#endif + SET_FILE_BINARY(fp); /* discard header */ getheader(fp, NULL, NULL); /* get picture size */