Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[sonar] Add const.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Tue, 11 Feb 2020 08:05:10 +0000 (09:05 +0100)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 12 Feb 2020 23:07:35 +0000 (00:07 +0100)
include/simgrid/host.h
src/kernel/activity/IoImpl.cpp
src/s4u/s4u_Host.cpp

index 71d594a..754a8bc 100644 (file)
@@ -68,7 +68,7 @@ XBT_PUBLIC xbt_dict_t sg_host_get_mounted_storage_list(sg_host_t host);
  * @return a dynar containing all storages (name) attached to the host
  */
 XBT_PUBLIC xbt_dynar_t sg_host_get_attached_storage_list(const_sg_host_t host);
-XBT_PUBLIC void sg_host_disks(sg_host_t host, unsigned int* disk_count, sg_disk_t** disks);
+XBT_PUBLIC void sg_host_disks(const_sg_host_t host, unsigned int* disk_count, sg_disk_t** disks);
 
 // =========== user-level functions ===============
 /** @brief Return the speed of the processor (in flop/s), regardless of the current load on the machine. */
index 966cae1..c9ec8ee 100644 (file)
@@ -21,7 +21,7 @@ namespace activity {
 
 IoImpl& IoImpl::set_timeout(double timeout)
 {
-  s4u::Host* host   = get_disk() ? get_disk()->get_host() : s4u::Host::by_name(get_storage()->get_host());
+  const s4u::Host* host = get_disk() ? get_disk()->get_host() : s4u::Host::by_name(get_storage()->get_host());
   timeout_detector_ = host->pimpl_cpu->sleep(timeout);
   timeout_detector_->set_activity(this);
   return *this;
index a4aad5c..f366323 100644 (file)
@@ -389,7 +389,7 @@ void sg_host_user_destroy(sg_host_t host) // deprecated
 }
 
 // ========= storage related functions ============
-void sg_host_disks(sg_host_t host, unsigned int* disk_count, sg_disk_t** disks)
+void sg_host_disks(const_sg_host_t host, unsigned int* disk_count, sg_disk_t** disks)
 {
   std::vector<sg_disk_t> list = host->get_disks();
   *disk_count                 = list.size();