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

Comparing ray/src/common/otypes.c (file contents):
Revision 1.1 by greg, Thu Feb 2 10:34:38 1989 UTC vs.
Revision 1.3 by greg, Fri Jan 5 09:16:40 1990 UTC

# Line 133 | Line 133 | register struct ohtab  *tab;
133                  tab->hsiz = nexthsiz(tab->hsiz);
134                  tab->htab = (OBJECT *)malloc(tab->hsiz*sizeof(OBJECT));
135                  if (tab->htab == NULL)
136 <                        error(SYSTEM, "out of memory in tputo");
136 >                        error(SYSTEM, "out of memory in otndx");
137                  ndx = tab->hsiz;
138                  while (ndx--)                   /* empty it */
139                          tab->htab[ndx] = OVOID;
140          }
141                                          /* look up object */
142          hval = shash(name);
143 + tryagain:
144          for (i = 0; i < tab->hsiz; i++) {
145                  ndx = (hval + i*i) % tab->hsiz;
146                  if (tab->htab[ndx] == OVOID ||
# Line 156 | Line 157 | register struct ohtab  *tab;
157                          tab->htab[i] = oldhtab[ndx];
158                  }
159          free((char *)oldhtab);
160 <        return(otndx(name, tab));
160 >        goto tryagain;                  /* should happen only once! */
161   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines