summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2016-12-10 16:56:47 +0100
committerTobias Klauser <tklauser@distanz.ch>2016-12-10 16:56:47 +0100
commitc16b914a728f2786aaa4e1c44c092c3faaf1df48 (patch)
tree5b33edb77b0db638326c8814eee15366abfb3339
parent19fd2e57dc963f0e26e625645ee6a922cf3aed2f (diff)
bpfc: make verbose parameter boolean
Verbose mode is a boolean option, so make the variable and parameters carrying it of type bool. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
-rw-r--r--bpf_parser.y4
-rw-r--r--bpfc.c8
2 files changed, 6 insertions, 6 deletions
diff --git a/bpf_parser.y b/bpf_parser.y
index 6f5f2b0..5082dd2 100644
--- a/bpf_parser.y
+++ b/bpf_parser.y
@@ -27,7 +27,7 @@
#include "die.h"
#include "cpp.h"
-int compile_filter(char *file, int verbose, int bypass, int format,
+int compile_filter(char *file, bool verbose, int bypass, int format,
bool invoke_cpp, char *const cpp_argv[]);
static int curr_instr = 0;
@@ -734,7 +734,7 @@ static void pretty_printer(const struct sock_fprog *prog, int format)
}
}
-int compile_filter(char *file, int verbose, int bypass, int format,
+int compile_filter(char *file, bool verbose, int bypass, int format,
bool invoke_cpp, char *const cpp_argv[])
{
int i;
diff --git a/bpfc.c b/bpfc.c
index bf14147..562c463 100644
--- a/bpfc.c
+++ b/bpfc.c
@@ -40,7 +40,7 @@ static const char *copyright = "Please report bugs to <netsniff-ng@googlegroups.
"This is free software: you are free to change and redistribute it.\n"
"There is NO WARRANTY, to the extent permitted by law.";
-extern int compile_filter(char *file, int verbose, int bypass, int format,
+extern int compile_filter(char *file, bool verbose, int bypass, int format,
bool invoke_cpp, char **cpp_argv);
static void __noreturn help(void)
@@ -82,8 +82,8 @@ static void __noreturn version(void)
int main(int argc, char **argv)
{
- int ret, verbose = 0, c, bypass = 0, format = 0;
- bool invoke_cpp = false;
+ int ret, c, bypass = 0, format = 0;
+ bool verbose = false, invoke_cpp = false;
char **cpp_argv = NULL;
size_t cpp_argc = 0;
char *file = NULL;
@@ -104,7 +104,7 @@ int main(int argc, char **argv)
version();
break;
case 'V':
- verbose = 1;
+ verbose = true;
break;
case 'p':
invoke_cpp = true;