From a6ba3ad626ccd15f9104b3143c297f39cce6e050 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Tue, 22 Aug 2017 18:19:12 +0200 Subject: src: remove ifdef DEBUG pollution Get rid of lots of ifdef DEBUG pollution in the code. The --debug= option is useful to get feedback from users, so it should be always there. And we really save nothing from keeping this code away from the control plane with a compile time option. Just running tests/shell/ before and after this patch, time shows almost no difference. So this patch leaves --enable-debug around to add debugging symbols in your builds, this is left set on by default. Signed-off-by: Pablo Neira Ayuso --- src/main.c | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index fc44b186..4c74bdce 100644 --- a/src/main.c +++ b/src/main.c @@ -29,9 +29,7 @@ #include static struct nft_ctx nft; -#ifdef DEBUG unsigned int debug_level; -#endif enum opt_vals { OPT_HELP = 'h', @@ -90,13 +88,11 @@ static const struct option options[] = { .val = OPT_INCLUDEPATH, .has_arg = 1, }, -#ifdef DEBUG { .name = "debug", .val = OPT_DEBUG, .has_arg = 1, }, -#endif { .name = "handle", .val = OPT_HANDLE_OUTPUT, @@ -131,14 +127,11 @@ static void show_help(const char *name) " -a, --handle Output rule handle.\n" " -e, --echo Echo what has been added, inserted or replaced.\n" " -I, --includepath Add to the paths searched for include files. Default is: %s\n" -#ifdef DEBUG " --debug Specify debugging level (scanner, parser, eval, netlink, mnl, proto-ctx, segtree, all)\n" -#endif "\n", name, DEFAULT_INCLUDE_PATH); } -#ifdef DEBUG static const struct { const char *name; enum debug_level level; @@ -176,7 +169,6 @@ static const struct { .level = ~0, }, }; -#endif static const struct input_descriptor indesc_cmdline = { .type = INDESC_BUFFER, @@ -359,7 +351,6 @@ int main(int argc, char * const *argv) case OPT_IP2NAME: nft.output.ip2name++; break; -#ifdef DEBUG case OPT_DEBUG: for (;;) { unsigned int i; @@ -387,7 +378,6 @@ int main(int argc, char * const *argv) optarg = end + 1; } break; -#endif case OPT_HANDLE_OUTPUT: nft.output.handle++; break; -- cgit v1.2.3