--- ray/src/px/psum.c 2003/02/22 02:07:27 2.5 +++ ray/src/px/psum.c 2004/03/28 20:33:14 2.8 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: psum.c,v 2.5 2003/02/22 02:07:27 greg Exp $"; +static const char RCSid[] = "$Id: psum.c,v 2.8 2004/03/28 20:33:14 schorsch Exp $"; #endif /* * psum.c - program to sum pictures. @@ -8,10 +8,11 @@ static const char RCSid[] = "$Id: psum.c,v 2.5 2003/02 */ #include - #include #include "color.h" +#include "resolu.h" +#include "rterror.h" #define MAXFILE 8 @@ -25,19 +26,27 @@ FILE *fptr[MAXFILE]; /* the file pointers */ COLOR scale[MAXFILE]; /* scaling factors */ int nfile; /* number of files */ +static gethfunc tabputs; +static void psum(void); -int -tabputs(s) /* print line preceded by a tab */ -char *s; + + +static int +tabputs( /* print line preceded by a tab */ + char *s, + void *p +) { putc('\t', stdout); return(fputs(s, stdout)); } -main(argc, argv) -int argc; -char *argv[]; +int +main( + int argc, + char *argv[] +) { double d; int xres, yres; @@ -94,7 +103,7 @@ char *argv[]; /* get header */ fputs(fname[nfile], stdout); fputs(":\n", stdout); - getheader(fptr[nfile], tabputs); + getheader(fptr[nfile], tabputs, NULL); /* get picture size */ if (fgetresolu(&xres, &yres, fptr[nfile]) != (YMAJOR|YDECR)) { fprintf(stderr, "%s: bad picture size\n", progname); @@ -118,10 +127,12 @@ char *argv[]; psum(); quit(0); + return 0; /* pro forma return */ } -psum() /* sum the files */ +static void +psum(void) /* sum the files */ { COLOR *scanin, *scanout; int y, i; @@ -158,8 +169,9 @@ psum() /* sum the files */ void -quit(code) /* exit gracefully */ -int code; +quit( /* exit gracefully */ + int code +) { exit(code); }