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

Comparing ray/src/common/calexpr.c (file contents):
Revision 1.13 by greg, Thu Aug 8 12:11:19 1991 UTC vs.
Revision 1.14 by greg, Thu Aug 8 13:40:09 1991 UTC

# Line 604 | Line 604 | getE5()                                /* E5 -> (E1) */
604                                  /*       ARG */
605   {
606      int  i;
607 +    char  *nam;
608      register EPNODE  *ep1, *ep2;
609  
610      if (nextc == '(') {
# Line 627 | Line 628 | getE5()                                /* E5 -> (E1) */
628  
629   #if  defined(VARIABLE) || defined(FUNCTION)
630      if (isalpha(nextc)) {
631 <        ep1 = newnode();
631 <        ep1->type = VAR;
632 <        ep1->v.ln = varinsert(getname());
633 <
631 >        nam = getname();
632   #if  defined(VARIABLE) && defined(FUNCTION)
633 +        ep1 = NULL;
634          if (curfunc != NULL)
635              for (i = 1, ep2 = curfunc->v.kid->sibling;
636                                  ep2 != NULL; i++, ep2 = ep2->sibling)
637 <                if (!strcmp(ep2->v.name, ep1->v.ln->name)) {
639 <                    epfree(ep1);
637 >                if (!strcmp(ep2->v.name, nam)) {
638                      ep1 = newnode();
639                      ep1->type = ARG;
640                      ep1->v.chan = i;
641                      break;
642                  }
643 +        if (ep1 == NULL)
644   #endif
645 +        {
646 +            ep1 = newnode();
647 +            ep1->type = VAR;
648 +            ep1->v.ln = varinsert(nam);
649 +        }
650   #ifdef  FUNCTION
651          if (nextc == '(') {
652              ep2 = newnode();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines