sh: Fix some warnings in code for arithmetic expressions.
Submitted by: eadler
This commit is contained in:
parent
e776709347
commit
976018d24f
@ -198,7 +198,7 @@ again:
|
||||
}
|
||||
}
|
||||
|
||||
static arith_t binop2(arith_t a, int op, int prec, int noeval)
|
||||
static arith_t binop2(arith_t a, int op, int precedence, int noeval)
|
||||
{
|
||||
for (;;) {
|
||||
union yystype val;
|
||||
@ -221,7 +221,7 @@ static arith_t binop2(arith_t a, int op, int prec, int noeval)
|
||||
a = noeval ? b : do_binop(op, a, b);
|
||||
|
||||
if (op2 < ARITH_BINOP_MIN || op2 >= ARITH_BINOP_MAX ||
|
||||
arith_prec(op2) >= prec)
|
||||
arith_prec(op2) >= precedence)
|
||||
return a;
|
||||
|
||||
op = op2;
|
||||
|
@ -57,6 +57,7 @@ yylex()
|
||||
{
|
||||
int value;
|
||||
const char *buf = arith_buf;
|
||||
char *end;
|
||||
const char *p;
|
||||
|
||||
for (;;) {
|
||||
@ -79,7 +80,8 @@ yylex()
|
||||
case '7':
|
||||
case '8':
|
||||
case '9':
|
||||
yylval.val = strtoarith_t(buf, (char **)&arith_buf, 0);
|
||||
yylval.val = strtoarith_t(buf, (char **)&end, 0);
|
||||
arith_buf = end;
|
||||
return ARITH_NUM;
|
||||
case 'A':
|
||||
case 'B':
|
||||
|
Loading…
x
Reference in New Issue
Block a user