--- ray/src/px/ra_t8.c 1995/11/10 17:04:52 2.9 +++ ray/src/px/ra_t8.c 2003/06/05 19:29:34 2.12 @@ -1,9 +1,6 @@ -/* Copyright (c) 1992 Regents of the University of California */ - #ifndef lint -static char SCCSid[] = "$SunId$ LBL"; +static const char RCSid[] = "$Id: ra_t8.c,v 2.12 2003/06/05 19:29:34 schorsch Exp $"; #endif - /* * ra_t8.c - program to convert between RADIANCE and * Targa 8-bit color-mapped images. @@ -12,23 +9,15 @@ static char SCCSid[] = "$SunId$ LBL"; */ #include +#include +#include +#include "platform.h" #include "color.h" - #include "resolu.h" - #include "targa.h" -#ifdef MSDOS -#include -#endif -#include - -#ifndef BSD -#define bcopy(s,d,n) (void)memcpy(d,s,n) -#endif - #define goodpic(h) (my_imType(h) && my_mapType(h)) #define my_imType(h) (((h)->dataType==IM_CMAP || (h)->dataType==IM_CCMAP) \ && (h)->dataBits==8 && (h)->imType==0) @@ -70,12 +59,9 @@ char *argv[]; int ncolors = 256; int greyscale = 0; int i; -#ifdef MSDOS - extern int _fmode; - _fmode = O_BINARY; - setmode(fileno(stdin), O_BINARY); - setmode(fileno(stdout), O_BINARY); -#endif + SET_DEFAULT_BINARY(); + SET_FILE_BINARY(stdin); + SET_FILE_BINARY(stdout); progname = argv[0]; samplefac = 0; @@ -194,6 +180,7 @@ char *err; } +void eputs(s) char *s; { @@ -201,6 +188,7 @@ char *s; } +void quit(code) int code; { @@ -343,8 +331,8 @@ struct hdStruct *hp; if (fwritecolrs(scanline, xmax, stdout) < 0) quiterr("error writing RADIANCE file"); } - free((char *)scanline); - free((char *)tarData); + free((void *)scanline); + free((void *)tarData); }