Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 6 May 2025 22:02:10 GMT
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 502977f858d5 - main - devinfo: Use bool instead of int
Message-ID:  <202505062202.546M2Awi041259@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by imp:

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

commit 502977f858d5b18e7b5590d3c73ef9ab5bbe043f
Author:     ktullavik <ktullavik@gmail.com>
AuthorDate: 2024-10-17 14:58:25 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2025-05-06 22:01:45 +0000

    devinfo: Use bool instead of int
    
    Reviewed by: imp
    Pull Request: https://github.com/freebsd/freebsd-src/pull/1480
---
 usr.sbin/devinfo/devinfo.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/usr.sbin/devinfo/devinfo.c b/usr.sbin/devinfo/devinfo.c
index fe383edf04b3..4ca417368514 100644
--- a/usr.sbin/devinfo/devinfo.c
+++ b/usr.sbin/devinfo/devinfo.c
@@ -34,14 +34,15 @@
 #include <sys/types.h>
 #include <err.h>
 #include <errno.h>
+#include <stdbool.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
 #include "devinfo.h"
 
-static int	rflag;
-static int	vflag;
+static bool	rflag;
+static bool	vflag;
 
 static void	print_resource(struct devinfo_res *);
 static int	print_device_matching_resource(struct devinfo_res *, void *);
@@ -63,7 +64,7 @@ void
 print_resource(struct devinfo_res *res)
 {
 	struct devinfo_rman	*rman;
-	int			hexmode;
+	bool			hexmode;
 
 	rman = devinfo_handle_to_rman(res->dr_rman);
 	hexmode =  (rman->dm_size > 1000) || (rman->dm_size == 0);
@@ -250,23 +251,24 @@ int
 main(int argc, char *argv[]) 
 {
 	struct devinfo_dev	*root;
-	int			c, uflag, rv;
+	int			c, rv;
+	bool			uflag;
 	char			*path = NULL;
 
-	uflag = 0;
+	uflag = false;
 	while ((c = getopt(argc, argv, "p:ruv")) != -1) {
 		switch(c) {
 		case 'p':
 			path = optarg;
 			break;
 		case 'r':
-			rflag++;
+			rflag = true;
 			break;
 		case 'u':
-			uflag++;
+			uflag = true;
 			break;
 		case 'v':
-			vflag++;
+			vflag = true;
 			break;
 		default:
 			usage();



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202505062202.546M2Awi041259>