From e5063f9883790f245bf87e26455255213faf728e Mon Sep 17 00:00:00 2001 From: Nardi Ivan Date: Mon, 5 Sep 2022 15:52:01 +0200 Subject: Fix some warnings Ubuntu-20.04, clang-16 (nightly build) ``` Making all in src/lib protocols/smpp.c:70:17: warning: variable 'pdu_c' set but not used [-Wunused-but-set-variable] u_int16_t pdu_c = 1; ^ 1 warning generated. third_party/src/ahocorasick.c:173:20: warning: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion] thiz->root->root = 1; ^ ~ third_party/src/ahocorasick.c:336:15: warning: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion] n->ff = 1; ^ ~ third_party/src/ahocorasick.c:716:21: warning: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion] node->final = 1; [...] ``` --- src/lib/protocols/smpp.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/lib/protocols') diff --git a/src/lib/protocols/smpp.c b/src/lib/protocols/smpp.c index e4ab8f93f..2b3542a9b 100644 --- a/src/lib/protocols/smpp.c +++ b/src/lib/protocols/smpp.c @@ -67,7 +67,9 @@ void ndpi_search_smpp_tcp(struct ndpi_detection_module_struct* ndpi_struct, // check if multiple PDUs included u_int32_t total_pdu_l = pdu_l; u_int32_t tmp_pdu_l = 0; +#ifdef NDPI_ENABLE_DEBUG_MESSAGES u_int16_t pdu_c = 1; +#endif // loop PDUs (check if lengths are valid) while(total_pdu_l < ((uint32_t)packet->payload_packet_len-4)) { // get next PDU length @@ -76,8 +78,10 @@ void ndpi_search_smpp_tcp(struct ndpi_detection_module_struct* ndpi_struct, if(tmp_pdu_l == 0 || ndpi_check_overflow(tmp_pdu_l, total_pdu_l) ) return; // inc total PDU length total_pdu_l += ntohl(get_u_int32_t(packet->payload, total_pdu_l)); +#ifdef NDPI_ENABLE_DEBUG_MESSAGES // inc total PDU count ++pdu_c; +#endif } NDPI_LOG_DBG2(ndpi_struct, -- cgit v1.2.3