From 47019e26f636fdd6abe687335338b17833019d6c Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Sat, 9 Nov 2019 22:42:13 +0100 Subject: [PATCH] fix signed/unsigned comparison warning --- lib/include/srslte/common/pdu.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/include/srslte/common/pdu.h b/lib/include/srslte/common/pdu.h index 2562a5f7f..d57bee899 100644 --- a/lib/include/srslte/common/pdu.h +++ b/lib/include/srslte/common/pdu.h @@ -137,7 +137,7 @@ public: nof_subheaders++; } - if (ret && (ptr - init_ptr) >= pdu_len) { + if (ret && ((ptr - init_ptr) >= (int32_t)pdu_len)) { // stop processing last subheader indicates another one but all bytes are consume nof_subheaders = 0; INFO("Corrupted MAC PDU - all bytes have been consumed (pdu_len=%d)\n", pdu_len); @@ -145,7 +145,7 @@ public: log->info_hex(init_ptr, pdu_len, "Corrupted MAC PDU - all bytes have been consumed (pdu_len=%d)\n", pdu_len); } } - } while (ret && (nof_subheaders + 1) < (int)max_subheaders && pdu_len > (ptr - init_ptr)); + } while (ret && (nof_subheaders + 1) < (int)max_subheaders && ((int32_t)pdu_len > (ptr - init_ptr))); for (int i = 0; i < nof_subheaders; i++) { subheaders[i].read_payload(&ptr);