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.31 by greg, Sat Mar 12 17:21:10 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;
203 >    EPNODE  *dp = dlookup(name);
204  
205 <    return((dp = dlookup(name)) != NULL && dp->v.kid->type == SYM);
205 >    if (dp == NULL || dp->v.kid->type != SYM)
206 >        return(0);
207 >
208 >    return(dp->type);
209   }
210  
211  
# Line 637 | Line 640 | getdefn(void)
640              ep2 = newnode();
641              ep2->type = SYM;
642              ep2->v.name = savestr(getname());
643 +            if (strchr(ep2->v.name, CNTXMARK) != NULL)
644 +                syntax("illegal parameter name");
645              addekid(ep1, ep2);
646          } while (nextc == ',');
647          if (nextc != ')')

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines