summaryrefslogtreecommitdiffstats
path: root/libtransport/src
diff options
context:
space:
mode:
authorMauro Sardara <msardara@cisco.com>2022-09-02 14:34:36 +0000
committerMauro Sardara <msardara@cisco.com>2022-09-02 14:42:53 +0000
commitcb6f5724b85e51295498a39144ed4ccce114ad53 (patch)
tree090b6753d305fd7bc25b84879b63581bbec3b38c /libtransport/src
parent00a6f92b97a0456259163ade2085defdebeb3f84 (diff)
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 <msardara@cisco.com>
Diffstat (limited to 'libtransport/src')
-rw-r--r--libtransport/src/core/interest.cc16
-rw-r--r--libtransport/src/core/local_connector.h1
-rw-r--r--libtransport/src/core/portal.h2
3 files changed, 8 insertions, 11 deletions
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 <hicn/transport/core/connector.h>
#include <hicn/transport/core/global_object_pool.h>
#include <hicn/transport/errors/not_implemented_exception.h>
-#include <hicn/transport/utils/move_wrapper.h>
#include <hicn/transport/utils/shared_ptr_utils.h>
#include <io_modules/forwarder/errors.h>
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();
}