--- ray/src/px/ra_t16.c 1992/10/30 09:11:36 2.4 +++ ray/src/px/ra_t16.c 2003/06/05 19:29:34 2.7 @@ -1,9 +1,6 @@ -/* Copyright (c) 1991 Regents of the University of California */ - #ifndef lint -static char SCCSid[] = "$SunId$ LBL"; +static const char RCSid[] = "$Id: ra_t16.c,v 2.7 2003/06/05 19:29:34 schorsch Exp $"; #endif - /* * ra_t16.c - program to convert between RADIANCE and * Targa 16, 24 and 32-bit images. @@ -12,19 +9,13 @@ static char SCCSid[] = "$SunId$ LBL"; */ #include - -#ifdef MSDOS -#include -#endif - +#include #include +#include "platform.h" #include "color.h" - #include "resolu.h" - #include "random.h" - #include "targa.h" #define goodpic(h) (((h)->dataType==IM_RGB || (h)->dataType==IM_CRGB) \ @@ -56,12 +47,9 @@ char *argv[]; struct hdStruct head; int reverse = 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]; head.dataBits = 16; @@ -113,6 +101,7 @@ char *argv[]; if (!goodpic(&head)) quiterr("incompatible format"); /* put header */ + newheader("RADIANCE", stdout); printargs(i, argv, stdout); fputformat(COLRFMT, stdout); putchar('\n'); @@ -173,6 +162,7 @@ char *err; } +void eputs(s) char *s; { @@ -180,6 +170,7 @@ char *s; } +void quit(code) int code; { @@ -290,8 +281,8 @@ struct hdStruct *hp; if (fwritecolrs(scanline, hp->x, stdout) < 0) quiterr("error writing RADIANCE file"); } - free((char *)scanline); - free((char *)tarData); + free((void *)scanline); + free((void *)tarData); } @@ -339,8 +330,8 @@ struct hdStruct *hp; /* write out targa data */ writetarga(hp, tarData, stdout); - free((char *)inl); - free((char *)tarData); + free((void *)inl); + free((void *)tarData); }