devmatch: Convert command line flags to bools

These are bools, and should have been bools from the start. Make them
bools.

Sponsored by:		Netflix
This commit is contained in:
Warner Losh 2024-04-05 16:34:03 -06:00
parent 03cfd91998
commit ea002c1017

View File

@ -30,6 +30,7 @@
#include <errno.h>
#include <fcntl.h>
#include <getopt.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@ -54,13 +55,13 @@ static struct option longopts[] = {
#define DEVMATCH_MAX_HITS 256
static int all_flag;
static int dump_flag;
static bool all_flag;
static bool dump_flag;
static char *linker_hints;
static char *nomatch_str;
static int quiet_flag;
static int unbound_flag;
static int verbose_flag;
static bool quiet_flag;
static bool unbound_flag;
static bool verbose_flag;
static void *hints;
static void *hints_end;
@ -573,10 +574,10 @@ main(int argc, char **argv)
longopts, NULL)) != -1) {
switch (ch) {
case 'a':
all_flag++;
all_flag = true;
break;
case 'd':
dump_flag++;
dump_flag = true;
break;
case 'h':
linker_hints = optarg;
@ -585,13 +586,13 @@ main(int argc, char **argv)
nomatch_str = optarg;
break;
case 'q':
quiet_flag++;
quiet_flag = true;
break;
case 'u':
unbound_flag++;
unbound_flag = true;
break;
case 'v':
verbose_flag++;
verbose_flag = true;
break;
default:
usage();