17 |
|
|
18 |
|
|
19 |
|
static struct ohtab { |
20 |
< |
int hsiz; /* current table size */ |
21 |
< |
OBJECT *htab; /* table, if allocated */ |
20 |
> |
int hsiz; /* current table size */ |
21 |
> |
OBJECT *htab; /* table, if allocated */ |
22 |
|
} modtab = {100, NULL}, objtab = {1000, NULL}; /* modifiers and objects */ |
23 |
|
|
24 |
|
static int otndx(char *, struct ohtab *); |
48 |
|
) |
49 |
|
{ |
50 |
|
OBJREC *op; |
51 |
< |
int i; |
51 |
> |
OBJECT i; |
52 |
|
|
53 |
|
i = modifier(mname); /* try hash table first */ |
54 |
|
if ((obj == OVOID) | (i < obj)) |
55 |
|
return(i); |
56 |
|
for (i = obj; i-- > 0; ) { /* need to search */ |
57 |
|
op = objptr(i); |
58 |
< |
if (ismodifier(op->otype) && op->oname[0] == mname[0] && |
59 |
< |
!strcmp(op->oname, mname)) |
58 |
> |
if ((ismodifier(op->otype) != 0) & (op->oname[0] == mname[0]) |
59 |
> |
&& !strcmp(op->oname, mname)) |
60 |
|
return(i); |
61 |
|
} |
62 |
|
return(OVOID); |
196 |
|
|
197 |
|
if (nobjects <= 0) { |
198 |
|
if (modtab.htab != NULL) { |
199 |
< |
free((void *)modtab.htab); |
199 |
> |
free(modtab.htab); |
200 |
|
modtab.htab = NULL; |
201 |
|
modtab.hsiz = 100; |
202 |
|
} |
203 |
|
if (objtab.htab != NULL) { |
204 |
< |
free((void *)objtab.htab); |
204 |
> |
free(objtab.htab); |
205 |
|
objtab.htab = NULL; |
206 |
|
objtab.hsiz = 100; |
207 |
|
} |
278 |
|
i = otndx(onm, tab); |
279 |
|
tab->htab[i] = oldhtab[ndx]; |
280 |
|
} |
281 |
< |
free((void *)oldhtab); |
281 |
> |
free(oldhtab); |
282 |
|
goto tryagain; /* should happen only once! */ |
283 |
|
} |