From: Michael Buesch Date: Mon, 20 Sep 2010 20:41:48 +0000 (+0200) Subject: disassembler: Put debug variable into cmdargs struct X-Git-Tag: b43-fwcutter-014~25 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=6c31b6389e3e1d944799847700e62dfde7754663;p=b43-tools.git disassembler: Put debug variable into cmdargs struct Signed-off-by: Michael Buesch --- diff --git a/disassembler/args.c b/disassembler/args.c index 08e3a40..89db706 100644 --- a/disassembler/args.c +++ b/disassembler/args.c @@ -22,13 +22,12 @@ #include -int _debug; - struct cmdline_args cmdargs = { - .arch = 5, - .informat = FMT_B43, - .print_addresses = 0, - .unknown_decode = 0, + .debug = 0, + .arch = 5, + .informat = FMT_B43, + .print_addresses = 0, + .unknown_decode = 0, }; #define ARG_MATCH 0 @@ -139,7 +138,7 @@ int parse_args(int argc, char **argv) } else if ((res = cmp_arg(argv, &i, "--unkdec", "-u", NULL)) == ARG_MATCH) { cmdargs.unknown_decode = 1; } else if ((res = cmp_arg(argv, &i, "--debug", "-d", NULL)) == ARG_MATCH) { - _debug++; + cmdargs.debug++; } else if ((res = cmp_arg(argv, &i, "--arch", "-a", ¶m)) == ARG_MATCH) { unsigned long arch; char *tail; diff --git a/disassembler/args.h b/disassembler/args.h index 67f1e45..6af5b8d 100644 --- a/disassembler/args.h +++ b/disassembler/args.h @@ -8,6 +8,7 @@ enum fwformat { }; struct cmdline_args { + int debug; /* Debug level. */ unsigned int arch; /* The architecture we're disassembling. */ enum fwformat informat; /* The input file format. */ int print_addresses; /* Print a comment with instruction address. */ @@ -21,11 +22,10 @@ void close_input_file(void); int open_output_file(void); void close_output_file(void); -extern int _debug; extern struct cmdline_args cmdargs; -#define IS_DEBUG (_debug > 0) -#define IS_VERBOSE_DEBUG (_debug > 1) -#define IS_INSANE_DEBUG (_debug > 2) +#define IS_DEBUG (cmdargs.debug > 0) +#define IS_VERBOSE_DEBUG (cmdargs.debug > 1) +#define IS_INSANE_DEBUG (cmdargs.debug > 2) #endif /* B43_DASM_ARGS_H_ */