--- ray/src/px/pcwarp.c 1997/02/05 17:29:25 3.1 +++ ray/src/px/pcwarp.c 2004/03/28 20:33:14 3.4 @@ -1,30 +1,34 @@ -/* Copyright (c) 1997 Regents of the University of California */ - #ifndef lint -static char SCCSid[] = "$SunId$ LBL"; +static const char RCSid[] = "$Id: pcwarp.c,v 3.4 2004/03/28 20:33:14 schorsch Exp $"; #endif - /* * Warp colors in Radiance picture to correct for input/output changes. */ #include + +#include "resolu.h" #include "color.h" #include "warp3d.h" char *progname; /* global argv[0] */ -FILE *infp = stdin; /* input stream */ +FILE *infp = NULL; /* input stream */ int xres, yres; /* input picture resolution */ WARP3D *cwarp; /* our warp map */ int iclip = CGAMUT_UPPER; /* input value gamut clipping */ int oclip = CGAMUT_LOWER; /* output value gamut clipping */ +static void syserror(char *s); +static void picwarp(void); -main(argc, argv) -int argc; -char *argv[]; + +int +main( + int argc, + char *argv[] +) { static char picfmt[LPICFMT+1] = PICFMT; int cwflags = 0; @@ -32,6 +36,7 @@ char *argv[]; int i; progname = argv[0]; + infp = stdin; /* get options */ for (i = 1; i < argc && argv[i][0] == '-'; i++) switch (argv[i][1]) { @@ -90,8 +95,10 @@ userr: } -syserror(s) /* print system error and exit */ -char *s; +static void +syserror( /* print system error and exit */ + char *s +) { fprintf(stderr, "%s: ", progname); perror(s); @@ -99,7 +106,8 @@ char *s; } -picwarp() /* warp our picture scanlines */ +static void +picwarp(void) /* warp our picture scanlines */ { register COLOR *scan; long ngamut = 0; @@ -141,7 +149,7 @@ picwarp() /* warp our picture scanlines */ } } if (ngamut >= (long)xres*yres/100) - fprintf(stderr, "%s: warning - %d%% of pixels out of gamut\n", + fprintf(stderr, "%s: warning - %ld%% of pixels out of gamut\n", progname, 100*ngamut/((long)xres*yres)); - free((char *)scan); + free((void *)scan); }