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

Comparing ray/src/common/caldefn.c (file contents):
Revision 2.28 by greg, Thu Apr 2 18:00:34 2020 UTC vs.
Revision 2.30 by greg, Sat Mar 12 15:50:13 2022 UTC

# Line 196 | Line 196 | dremove(                       /* delete all definitions of name */
196  
197  
198   int
199 < vardefined(     /* return non-zero if variable defined */
199 > vardefined(     /* return '=' or ':' if variable/constant defined */
200          char  *name
201   )
202   {
203      EPNODE  *dp;
204  
205 <    return((dp = dlookup(name)) != NULL && dp->v.kid->type == SYM);
205 >    if ((dp = dlookup(name)) == NULL || dp->v.kid->type != SYM)
206 >        return(0);
207 >    return(dp->type);
208   }
209  
210  
# Line 637 | Line 639 | getdefn(void)
639              ep2 = newnode();
640              ep2->type = SYM;
641              ep2->v.name = savestr(getname());
642 +            if (strchr(ep2->v.name, CNTXMARK) != NULL)
643 +                syntax("illegal parameter name");
644              addekid(ep1, ep2);
645          } while (nextc == ',');
646          if (nextc != ')')

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines