--- ray/src/px/psum.c 1989/09/12 13:04:29 1.2 +++ ray/src/px/psum.c 2003/10/27 10:22:27 2.6 @@ -1,9 +1,6 @@ -/* Copyright (c) 1986 Regents of the University of California */ - #ifndef lint -static char SCCSid[] = "$SunId$ LBL"; +static const char RCSid[] = "$Id: psum.c,v 2.6 2003/10/27 10:22:27 schorsch Exp $"; #endif - /* * psum.c - program to sum pictures. * @@ -11,8 +8,11 @@ static char SCCSid[] = "$SunId$ LBL"; */ #include +#include #include "color.h" +#include "resolu.h" +#include "rterror.h" #define MAXFILE 8 @@ -27,11 +27,12 @@ COLOR scale[MAXFILE]; /* scaling factors */ int nfile; /* number of files */ +int tabputs(s) /* print line preceded by a tab */ char *s; { putc('\t', stdout); - fputs(s, stdout); + return(fputs(s, stdout)); } @@ -39,7 +40,7 @@ main(argc, argv) int argc; char *argv[]; { - double d, atof(); + double d; int xres, yres; int an; @@ -94,7 +95,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); @@ -152,11 +153,12 @@ psum() /* sum the files */ quit(1); } } - free((char *)scanin); - free((char *)scanout); + free((void *)scanin); + free((void *)scanout); } +void quit(code) /* exit gracefully */ int code; {