Skip to content

Commit

Permalink
devmatch: Convert command line flags to bools
Browse files Browse the repository at this point in the history
These are bools, and should have been bools from the start. Make them
bools.

Sponsored by:		Netflix
  • Loading branch information
bsdimp authored and bsdjhb committed Aug 7, 2024
2 parents 09f7fab + ea002c1 commit 88ee431
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions sbin/devmatch/devmatch.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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();
Expand Down

0 comments on commit 88ee431

Please sign in to comment.