From 63e9665e8d29922d9441be30dc88ecf48c820b54 Mon Sep 17 00:00:00 2001 From: "Janet B. Anderson" Date: Wed, 2 Feb 2000 22:00:18 +0000 Subject: [PATCH] Changed test order in while stmnts to prevent UMR problem. - Evans --- src/libCom/postfix.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/libCom/postfix.c b/src/libCom/postfix.c index 846bb41a0..f9fbc423f 100644 --- a/src/libCom/postfix.c +++ b/src/libCom/postfix.c @@ -331,7 +331,7 @@ long epicsShareAPI postfix(char *pinfix,char *ppostfix,short *perror) *perror = 0; if (* pinfix == 0 ) return(0); - pstacktop = &stack[0]; + pstacktop = stack; while (get_element(pinfix,&pelement,&no_bytes) != END){ pinfix += no_bytes; switch (pelement->type){ @@ -396,8 +396,8 @@ long epicsShareAPI postfix(char *pinfix,char *ppostfix,short *perror) /* add operators of higher or equal priority to */ /* postfix notation */ - while ((pstacktop->in_stack_pri >= pelement->in_coming_pri) - && (pstacktop >= &stack[1])){ + while ((pstacktop >= stack+1) && + (pstacktop->in_stack_pri >= pelement->in_coming_pri)) { *ppostfix++ = pstacktop->code; pstacktop--; } @@ -417,8 +417,8 @@ long epicsShareAPI postfix(char *pinfix,char *ppostfix,short *perror) /* add operators of higher or equal priority to */ /* postfix notation */ - while ((pstacktop->in_stack_pri >= pelement->in_coming_pri) - && (pstacktop >= &stack[1])){ + while ((pstacktop >= stack+1) && + (pstacktop->in_stack_pri >= pelement->in_coming_pri)) { *ppostfix++ = pstacktop->code; pstacktop--; } @@ -448,8 +448,8 @@ long epicsShareAPI postfix(char *pinfix,char *ppostfix,short *perror) /* add operators of higher or equal priority to */ /* postfix notation */ - while ((pstacktop->in_stack_pri >= in_coming_pri) - && (pstacktop >= &stack[1])){ + while ((pstacktop >= stack+1) && + (pstacktop->in_stack_pri >= pelement->in_coming_pri)) { *ppostfix++ = pstacktop->code; pstacktop--; } @@ -470,8 +470,8 @@ long epicsShareAPI postfix(char *pinfix,char *ppostfix,short *perror) /* add operators to postfix until open paren */ while (pstacktop->element[0] != '('){ - if (pstacktop == &stack[1] || - pstacktop == &stack[0]){ + if (pstacktop == stack+1 || + pstacktop == stack){ *perror = 6; *ppostfixStart = BAD_EXPRESSION; return(-1); } @@ -489,8 +489,8 @@ long epicsShareAPI postfix(char *pinfix,char *ppostfix,short *perror) /* add operators to postfix until matching paren */ while (pstacktop->element[0] != '('){ - if (pstacktop == &stack[1] || - pstacktop == &stack[0]){ + if (pstacktop == stack+1 || + pstacktop == stack){ *perror = 6; *ppostfixStart = BAD_EXPRESSION; return(-1); } @@ -508,8 +508,8 @@ long epicsShareAPI postfix(char *pinfix,char *ppostfix,short *perror) /* add operators of higher priority to */ /* postfix notation */ - while ((pstacktop->in_stack_pri > pelement->in_coming_pri) - && (pstacktop >= &stack[1])){ + while ((pstacktop >= stack+1) && + (pstacktop->in_stack_pri >= pelement->in_coming_pri)) { *ppostfix++ = pstacktop->code; pstacktop--; } @@ -534,7 +534,7 @@ long epicsShareAPI postfix(char *pinfix,char *ppostfix,short *perror) } /* add all operators on stack to postfix */ - while (pstacktop >= &stack[1]){ + while (pstacktop >= stack+1){ if (pstacktop->element[0] == '('){ *perror = 6; *ppostfixStart = BAD_EXPRESSION; return(-1); @@ -562,7 +562,7 @@ long epicsShareAPI postfix(char *pinfix,char *ppostfix,short *perror) } /* add all operators on stack to postfix */ - while (pstacktop >= &stack[1]){ + while (pstacktop >= stack+1){ if (pstacktop->element[0] == '('){ *perror = 6; *ppostfixStart = BAD_EXPRESSION; return(-1);