--- ray/src/px/ra_pr24.c 1993/11/18 09:55:14 2.7 +++ ray/src/px/ra_pr24.c 2003/07/03 22:41:44 2.11 @@ -1,29 +1,20 @@ -/* Copyright (c) 1992 Regents of the University of California */ - #ifndef lint -static char SCCSid[] = "$SunId$ LBL"; +static const char RCSid[] = "$Id: ra_pr24.c,v 2.11 2003/07/03 22:41:44 schorsch Exp $"; #endif - /* * program to convert between RADIANCE and 24-bit rasterfiles. */ #include - -#ifdef MSDOS -#include -#endif - +#include #include +#include +#include "platform.h" #include "rasterfile.h" - #include "color.h" - #include "resolu.h" -extern char *malloc(); - double gamcor = 2.2; /* gamma correction */ int bradj = 0; /* brightness adjustment */ @@ -40,12 +31,9 @@ char *argv[]; struct rasterfile 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.ras_type = RT_STANDARD; @@ -99,6 +87,7 @@ char *argv[]; || head.ras_depth != 24) quiterr("incompatible format"); /* put header */ + newheader("RADIANCE", stdout); printargs(i, argv, stdout); fputformat(COLRFMT, stdout); putchar('\n'); @@ -176,7 +165,7 @@ int pad; quiterr("error writing Radiance picture"); } /* free scanline */ - free((char *)scanout); + free((void *)scanout); } @@ -222,5 +211,5 @@ int pad; quiterr("error writing rasterfile"); } /* free scanline */ - free((char *)scanin); + free((void *)scanin); }