--- ray/src/px/pfilt.c 2003/06/05 19:29:34 2.23 +++ ray/src/px/pfilt.c 2004/01/02 12:47:01 2.28 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: pfilt.c,v 2.23 2003/06/05 19:29:34 schorsch Exp $"; +static const char RCSid[] = "$Id: pfilt.c,v 2.28 2004/01/02 12:47:01 schorsch Exp $"; #endif /* * pfilt.c - program to post-process picture file. @@ -8,8 +8,12 @@ static const char RCSid[] = "$Id: pfilt.c,v 2.23 2003/ * 6/23/93 Added additional buffers for value spreading */ +#include "copyright.h" + #include +#include +#include "platform.h" #include "standard.h" #include "color.h" #include "view.h" @@ -79,12 +83,13 @@ int orad = 0; /* output window radius */ char *progname; +static gethfunc headline; + main(argc, argv) int argc; char **argv; { - extern int headline(); FILE *fin; float *lampcolor; char *lamptype = NULL; @@ -97,10 +102,14 @@ char **argv; SET_FILE_BINARY(stdout); if (signal(SIGINT, quit) == SIG_IGN) signal(SIGINT, SIG_IGN); +#ifdef SIGHUP if (signal(SIGHUP, quit) == SIG_IGN) signal(SIGHUP, SIG_IGN); +#endif signal(SIGTERM, quit); +#ifdef SIGPIPE signal(SIGPIPE, quit); +#endif #ifdef SIGXCPU signal(SIGXCPU, quit); signal(SIGXFSZ, quit); @@ -320,9 +329,11 @@ COLOR clr; double (*ourbright)() = rgb_bright; -int -headline(s) /* process line from header */ -char *s; +static int +headline( /* process line from header */ + char *s, + void *p +) { char fmt[32]; @@ -482,12 +493,12 @@ scan2init() /* prepare scanline arrays */ if (obarsize > 0) { scoutbar = (COLOR **)malloc(obarsize*sizeof(COLOR *)); greybar = (float **)malloc(obarsize*sizeof(float *)); - if (scoutbar == NULL | greybar == NULL) + if ((scoutbar == NULL) | (greybar == NULL)) goto memerr; for (i = 0; i < obarsize; i++) { scoutbar[i] = (COLOR *)malloc(ncols*sizeof(COLOR)); greybar[i] = (float *)malloc(ncols*sizeof(float)); - if (scoutbar[i] == NULL | greybar[i] == NULL) + if ((scoutbar[i] == NULL) | (greybar[i] == NULL)) goto memerr; } } else { @@ -536,7 +547,7 @@ int r; greybar[nextrow%obarsize][c] = (*ourbright)(ctmp); } /* and zero output scanline */ - bzero((char *)scoutbar[nextrow%obarsize], ncols*sizeof(COLOR)); + memset((char *)scoutbar[nextrow%obarsize], '\0', ncols*sizeof(COLOR)); nextrow++; } /* point to top scanline for output */