--- ray/src/common/caldefn.c 2003/07/03 22:41:44 2.17 +++ ray/src/common/caldefn.c 2003/07/21 22:30:17 2.19 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: caldefn.c,v 2.17 2003/07/03 22:41:44 schorsch Exp $"; +static const char RCSid[] = "$Id: caldefn.c,v 2.19 2003/07/21 22:30:17 schorsch Exp $"; #endif /* * Store variable definitions. @@ -28,11 +28,10 @@ static const char RCSid[] = "$Id: caldefn.c,v 2.17 200 #include "copyright.h" #include - #include - #include +#include "rterror.h" #include "calcomp.h" #ifndef NHASH @@ -43,7 +42,7 @@ static const char RCSid[] = "$Id: caldefn.c,v 2.17 200 #define newnode() (EPNODE *)ecalloc(1, sizeof(EPNODE)) -static double dvalue(); +static double dvalue(char *name, EPNODE *d); #define MAXCLOCK (1L<<31) /* clock wrap value */ @@ -350,11 +349,12 @@ dcleanup( /* clear definitions (0->vars,1->output,2-> /* if context is global, clear all */ for (i = 0; i < NHASH; i++) for (vp = hashtbl[i]; vp != NULL; vp = vp->next) - if (incontext(vp->name)) + if (incontext(vp->name)) { if (lvl >= 2) dremove(vp->name); else dclear(vp->name); + } if (lvl >= 1) { for (ep = outchan; ep != NULL; ep = ep->sibling) epfree(ep); @@ -572,7 +572,7 @@ getstatement(void) /* get next statement */ } else { /* ordinary definition */ ep = getdefn(); qname = qualname(dname(ep), 0); - if (esupport&E_REDEFW && (vdef = varlookup(qname)) != NULL) + if (esupport&E_REDEFW && (vdef = varlookup(qname)) != NULL) { if (vdef->def != NULL && epcmp(ep, vdef->def)) { wputs(qname); if (vdef->def->type == ':') @@ -583,6 +583,7 @@ getstatement(void) /* get next statement */ wputs(qname); wputs(": definition hides library function\n"); } + } if (ep->type == ':') dremove(qname); else @@ -689,11 +690,8 @@ getchan(void) /* A -> $N = E1 */ */ -static double -dvalue( /* evaluate a variable */ -char *name, -EPNODE *d -) +static double /* evaluate a variable */ +dvalue(char *name, EPNODE *d) { register EPNODE *ep1, *ep2;