--- ray/src/px/pflip.c 2003/06/05 19:29:34 2.6 +++ ray/src/px/pflip.c 2006/08/08 18:04:41 2.9 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: pflip.c,v 2.6 2003/06/05 19:29:34 schorsch Exp $"; +static const char RCSid[] = "$Id: pflip.c,v 2.9 2006/08/08 18:04:41 greg Exp $"; #endif /* * flip picture file horizontally and/or vertically @@ -7,6 +7,7 @@ static const char RCSid[] = "$Id: pflip.c,v 2.6 2003/0 #include #include +#include #include "platform.h" #include "color.h" @@ -26,8 +27,13 @@ FILE *fin; /* input file */ char *progname; -int -neworder() /* figure out new order from old */ +static void memerr(void); +static void scanfile(void); +static void flip(void); + + +static int +neworder(void) /* figure out new order from old */ { register int no; @@ -43,10 +49,11 @@ neworder() /* figure out new order from old */ return(no); } - -main(argc, argv) -int argc; -char *argv[]; +int +main( + int argc, + char *argv[] +) { static char picfmt[LPICFMT+1] = PICFMT; int i, rval; @@ -69,7 +76,7 @@ char *argv[]; exit(1); } if ((fin = fopen(argv[i], "r")) == NULL) { - fprintf(stderr, "%s: cannot open\n", argv[1]); + fprintf(stderr, "%s: cannot open\n", argv[i]); exit(1); } if (i < argc-1 && freopen(argv[i+1], "w", stdout) == NULL) { @@ -102,14 +109,16 @@ char *argv[]; } -memerr() +static void +memerr(void) { fprintf(stderr, "%s: out of memory\n", progname); exit(1); } -scanfile() /* scan to the end of file */ +static void +scanfile(void) /* scan to the end of file */ { extern long ftell(); COLR *scanin; @@ -131,7 +140,8 @@ scanfile() /* scan to the end of file */ } -flip() /* flip the picture */ +static void +flip(void) /* flip the picture */ { COLR *scanin, *scanout; int y;