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

Comparing ray/src/px/pflip.c (file contents):
Revision 2.3 by greg, Wed Oct 28 11:23:22 1992 UTC vs.
Revision 2.5 by greg, Sat Feb 22 02:07:27 2003 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   * flip picture file horizontally and/or vertically
6   */
# Line 14 | Line 11 | static char SCCSid[] = "$SunId$ LBL";
11   #include  <fcntl.h>
12   #endif
13  
14 + #include  <time.h>
15 +
16   #include "color.h"
17  
18   #include "resolu.h"
# Line 31 | Line 30 | FILE   *fin;                           /* input file */
30  
31   char    *progname;
32  
34 extern char     *malloc();
33  
36
34   int
35   neworder()                      /* figure out new order from old */
36   {
# Line 56 | Line 53 | main(argc, argv)
53   int     argc;
54   char    *argv[];
55   {
56 <        int     i;
56 >        static char     picfmt[LPICFMT+1] = PICFMT;
57 >        int     i, rval;
58   #ifdef MSDOS
59          extern int  _fmode;
60          _fmode = O_BINARY;
# Line 87 | Line 85 | char   *argv[];
85                  exit(1);
86          }
87                                          /* transfer header */
88 <        if (checkheader(fin, COLRFMT, stdout) < 0) {
88 >        if ((rval = checkheader(fin, picfmt, stdout)) < 0) {
89                  fprintf(stderr, "%s: input not a Radiance picture\n",
90                                  progname);
91                  exit(1);
92          }
93 +        if (rval)
94 +                fputformat(picfmt, stdout);
95                                          /* add new header info. */
96          printargs(i, argv, stdout);
97        fputformat(COLRFMT, stdout);
97          putchar('\n');
98                                          /* get picture size */
99          if ((order = fgetresolu(&xres, &yres, fin)) < 0) {
# Line 136 | Line 135 | scanfile()                             /* scan to the end of file */
135                  }
136          }
137          scanpos[0] = ftell(fin);
138 <        free((char *)scanin);
138 >        free((void *)scanin);
139   }
140  
141  
# Line 170 | Line 169 | flip()                                 /* flip the picture */
169                          exit(1);
170                  }
171          }
172 <        free((char *)scanin);
172 >        free((void *)scanin);
173          if (fhoriz)
174 <                free((char *)scanout);
174 >                free((void *)scanout);
175   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines