Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Update copyright lines with new year.
[simgrid.git] / teshsuite / s4u / storage_client_server / storage_client_server.cpp
index 4803505..2cc23e4 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013-2019. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2013-2020. 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. */
@@ -11,7 +11,7 @@
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(storage, "Messages specific for this simulation");
 
-static void display_disk_properties(simgrid::s4u::Disk* disk)
+static void display_disk_properties(const simgrid::s4u::Disk* disk)
 {
   const std::unordered_map<std::string, std::string>* props = disk->get_properties();
   if (not props->empty()) {
@@ -57,11 +57,11 @@ static void hsm_put(const std::string& remote_host, const std::string& src, cons
   simgrid::s4u::this_actor::sleep_for(.4);
 }
 
-static void display_disk_content(simgrid::s4u::Disk* disk)
+static void display_disk_content(const simgrid::s4u::Disk* disk)
 {
   XBT_INFO("*** Dump a disk ***");
   XBT_INFO("Print the content of the disk: %s", disk->get_cname());
-  std::map<std::string, sg_size_t>* content = disk->extension<simgrid::s4u::FileSystemDiskExt>()->get_content();
+  const std::map<std::string, sg_size_t>* content = disk->extension<simgrid::s4u::FileSystemDiskExt>()->get_content();
   if (not content->empty()) {
     for (auto const& entry : *content)
       XBT_INFO("  %s size: %llu bytes", entry.first.c_str(), entry.second);
@@ -74,7 +74,7 @@ static void get_set_disk_data(simgrid::s4u::Disk* disk)
 {
   XBT_INFO("*** GET/SET DATA for disk: %s ***", disk->get_cname());
 
-  std::string* data = static_cast<std::string*>(disk->get_data());
+  const std::string* data = static_cast<std::string*>(disk->get_data());
   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());
@@ -84,7 +84,6 @@ static void get_set_disk_data(simgrid::s4u::Disk* disk)
 
 static void dump_platform_disks()
 {
-
   for (auto const& h : simgrid::s4u::Engine::get_instance()->get_all_hosts())
     for (auto const& d : h->get_disks()) {
       if (h == d->get_host())
@@ -93,7 +92,7 @@ static void dump_platform_disks()
     }
 }
 
-static void disk_info(simgrid::s4u::Host* host)
+static void disk_info(const simgrid::s4u::Host* host)
 {
   XBT_INFO("*** Disk info on %s ***", host->get_cname());
 
@@ -128,7 +127,7 @@ static void server()
 
   XBT_INFO("Server waiting for transfers ...");
   while (1) {
-    std::string* msg = static_cast<std::string*>(mailbox->get());
+    const std::string* msg = static_cast<std::string*>(mailbox->get());
     if (*msg == "finalize") { // Shutdown ...
       delete msg;
       break;