From cb6f5724b85e51295498a39144ed4ccce114ad53 Mon Sep 17 00:00:00 2001 From: Mauro Sardara Date: Fri, 2 Sep 2022 14:34:36 +0000 Subject: fix(sonar): make sonarqube happy Ref: HICN-766 HICN-767 HICN-764 HICN-762 HICN-743 HICN-759 HICN-760 HICN-758 HICN-761 HICN-756 Change-Id: Ic2accf6b6771c7a78d2b22d9bdb8e5a5be9ead8a Signed-off-by: Mauro Sardara --- libtransport/src/core/interest.cc | 16 +++++++--------- libtransport/src/core/local_connector.h | 1 - libtransport/src/core/portal.h | 2 +- 3 files changed, 8 insertions(+), 11 deletions(-) (limited to 'libtransport/src') diff --git a/libtransport/src/core/interest.cc b/libtransport/src/core/interest.cc index 10e1a6dfa..6348a8d3e 100644 --- a/libtransport/src/core/interest.cc +++ b/libtransport/src/core/interest.cc @@ -76,14 +76,13 @@ Interest &Interest::operator=(const Interest &other) { return (Interest &)Packet::operator=(other); } -Interest::~Interest() {} +Interest::~Interest() = default; const Name &Interest::getName() const { - if (!name_) { - if (hicn_interest_get_name( - &pkbuf_, (hicn_name_t *)&name_.getConstStructReference()) < 0) { - throw errors::MalformedPacketException(); - } + if (!name_ && + hicn_interest_get_name( + &pkbuf_, (hicn_name_t *)&name_.getConstStructReference()) < 0) { + throw errors::MalformedPacketException(); } return name_; @@ -149,7 +148,7 @@ void Interest::resetForHash() { } } -bool Interest::hasManifest() { +bool Interest::hasManifest() const { return (getPayloadType() == PayloadType::MANIFEST); } @@ -174,8 +173,7 @@ void Interest::encodeSuffixes() { memset(int_manifest_header->request_bitmap, 0xFFFFFFFF, BITMAP_SIZE * sizeof(hicn_uword)); - uint32_t *suffix = (uint32_t *)(int_manifest_header + 1); - for (auto it = suffix_set_.begin(); it != suffix_set_.end(); it++, suffix++) { + for (auto it = suffix_set_.begin(); it != suffix_set_.end(); it++) { interest_manifest_add_suffix(int_manifest_header, *it); } diff --git a/libtransport/src/core/local_connector.h b/libtransport/src/core/local_connector.h index 963f455e6..bf64b71d6 100644 --- a/libtransport/src/core/local_connector.h +++ b/libtransport/src/core/local_connector.h @@ -20,7 +20,6 @@ #include #include #include -#include #include #include diff --git a/libtransport/src/core/portal.h b/libtransport/src/core/portal.h index 7a6ab9d0e..c4ba096b9 100644 --- a/libtransport/src/core/portal.h +++ b/libtransport/src/core/portal.h @@ -56,7 +56,7 @@ class HandlerMemory { HandlerMemory(const HandlerMemory &) = delete; HandlerMemory &operator=(const HandlerMemory &) = delete; - void *allocate(std::size_t size) { + void *allocate(std::size_t /* size */) { return utils::FixedBlockAllocator<128, 8192>::getInstance().allocateBlock(); } -- cgit 1.2.3-korg