summaryrefslogtreecommitdiffstats
path: root/src/evaluate.c
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2017-08-22 18:19:12 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2017-08-23 23:42:33 +0200
commita6ba3ad626ccd15f9104b3143c297f39cce6e050 (patch)
tree4cfe6caba40c1d639e3a61ba78cfdf44505513f0 /src/evaluate.c
parent4dedecf4d64ef64f7f86efeeed117be931005282 (diff)
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 <pablo@netfilter.org>
Diffstat (limited to 'src/evaluate.c')
-rw-r--r--src/evaluate.c8
1 files changed, 0 insertions, 8 deletions
diff --git a/src/evaluate.c b/src/evaluate.c
index 3989d5e3..e3c8e1dc 100644
--- a/src/evaluate.c
+++ b/src/evaluate.c
@@ -1708,7 +1708,6 @@ static int expr_evaluate_meta(struct eval_ctx *ctx, struct expr **exprp)
static int expr_evaluate(struct eval_ctx *ctx, struct expr **expr)
{
-#ifdef DEBUG
if (debug_level & DEBUG_EVALUATION) {
struct error_record *erec;
erec = erec_create(EREC_INFORMATIONAL, &(*expr)->location,
@@ -1717,7 +1716,6 @@ static int expr_evaluate(struct eval_ctx *ctx, struct expr **expr)
expr_print(*expr, &octx_debug_dummy);
printf("\n\n");
}
-#endif
switch ((*expr)->ops->type) {
case EXPR_SYMBOL:
@@ -2691,7 +2689,6 @@ static int stmt_evaluate_objref(struct eval_ctx *ctx, struct stmt *stmt)
int stmt_evaluate(struct eval_ctx *ctx, struct stmt *stmt)
{
-#ifdef DEBUG
if (debug_level & DEBUG_EVALUATION) {
struct error_record *erec;
erec = erec_create(EREC_INFORMATIONAL, &stmt->location,
@@ -2699,7 +2696,6 @@ int stmt_evaluate(struct eval_ctx *ctx, struct stmt *stmt)
erec_print(stdout, erec); stmt_print(stmt, &octx_debug_dummy);
printf("\n\n");
}
-#endif
switch (stmt->ops->type) {
case STMT_COUNTER:
@@ -3341,7 +3337,6 @@ static int cmd_evaluate_export(struct eval_ctx *ctx, struct cmd *cmd)
return cache_update(ctx->nf_sock, ctx->cache, cmd->op, ctx->msgs);
}
-#ifdef DEBUG
static const char *cmd_op_name[] = {
[CMD_INVALID] = "invalid",
[CMD_ADD] = "add",
@@ -3364,11 +3359,9 @@ static const char *cmd_op_to_name(enum cmd_ops op)
return cmd_op_name[op];
}
-#endif
int cmd_evaluate(struct eval_ctx *ctx, struct cmd *cmd)
{
-#ifdef DEBUG
if (debug_level & DEBUG_EVALUATION) {
struct error_record *erec;
@@ -3376,7 +3369,6 @@ int cmd_evaluate(struct eval_ctx *ctx, struct cmd *cmd)
"Evaluate %s", cmd_op_to_name(cmd->op));
erec_print(stdout, erec); printf("\n\n");
}
-#endif
ctx->cmd = cmd;
switch (cmd->op) {