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

Comparing ray/src/common/color.c (file contents):
Revision 2.17 by greg, Sat May 31 20:13:31 2014 UTC vs.
Revision 2.19 by greg, Tue Apr 10 23:42:52 2018 UTC

# Line 17 | Line 17 | static const char      RCSid[] = "$Id$";
17   #ifdef getc_unlocked            /* avoid horrendous overhead of flockfile */
18   #undef getc
19   #undef putc
20 + #undef ferror
21   #define getc    getc_unlocked
22   #define putc    putc_unlocked
23 + #define ferror  ferror_unlocked
24   #endif
25  
26   #define  MINELEN        8       /* minimum scanline length for encoding */
# Line 100 | Line 102 | fwritecolrs(                   /* write out a colr scanline */
102  
103  
104   static int
105 < oldreadcolrs(                   /* read in an old colr scanline */
105 > oldreadcolrs(                   /* read in an old-style colr scanline */
106          COLR  *scanline,
107          int  len,
108          FILE  *fp
109   )
110   {
111 <        int  rshift;
111 >        int  rshift = 0;
112          int  i;
113          
112        rshift = 0;
113        
114          while (len > 0) {
115                  scanline[0][RED] = getc(fp);
116                  scanline[0][GRN] = getc(fp);
117                  scanline[0][BLU] = getc(fp);
118 <                scanline[0][EXP] = getc(fp);
119 <                if (feof(fp) || ferror(fp))
118 >                scanline[0][EXP] = i = getc(fp);
119 >                if (i == EOF)
120                          return(-1);
121                  if (scanline[0][RED] == 1 &&
122                                  scanline[0][GRN] == 1 &&

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines