54 |
|
goto memerr; |
55 |
|
strcpy(lup->key, o->oname); |
56 |
|
} else if (lup->data != NULL) |
57 |
< |
freemtl((MATREC *)lup->data); |
57 |
> |
freemtl(lup->data); |
58 |
|
if ((lup->data = o->os) != NULL) /* make material reference */ |
59 |
|
((MATREC *)lup->data)->nlinks++; |
60 |
|
return(0); |
87 |
|
goto memerr; |
88 |
|
strcpy(lup->key, nam); |
89 |
|
} else if (lup->data != NULL) |
90 |
< |
freemtl((MATREC *)lup->data); |
90 |
> |
freemtl(lup->data); |
91 |
|
lup->data = (char *)malloc(sizeof(MATREC)); |
92 |
|
if (lup->data == NULL) |
93 |
|
goto memerr; |
99 |
|
|
100 |
|
|
101 |
|
void |
102 |
< |
freemtl(mp) /* free a material */ |
103 |
< |
register MATREC *mp; |
102 |
> |
freemtl(p) /* free a material */ |
103 |
> |
void *p; |
104 |
|
{ |
105 |
+ |
register MATREC *mp = (MATREC *)p; |
106 |
+ |
|
107 |
|
if (!--mp->nlinks) |
108 |
|
free((void *)mp); |
109 |
|
} |