From b3a19f2cc0136088a395b37f4a9cfd9578815f06 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Mon, 21 Nov 2022 15:36:37 +0100 Subject: [PATCH] Address misc Sonar issues. --- src/kernel/actor/ActorImpl.cpp | 4 ++-- src/kernel/actor/ActorImpl.hpp | 2 +- src/kernel/resource/WifiLinkImpl.hpp | 2 +- src/mc/ModelChecker.hpp | 5 ----- src/mc/remote/AppSide.cpp | 2 +- 5 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/kernel/actor/ActorImpl.cpp b/src/kernel/actor/ActorImpl.cpp index be71dd3dee..b1cb37bf05 100644 --- a/src/kernel/actor/ActorImpl.cpp +++ b/src/kernel/actor/ActorImpl.cpp @@ -34,8 +34,8 @@ ActorImpl* ActorImpl::self() return (self_context != nullptr) ? self_context->get_actor() : nullptr; } -ActorImpl::ActorImpl(std::string name, s4u::Host* host, aid_t ppid) - : ActorIDTrait(std::move(name), ppid), host_(host), piface_(this) +ActorImpl::ActorImpl(const std::string& name, s4u::Host* host, aid_t ppid) + : ActorIDTrait(name, ppid), host_(host), piface_(this) { simcall_.issuer_ = this; stacksize_ = context::stack_size; diff --git a/src/kernel/actor/ActorImpl.hpp b/src/kernel/actor/ActorImpl.hpp index 044bbf5cd0..8efbc18994 100644 --- a/src/kernel/actor/ActorImpl.hpp +++ b/src/kernel/actor/ActorImpl.hpp @@ -67,7 +67,7 @@ class XBT_PUBLIC ActorImpl : public xbt::PropertyHolder, public ActorIDTrait, pu friend activity::MailboxImpl; public: - ActorImpl(std::string name, s4u::Host* host, aid_t ppid); + ActorImpl(const std::string& name, s4u::Host* host, aid_t ppid); ActorImpl(const ActorImpl&) = delete; ActorImpl& operator=(const ActorImpl&) = delete; ~ActorImpl(); diff --git a/src/kernel/resource/WifiLinkImpl.hpp b/src/kernel/resource/WifiLinkImpl.hpp index 3036606243..ad08b6c3ed 100644 --- a/src/kernel/resource/WifiLinkImpl.hpp +++ b/src/kernel/resource/WifiLinkImpl.hpp @@ -19,7 +19,7 @@ class XBT_PRIVATE WifiLinkAction; class WifiLinkImpl : public StandardLinkImpl { /** @brief Hold every rates association between host and links (host name, rates id) */ - std::map host_rates_; + std::map> host_rates_; /** @brief A link can have several bandwidths attached to it (mostly use by wifi model) */ std::vector bandwidths_; diff --git a/src/mc/ModelChecker.hpp b/src/mc/ModelChecker.hpp index 504f6826cf..ef560dddf5 100644 --- a/src/mc/ModelChecker.hpp +++ b/src/mc/ModelChecker.hpp @@ -12,7 +12,6 @@ #include "xbt/base.h" #include -#include namespace simgrid::mc { @@ -20,8 +19,6 @@ namespace simgrid::mc { */ class ModelChecker { CheckerSide checker_side_; - /** String pool for host names */ - std::set> hostnames_; // This is the parent snapshot of the current state: PageStore page_store_{500}; std::unique_ptr remote_process_; @@ -40,8 +37,6 @@ public: Channel& channel() { return checker_side_.get_channel(); } PageStore& page_store() { return page_store_; } - std::string const& get_host_name(const char* hostname) { return *this->hostnames_.insert(hostname).first; } - void start(); void shutdown(); void resume(); diff --git a/src/mc/remote/AppSide.cpp b/src/mc/remote/AppSide.cpp index 56de882c90..fe481ca3d8 100644 --- a/src/mc/remote/AppSide.cpp +++ b/src/mc/remote/AppSide.cpp @@ -85,7 +85,7 @@ AppSide* AppSide::initialize() void AppSide::handle_deadlock_check(const s_mc_message_t*) const { - auto* engine = kernel::EngineImpl::get_instance(); + const auto* engine = kernel::EngineImpl::get_instance(); const auto& actor_list = engine->get_actor_list(); bool deadlock = not actor_list.empty() && std::none_of(begin(actor_list), end(actor_list), [](const auto& kv) { return mc::actor_is_enabled(kv.second); -- 2.20.1