From 8843f95926e1cb5b43a3915b761fa16d1b5635a0 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Sat, 13 Aug 2016 09:41:46 +0200 Subject: [PATCH] cleanups to please sonar, and add a FIXME for a bug we have --- examples/s4u/launching/s4u_launching.cpp | 14 ++++++++++---- src/surf/sg_platf.cpp | 1 - 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/examples/s4u/launching/s4u_launching.cpp b/examples/s4u/launching/s4u_launching.cpp index 39f8d14538..6338f89863 100644 --- a/examples/s4u/launching/s4u_launching.cpp +++ b/examples/s4u/launching/s4u_launching.cpp @@ -36,10 +36,10 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_launching_test, "The logging channel used in th class Sender { public: std::string msg = "GaBuZoMeu"; - Sender() { + explicit Sender() { /* Constructor used when no parameter is passed to the actor */ }; - Sender(std::vector args) { + explicit Sender(std::vector args) { /* This constructor is used when we pass parameters to the actor */ if (args.size() > 0) msg = args[0]; @@ -63,10 +63,16 @@ class Receiver { public: simgrid::s4u::MailboxPtr mailbox = simgrid::s4u::Mailbox::byName("thingy"); - Receiver() {}; - Receiver(std::vector args) { + explicit Receiver() = default; + explicit Receiver(std::vector args) { /* This constructor is used when we pass parameters to the actor */ /* as with argc/argv, args[0] is the actor's name, so the first parameter is args[1] */ + + /* FIXME: this is a bug as this does not happen when starting the process directly + * We should fix it by not adding the process name as argv[0] from the deployment file, + * which is useless anyway since it's always the function name in this setting. + * But this will break MSG... + */ if (args.size() > 1) mailbox = simgrid::s4u::Mailbox::byName(args[1]); } diff --git a/src/surf/sg_platf.cpp b/src/surf/sg_platf.cpp index 9e3d11b939..7c8b90e828 100644 --- a/src/surf/sg_platf.cpp +++ b/src/surf/sg_platf.cpp @@ -307,7 +307,6 @@ void sg_platf_new_cluster(sg_platf_cluster_cbarg_t cluster) host.core_amount = cluster->core_amount; host.coord = ""; sg_platf_new_host(&host); - // delete host.speed_per_pstate; XBT_DEBUG(""); XBT_DEBUG("", link_id, cluster->bw, cluster->lat); -- 2.20.1