Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[sonar] Const etc. (round #3).
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Fri, 3 Jul 2020 19:22:42 +0000 (21:22 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Fri, 3 Jul 2020 19:36:09 +0000 (21:36 +0200)
include/simgrid/actor.h
include/simgrid/msg.h
include/simgrid/plugins/file_system.h
include/simgrid/s4u/Actor.hpp
src/mc/remote/AppSide.cpp
src/mc/remote/AppSide.hpp
src/msg/msg_legacy.cpp
src/plugins/file_system/s4u_FileSystem.cpp
src/s4u/s4u_Actor.cpp

index 5885acc..3640e26 100644 (file)
@@ -44,7 +44,7 @@ XBT_PUBLIC const char* sg_actor_get_property_value(const_sg_actor_t actor, const
 XBT_PUBLIC xbt_dict_t sg_actor_get_properties(const_sg_actor_t actor);
 XBT_PUBLIC void sg_actor_suspend(sg_actor_t actor);
 XBT_PUBLIC void sg_actor_resume(sg_actor_t actor);
-XBT_PUBLIC int sg_actor_is_suspended(sg_actor_t actor);
+XBT_PUBLIC int sg_actor_is_suspended(const_sg_actor_t actor);
 XBT_PUBLIC sg_actor_t sg_actor_restart(sg_actor_t actor);
 XBT_PUBLIC void sg_actor_set_auto_restart(sg_actor_t actor, int auto_restart);
 XBT_PUBLIC void sg_actor_daemonize(sg_actor_t actor);
index 64cc2cb..33ab45c 100644 (file)
@@ -204,7 +204,7 @@ XBT_PUBLIC const char* MSG_process_get_property_value(const_sg_actor_t process,
 
 XBT_PUBLIC void MSG_process_suspend(msg_process_t process);
 XBT_PUBLIC void MSG_process_resume(msg_process_t process);
-XBT_PUBLIC int MSG_process_is_suspended(msg_process_t process);
+XBT_PUBLIC int MSG_process_is_suspended(const_sg_actor_t process);
 XBT_PUBLIC void MSG_process_restart(msg_process_t process);
 /** @brief Sets the "auto-restart" flag of the process.
  *
index bc36088..73fa2ff 100644 (file)
@@ -31,7 +31,7 @@ XBT_PUBLIC void sg_file_close(const_sg_file_t fd);
 
 XBT_PUBLIC const char* sg_file_get_name(const_sg_file_t fd);
 XBT_PUBLIC sg_size_t sg_file_get_size(const_sg_file_t fd);
-XBT_PUBLIC void sg_file_dump(sg_file_t fd);
+XBT_PUBLIC void sg_file_dump(const_sg_file_t fd);
 XBT_PUBLIC void* sg_file_get_data(const_sg_file_t fd);
 XBT_PUBLIC void sg_file_set_data(sg_file_t fd, void* data);
 XBT_PUBLIC void sg_file_seek(sg_file_t fd, sg_offset_t offset, int origin);
index c664c03..1053860 100644 (file)
@@ -178,7 +178,7 @@ public:
   /** Sets the time at which that actor should be killed */
   void set_kill_time(double time);
   /** Retrieves the time at which that actor will be killed (or -1 if not set) */
-  double get_kill_time();
+  double get_kill_time() const;
 
   /** @brief Moves the actor to another host
    *
index 907f73c..21fa56b 100644 (file)
@@ -145,7 +145,7 @@ void AppSide::handle_messages() const
   }
 }
 
-void AppSide::main_loop()
+void AppSide::main_loop() const
 {
   while (true) {
     simgrid::mc::wait_for_requests();
index ccb19fa..d159af9 100644 (file)
@@ -38,7 +38,7 @@ private:
 public:
   Channel const& get_channel() const { return channel_; }
   Channel& get_channel() { return channel_; }
-  XBT_ATTRIB_NORETURN void main_loop();
+  XBT_ATTRIB_NORETURN void main_loop() const;
   void report_assertion_failure() const;
   void ignore_memory(void* addr, std::size_t size) const;
   void ignore_heap(void* addr, std::size_t size) const;
index c76bad3..a255124 100644 (file)
@@ -96,7 +96,7 @@ void MSG_process_resume(sg_actor_t actor)
 {
   sg_actor_resume(actor);
 }
-int MSG_process_is_suspended(sg_actor_t actor)
+int MSG_process_is_suspended(const_sg_actor_t actor)
 {
   return sg_actor_is_suspended(actor);
 }
index 6c37927..2411894 100644 (file)
@@ -716,7 +716,7 @@ sg_size_t sg_file_get_size(const_sg_file_t fd)
   return fd->size();
 }
 
-void sg_file_dump(sg_file_t fd)
+void sg_file_dump(const_sg_file_t fd)
 {
   fd->dump();
 }
index da64c24..b9cc222 100644 (file)
@@ -245,7 +245,7 @@ void Actor::set_kill_time(double kill_time)
 }
 
 /** @brief Get the kill time of an actor(or 0 if unset). */
-double Actor::get_kill_time()
+double Actor::get_kill_time() const
 {
   return pimpl_->get_kill_time();
 }
@@ -624,7 +624,7 @@ void sg_actor_resume(sg_actor_t actor)
  *
  * This checks whether an actor is suspended or not by inspecting the task on which it was waiting for the completion.
  */
-int sg_actor_is_suspended(sg_actor_t actor)
+int sg_actor_is_suspended(const_sg_actor_t actor)
 {
   return actor->is_suspended();
 }