From 5f1131cae292188a66611be1569834c6e21c7a97 Mon Sep 17 00:00:00 2001 From: Alexis La Goutte Date: Tue, 25 Jul 2017 13:51:14 +0000 Subject: ndpiReader: fix file_first_time/_statsFilePath defined but not used [-Werror=unused-variable] --- example/ndpiReader.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/example/ndpiReader.c b/example/ndpiReader.c index bcab28568..36d217a30 100644 --- a/example/ndpiReader.c +++ b/example/ndpiReader.c @@ -64,8 +64,8 @@ static FILE *results_file = NULL; static char *results_path = NULL; static char * bpfFilter = NULL; /**< bpf filter */ static char *_protoFilePath = NULL; /**< Protocol file path */ -static char *_statsFilePath = NULL; /**< Top stats file path */ #ifdef HAVE_JSON_C +static char *_statsFilePath = NULL; /**< Top stats file path */ static char *_diagnoseFilePath = NULL; /**< Top stats file path */ static char *_jsonFilePath = NULL; /**< JSON file path */ static FILE *stats_fp = NULL; /**< for Top Stats JSON file */ @@ -78,7 +78,10 @@ static u_int8_t live_capture = 0; static u_int8_t undetected_flows_deleted = 0; /** User preferences **/ static u_int8_t enable_protocol_guess = 1, verbose = 0, nDPI_traceLevel = 0, json_flag = 0; -static u_int8_t stats_flag = 0, file_first_time = 1, bpf_filter_flag = 0; +static u_int8_t stats_flag = 0, bpf_filter_flag = 0; +#ifdef HAVE_JSON_C +static u_int8_t file_first_time = 1; +#endif static u_int32_t pcap_analysis_duration = (u_int32_t)-1; static u_int16_t decode_tunnels = 0; static u_int16_t num_loops = 1; -- cgit v1.2.3 From b021f5bce1810d58a3bcae42ea97242ed24bc41d Mon Sep 17 00:00:00 2001 From: Alexis La Goutte Date: Tue, 25 Jul 2017 14:03:10 +0000 Subject: ndpiReader.c fix ‘getTopStats/deleteTopStats/top_stats_sort/scanners_port_sort/scanners_sort/deleteScanners’ defined but not used [-Werror=unused-function] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- example/ndpiReader.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/example/ndpiReader.c b/example/ndpiReader.c index 36d217a30..e6281b617 100644 --- a/example/ndpiReader.c +++ b/example/ndpiReader.c @@ -1033,6 +1033,7 @@ static void updatePortStats(struct port_stats **stats, u_int32_t port, /* *********************************************** */ +#ifdef HAVE_JSON_C static void deleteScanners(struct single_flow_info *scanners) { struct single_flow_info *s, *tmp; struct port_flow_info *p, *tmp2; @@ -1046,6 +1047,7 @@ static void deleteScanners(struct single_flow_info *scanners) { free(s); } } +#endif /* *********************************************** */ @@ -1358,6 +1360,7 @@ static int port_stats_sort(void *_a, void *_b) { /* *********************************************** */ +#ifdef HAVE_JSON_C static int scanners_sort(void *_a, void *_b) { struct single_flow_info *a = (struct single_flow_info *)_a; struct single_flow_info *b = (struct single_flow_info *)_b; @@ -1374,6 +1377,7 @@ static int scanners_port_sort(void *_a, void *_b) { return(b->num_flows - a->num_flows); } +#endif /* *********************************************** */ static int info_pair_cmp (const void *_a, const void *_b) @@ -1386,6 +1390,7 @@ static int info_pair_cmp (const void *_a, const void *_b) /* *********************************************** */ +#ifdef HAVE_JSON_C static int top_stats_sort(void *_a, void *_b) { struct top_stats *a = (struct top_stats*)_a; struct top_stats *b = (struct top_stats*)_b; @@ -1444,7 +1449,6 @@ static int getTopStats(struct top_stats **topStats, struct port_stats *stats) { /* *********************************************** */ -#ifdef HAVE_JSON_C static void saveScannerStats(json_object **jObj_group, struct single_flow_info *scanners) { struct single_flow_info *s, *tmp; struct port_flow_info *p, *tmp2; -- cgit v1.2.3 From 5ebc85e705049983095e50d02577c4e39aad77fa Mon Sep 17 00:00:00 2001 From: Alexis La Goutte Date: Thu, 27 Jul 2017 12:09:15 +0000 Subject: ndpiReader.c: fix variable ‘fileName’ set but not used [-Werror=unused-but-set-variable] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- example/ndpiReader.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/example/ndpiReader.c b/example/ndpiReader.c index e6281b617..189321968 100644 --- a/example/ndpiReader.c +++ b/example/ndpiReader.c @@ -2285,7 +2285,6 @@ void automataUnitTest() { void bpf_filter_produce_filter(int port_array[], int p_size, const char *host_array[48], int h_size, char *filePath) { FILE *fp = NULL; char _filterFilePath[1024]; - char *fileName; char filter[2048]; int produced = 0; int i = 0; @@ -2337,7 +2336,6 @@ void bpf_filter_produce_filter(int port_array[], int p_size, const char *host_ar produced = 1; } - fileName = basename(filePath); snprintf(_filterFilePath, sizeof(_filterFilePath), "%s.bpf", filePath); if((fp = fopen(_filterFilePath,"w")) == NULL) { -- cgit v1.2.3 From ad401c4192f9db7e5e1c6b9fa8b45b2cd9d3d657 Mon Sep 17 00:00:00 2001 From: Alexis La Goutte Date: Fri, 28 Jul 2017 13:05:30 +0000 Subject: ndpi_main.c: fix unused variable 'rc' [-Werror,-Wunused-variable] --- src/lib/ndpi_main.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c index 537893567..84e43e660 100644 --- a/src/lib/ndpi_main.c +++ b/src/lib/ndpi_main.c @@ -4678,7 +4678,6 @@ int ndpi_match_string_subprotocol(struct ndpi_detection_module_struct *ndpi_stru int matching_protocol_id = NDPI_PROTOCOL_UNKNOWN; AC_TEXT_t ac_input_text; ndpi_automa *automa = is_host_match ? &ndpi_struct->host_automa : &ndpi_struct->content_automa; - int rc; if((automa->ac_automa == NULL) || (string_to_match_len == 0)) return(NDPI_PROTOCOL_UNKNOWN); -- cgit v1.2.3