git: d167318506a6 - main - systat/iostat: Use bools for numbers and kbpt
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 07 Feb 2022 21:51:55 UTC
The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=d167318506a69a6acf9ff0c7ec65c581d5b710e1 commit d167318506a69a6acf9ff0c7ec65c581d5b710e1 Author: Warner Losh <imp@FreeBSD.org> AuthorDate: 2022-02-07 21:50:35 +0000 Commit: Warner Losh <imp@FreeBSD.org> CommitDate: 2022-02-07 21:51:45 +0000 systat/iostat: Use bools for numbers and kbpt These are really bools, declare them as such. Sponsored by: Netflix --- usr.bin/systat/iostat.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/usr.bin/systat/iostat.c b/usr.bin/systat/iostat.c index e3d577507e08..f6ed026c6a97 100644 --- a/usr.bin/systat/iostat.c +++ b/usr.bin/systat/iostat.c @@ -72,6 +72,7 @@ static const char sccsid[] = "@(#)iostat.c 8.1 (Berkeley) 6/6/93"; #include <err.h> #include <nlist.h> #include <paths.h> +#include <stdbool.h> #include <stdlib.h> #include <string.h> @@ -81,8 +82,8 @@ static const char sccsid[] = "@(#)iostat.c 8.1 (Berkeley) 6/6/93"; static int linesperregion; static double etime; -static int numbers = 0; /* default display bar graphs */ -static int kbpt = 0; /* default ms/seek shown */ +static bool numbers = false; /* default display bar graphs */ +static bool kbpt = false; /* default ms/seek shown */ static int barlabels(int); static void histogram(long double, int, double); @@ -377,9 +378,9 @@ cmdiostat(const char *cmd, const char *args) if (prefix(cmd, "kbpt")) kbpt = !kbpt; else if (prefix(cmd, "numbers")) - numbers = 1; + numbers = true; else if (prefix(cmd, "bars")) - numbers = 0; + numbers = false; else if (!dscmd(cmd, args, 100, &cur_dev)) return (0); wclear(wnd);