git: eca9714e4bf2 - main - libbsnmptools: Fully comment out set but unused count variable.

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Tue, 27 Jun 2023 17:19:47 UTC
The branch main has been updated by jhb:

URL: https://cgit.FreeBSD.org/src/commit/?id=eca9714e4bf299cd704eb9e28a06a97d1bb1c301

commit eca9714e4bf299cd704eb9e28a06a97d1bb1c301
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2023-06-27 17:19:32 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2023-06-27 17:19:32 +0000

    libbsnmptools: Fully comment out set but unused count variable.
    
    These functions all end with 'return (2/* count */);'.
    
    Reviewed by:    emaste
    Differential Revision:  https://reviews.freebsd.org/D40670
---
 usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c b/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c
index 9dc2f890ac7f..219be6f7209b 100644
--- a/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c
+++ b/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c
@@ -483,7 +483,7 @@ parse_ascii(char *ascii, uint8_t *binstr, size_t binlen)
 int32_t
 parse_authentication(struct snmp_toolinfo *snmptoolctx __unused, char *opt_arg)
 {
-	int32_t count, subopt;
+	int32_t /* count, */ subopt;
 	char *val, *option;
 	const char *const subopts[] = {
 		"proto",
@@ -492,7 +492,7 @@ parse_authentication(struct snmp_toolinfo *snmptoolctx __unused, char *opt_arg)
 	};
 
 	assert(opt_arg != NULL);
-	count = 1;
+	/* count = 1; */
 	while ((subopt = getsubopt1(&opt_arg, subopts, &val, &option)) != EOF) {
 		switch (subopt) {
 		case 0:
@@ -530,7 +530,7 @@ parse_authentication(struct snmp_toolinfo *snmptoolctx __unused, char *opt_arg)
 			warnx("Unknown suboption - '%s'", suboptarg);
 			return (-1);
 		}
-		count += 1;
+		/* count += 1; */
 	}
 	return (2/* count */);
 }
@@ -538,7 +538,7 @@ parse_authentication(struct snmp_toolinfo *snmptoolctx __unused, char *opt_arg)
 int32_t
 parse_privacy(struct snmp_toolinfo *snmptoolctx __unused, char *opt_arg)
 {
-	int32_t count, subopt;
+	int32_t /* count, */ subopt;
 	char *val, *option;
 	const char *const subopts[] = {
 		"proto",
@@ -547,7 +547,7 @@ parse_privacy(struct snmp_toolinfo *snmptoolctx __unused, char *opt_arg)
 	};
 
 	assert(opt_arg != NULL);
-	count = 1;
+	/* count = 1; */
 	while ((subopt = getsubopt1(&opt_arg, subopts, &val, &option)) != EOF) {
 		switch (subopt) {
 		case 0:
@@ -583,7 +583,7 @@ parse_privacy(struct snmp_toolinfo *snmptoolctx __unused, char *opt_arg)
 			warnx("Unknown suboption - '%s'", suboptarg);
 			return (-1);
 		}
-		count += 1;
+		/* count += 1; */
 	}
 	return (2/* count */);
 }
@@ -591,7 +591,7 @@ parse_privacy(struct snmp_toolinfo *snmptoolctx __unused, char *opt_arg)
 int32_t
 parse_context(struct snmp_toolinfo *snmptoolctx __unused, char *opt_arg)
 {
-	int32_t count, subopt;
+	int32_t /* count, */ subopt;
 	char *val, *option;
 	const char *const subopts[] = {
 		"context",
@@ -600,7 +600,7 @@ parse_context(struct snmp_toolinfo *snmptoolctx __unused, char *opt_arg)
 	};
 
 	assert(opt_arg != NULL);
-	count = 1;
+	/* count = 1; */
 	while ((subopt = getsubopt1(&opt_arg, subopts, &val, &option)) != EOF) {
 		switch (subopt) {
 		case 0:
@@ -625,7 +625,7 @@ parse_context(struct snmp_toolinfo *snmptoolctx __unused, char *opt_arg)
 			warnx("Unknown suboption - '%s'", suboptarg);
 			return (-1);
 		}
-		count += 1;
+		/* count += 1; */
 	}
 	return (2/* count */);
 }
@@ -633,7 +633,7 @@ parse_context(struct snmp_toolinfo *snmptoolctx __unused, char *opt_arg)
 int32_t
 parse_user_security(struct snmp_toolinfo *snmptoolctx __unused, char *opt_arg)
 {
-	int32_t count, subopt, saved_errno;
+	int32_t /* count, */ subopt, saved_errno;
 	char *val, *option;
 	const char *const subopts[] = {
 		"engine",
@@ -644,7 +644,7 @@ parse_user_security(struct snmp_toolinfo *snmptoolctx __unused, char *opt_arg)
 	};
 
 	assert(opt_arg != NULL);
-	count = 1;
+	/* count = 1; */
 	while ((subopt = getsubopt1(&opt_arg, subopts, &val, &option)) != EOF) {
 		switch (subopt) {
 		case 0:
@@ -697,7 +697,7 @@ parse_user_security(struct snmp_toolinfo *snmptoolctx __unused, char *opt_arg)
 			warnx("Unknown suboption - '%s'", suboptarg);
 			return (-1);
 		}
-		count += 1;
+		/* count += 1; */
 	}
 	return (2/* count */);
 }