Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Remove usage of bad style "using namespace" with little benefit.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Mon, 25 Jun 2018 20:18:09 +0000 (22:18 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Mon, 25 Jun 2018 20:28:30 +0000 (22:28 +0200)
teshsuite/s4u/comm-pt2pt/comm-pt2pt.cpp
teshsuite/surf/maxmin_bench/maxmin_bench.cpp

index 648e9a2..76b4fef 100644 (file)
@@ -16,8 +16,6 @@
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_test, "Messages specific for this s4u example");
 
 
 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 <send_spec> <recv_spec>\n"
 static void usage(const char* binaryName, const char* defaultSend, const char* defaultRecv)
 {
   std::fprintf(stderr, "Usage: %s examples/platforms/cluster.xml <send_spec> <recv_spec>\n"
@@ -49,7 +47,7 @@ static void sender(std::vector<std::string> args)
 {
   XBT_INFO("Sender spec: %s", args[0].c_str());
   for (unsigned int test = 1; test <= args[0].size(); test++) {
 {
   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());
 
     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<std::string> args)
 {
   XBT_INFO("Receiver spec: %s", args[0].c_str());
   for (unsigned int test = 1; test <= args[0].size(); test++) {
 {
   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;
     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<std::string> args)
         break;
       case 'p':
         XBT_INFO("Test %u: p (regular receive on permanent mailbox)", test);
         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);
         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);
         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->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:
         mbox->get_async(&received)->wait();
         break;
       default:
index 5175990..da990b1 100644 (file)
@@ -17,8 +17,6 @@
 #include <cstdio>
 #include <cstdlib>
 
 #include <cstdio>
 #include <cstdlib>
 
-using namespace simgrid::kernel;
-
 double date;
 int64_t seedx = 0;
 
 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)
 {
 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 */
   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));
 
   for (int i = 0; i < nb_cnst; i++) {
     cnst[i] = Sys->constraint_new(NULL, float_random(10.0));