Skip to content

Commit

Permalink
bpfc: make verbose parameter boolean
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
tklauser committed Dec 10, 2016
1 parent 19fd2e5 commit c16b914
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions bpf_parser.y
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions bpfc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand All @@ -104,7 +104,7 @@ int main(int argc, char **argv)
version();
break;
case 'V':
verbose = 1;
verbose = true;
break;
case 'p':
invoke_cpp = true;
Expand Down

0 comments on commit c16b914

Please sign in to comment.