Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Sonar smells.
[simgrid.git] / teshsuite / s4u / concurrent_rw / concurrent_rw.cpp
index 7a6975643d8b9221a88737edad04e486432112c4..ba81b74f38e5ff267fc0c37c12a2f62189b56756 100644 (file)
@@ -10,20 +10,20 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_test, "Messages specific for this s4u test");
 static void host()
 {
   simgrid::s4u::Disk* disk = simgrid::s4u::this_actor::get_host()->get_disks().front(); // Disk1
-  int id                   = static_cast<int>(simgrid::s4u::this_actor::get_pid());
-  XBT_INFO("process %d is writing!", id);
+  aid_t id                 = simgrid::s4u::this_actor::get_pid();
+  XBT_INFO("process %ld is writing!", id);
   disk->write(4000000);
-  XBT_INFO("process %d goes to sleep for %d seconds", id, id);
-  simgrid::s4u::this_actor::sleep_for(id);
-  XBT_INFO("process %d is writing again!", id);
+  XBT_INFO("process %ld goes to sleep for %ld seconds", id, id);
+  simgrid::s4u::this_actor::sleep_for(static_cast<double>(id));
+  XBT_INFO("process %ld is writing again!", id);
   disk->write(4000000);
-  XBT_INFO("process %d goes to sleep for %d seconds", id, 6 - id);
-  simgrid::s4u::this_actor::sleep_for(6 - id);
-  XBT_INFO("process %d is reading!", id);
+  XBT_INFO("process %ld goes to sleep for %ld seconds", id, 6 - id);
+  simgrid::s4u::this_actor::sleep_for(static_cast<double>(6 - id));
+  XBT_INFO("process %ld is reading!", id);
   disk->read(4000000);
-  XBT_INFO("process %d goes to sleep for %d seconds", id, id);
-  simgrid::s4u::this_actor::sleep_for(id);
-  XBT_INFO("process %d is reading again!", id);
+  XBT_INFO("process %ld goes to sleep for %ld seconds", id, id);
+  simgrid::s4u::this_actor::sleep_for(static_cast<double>(id));
+  XBT_INFO("process %ld is reading again!", id);
   disk->read(4000000);
 }