--- ray/src/common/objset.c 1990/09/07 08:32:36 1.3 +++ ray/src/common/objset.c 1990/12/14 10:06:33 1.6 @@ -18,7 +18,9 @@ static char SCCSid[] = "$SunId$ LBL"; #include "otypes.h" -#define OSTSIZ 3037 /* object table size (a prime!) */ +#ifndef OSTSIZ +#define OSTSIZ 12329 /* object table size (a prime!) */ +#endif static OBJECT *ostable[OSTSIZ]; /* the object set table */ @@ -44,8 +46,12 @@ OBJECT obj; { register int i; - for (i = (*os++)--; i > 0 && *os < obj; i--, os++) - ; + i = (*os)--; + os++; + while (i > 0 && *os < obj) { + i--; + os++; + } while (--i > 0) { os[0] = os[1]; os++; @@ -183,19 +189,17 @@ int orig, nobjs; { int n; register OBJECT *os; - register OBJECT i, t; + register OBJECT i; for (n = 0; n < OSTSIZ; n++) { if ((os = ostable[n]) == NULL) continue; while ((i = *os++) > 0) while (i--) { - t = *os++; - if (t >= orig && t < orig+nobjs) { - t = objptr(t)->otype; - if (!issurface(t)) - return(1); - } + if (*os >= orig && *os < orig+nobjs && + !issurface(objptr(*os)->otype)) + return(1); + os++; } } return(0);