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

Comparing ray/src/px/psum.c (file contents):
Revision 2.1 by greg, Tue Nov 12 16:05:27 1991 UTC vs.
Revision 2.8 by schorsch, Sun Mar 28 20:33:14 2004 UTC

# Line 1 | Line 1
1 /* Copyright (c) 1986 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   *  psum.c - program to sum pictures.
6   *
# Line 11 | Line 8 | static char SCCSid[] = "$SunId$ LBL";
8   */
9  
10   #include  <stdio.h>
11 + #include  <math.h>
12  
13   #include  "color.h"
14 + #include  "resolu.h"
15 + #include  "rterror.h"
16  
17  
18   #define  MAXFILE        8
# Line 26 | Line 26 | FILE  *fptr[MAXFILE];                  /* the file pointers */
26   COLOR  scale[MAXFILE];                  /* scaling factors */
27   int  nfile;                             /* number of files */
28  
29 + static gethfunc tabputs;
30 + static void psum(void);
31  
32 < tabputs(s)                      /* print line preceded by a tab */
33 < char  *s;
32 >
33 >
34 > static int
35 > tabputs(                        /* print line preceded by a tab */
36 >        char    *s,
37 >        void    *p
38 > )
39   {
40          putc('\t', stdout);
41 <        fputs(s, stdout);
41 >        return(fputs(s, stdout));
42   }
43  
44  
45 < main(argc, argv)
46 < int  argc;
47 < char  *argv[];
45 > int
46 > main(
47 >        int  argc,
48 >        char  *argv[]
49 > )
50   {
51 <        double  d, atof();
51 >        double  d;
52          int  xres, yres;
53          int  an;
54  
# Line 94 | Line 103 | char  *argv[];
103                                                  /* get header */
104                  fputs(fname[nfile], stdout);
105                  fputs(":\n", stdout);
106 <                getheader(fptr[nfile], tabputs);
106 >                getheader(fptr[nfile], tabputs, NULL);
107                                                  /* get picture size */
108                  if (fgetresolu(&xres, &yres, fptr[nfile]) != (YMAJOR|YDECR)) {
109                          fprintf(stderr, "%s: bad picture size\n", progname);
# Line 118 | Line 127 | char  *argv[];
127          psum();
128          
129          quit(0);
130 +        return 0; /* pro forma return */
131   }
132  
133  
134 < psum()                          /* sum the files */
134 > static void
135 > psum(void)                              /* sum the files */
136   {
137          COLOR  *scanin, *scanout;
138          int  y, i;
# Line 152 | Line 163 | psum()                         /* sum the files */
163                          quit(1);
164                  }
165          }
166 <        free((char *)scanin);
167 <        free((char *)scanout);
166 >        free((void *)scanin);
167 >        free((void *)scanout);
168   }
169  
170  
171 < quit(code)              /* exit gracefully */
172 < int  code;
171 > void
172 > quit(           /* exit gracefully */
173 >        int  code
174 > )
175   {
176          exit(code);
177   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines