--- ray/src/common/calexpr.c 2003/06/07 12:50:20 2.22 +++ ray/src/common/calexpr.c 2003/07/21 22:30:17 2.25 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: calexpr.c,v 2.22 2003/06/07 12:50:20 schorsch Exp $"; +static const char RCSid[] = "$Id: calexpr.c,v 2.25 2003/07/21 22:30:17 schorsch Exp $"; #endif /* * Compute data values using expression parser @@ -26,6 +26,7 @@ static const char RCSid[] = "$Id: calexpr.c,v 2.22 200 #include #include +#include "rterror.h" #include "calcomp.h" #define MAXLINE 256 /* maximum line length */ @@ -34,10 +35,12 @@ static const char RCSid[] = "$Id: calexpr.c,v 2.22 200 #define isdecimal(c) (isdigit(c) || (c) == '.') -static double euminus(), eargument(), enumber(); -static double echannel(); -static double eadd(), esubtr(), emult(), edivi(), epow(); -static double ebotch(); +static double euminus(EPNODE *), eargument(EPNODE *), enumber(EPNODE *); +static double echannel(EPNODE *); +static double eadd(EPNODE *), esubtr(EPNODE *), + emult(EPNODE *), edivi(EPNODE *), + epow(EPNODE *); +static double ebotch(EPNODE *); unsigned int esupport = /* what to support */ E_VARIABLE | E_FUNCTION ; @@ -473,11 +476,11 @@ EPNODE *ekid; char * getname() /* scan an identifier */ { - static char str[MAXWORD+1]; + static char str[RMAXWORD+1]; register int i, lnext; lnext = nextc; - for (i = 0; i < MAXWORD && isid(lnext); i++, lnext = scan()) + for (i = 0; i < RMAXWORD && isid(lnext); i++, lnext = scan()) str[i] = lnext; str[i] = '\0'; while (isid(lnext)) /* skip rest of name */ @@ -506,34 +509,34 @@ double getnum() /* scan a positive float */ { register int i, lnext; - char str[MAXWORD+1]; + char str[RMAXWORD+1]; i = 0; lnext = nextc; - while (isdigit(lnext) && i < MAXWORD) { + while (isdigit(lnext) && i < RMAXWORD) { str[i++] = lnext; lnext = scan(); } - if (lnext == '.' && i < MAXWORD) { + if (lnext == '.' && i < RMAXWORD) { str[i++] = lnext; lnext = scan(); if (i == 1 && !isdigit(lnext)) syntax("badly formed number"); - while (isdigit(lnext) && i < MAXWORD) { + while (isdigit(lnext) && i < RMAXWORD) { str[i++] = lnext; lnext = scan(); } } - if ((lnext == 'e' | lnext == 'E') && i < MAXWORD) { + if ((lnext == 'e' | lnext == 'E') && i < RMAXWORD) { str[i++] = lnext; lnext = scan(); - if ((lnext == '-' | lnext == '+') && i < MAXWORD) { + if ((lnext == '-' | lnext == '+') && i < RMAXWORD) { str[i++] = lnext; lnext = scan(); } if (!isdigit(lnext)) syntax("missing exponent"); - while (isdigit(lnext) && i < MAXWORD) { + while (isdigit(lnext) && i < RMAXWORD) { str[i++] = lnext; lnext = scan(); } @@ -768,11 +771,12 @@ register EPNODE *ep; if (ep->type != VAR) return(0); - if ((dp = ep->v.ln->def) != NULL) + if ((dp = ep->v.ln->def) != NULL) { if (dp->v.kid->type == FUNC) return(dp->type == ':'); else return(0); /* don't identify masked library functions */ + } if ((lp = ep->v.ln->lib) != NULL) return(lp->atyp == ':'); return(0);