diff --git a/src/libCom/calc/sCalcPerform.c b/src/libCom/calc/sCalcPerform.c index 151302887..3e6a5b7c4 100644 --- a/src/libCom/calc/sCalcPerform.c +++ b/src/libCom/calc/sCalcPerform.c @@ -27,6 +27,7 @@ * Modification Log: * ----------------- * 03-18-98 tmm Essentially rewritten to support string operators + * 5/21/98 fixed ?: operator */ /* This module contains the code for processing the arithmetic @@ -98,6 +99,7 @@ struct stackElement { char *s; }; +#define OVERRIDESTDCALC 0 #define DEBUG 0 volatile int sCalcPerformDebug = 0; #if DEBUG @@ -244,7 +246,7 @@ static char *findConversionIndicator(char *s) return(retval); } -#if 0 +#if OVERRIDESTDCALC /* Override standard EPICS expression evaluator (if we're loaded after it) */ epicsShareFunc long epicsShareAPI calcPerform(double *parg, double *presult, char *post) @@ -405,7 +407,7 @@ epicsShareFunc long epicsShareAPI switch(post[1]) { case LITERAL: post+=8; break; case COND_IF: got_if++; break; - case COND_ELSE: got_if--; break; + case COND_END: got_if--; break; case FETCH: post++; break; } } @@ -806,7 +808,7 @@ printf(") \n"); case LITERAL: post+=8; break; case SLITERAL: post++; while (post[1]) post++; break; case COND_IF: got_if++; break; - case COND_ELSE: got_if--; break; + case COND_END: got_if--; break; case FETCH: case SFETCH: post++; break; } } diff --git a/src/libCom/calc/sCalcPostfix.c b/src/libCom/calc/sCalcPostfix.c index 8bbe1dad1..f8d747db4 100644 --- a/src/libCom/calc/sCalcPostfix.c +++ b/src/libCom/calc/sCalcPostfix.c @@ -107,6 +107,7 @@ #include "sCalcPostfixPvt.h" +#define OVERRIDESTDCALC 0 #define DEBUG 0 volatile int sCalcPostfixDebug=0; @@ -161,7 +162,8 @@ struct expression_element{ * then try to find BS therefore ABS must be first in this list */ static struct expression_element elements[] = { -/* element i_s_p i_c_p type_element internal_rep */ +/* +element i_s_p i_c_p type_element internal_rep */ "ABS", 7, 8, UNARY_OPERATOR, ABS_VAL, /* absolute value */ "NOT", 7, 8, UNARY_OPERATOR, UNARY_NEG, /* unary negate */ "-", 7, 8, MINUS_OPERATOR, UNARY_NEG, /* unary negate (or binary op) */ @@ -341,7 +343,7 @@ register short *pno_bytes, *parg; } -#if 0 +#if OVERRIDESTDCALC /* Override standard EPICS expression evaluator (if we're loaded after it). */ long epicsShareAPI postfix(char *pinfix,char *ppostfix,short *perror) { diff --git a/src/libCom/calc/sCalcPostfix.h b/src/libCom/calc/sCalcPostfix.h index f4da82c0e..4800747a2 100644 --- a/src/libCom/calc/sCalcPostfix.h +++ b/src/libCom/calc/sCalcPostfix.h @@ -32,7 +32,8 @@ #ifndef INCpostfixh #define INCpostfixh -#include "shareLib.h" +#define BAD_EXPRESSION 0 +#define END_STACK 127 long epicsShareAPI sCalcPostfix(char *pinfix, char **pp_postfix, short *perror); epicsShareFunc long epicsShareAPI diff --git a/src/libCom/calc/sCalcPostfixPvt.h b/src/libCom/calc/sCalcPostfixPvt.h index b66ef9330..f7ac29f1e 100644 --- a/src/libCom/calc/sCalcPostfixPvt.h +++ b/src/libCom/calc/sCalcPostfixPvt.h @@ -29,11 +29,15 @@ * */ +#ifndef INCpostfixh +#include +#endif #ifndef INCpostfixPvth #define INCpostfixPvth +/* #define BAD_EXPRESSION 0 */ + /* defines for element table */ -#define BAD_EXPRESSION 0 /* elements that define a value */ #define FETCH 1 #define SFETCH 2 @@ -104,7 +108,7 @@ #define SUBRANGE 63 #define TO_STRING 64 #define REPLACE 65 -#define END_STACK 127 +/* #define END_STACK 127 */ #define USES_STRING 126 #define NO_STRING 125 diff --git a/src/libCom/sCalcPerform.c b/src/libCom/sCalcPerform.c index 151302887..3e6a5b7c4 100644 --- a/src/libCom/sCalcPerform.c +++ b/src/libCom/sCalcPerform.c @@ -27,6 +27,7 @@ * Modification Log: * ----------------- * 03-18-98 tmm Essentially rewritten to support string operators + * 5/21/98 fixed ?: operator */ /* This module contains the code for processing the arithmetic @@ -98,6 +99,7 @@ struct stackElement { char *s; }; +#define OVERRIDESTDCALC 0 #define DEBUG 0 volatile int sCalcPerformDebug = 0; #if DEBUG @@ -244,7 +246,7 @@ static char *findConversionIndicator(char *s) return(retval); } -#if 0 +#if OVERRIDESTDCALC /* Override standard EPICS expression evaluator (if we're loaded after it) */ epicsShareFunc long epicsShareAPI calcPerform(double *parg, double *presult, char *post) @@ -405,7 +407,7 @@ epicsShareFunc long epicsShareAPI switch(post[1]) { case LITERAL: post+=8; break; case COND_IF: got_if++; break; - case COND_ELSE: got_if--; break; + case COND_END: got_if--; break; case FETCH: post++; break; } } @@ -806,7 +808,7 @@ printf(") \n"); case LITERAL: post+=8; break; case SLITERAL: post++; while (post[1]) post++; break; case COND_IF: got_if++; break; - case COND_ELSE: got_if--; break; + case COND_END: got_if--; break; case FETCH: case SFETCH: post++; break; } } diff --git a/src/libCom/sCalcPostfix.c b/src/libCom/sCalcPostfix.c index 8bbe1dad1..f8d747db4 100644 --- a/src/libCom/sCalcPostfix.c +++ b/src/libCom/sCalcPostfix.c @@ -107,6 +107,7 @@ #include "sCalcPostfixPvt.h" +#define OVERRIDESTDCALC 0 #define DEBUG 0 volatile int sCalcPostfixDebug=0; @@ -161,7 +162,8 @@ struct expression_element{ * then try to find BS therefore ABS must be first in this list */ static struct expression_element elements[] = { -/* element i_s_p i_c_p type_element internal_rep */ +/* +element i_s_p i_c_p type_element internal_rep */ "ABS", 7, 8, UNARY_OPERATOR, ABS_VAL, /* absolute value */ "NOT", 7, 8, UNARY_OPERATOR, UNARY_NEG, /* unary negate */ "-", 7, 8, MINUS_OPERATOR, UNARY_NEG, /* unary negate (or binary op) */ @@ -341,7 +343,7 @@ register short *pno_bytes, *parg; } -#if 0 +#if OVERRIDESTDCALC /* Override standard EPICS expression evaluator (if we're loaded after it). */ long epicsShareAPI postfix(char *pinfix,char *ppostfix,short *perror) { diff --git a/src/libCom/sCalcPostfix.h b/src/libCom/sCalcPostfix.h index f4da82c0e..4800747a2 100644 --- a/src/libCom/sCalcPostfix.h +++ b/src/libCom/sCalcPostfix.h @@ -32,7 +32,8 @@ #ifndef INCpostfixh #define INCpostfixh -#include "shareLib.h" +#define BAD_EXPRESSION 0 +#define END_STACK 127 long epicsShareAPI sCalcPostfix(char *pinfix, char **pp_postfix, short *perror); epicsShareFunc long epicsShareAPI diff --git a/src/libCom/sCalcPostfixPvt.h b/src/libCom/sCalcPostfixPvt.h index b66ef9330..f7ac29f1e 100644 --- a/src/libCom/sCalcPostfixPvt.h +++ b/src/libCom/sCalcPostfixPvt.h @@ -29,11 +29,15 @@ * */ +#ifndef INCpostfixh +#include +#endif #ifndef INCpostfixPvth #define INCpostfixPvth +/* #define BAD_EXPRESSION 0 */ + /* defines for element table */ -#define BAD_EXPRESSION 0 /* elements that define a value */ #define FETCH 1 #define SFETCH 2 @@ -104,7 +108,7 @@ #define SUBRANGE 63 #define TO_STRING 64 #define REPLACE 65 -#define END_STACK 127 +/* #define END_STACK 127 */ #define USES_STRING 126 #define NO_STRING 125