Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[sonar] Replace redundant type with "auto" (examples/).
[simgrid.git] / examples / s4u / network-ns3 / s4u-network-ns3.cpp
index 107c85e..3c150a4 100644 (file)
@@ -7,7 +7,7 @@
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_test, "Messages specific for this s4u example");
 
-int timer_start; // set as 1 in the master process
+int timer_start; // set as 1 in the master actor
 
 #define NTASKS 1500
 double start_time;
@@ -22,8 +22,8 @@ static void master(int argc, char* argv[])
   XBT_DEBUG("Master started");
 
   /* data size */
-  double task_comm_size = std::stod(argv[1]);
-  int id                = std::stoi(argv[3]); // unique id to control statistics
+  double msg_size = std::stod(argv[1]);
+  int id          = std::stoi(argv[3]); // unique id to control statistics
 
   /* worker name */
   workernames[id] = xbt_strdup(argv[2]);
@@ -33,14 +33,14 @@ static void master(int argc, char* argv[])
   masternames[id] = simgrid::s4u::Host::current()->get_cname();
 
   double* payload = new double();
-  *payload        = task_comm_size;
+  *payload        = msg_size;
 
   count_finished++;
   timer_start = 1;
 
   /* time measurement */
   start_time = simgrid::s4u::Engine::get_clock();
-  mbox->put(payload, task_comm_size);
+  mbox->put(payload, msg_size);
 
   XBT_DEBUG("Finished");
 }
@@ -73,7 +73,7 @@ static void worker(int argc, char* argv[])
 
   XBT_DEBUG("Worker started");
 
-  const double* payload = static_cast<double*>(mbox->get());
+  const auto* payload = static_cast<double*>(mbox->get());
 
   count_finished--;
   if (count_finished == 0) {