From d9e2e47685ba4a3463645fa0016030879976d8ef Mon Sep 17 00:00:00 2001 From: Konstantin Akimov Date: Tue, 11 Jun 2024 21:01:49 +0700 Subject: [PATCH 1/4] fix: add a missing file util/wpipe to linter lists --- test/util/data/non-backported.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/util/data/non-backported.txt b/test/util/data/non-backported.txt index 9d5eff8477..150bbb70c1 100644 --- a/test/util/data/non-backported.txt +++ b/test/util/data/non-backported.txt @@ -37,5 +37,11 @@ src/test/dynamic_activation*.cpp src/test/evo*.cpp src/test/governance*.cpp src/unordered_lru_cache.h +src/util/edge.* +src/util/enumerate.h +src/util/irange.h +src/util/ranges.h +src/util/ranges_set.* +src/util/wpipe.* src/wallet/bip39* src/wallet/hdchain.* From 9d941aacb9b4c608f7aad29604be24e92ddc48d2 Mon Sep 17 00:00:00 2001 From: Konstantin Akimov Date: Wed, 12 Jun 2024 15:42:44 +0700 Subject: [PATCH 2/4] fix: removed unused assigned --- src/util/ranges_set.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/ranges_set.cpp b/src/util/ranges_set.cpp index 615f977e99..f4ff5a2ca5 100644 --- a/src/util/ranges_set.cpp +++ b/src/util/ranges_set.cpp @@ -37,7 +37,7 @@ bool CRangesSet::Add(uint64_t value) if (next != ranges.end()) { if (next->begin == value + 1) { new_range.end = next->end; - it = ranges.erase(next); + ranges.erase(next); } } const auto ret = ranges.insert(new_range); From b799683d6058ef02231f563544ff7fcc9864aef8 Mon Sep 17 00:00:00 2001 From: Konstantin Akimov Date: Wed, 12 Jun 2024 22:17:35 +0700 Subject: [PATCH 3/4] fix: pass reference instead copy of argument in util/edge --- src/util/edge.cpp | 4 ++-- src/util/edge.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/util/edge.cpp b/src/util/edge.cpp index bb7f867127..924c0cb30f 100644 --- a/src/util/edge.cpp +++ b/src/util/edge.cpp @@ -62,7 +62,7 @@ EdgeTriggeredEvents::~EdgeTriggeredEvents() } } -bool EdgeTriggeredEvents::RegisterEntity(int entity, std::string entity_name) const +bool EdgeTriggeredEvents::RegisterEntity(int entity, const std::string& entity_name) const { assert(m_valid); @@ -97,7 +97,7 @@ bool EdgeTriggeredEvents::RegisterEntity(int entity, std::string entity_name) co return true; } -bool EdgeTriggeredEvents::UnregisterEntity(int entity, std::string entity_name) const +bool EdgeTriggeredEvents::UnregisterEntity(int entity, const std::string& entity_name) const { assert(m_valid); diff --git a/src/util/edge.h b/src/util/edge.h index b605cf817c..d1de2f7ba6 100644 --- a/src/util/edge.h +++ b/src/util/edge.h @@ -44,8 +44,8 @@ private: bool UnregisterPipe(int wakeup_pipe); private: - bool RegisterEntity(int entity, std::string entity_name) const; - bool UnregisterEntity(int entity, std::string entity_name) const; + bool RegisterEntity(int entity, const std::string& entity_name) const; + bool UnregisterEntity(int entity, const std::string& entity_name) const; private: /* Flag set if pipe has been registered with instance */ From fbffe06dad6f3dd1e257950f6f304d4a5de414cf Mon Sep 17 00:00:00 2001 From: Konstantin Akimov Date: Wed, 12 Jun 2024 22:17:56 +0700 Subject: [PATCH 4/4] fix: suppress lint warnings for edge due to both missing epoll and kpoll --- test/lint/lint-cppcheck-dash.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/lint/lint-cppcheck-dash.sh b/test/lint/lint-cppcheck-dash.sh index dd88255961..04bcdde741 100755 --- a/test/lint/lint-cppcheck-dash.sh +++ b/test/lint/lint-cppcheck-dash.sh @@ -85,7 +85,7 @@ then mkdir $CPPCHECK_DIR fi WARNINGS=$(echo "${FILES}" | \ - xargs cppcheck --enable=all --inline-suppr --suppress=missingIncludeSystem --cppcheck-build-dir=$CPPCHECK_DIR -j "$(getconf _NPROCESSORS_ONLN)" --language=c++ --std=c++17 --template=gcc -D__cplusplus -DENABLE_WALLET -DCLIENT_VERSION_BUILD -DCLIENT_VERSION_IS_RELEASE -DCLIENT_VERSION_MAJOR -DCLIENT_VERSION_MINOR -DCOPYRIGHT_YEAR -DDEBUG -DCHAR_BIT=8 -I src/ -q 2>&1 | sort -u | \ + xargs cppcheck --enable=all --inline-suppr --suppress=missingIncludeSystem --cppcheck-build-dir=$CPPCHECK_DIR -j "$(getconf _NPROCESSORS_ONLN)" --language=c++ --std=c++17 --template=gcc -D__cplusplus -DENABLE_WALLET -DCLIENT_VERSION_BUILD -DCLIENT_VERSION_IS_RELEASE -DCLIENT_VERSION_MAJOR -DCLIENT_VERSION_MINOR -DCOPYRIGHT_YEAR -DDEBUG -DUSE_EPOLL -DCHAR_BIT=8 -I src/ -q 2>&1 | sort -u | \ grep -E "${ENABLED_CHECKS_REGEXP}" | \ grep -vE "${IGNORED_WARNINGS_REGEXP}" | \ grep -E "${FILES_REGEXP}")