mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-18 10:35:55 +00:00
sh: Fix some warnings in code for arithmetic expressions.
Submitted by: eadler
This commit is contained in:
parent
e776709347
commit
976018d24f
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=219306
@ -198,7 +198,7 @@ static arith_t primary(int token, union yystype *val, int op, int noeval)
|
||||
}
|
||||
}
|
||||
|
||||
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…
Reference in New Issue
Block a user