--- ray/src/px/pextrem.c 1992/09/21 12:14:03 2.2 +++ ray/src/px/pextrem.c 2003/07/03 22:41:44 2.8 @@ -1,17 +1,15 @@ -/* Copyright (c) 1992 Regents of the University of California */ - #ifndef lint -static char SCCSid[] = "$SunId$ LBL"; +static const char RCSid[] = "$Id: pextrem.c,v 2.8 2003/07/03 22:41:44 schorsch Exp $"; #endif - /* * Find extrema points in a Radiance picture. */ #include -#ifdef MSDOS -#include -#endif +#include +#include + +#include "platform.h" #include "color.h" @@ -21,9 +19,7 @@ int wrongformat = 0; COLOR expos = WHTCOLOR; -extern char *malloc(); - headline(s) /* check header line */ char *s; { @@ -33,10 +29,10 @@ char *s; if (isformat(s)) { /* format */ formatval(fmt, s); - wrongformat = strcmp(fmt, COLRFMT); + wrongformat = !globmatch(PICFMT, fmt); } if (!orig) - return; + return(0); if (isexpos(s)) { /* exposure */ d = exposval(s); scalecolor(expos, d); @@ -44,6 +40,7 @@ char *s; colcorval(ctmp, s); multcolor(expos, ctmp); } + return(0); } @@ -58,11 +55,8 @@ char *argv[]; COLR *scan; COLR cmin, cmax; int xmin, ymin, xmax, ymax; -#ifdef MSDOS - extern int _fmode; - _fmode = O_BINARY; - setmode(fileno(stdin), O_BINARY); -#endif + SET_DEFAULT_BINARY(); + SET_FILE_BINARY(stdin); for (i = 1; i < argc; i++) /* get options */ if (!strcmp(argv[i], "-o")) orig++; @@ -109,7 +103,7 @@ char *argv[]; } } } - free((char *)scan); + free((void *)scan); printf("%d %d\t%e %e %e\n", xmin, ymin, colrval(cmin,RED)/colval(expos,RED), colrval(cmin,GRN)/colval(expos,GRN),