From owner-svn-src-all@FreeBSD.ORG Sat Mar 5 13:27:13 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B7151065672; Sat, 5 Mar 2011 13:27:13 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6AF5D8FC15; Sat, 5 Mar 2011 13:27:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p25DRDkV058615; Sat, 5 Mar 2011 13:27:13 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p25DRDh6058612; Sat, 5 Mar 2011 13:27:13 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201103051327.p25DRDh6058612@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 5 Mar 2011 13:27:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219306 - head/bin/sh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Mar 2011 13:27:13 -0000 Author: jilles Date: Sat Mar 5 13:27:13 2011 New Revision: 219306 URL: http://svn.freebsd.org/changeset/base/219306 Log: sh: Fix some warnings in code for arithmetic expressions. Submitted by: eadler Modified: head/bin/sh/arith_yacc.c head/bin/sh/arith_yylex.c Modified: head/bin/sh/arith_yacc.c ============================================================================== --- head/bin/sh/arith_yacc.c Sat Mar 5 12:46:24 2011 (r219305) +++ head/bin/sh/arith_yacc.c Sat Mar 5 13:27:13 2011 (r219306) @@ -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, 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; Modified: head/bin/sh/arith_yylex.c ============================================================================== --- head/bin/sh/arith_yylex.c Sat Mar 5 12:46:24 2011 (r219305) +++ head/bin/sh/arith_yylex.c Sat Mar 5 13:27:13 2011 (r219306) @@ -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':