--- ray/src/px/macbethcal.c 1999/07/16 16:12:20 2.16 +++ ray/src/px/macbethcal.c 2003/07/21 22:30:18 2.19 @@ -1,9 +1,6 @@ -/* Copyright (c) 1999 Regents of the University of California */ - #ifndef lint -static char SCCSid[] = "$SunId$ SGI"; +static const char RCSid[] = "$Id: macbethcal.c,v 2.19 2003/07/21 22:30:18 schorsch Exp $"; #endif - /* * Calibrate a scanned MacBeth Color Checker Chart * @@ -15,9 +12,9 @@ static char SCCSid[] = "$SunId$ SGI"; #include #include -#ifdef MSDOS -#include -#endif +#include + +#include "platform.h" #include "color.h" #include "resolu.h" #include "pmap.h" @@ -125,9 +122,7 @@ WARP3D *wcor = NULL; /* color space warp */ FILE *debugfp = NULL; /* debug output picture */ char *progname; -extern char *malloc(); - main(argc, argv) int argc; char **argv; @@ -145,9 +140,7 @@ char **argv; perror(argv[i]); exit(1); } -#ifdef MSDOS - setmode(fileno(debugfp), O_BINARY); -#endif + SET_FILE_BINARY(debugfp); newheader("RADIANCE", debugfp); /* start */ printargs(argc, argv, debugfp); /* header */ break; @@ -192,9 +185,7 @@ char **argv; exit(1); } if (scanning) { /* load input picture header */ -#ifdef MSDOS - setmode(fileno(stdin), O_BINARY); -#endif + SET_FILE_BINARY(stdin); if (checkheader(stdin, COLRFMT, NULL) < 0 || fgetresolu(&xmax, &ymax, stdin) < 0) { fprintf(stderr, "%s: bad input picture\n", progname); @@ -250,11 +241,12 @@ char **argv; printf("}\n"); putmapping(); /* put out color mapping */ } - if (debugfp != NULL) /* put out debug picture */ + if (debugfp != NULL) { /* put out debug picture */ if (scanning) picdebug(); else clrdebug(); + } exit(0); userr: fprintf(stderr, @@ -362,7 +354,7 @@ getpicture() /* load in picture colors */ scalecolor(inpRGB[i], d); inpflags |= 1L<