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 1.5 by greg, Mon Nov 11 14:02:02 1991 UTC vs.
Revision 2.3 by greg, Wed Oct 28 11:23:22 1992 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1991 Regents of the University of California */
1 > /* Copyright (c) 1992 Regents of the University of California */
2  
3   #ifndef lint
4   static char SCCSid[] = "$SunId$ LBL";
# Line 10 | Line 10 | static char SCCSid[] = "$SunId$ LBL";
10  
11   #include <stdio.h>
12  
13 + #ifdef MSDOS
14 + #include  <fcntl.h>
15 + #endif
16 +
17   #include "color.h"
18  
19   #include "resolu.h"
# Line 27 | Line 31 | FILE   *fin;                           /* input file */
31  
32   char    *progname;
33  
34 + extern char     *malloc();
35  
36 +
37   int
38   neworder()                      /* figure out new order from old */
39   {
# Line 51 | Line 57 | int    argc;
57   char    *argv[];
58   {
59          int     i;
60 <
60 > #ifdef MSDOS
61 >        extern int  _fmode;
62 >        _fmode = O_BINARY;
63 >        setmode(fileno(stdout), O_BINARY);
64 > #endif
65          progname = argv[0];
66  
67          for (i = 1; i < argc; i++)
# Line 118 | Line 128 | scanfile()                             /* scan to the end of file */
128                  memerr();
129          if ((scanin = (COLR *)malloc(xres*sizeof(COLR))) == NULL)
130                  memerr();
131 <        for (y = yres-1; y >= 0; y--) {
131 >        for (y = yres-1; y > 0; y--) {
132                  scanpos[y] = ftell(fin);
133                  if (freadcolrs(scanin, xres, fin) < 0) {
134                          fprintf(stderr, "%s: read error\n", progname);
135                          exit(1);
136                  }
137          }
138 +        scanpos[0] = ftell(fin);
139          free((char *)scanin);
140   }
141  
# Line 160 | Line 171 | flip()                                 /* flip the picture */
171                  }
172          }
173          free((char *)scanin);
174 <        free((char *)scanout);
174 >        if (fhoriz)
175 >                free((char *)scanout);
176   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines