git: b29817874d19 - main - setkey: fix several warnings popping up when compiling without WARNS=1

Mateusz Guzik mjg at FreeBSD.org
Thu Jul 8 14:01:01 UTC 2021


The branch main has been updated by mjg:

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

commit b29817874d19ce3e4e4c78e3cb74ebefe71f90cc
Author:     Mateusz Guzik <mjg at FreeBSD.org>
AuthorDate: 2021-07-08 11:30:45 +0000
Commit:     Mateusz Guzik <mjg at FreeBSD.org>
CommitDate: 2021-07-08 14:00:55 +0000

    setkey: fix several warnings popping up when compiling without WARNS=1
---
 sbin/setkey/setkey.c | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/sbin/setkey/setkey.c b/sbin/setkey/setkey.c
index d011fd44a40a..9e896996a259 100644
--- a/sbin/setkey/setkey.c
+++ b/sbin/setkey/setkey.c
@@ -73,17 +73,17 @@ static int32_t gmt2local(time_t);
 #define MODE_CMDFLUSH	3
 #define MODE_PROMISC	4
 
-int so;
-
-int f_forever = 0;
-int f_all = 0;
-int f_verbose = 0;
-int f_mode = 0;
-int f_cmddump = 0;
-int f_policy = 0;
-int f_hexdump = 0;
-int f_tflag = 0;
-int f_scope = 0;
+static int so;
+
+static int f_forever = 0;
+static int f_all = 0;
+static int f_verbose = 0;
+static int f_mode = 0;
+static int f_cmddump = 0;
+static int f_policy = 0;
+static int f_hexdump = 0;
+static int f_tflag = 0;
+static int f_scope = 0;
 static time_t thiszone;
 
 extern int lineno;
@@ -322,10 +322,10 @@ again:
 		printf("\n");
 	}
 	if (f_hexdump) {
-		int i;
+		size_t i;
 		for (i = 0; i < len; i++) {
 			if (i % 16 == 0)
-				printf("%08x: ", i);
+				printf("%08x: ", (u_int)i);
 			printf("%02x ", buf[i] & 0xff);
 			if (i % 16 == 15)
 				printf("\n");


More information about the dev-commits-src-main mailing list