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

Comparing ray/src/common/lookup.c (file contents):
Revision 2.13 by schorsch, Sun Mar 28 20:33:12 2004 UTC vs.
Revision 2.14 by greg, Tue May 25 06:30:46 2004 UTC

# Line 167 | Line 167 | extern int
167   lu_doall(               /* loop through all valid table entries */
168          register LUTAB  *tbl,
169          //int   (*f)(LUENT *)
170 <        lut_doallf_t *f
170 >        lut_doallf_t *f,
171 >        void *p
172   )
173   {
174          int     rval = 0;
# Line 175 | Line 176 | lu_doall(              /* loop through all valid table entries */
176  
177          for (tp = tbl->tabl + tbl->tsiz; tp-- > tbl->tabl; )
178                  if (tp->data != NULL) {
179 <                        if (f != NULL)
180 <                                rval += (*f)(tp);
181 <                        else
179 >                        if (f != NULL) {
180 >                                int     r = (*f)(tp, p);
181 >                                if (r < 0)
182 >                                        return(-1);
183 >                                rval += r;
184 >                        } else
185                                  rval++;
186                  }
187          return(rval);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines