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

Comparing ray/src/px/ra_ppm.c (file contents):
Revision 2.13 by greg, Fri Jan 6 06:40:53 2006 UTC vs.
Revision 2.18 by greg, Fri Jun 6 19:11:21 2025 UTC

# Line 5 | Line 5 | static const char      RCSid[] = "$Id$";
5   *  program to convert between RADIANCE and Poskanzer Pixmaps
6   */
7  
8 #include  <stdio.h>
8   #include  <math.h>
9   #include  <ctype.h>
10 < #include  <time.h>
12 <
10 > #include  "paths.h"
11   #include  "platform.h"
12 + #include  "rtio.h"
13   #include  "color.h"
14   #include  "resolu.h"
15  
# Line 18 | Line 17 | static const char      RCSid[] = "$Id$";
17   int  bradj = 0;                         /* brightness adjustment */
18   double  gamcor = 2.2;                   /* gamma correction value */
19   int  maxval = 255;                      /* maximum primary value */
21 char  *progname;
20   int  xmax, ymax;
21  
22   typedef int colrscanf_t(COLR *scan, int len, FILE *fp);
# Line 53 | Line 51 | main(
51          int  ptype;
52          int  i;
53          
54 <        progname = argv[0];
54 >        fixargv0(argv[0]);
55  
56          for (i = 1; i < argc; i++)
57                  if (argv[i][0] == '-')
# Line 103 | Line 101 | main(
101                  if (read(fileno(stdin), inpbuf, 2) != 2 || inpbuf[0] != 'P')
102                          quiterr("input not a Poskanzer Pixmap");
103                  ptype = inpbuf[1];
104 < #ifdef _WIN32
104 > #if defined(_WIN32) || defined(_WIN64)
105                  if (ptype > 4)
106                          SET_FILE_BINARY(stdin);
107                  SET_FILE_BINARY(stdout);
# Line 153 | Line 151 | main(
151                                  quiterr("unsupported Pixmap type");
152                          }
153          } else {
154 < #ifdef _WIN32
154 > #if defined(_WIN32) || defined(_WIN64)
155                  SET_FILE_BINARY(stdin);
156                  if (binflag)
157                          SET_FILE_BINARY(stdout);
# Line 587 | Line 585 | getby2(                        /* return 2-byte quantity from fp */
585  
586          upperb = getc(fp);
587          lowerb = getc(fp);
588 <        if (upperb == EOF)
588 >        if (lowerb == EOF)
589                  return(EOF);
590          return(upperb<<8 | lowerb);
591   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines