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

Public GIT Repository
Extract assignment from expression.
[simgrid.git] / teshsuite / s4u / storage_client_server / storage_client_server.cpp
index 8c1f927bfc4d96df5f03a748ece8acff55ea7b21..86821976260d0de254476e5f05f27e28a89a43e3 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013-2021. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2013-2022. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -74,10 +74,10 @@ static void get_set_disk_data(simgrid::s4u::Disk* disk)
 {
   XBT_INFO("*** GET/SET DATA for disk: %s ***", disk->get_cname());
 
-  const std::string* data = static_cast<std::string*>(disk->get_data());
+  const std::string* data = disk->get_data<std::string>();
   XBT_INFO("Get data: '%s'", data ? data->c_str() : "No User Data");
   disk->set_data(new std::string("Some data"));
-  data = static_cast<std::string*>(disk->get_data());
+  data = disk->get_data<std::string>();
   XBT_INFO("  Set and get data: '%s'", data->c_str());
   delete data;
 }
@@ -154,6 +154,6 @@ int main(int argc, char* argv[])
 
   e.run();
 
-  XBT_INFO("Simulated time: %g", e.get_clock());
+  XBT_INFO("Simulated time: %g", simgrid::s4u::Engine::get_clock());
   return 0;
 }