svn commit: r295190 - user/ngie/bsnmp_cleanup/usr.sbin/bsnmpd/tools/libbsnmptools
Garrett Cooper
ngie at FreeBSD.org
Wed Feb 3 02:03:01 UTC 2016
Author: ngie
Date: Wed Feb 3 02:03:00 2016
New Revision: 295190
URL: https://svnweb.freebsd.org/changeset/base/295190
Log:
Don't test for tc < 0 in snmp_oct2tc(..), snmp_tc2oid(..), and
snmp_tc2oct(..) to mute valid -Wtautological-compare warnings as
tc is an enum and (by the current definition of the enum) will
always be positive
Reported by: Jenkins (clang job)
Sponsored by: EMC / Isilon Storage Division
Modified:
user/ngie/bsnmp_cleanup/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c
Modified: user/ngie/bsnmp_cleanup/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c
==============================================================================
--- user/ngie/bsnmp_cleanup/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c Wed Feb 3 02:02:01 2016 (r295189)
+++ user/ngie/bsnmp_cleanup/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c Wed Feb 3 02:03:00 2016 (r295190)
@@ -158,7 +158,7 @@ snmp_oct2tc(enum snmp_tc tc, uint32_t le
uint32_t tc_len;
char * buf;
- if (tc < 0 || tc > SNMP_UNKNOWN)
+ if (tc > SNMP_UNKNOWN)
tc = SNMP_UNKNOWN;
if (text_convs[tc].len > 0)
@@ -183,7 +183,7 @@ snmp_oct2tc(enum snmp_tc tc, uint32_t le
char *
snmp_tc2oid(enum snmp_tc tc, char *str, struct asn_oid *oid)
{
- if (tc < 0 || tc > SNMP_UNKNOWN)
+ if (tc > SNMP_UNKNOWN)
tc = SNMP_UNKNOWN;
return (text_convs[tc].tc2oid(str, oid));
@@ -192,7 +192,7 @@ snmp_tc2oid(enum snmp_tc tc, char *str,
int32_t
snmp_tc2oct(enum snmp_tc tc, struct snmp_value *value, char *string)
{
- if (tc < 0 || tc > SNMP_UNKNOWN)
+ if (tc > SNMP_UNKNOWN)
tc = SNMP_UNKNOWN;
return (text_convs[tc].tc2oct(value, string));
More information about the svn-src-user
mailing list