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.2 by greg, Tue Jun 23 10:59:34 1992 UTC vs.
Revision 2.5 by greg, Fri Feb 26 10:08:50 1993 UTC

# Line 15 | Line 15 | static char SCCSid[] = "$SunId$ LBL";
15   #include  "color.h"
16  
17   #define  MINELEN        8       /* minimum scanline length for encoding */
18 + #define  MAXELEN        0x7ffe  /* maximum scanline length for encoding */
19   #define  MINRUN         4       /* minimum run length */
20  
21 + #ifndef frexp
22 + extern double  frexp();
23 + #endif
24  
25 +
26   char *
27   tempbuffer(len)                 /* get a temporary buffer */
28   unsigned  len;
29   {
30          extern char  *malloc(), *realloc();
31          static char  *tempbuf = NULL;
32 <        static int  tempbuflen = 0;
32 >        static unsigned  tempbuflen = 0;
33  
34          if (len > tempbuflen) {
35                  if (tempbuflen > 0)
# Line 45 | Line 50 | register FILE  *fp;
50          register int  i, j, beg, cnt;
51          int  c2;
52          
53 <        if (len < MINELEN | len > 0x7fff)       /* OOBs, write out flat */
53 >        if (len < MINELEN | len > MAXELEN)      /* OOBs, write out flat */
54                  return(fwrite((char *)scanline,sizeof(COLR),len,fp) - len);
55                                          /* put magic header */
56          putc(2, fp);
# Line 97 | Line 102 | register FILE  *fp;
102          register int  i, j;
103          int  code;
104                                          /* determine scanline type */
105 <        if (len < MINELEN)
105 >        if (len < MINELEN | len > MAXELEN)
106                  return(oldreadcolrs(scanline, len, fp));
107          if ((i = getc(fp)) == EOF)
108                  return(-1);
# Line 225 | Line 230 | setcolr(clr, r, g, b)          /* assign a short color value *
230   register COLR  clr;
231   double  r, g, b;
232   {
228        double  frexp();
233          double  d;
234          int  e;
235          

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines