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

Comparing ray/src/px/ra_t8.c (file contents):
Revision 2.9 by greg, Fri Nov 10 17:04:52 1995 UTC vs.
Revision 2.12 by schorsch, Thu Jun 5 19:29:34 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   *  ra_t8.c - program to convert between RADIANCE and
6   *              Targa 8-bit color-mapped images.
# Line 12 | Line 9 | static char SCCSid[] = "$SunId$ LBL";
9   */
10  
11   #include  <stdio.h>
12 + #include  <time.h>
13 + #include  <math.h>
14  
15 + #include  "platform.h"
16   #include  "color.h"
17
17   #include  "resolu.h"
19
18   #include  "targa.h"
19  
22 #ifdef MSDOS
23 #include  <fcntl.h>
24 #endif
20  
26 #include  <math.h>
27
28 #ifndef  BSD
29 #define  bcopy(s,d,n)           (void)memcpy(d,s,n)
30 #endif
31
21   #define  goodpic(h)     (my_imType(h) && my_mapType(h))
22   #define  my_imType(h)   (((h)->dataType==IM_CMAP || (h)->dataType==IM_CCMAP) \
23                                  && (h)->dataBits==8 && (h)->imType==0)
# Line 70 | Line 59 | char  *argv[];
59          int  ncolors = 256;
60          int  greyscale = 0;
61          int  i;
62 < #ifdef MSDOS
63 <        extern int  _fmode;
64 <        _fmode = O_BINARY;
76 <        setmode(fileno(stdin), O_BINARY);
77 <        setmode(fileno(stdout), O_BINARY);
78 < #endif
62 >        SET_DEFAULT_BINARY();
63 >        SET_FILE_BINARY(stdin);
64 >        SET_FILE_BINARY(stdout);
65          progname = argv[0];
66          samplefac = 0;
67  
# Line 194 | Line 180 | char  *err;
180   }
181  
182  
183 + void
184   eputs(s)
185   char *s;
186   {
# Line 201 | Line 188 | char *s;
188   }
189  
190  
191 + void
192   quit(code)
193   int code;
194   {
# Line 343 | Line 331 | struct hdStruct         *hp;
331                  if (fwritecolrs(scanline, xmax, stdout) < 0)
332                          quiterr("error writing RADIANCE file");
333          }
334 <        free((char *)scanline);
335 <        free((char *)tarData);
334 >        free((void *)scanline);
335 >        free((void *)tarData);
336   }
337  
338  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines