--- ray/src/px/pextrem.c 1998/10/27 09:08:26 2.4 +++ ray/src/px/pextrem.c 2003/06/08 12:03:10 2.7 @@ -1,18 +1,14 @@ -/* 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.7 2003/06/08 12:03:10 schorsch Exp $"; #endif - /* * Find extrema points in a Radiance picture. */ #include #include -#ifdef MSDOS -#include -#endif + +#include "platform.h" #include "color.h" @@ -22,9 +18,7 @@ int wrongformat = 0; COLOR expos = WHTCOLOR; -extern char *malloc(); - headline(s) /* check header line */ char *s; { @@ -34,7 +28,7 @@ char *s; if (isformat(s)) { /* format */ formatval(fmt, s); - wrongformat = strcmp(fmt, COLRFMT); + wrongformat = !globmatch(PICFMT, fmt); } if (!orig) return(0); @@ -60,11 +54,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++; @@ -111,7 +102,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),