From: Arnaud Giersch Date: Mon, 23 Dec 2019 21:56:35 +0000 (+0100) Subject: [sonar] Constify pointer and reference local variables in src/simix/. X-Git-Tag: v3.25~225 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/9c1bc911d15a70898c862abf50907806010609a2?ds=sidebyside [sonar] Constify pointer and reference local variables in src/simix/. --- diff --git a/src/simix/smx_deployment.cpp b/src/simix/smx_deployment.cpp index 1038309608..d4825df8e1 100644 --- a/src/simix/smx_deployment.cpp +++ b/src/simix/smx_deployment.cpp @@ -64,7 +64,7 @@ void SIMIX_process_set_function(const char* process_host, const char* process_fu { simgrid::kernel::routing::ActorCreationArgs actor; - sg_host_t host = sg_host_by_name(process_host); + const simgrid::s4u::Host* host = sg_host_by_name(process_host); if (not host) throw std::invalid_argument(simgrid::xbt::string_printf("Host '%s' unknown", process_host)); actor.host = process_host; @@ -77,7 +77,7 @@ void SIMIX_process_set_function(const char* process_host, const char* process_fu } // Check we know how to handle this function name: - simgrid::simix::ActorCodeFactory& parse_code = SIMIX_get_actor_code_factory(process_function); + const simgrid::simix::ActorCodeFactory& parse_code = SIMIX_get_actor_code_factory(process_function); xbt_assert(parse_code, "Function '%s' unknown", process_function); actor.function = process_function; diff --git a/src/simix/smx_global.cpp b/src/simix/smx_global.cpp index 68a74dae84..ee1a4ca302 100644 --- a/src/simix/smx_global.cpp +++ b/src/simix/smx_global.cpp @@ -595,6 +595,6 @@ int SIMIX_is_maestro() { if (simix_global == nullptr) // SimDag return true; - simgrid::kernel::actor::ActorImpl* self = SIMIX_process_self(); + const simgrid::kernel::actor::ActorImpl* self = SIMIX_process_self(); return self == nullptr || self == simix_global->maestro_; }