From a2428d214e4043d8a986aab424abf693a768b918 Mon Sep 17 00:00:00 2001 From: SUTER Frederic Date: Fri, 7 Jan 2022 18:37:35 +0100 Subject: [PATCH] [sonar] bunch of smells --- include/simgrid/s4u/Activity.hpp | 2 +- include/simgrid/s4u/Actor.hpp | 2 +- include/simgrid/s4u/Link.hpp | 2 +- include/simgrid/s4u/NetZone.hpp | 2 +- src/s4u/s4u_Netzone.cpp | 2 +- src/surf/sg_platf.cpp | 1 - 6 files changed, 5 insertions(+), 6 deletions(-) diff --git a/include/simgrid/s4u/Activity.hpp b/include/simgrid/s4u/Activity.hpp index 8a9e2398cf..6c9f9d7762 100644 --- a/include/simgrid/s4u/Activity.hpp +++ b/include/simgrid/s4u/Activity.hpp @@ -104,7 +104,7 @@ public: * resource assigned) */ static void on_veto_cb(const std::function& cb) { on_veto.connect(cb); } /*! Add a callback fired when theactivity completes (either normally, cancelled or failed) */ - static void on_completion_cb(const std::function cb) { on_completion.connect(cb); } + static void on_completion_cb(const std::function& cb) { on_completion.connect(cb); } void vetoable_start() { diff --git a/include/simgrid/s4u/Actor.hpp b/include/simgrid/s4u/Actor.hpp index 9d7e994d98..901695cc9c 100644 --- a/include/simgrid/s4u/Actor.hpp +++ b/include/simgrid/s4u/Actor.hpp @@ -83,7 +83,7 @@ public: /** Add a callback fired when a new actor has been created **/ static void on_creation_cb(const std::function& cb) { on_creation.connect(cb); } /** Add a callback fired when an actor has been suspended**/ - static void on_suspend_cb(const std::function cb) { on_suspend.connect(cb); } + static void on_suspend_cb(const std::function& cb) { on_suspend.connect(cb); } /** Add a callback fired when an actor has been resumed **/ static void on_resume_cb(const std::function& cb) { on_resume.connect(cb); } /** Add a callback fired when an actor starts sleeping **/ diff --git a/include/simgrid/s4u/Link.hpp b/include/simgrid/s4u/Link.hpp index 3c5a953a46..5939fe35e9 100644 --- a/include/simgrid/s4u/Link.hpp +++ b/include/simgrid/s4u/Link.hpp @@ -165,7 +165,7 @@ public: on_communication_state_change.connect(cb); } /** @brief Add a callback fired when a Link is destroyed */ - static void on_destruction_cb(std::function cb) { on_destruction.connect(cb); } + static void on_destruction_cb(const std::function& cb) { on_destruction.connect(cb); } }; /** diff --git a/include/simgrid/s4u/NetZone.hpp b/include/simgrid/s4u/NetZone.hpp index ebfb662796..e15952f304 100644 --- a/include/simgrid/s4u/NetZone.hpp +++ b/include/simgrid/s4u/NetZone.hpp @@ -99,7 +99,7 @@ public: "Please use add_bypass_route() method which uses s4u::LinkInRoute instead of " "LinkImpl") void add_bypass_route(kernel::routing::NetPoint* src, kernel::routing::NetPoint* dst, kernel::routing::NetPoint* gw_src, kernel::routing::NetPoint* gw_dst, - std::vector& link_list, + const std::vector& link_list, bool /*symmetrical*/); #endif diff --git a/src/s4u/s4u_Netzone.cpp b/src/s4u/s4u_Netzone.cpp index acb615e25f..415f8a94cf 100644 --- a/src/s4u/s4u_Netzone.cpp +++ b/src/s4u/s4u_Netzone.cpp @@ -131,7 +131,7 @@ void NetZone::add_route(kernel::routing::NetPoint* src, kernel::routing::NetPoin // XBT_ATTRIB_DEPRECATED_v332 void NetZone::add_bypass_route(kernel::routing::NetPoint* src, kernel::routing::NetPoint* dst, kernel::routing::NetPoint* gw_src, kernel::routing::NetPoint* gw_dst, - std::vector& link_list, bool /*symmetrical*/) + const std::vector& link_list, bool /*symmetrical*/) { pimpl_->add_bypass_route(src, dst, gw_src, gw_dst, convert_to_linkInRoute(link_list)); } diff --git a/src/surf/sg_platf.cpp b/src/surf/sg_platf.cpp index b160972203..251c3ce2df 100644 --- a/src/surf/sg_platf.cpp +++ b/src/surf/sg_platf.cpp @@ -56,7 +56,6 @@ void sg_platf_init() void sg_platf_exit() { simgrid::kernel::routing::on_cluster_creation.disconnect_slots(); - // simgrid::s4u::Engine::on_platform_created.disconnect_slots(); surf_parse_lex_destroy(); } -- 2.20.1