ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/px/pextrem.c
(Generate patch)

Comparing ray/src/px/pextrem.c (file contents):
Revision 2.4 by gwlarson, Tue Oct 27 09:08:26 1998 UTC vs.
Revision 2.9 by schorsch, Fri Jan 2 12:47:01 2004 UTC

# Line 1 | Line 1
1 /* Copyright (c) 1992 Regents of the University of California */
2
1   #ifndef lint
2 < static char SCCSid[] = "$SunId$ LBL";
2 > static const char       RCSid[] = "$Id$";
3   #endif
6
4   /*
5   * Find extrema points in a Radiance picture.
6   */
7  
8   #include  <stdio.h>
9   #include  <math.h>
10 < #ifdef MSDOS
11 < #include  <fcntl.h>
12 < #endif
10 > #include  <string.h>
11 >
12 > #include  "platform.h"
13   #include  "color.h"
14 + #include  "resolu.h"
15  
16  
17   int  orig = 0;
# Line 22 | Line 20 | int  wrongformat = 0;
20  
21   COLOR  expos = WHTCOLOR;
22  
23 < extern char  *malloc();
23 > static gethfunc headline;
24  
25  
26 < headline(s)                     /* check header line */
27 < char  *s;
26 > static int
27 > headline(                       /* check header line */
28 >        char  *s,
29 >        void    *p
30 > )
31   {
32          char    fmt[32];
33          double  d;
# Line 34 | Line 35 | char  *s;
35  
36          if (isformat(s)) {                      /* format */
37                  formatval(fmt, s);
38 <                wrongformat = strcmp(fmt, COLRFMT);
38 >                wrongformat = !globmatch(PICFMT, fmt);
39          }
40          if (!orig)
41                  return(0);
# Line 60 | Line 61 | char  *argv[];
61          COLR  *scan;
62          COLR  cmin, cmax;
63          int  xmin, ymin, xmax, ymax;
64 < #ifdef MSDOS
65 <        extern int  _fmode;
65 <        _fmode = O_BINARY;
66 <        setmode(fileno(stdin), O_BINARY);
67 < #endif
64 >        SET_DEFAULT_BINARY();
65 >        SET_FILE_BINARY(stdin);
66          for (i = 1; i < argc; i++)      /* get options */
67                  if (!strcmp(argv[i], "-o"))
68                          orig++;
# Line 111 | Line 109 | char  *argv[];
109                          }
110                  }
111          }
112 <        free((char *)scan);
112 >        free((void *)scan);
113          printf("%d %d\t%e %e %e\n", xmin, ymin,
114                          colrval(cmin,RED)/colval(expos,RED),
115                          colrval(cmin,GRN)/colval(expos,GRN),

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines