--- ray/src/px/pcwarp.c 1999/06/09 14:06:55 3.2 +++ ray/src/px/pcwarp.c 2008/11/10 19:08:19 3.5 @@ -1,14 +1,13 @@ -/* 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.5 2008/11/10 19:08:19 greg Exp $"; #endif - /* * Warp colors in Radiance picture to correct for input/output changes. */ #include + +#include "resolu.h" #include "color.h" #include "warp3d.h" @@ -21,10 +20,15 @@ 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; @@ -85,14 +89,16 @@ char *argv[]; exit(0); userr: fprintf(stderr, - "Usage: %s [-i][-o][-e|-f] map.cwp [input.pic [output.pic]]\n", + "Usage: %s [-i][-o][-e|-f] map.cwp [input.hdr [output.hdr]]\n", progname); exit(1); } -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); @@ -100,7 +106,8 @@ char *s; } -picwarp() /* warp our picture scanlines */ +static void +picwarp(void) /* warp our picture scanlines */ { register COLOR *scan; long ngamut = 0; @@ -142,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); }