| 222 |
|
) |
| 223 |
|
{ |
| 224 |
|
static int hsiztab[] = { |
| 225 |
< |
251, 509, 1021, 2039, 4093, 8191, 16381, 0 |
| 225 |
> |
251, 509, 1021, 2039, 4093, 8191, 16381, |
| 226 |
> |
32749, 65521, 131071, 262139, 0 |
| 227 |
|
}; |
| 228 |
|
int *hsp; |
| 229 |
|
|
| 240 |
|
struct ohtab *tab |
| 241 |
|
) |
| 242 |
|
{ |
| 243 |
+ |
char *onm; |
| 244 |
|
OBJECT *oldhtab; |
| 245 |
|
int hval, i; |
| 246 |
|
int ndx; |
| 259 |
|
tryagain: |
| 260 |
|
for (i = 0; i < tab->hsiz; i++) { |
| 261 |
|
ndx = (hval + (unsigned long)i*i) % tab->hsiz; |
| 262 |
< |
if (tab->htab[ndx] == OVOID || |
| 261 |
< |
!strcmp(objptr(tab->htab[ndx])->oname, name)) |
| 262 |
> |
if (tab->htab[ndx] == OVOID) |
| 263 |
|
return(ndx); |
| 264 |
+ |
onm = objptr(tab->htab[ndx])->oname; |
| 265 |
+ |
if (onm != NULL && !strcmp(onm, name)) |
| 266 |
+ |
return(ndx); |
| 267 |
|
} |
| 268 |
|
/* table is full, reallocate */ |
| 269 |
|
oldhtab = tab->htab; |
| 271 |
|
tab->htab = NULL; |
| 272 |
|
while (ndx--) |
| 273 |
|
if (oldhtab[ndx] != OVOID) { |
| 274 |
< |
i = otndx(objptr(oldhtab[ndx])->oname, tab); |
| 274 |
> |
onm = objptr(oldhtab[ndx])->oname; |
| 275 |
> |
if (onm == NULL) |
| 276 |
> |
continue; |
| 277 |
> |
i = otndx(onm, tab); |
| 278 |
|
tab->htab[i] = oldhtab[ndx]; |
| 279 |
|
} |
| 280 |
|
free((void *)oldhtab); |