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.6 by greg, Thu Apr 8 16:41:21 1993 UTC vs.
Revision 2.9 by greg, Tue Mar 28 11:18:52 1995 UTC

# Line 42 | Line 42 | extern char  *ecalloc(), *emalloc(), *savestr(), *strc
42  
43   static double  dvalue();
44  
45 < long  eclock = -1;                      /* value storage timer */
45 > unsigned long  eclock = 0;              /* value storage timer */
46  
47   static char  context[MAXWORD+1];        /* current context path */
48  
# Line 299 | Line 299 | toolong:
299   incontext(qn)                   /* is qualified name in current context? */
300   register char  *qn;
301   {
302 +    if (!context[0])                    /* global context accepts all */
303 +        return(1);
304      while (*qn && *qn != CNTXMARK)      /* find context mark */
305          qn++;
306      return(!strcmp(qn, context));
# Line 327 | Line 329 | int  lvl;
329                                  /* if context is global, clear all */
330      for (i = 0; i < NHASH; i++)
331          for (vp = hashtbl[i]; vp != NULL; vp = vp->next)
332 <            if (!context[0] || incontext(vp->name))
332 >            if (incontext(vp->name))
333                  if (lvl >= 2)
334                      dremove(vp->name);
335                  else
# Line 556 | Line 558 | getstatement()                 /* get next statement */
558          qname = qualname(dname(ep), 0);
559   #ifdef  REDEFW
560          if ((vdef = varlookup(qname)) != NULL)
561 <            if (vdef->def != NULL) {
561 >            if (vdef->def != NULL && epcmp(ep, vdef->def)) {
562                  wputs(qname);
563                  if (vdef->def->type == ':')
564                      wputs(": redefined constant expression\n");
# Line 638 | Line 640 | getdefn()                      /* A -> SYM = E1 */
640              ep1->sibling->type != NUM) {
641          ep1 = newnode();
642          ep1->type = TICK;
643 <        ep1->v.tick = -1;
643 >        ep1->v.tick = 0;
644          addekid(ep2, ep1);
645          ep1 = newnode();
646          ep1->type = NUM;
# Line 699 | Line 701 | EPNODE *d;
701      if (ep1->type == NUM)
702          return(ep1->v.num);                     /* return if number */
703      ep2 = ep1->sibling;                         /* check time */
704 <    if (ep2->v.tick < 0 || ep2->v.tick < eclock) {
705 <        ep2->v.tick = d->type == ':' ? 1L<<30 : eclock;
704 >    if (ep2->v.tick == 0 || ep2->v.tick < eclock) {
705 >        ep2->v.tick = d->type == ':' ? ~0L : eclock;
706          ep2 = ep2->sibling;
707          ep2->v.num = evalue(ep1);               /* needs new value */
708      } else

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines