aboutsummaryrefslogtreecommitdiff
path: root/src/lib/protocols/smpp.c
diff options
context:
space:
mode:
authorNardi Ivan <nardi.ivan@gmail.com>2022-09-05 15:52:01 +0200
committerToni <matzeton@googlemail.com>2022-09-05 23:44:51 +0200
commite5063f9883790f245bf87e26455255213faf728e (patch)
tree344e6ff22e2fe56a05f190d6ae4cbe4ea1726a05 /src/lib/protocols/smpp.c
parent0a47f745cc87f967f0d8513b4178321e21a02efc (diff)
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; [...] ```
Diffstat (limited to 'src/lib/protocols/smpp.c')
-rw-r--r--src/lib/protocols/smpp.c4
1 files changed, 4 insertions, 0 deletions
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,