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

Comparing ray/src/common/objset.c (file contents):
Revision 2.10 by greg, Wed Apr 23 00:52:33 2003 UTC vs.
Revision 2.15 by greg, Wed Dec 15 22:02:04 2004 UTC

# Line 16 | Line 16 | static const char      RCSid[] = "$Id$";
16   #include  "object.h"
17  
18   #ifndef  OSTSIZ
19 < #ifdef  BIGMEM
20 < #define  OSTSIZ         262139          /* object table size (a prime!) */
21 < #else
19 > #ifdef  SMLMEM
20   #define  OSTSIZ         32749           /* object table size (a prime!) */
21 + #else
22 + #define  OSTSIZ         262139          /* object table size (a prime!) */
23   #endif
24   #endif
25  
# Line 209 | Line 209 | tryagain:
209                  ot = oseti(i*OSTSIZ + osentry);
210                  if (*os > 0)                    /* found it */
211                          return(ot);
212 <                if (!isfull(ot))                /* entry overflow */
212 >                if (!isfull(ot)) {              /* entry overflow */
213                          if (++ntries < OSTSIZ)
214                                  goto tryagain;
215                          else
216                                  error(INTERNAL, "hash table overflow in fullnode");
217 +                }
218                                                  /* remember position */
219                  i = os - ostable[osentry];
220                  os = ostable[osentry] = (OBJECT *)realloc(
# Line 229 | Line 230 | tryagain:
230          return(ot);
231   memerr:
232          error(SYSTEM, "out of memory in fullnode");
233 +        return 0; /* pro forma return */
234   }
235  
236  
# Line 253 | Line 255 | OCTREE  ot;
255          return;
256   noderr:
257          error(CONSISTENCY, "bad node in objset");
256 }
257
258
259 int
260 dosets(f)                               /* loop through all sets */
261 int     (*f)();
262 {
263        int  res = 0;
264        int  n;
265        register OBJECT  *os;
266
267        for (n = 0; n < OSTSIZ; n++) {
268                if ((os = ostable[n]) == NULL)
269                        continue;
270                while (*os > 0) {
271                        res += (*f)(os);
272                        os += *os + 1;
273                }
274        }
275        return(res);
258   }
259  
260  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines