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.25 by greg, Sun Jul 29 22:10:45 2012 UTC vs.
Revision 2.29 by greg, Mon Aug 31 15:06:20 2020 UTC

# Line 27 | Line 27 | static const char      RCSid[] = "$Id$";
27  
28   #include "copyright.h"
29  
30 #include  <stdio.h>
31 #include  <string.h>
30   #include  <ctype.h>
31  
32   #include  "rterror.h"
# Line 142 | Line 140 | varset(                /* set a variable's value */
140              return;
141          }
142      }
143 +    if (ep1 != NULL && esupport&E_REDEFW) {
144 +        wputs(qname);
145 +        if (ep1->type == ':')
146 +            wputs(": reset constant expression\n");
147 +        else
148 +            wputs(": reset expression\n");
149 +    }
150                                          /* hand build definition */
151      ep1 = newnode();
152      ep1->type = assign;
# Line 632 | Line 637 | getdefn(void)
637              ep2 = newnode();
638              ep2->type = SYM;
639              ep2->v.name = savestr(getname());
640 +            if (strchr(ep2->v.name, CNTXMARK) != NULL)
641 +                syntax("illegal parameter name");
642              addekid(ep1, ep2);
643          } while (nextc == ',');
644          if (nextc != ')')
# Line 697 | Line 704 | getchan(void)                  /* A -> $N = E1 */
704  
705  
706   static double                   /* evaluate a variable */
707 < dvalue(char  *name, EPNODE      *d)
707 > dvalue(char *name, EPNODE *d)
708   {
709      EPNODE  *ep1, *ep2;
710      
# Line 709 | Line 716 | dvalue(char  *name, EPNODE     *d)
716      ep1 = d->v.kid->sibling;                    /* get expression */
717      if (ep1->type == NUM)
718          return(ep1->v.num);                     /* return if number */
719 +    if (esupport&E_RCONST && d->type == ':') {
720 +        wputs(name);
721 +        wputs(": assigned non-constant value\n");
722 +    }
723      ep2 = ep1->sibling;                         /* check time */
724      if (eclock >= MAXCLOCK)
725          eclock = 1;                             /* wrap clock counter */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines