]> AND Public Git Repository - simgrid.git/blobdiff - examples/s4u/comm-wait/s4u-comm-wait.cpp
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Keep the right definition for type_names[].
[simgrid.git] / examples / s4u / comm-wait / s4u-comm-wait.cpp
index 4e7ee1a45dec7c1093a66699e00d2bed6a11e173..b2e531401168e4423e6f05005616f30ccb388cbd 100644 (file)
@@ -22,7 +22,7 @@ static void sender(int argc, char** argv)
 {
   xbt_assert(argc == 3, "Expecting 2 parameters from the XML deployment file but got %d", argc);
   long messages_count     = std::stol(argv[1]); /* - number of messages */
-  double msg_size         = std::stod(argv[2]); /* - message size in bytes */
+  long msg_size           = std::stol(argv[2]); /* - message size in bytes */
   double sleep_start_time = 5.0;
   double sleep_test_time  = 0;
 
@@ -35,7 +35,7 @@ static void sender(int argc, char** argv)
     std::string msg_content = std::string("Message ") + std::to_string(i);
     // Copy the data we send: the 'msg_content' variable is not a stable storage location.
     // It will be destroyed when this actor leaves the loop, ie before the receiver gets the data
-    std::string* payload = new std::string(msg_content);
+    auto* payload = new std::string(msg_content);
 
     /* Create a communication representing the ongoing communication and then */
     simgrid::s4u::CommPtr comm = mbox->put_async(payload, msg_size);
@@ -79,7 +79,7 @@ static void receiver(int, char**)
       comm->wait();
     }
 
-    const std::string* received = static_cast<std::string*>(payload);
+    const auto* received = static_cast<std::string*>(payload);
     XBT_INFO("I got a '%s'.", received->c_str());
     if (*received == "finalize")
       cont = false; // If it's a finalize message, we're done.