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/evaluate.c | 8 -------- 1 file changed, 8 deletions(-) (limited to 'src/evaluate.c') 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) { -- cgit v1.2.3