From 41882c654e7e6c14ae1849bafb8a8e8b0204fca0 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Fri, 3 Jul 2020 21:22:42 +0200 Subject: [PATCH] [sonar] Const etc. (round #3). --- include/simgrid/actor.h | 2 +- include/simgrid/msg.h | 2 +- include/simgrid/plugins/file_system.h | 2 +- include/simgrid/s4u/Actor.hpp | 2 +- src/mc/remote/AppSide.cpp | 2 +- src/mc/remote/AppSide.hpp | 2 +- src/msg/msg_legacy.cpp | 2 +- src/plugins/file_system/s4u_FileSystem.cpp | 2 +- src/s4u/s4u_Actor.cpp | 4 ++-- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/include/simgrid/actor.h b/include/simgrid/actor.h index 5885acca42..3640e2631b 100644 --- a/include/simgrid/actor.h +++ b/include/simgrid/actor.h @@ -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); diff --git a/include/simgrid/msg.h b/include/simgrid/msg.h index 64cc2cb723..33ab45c106 100644 --- a/include/simgrid/msg.h +++ b/include/simgrid/msg.h @@ -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. * diff --git a/include/simgrid/plugins/file_system.h b/include/simgrid/plugins/file_system.h index bc36088b42..73fa2ffad8 100644 --- a/include/simgrid/plugins/file_system.h +++ b/include/simgrid/plugins/file_system.h @@ -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); diff --git a/include/simgrid/s4u/Actor.hpp b/include/simgrid/s4u/Actor.hpp index c664c030a0..10538605d7 100644 --- a/include/simgrid/s4u/Actor.hpp +++ b/include/simgrid/s4u/Actor.hpp @@ -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 * diff --git a/src/mc/remote/AppSide.cpp b/src/mc/remote/AppSide.cpp index 907f73c0a6..21fa56bb9e 100644 --- a/src/mc/remote/AppSide.cpp +++ b/src/mc/remote/AppSide.cpp @@ -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(); diff --git a/src/mc/remote/AppSide.hpp b/src/mc/remote/AppSide.hpp index ccb19fad0e..d159af90fa 100644 --- a/src/mc/remote/AppSide.hpp +++ b/src/mc/remote/AppSide.hpp @@ -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; diff --git a/src/msg/msg_legacy.cpp b/src/msg/msg_legacy.cpp index c76bad3dad..a255124bb4 100644 --- a/src/msg/msg_legacy.cpp +++ b/src/msg/msg_legacy.cpp @@ -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); } diff --git a/src/plugins/file_system/s4u_FileSystem.cpp b/src/plugins/file_system/s4u_FileSystem.cpp index 6c37927962..241189486b 100644 --- a/src/plugins/file_system/s4u_FileSystem.cpp +++ b/src/plugins/file_system/s4u_FileSystem.cpp @@ -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(); } diff --git a/src/s4u/s4u_Actor.cpp b/src/s4u/s4u_Actor.cpp index da64c24010..b9cc2223c6 100644 --- a/src/s4u/s4u_Actor.cpp +++ b/src/s4u/s4u_Actor.cpp @@ -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(); } -- 2.20.1