--- ray/src/px/pflip.c 1992/10/28 11:23:22 2.3 +++ ray/src/px/pflip.c 2003/02/22 02:07:27 2.5 @@ -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: pflip.c,v 2.5 2003/02/22 02:07:27 greg Exp $"; #endif - /* * flip picture file horizontally and/or vertically */ @@ -14,6 +11,8 @@ static char SCCSid[] = "$SunId$ LBL"; #include #endif +#include + #include "color.h" #include "resolu.h" @@ -31,9 +30,7 @@ FILE *fin; /* input file */ char *progname; -extern char *malloc(); - int neworder() /* figure out new order from old */ { @@ -56,7 +53,8 @@ main(argc, argv) int argc; char *argv[]; { - int i; + static char picfmt[LPICFMT+1] = PICFMT; + int i, rval; #ifdef MSDOS extern int _fmode; _fmode = O_BINARY; @@ -87,14 +85,15 @@ char *argv[]; exit(1); } /* transfer header */ - if (checkheader(fin, COLRFMT, stdout) < 0) { + if ((rval = checkheader(fin, picfmt, stdout)) < 0) { fprintf(stderr, "%s: input not a Radiance picture\n", progname); exit(1); } + if (rval) + fputformat(picfmt, stdout); /* add new header info. */ printargs(i, argv, stdout); - fputformat(COLRFMT, stdout); putchar('\n'); /* get picture size */ if ((order = fgetresolu(&xres, &yres, fin)) < 0) { @@ -136,7 +135,7 @@ scanfile() /* scan to the end of file */ } } scanpos[0] = ftell(fin); - free((char *)scanin); + free((void *)scanin); } @@ -170,7 +169,7 @@ flip() /* flip the picture */ exit(1); } } - free((char *)scanin); + free((void *)scanin); if (fhoriz) - free((char *)scanout); + free((void *)scanout); }