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

Comparing ray/src/common/rglmat.c (file contents):
Revision 3.4 by greg, Wed Apr 23 02:28:06 2003 UTC vs.
Revision 3.5 by greg, Tue Sep 16 06:31:48 2003 UTC

# Line 54 | Line 54 | register OBJREC        *o;
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);
# Line 87 | Line 87 | char   *nam;
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;
# Line 99 | Line 99 | 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   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines