From 2f4e11b1ca6dde1aca311ea557544f96fe07fb7d Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Mon, 30 Sep 2013 17:46:32 +0200 Subject: [PATCH] Fix compiler warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit app-layer-parser.c: In function ‘AppLayerPPTestData’: app-layer-parser.c:2525:9: error: variable ‘dir’ set but not used [-Werror=unused-but-set-variable] int dir = 0; ^ --- src/app-layer-parser.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/app-layer-parser.c b/src/app-layer-parser.c index 4ef8d46138..5e8842b499 100644 --- a/src/app-layer-parser.c +++ b/src/app-layer-parser.c @@ -2522,8 +2522,9 @@ int AppLayerPPTestData(AppLayerProbingParser *pp, { int result = 0; int i, j, k; +#ifdef DEBUG int dir = 0; - +#endif for (i = 0; i < no_of_ip_proto; i++, pp = pp->next) { if (pp->ip_proto != ip_proto[i].ip_proto) goto end; @@ -2542,7 +2543,9 @@ int AppLayerPPTestData(AppLayerProbingParser *pp, goto end; AppLayerProbingParserElement *pp_element = pp_port->toserver; +#ifdef DEBUG dir = 0; +#endif for (j = 0 ; j < ip_proto[i].port[k].ts_no_of_element; j++, pp_element = pp_element->next) { @@ -2572,7 +2575,9 @@ int AppLayerPPTestData(AppLayerProbingParser *pp, goto end; pp_element = pp_port->toclient; +#ifdef DEBUG dir = 1; +#endif for (j = 0 ; j < ip_proto[i].port[k].tc_no_of_element; j++, pp_element = pp_element->next) { if ((strlen(pp_element->al_proto_name) != strlen(ip_proto[i].port[k].toclient_element[j].al_proto_name)) || @@ -2607,7 +2612,7 @@ int AppLayerPPTestData(AppLayerProbingParser *pp, result = 1; end: -#if DEBUG +#ifdef DEBUG printf("i = %d, k = %d, j = %d(%s)\n", i, k, j, (dir == 0) ? "ts" : "tc"); #endif return result;