From owner-svn-src-user@freebsd.org  Wed Feb  3 02:08:56 2016
Return-Path: <owner-svn-src-user@freebsd.org>
Delivered-To: svn-src-user@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6405FA9A2B6
 for <svn-src-user@mailman.ysv.freebsd.org>;
 Wed,  3 Feb 2016 02:08:56 +0000 (UTC)
 (envelope-from ngie@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 37D55126D;
 Wed,  3 Feb 2016 02:08:56 +0000 (UTC)
 (envelope-from ngie@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1328tSS055097;
 Wed, 3 Feb 2016 02:08:55 GMT (envelope-from ngie@FreeBSD.org)
Received: (from ngie@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1328tHh055096;
 Wed, 3 Feb 2016 02:08:55 GMT (envelope-from ngie@FreeBSD.org)
Message-Id: <201602030208.u1328tHh055096@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: ngie set sender to
 ngie@FreeBSD.org using -f
From: Garrett Cooper <ngie@FreeBSD.org>
Date: Wed, 3 Feb 2016 02:08:55 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
Subject: svn commit: r295192 -
 user/ngie/bsnmp_cleanup/usr.sbin/bsnmpd/tools/libbsnmptools
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.20
Precedence: list
List-Id: "SVN commit messages for the experimental &quot; user&quot;
 src tree" <svn-src-user.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-user/>
List-Post: <mailto:svn-src-user@freebsd.org>
List-Help: <mailto:svn-src-user-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 03 Feb 2016 02:08:56 -0000

Author: ngie
Date: Wed Feb  3 02:08:55 2016
New Revision: 295192
URL: https://svnweb.freebsd.org/changeset/base/295192

Log:
  Mute -Wsign-compare warnings
  
  By definition parse_ascii(..) returns -1 to denote errors, but
  snmp_client.clen and snmp_client.engine.engine_len are unsigned
  quantities. Cast their values to signed quantities when doing
  the compare, and check for -1 (the return code in the error case)
  instead of <0
  
  Reported by: Jenkins (clang job)
  Sponsored by: EMC / Isilon Storage Division

Modified:
  user/ngie/bsnmp_cleanup/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c

Modified: user/ngie/bsnmp_cleanup/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c
==============================================================================
--- user/ngie/bsnmp_cleanup/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c	Wed Feb  3 02:06:48 2016	(r295191)
+++ user/ngie/bsnmp_cleanup/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c	Wed Feb  3 02:08:55 2016	(r295192)
@@ -617,8 +617,8 @@ parse_context(struct snmp_toolinfo *snmp
 				warnx("Suboption 'context-engine' - no argument");
 				return (-1);
 			}
-			if ((snmp_client.clen = parse_ascii(val,
-			    snmp_client.cengine, SNMP_ENGINE_ID_SIZ)) < 0) {
+			if ((int32_t)(snmp_client.clen = parse_ascii(val,
+			    snmp_client.cengine, SNMP_ENGINE_ID_SIZ)) == -1) {
 				warnx("Bad EngineID - %s", val);
 				return (-1);
 			}
@@ -656,7 +656,7 @@ parse_user_security(struct snmp_toolinfo
 			}
 			snmp_client.engine.engine_len = parse_ascii(val, 
 			    snmp_client.engine.engine_id, SNMP_ENGINE_ID_SIZ);
-			if (snmp_client.engine.engine_len < 0) {
+			if ((int32_t)snmp_client.engine.engine_len == -1) {
 				warnx("Bad EngineID - %s", val);
 				return (-1);
 			}