--- ray/src/common/caldefn.c 1995/02/16 09:49:27 2.7 +++ ray/src/common/caldefn.c 1995/03/28 11:18:52 2.9 @@ -42,7 +42,7 @@ extern char *ecalloc(), *emalloc(), *savestr(), *strc static double dvalue(); -long eclock = -1; /* value storage timer */ +unsigned long eclock = 0; /* value storage timer */ static char context[MAXWORD+1]; /* current context path */ @@ -299,6 +299,8 @@ toolong: incontext(qn) /* is qualified name in current context? */ register char *qn; { + if (!context[0]) /* global context accepts all */ + return(1); while (*qn && *qn != CNTXMARK) /* find context mark */ qn++; return(!strcmp(qn, context)); @@ -327,7 +329,7 @@ int lvl; /* if context is global, clear all */ for (i = 0; i < NHASH; i++) for (vp = hashtbl[i]; vp != NULL; vp = vp->next) - if (!context[0] || incontext(vp->name)) + if (incontext(vp->name)) if (lvl >= 2) dremove(vp->name); else @@ -638,7 +640,7 @@ getdefn() /* A -> SYM = E1 */ ep1->sibling->type != NUM) { ep1 = newnode(); ep1->type = TICK; - ep1->v.tick = -1; + ep1->v.tick = 0; addekid(ep2, ep1); ep1 = newnode(); ep1->type = NUM; @@ -699,8 +701,8 @@ EPNODE *d; if (ep1->type == NUM) return(ep1->v.num); /* return if number */ ep2 = ep1->sibling; /* check time */ - if (ep2->v.tick < 0 || ep2->v.tick < eclock) { - ep2->v.tick = d->type == ':' ? 1L<<30 : eclock; + if (ep2->v.tick == 0 || ep2->v.tick < eclock) { + ep2->v.tick = d->type == ':' ? ~0L : eclock; ep2 = ep2->sibling; ep2->v.num = evalue(ep1); /* needs new value */ } else