From: Arnaud Giersch Date: Mon, 25 Jun 2018 20:18:09 +0000 (+0200) Subject: Remove usage of bad style "using namespace" with little benefit. X-Git-Tag: v3_21~630 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/2e149fac829260cc112102594c7271ffaab32134?ds=sidebyside Remove usage of bad style "using namespace" with little benefit. --- diff --git a/teshsuite/s4u/comm-pt2pt/comm-pt2pt.cpp b/teshsuite/s4u/comm-pt2pt/comm-pt2pt.cpp index 648e9a27ed..76b4fefa5c 100644 --- a/teshsuite/s4u/comm-pt2pt/comm-pt2pt.cpp +++ b/teshsuite/s4u/comm-pt2pt/comm-pt2pt.cpp @@ -16,8 +16,6 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_test, "Messages specific for this s4u example"); -using namespace simgrid::s4u; - static void usage(const char* binaryName, const char* defaultSend, const char* defaultRecv) { std::fprintf(stderr, "Usage: %s examples/platforms/cluster.xml \n" @@ -49,7 +47,7 @@ static void sender(std::vector args) { XBT_INFO("Sender spec: %s", args[0].c_str()); for (unsigned int test = 1; test <= args[0].size(); test++) { - this_actor::sleep_until(test * 5 - 5); + simgrid::s4u::this_actor::sleep_until(test * 5 - 5); std::string* mboxName = new std::string("Test #" + std::to_string(test)); simgrid::s4u::MailboxPtr mbox = simgrid::s4u::Mailbox::by_name(mboxName->c_str()); @@ -96,7 +94,7 @@ static void receiver(std::vector args) { XBT_INFO("Receiver spec: %s", args[0].c_str()); for (unsigned int test = 1; test <= args[0].size(); test++) { - this_actor::sleep_until(test * 5 - 5); + simgrid::s4u::this_actor::sleep_until(test * 5 - 5); std::string mboxName = "Test #" + std::to_string(test); simgrid::s4u::MailboxPtr mbox = simgrid::s4u::Mailbox::by_name(mboxName.c_str()); void* received = nullptr; @@ -123,24 +121,24 @@ static void receiver(std::vector args) break; case 'p': XBT_INFO("Test %u: p (regular receive on permanent mailbox)", test); - mbox->set_receiver(Actor::self()); + mbox->set_receiver(simgrid::s4u::Actor::self()); received = mbox->get(); break; case 'P': XBT_INFO("Test %u: P (sleep + regular receive on permanent mailbox)", test); simgrid::s4u::this_actor::sleep_for(0.5); - mbox->set_receiver(Actor::self()); + mbox->set_receiver(simgrid::s4u::Actor::self()); received = mbox->get(); break; case 'j': XBT_INFO("Test %u: j (irecv on permanent mailbox)", test); - mbox->set_receiver(Actor::self()); + mbox->set_receiver(simgrid::s4u::Actor::self()); mbox->get_async(&received)->wait(); break; case 'J': XBT_INFO("Test %u: J (sleep + irecv on permanent mailbox)", test); simgrid::s4u::this_actor::sleep_for(0.5); - mbox->set_receiver(Actor::self()); + mbox->set_receiver(simgrid::s4u::Actor::self()); mbox->get_async(&received)->wait(); break; default: diff --git a/teshsuite/surf/maxmin_bench/maxmin_bench.cpp b/teshsuite/surf/maxmin_bench/maxmin_bench.cpp index 51759905fd..da990b1cf8 100644 --- a/teshsuite/surf/maxmin_bench/maxmin_bench.cpp +++ b/teshsuite/surf/maxmin_bench/maxmin_bench.cpp @@ -17,8 +17,6 @@ #include #include -using namespace simgrid::kernel; - double date; int64_t seedx = 0; @@ -40,12 +38,12 @@ static unsigned int int_random(int max) static void test(int nb_cnst, int nb_var, int nb_elem, unsigned int pw_base_limit, unsigned int pw_max_limit, float rate_no_limit, int max_share, int mode) { - lmm::Constraint* cnst[nb_cnst]; - lmm::Variable* var[nb_var]; + simgrid::kernel::lmm::Constraint* cnst[nb_cnst]; + simgrid::kernel::lmm::Variable* var[nb_var]; int used[nb_cnst]; /* We cannot activate the selective update as we pass nullptr as an Action when creating the variables */ - lmm::System* Sys = new lmm::System(false); + simgrid::kernel::lmm::System* Sys = new simgrid::kernel::lmm::System(false); for (int i = 0; i < nb_cnst; i++) { cnst[i] = Sys->constraint_new(NULL, float_random(10.0));