Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Sonar smells
authorBruno Donassolo <bruno.donassolo@inria.fr>
Tue, 5 Apr 2022 09:16:16 +0000 (11:16 +0200)
committerBruno Donassolo <bruno.donassolo@inria.fr>
Fri, 8 Apr 2022 15:20:10 +0000 (17:20 +0200)
include/simgrid/kernel/routing/NetZoneImpl.hpp
src/kernel/resource/StandardLinkImpl.cpp
src/kernel/resource/StandardLinkImpl.hpp
src/kernel/routing/NetZoneImpl.cpp
src/s4u/s4u_Engine.cpp

index 97563da..72a09c6 100644 (file)
@@ -81,7 +81,7 @@ class XBT_PUBLIC NetZoneImpl : public xbt::PropertyHolder {
   // this hpp is exported to the users and so cannot include the other internal hpp.
   class LinkDeleter {
   public:
-    void operator()(resource::StandardLinkImpl* link);
+    void operator()(resource::StandardLinkImpl* link) const;
   };
   std::map<std::string, std::unique_ptr<resource::StandardLinkImpl, LinkDeleter>, std::less<>> links_;
   /* save split-duplex links separately, keep links_ with only LinkImpl* seen by the user
index cf3dfbb..92e4291 100644 (file)
@@ -27,7 +27,7 @@ StandardLinkImpl::StandardLinkImpl(const std::string& name) : LinkImpl(name), pi
   XBT_DEBUG("Create link '%s'", name.c_str());
 }
 
-void StandardLinkImpl::Deleter::operator()(resource::StandardLinkImpl* link)
+void StandardLinkImpl::Deleter::operator()(resource::StandardLinkImpl* link) const
 {
   link->destroy();
 }
index 818df95..1b06a36 100644 (file)
@@ -36,7 +36,7 @@ public:
   void destroy(); // Must be called instead of the destructor
   class Deleter {
   public:
-    void operator()(StandardLinkImpl* link);
+    void operator()(StandardLinkImpl* link) const;
   };
 
   void latency_check(double latency) const;
index 917f96b..a63f8a4 100644 (file)
@@ -71,7 +71,7 @@ xbt::signal<void(bool symmetrical, kernel::routing::NetPoint* src, kernel::routi
                  std::vector<kernel::resource::StandardLinkImpl*> const& link_list)>
     NetZoneImpl::on_route_creation;
 
-void NetZoneImpl::LinkDeleter::operator()(resource::StandardLinkImpl* link)
+void NetZoneImpl::LinkDeleter::operator()(resource::StandardLinkImpl* link) const
 {
   link->destroy();
 }
@@ -160,7 +160,7 @@ std::vector<s4u::Link*> NetZoneImpl::get_filtered_links(const std::function<bool
 
 std::vector<s4u::Link*> NetZoneImpl::get_all_links() const
 {
-  return get_filtered_links([](s4u::Link*) { return true; });
+  return get_filtered_links([](const s4u::Link*) { return true; });
 }
 
 size_t NetZoneImpl::get_link_count() const
index 7b529b4..c5a656a 100644 (file)
@@ -298,7 +298,7 @@ size_t Engine::get_link_count() const
 /** @brief Returns the list of all links found in the platform */
 std::vector<Link*> Engine::get_all_links() const
 {
-  return get_filtered_links([](Link*) { return true; });
+  return get_filtered_links([](const Link*) { return true; });
 }
 
 std::vector<Link*> Engine::get_filtered_links(const std::function<bool(Link*)>& filter) const