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

Comparing ray/src/px/clrtab.c (file contents):
Revision 2.7 by greg, Thu Jun 10 15:45:18 1993 UTC vs.
Revision 2.9 by greg, Thu Dec 9 12:04:23 1993 UTC

# Line 77 | Line 77 | int    ncolors;
77   #ifdef CLOSEST
78          closest(ncolors);       /* ensure colors picked are closest */
79   #endif
80 +                                /* reset dithering function */
81 +        dith_colrs((BYTE *)NULL, (COLR *)NULL, 0);
82                                  /* return new color table size */
83          return(ncolors);
84   }
# Line 107 | Line 109 | register BYTE  *bs;
109   register COLR   *cs;
110   int     n;
111   {
112 <        static short    (*cerr)[3];
112 >        static short    (*cerr)[3] = NULL;
113          static int      N = 0;
114          int     err[3], errp[3];
115          register int    x, i;
116  
117          if (n != N) {           /* get error propogation array */
118 <                if (N)
119 <                        cerr = (short (*)[3])realloc((char *)cerr,
120 <                                        3*n*sizeof(short));
121 <                else
118 >                if (N) {
119 >                        free((char *)cerr);
120 >                        cerr = NULL;
121 >                }
122 >                if (n)
123                          cerr = (short (*)[3])malloc(3*n*sizeof(short));
124                  if (cerr == NULL) {
125                          N = 0;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines