Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[sonar] Constify pointer and reference local variables in src/simix/.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Mon, 23 Dec 2019 21:56:35 +0000 (22:56 +0100)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Mon, 23 Dec 2019 23:33:39 +0000 (00:33 +0100)
src/simix/smx_deployment.cpp
src/simix/smx_global.cpp

index 1038309..d4825df 100644 (file)
@@ -64,7 +64,7 @@ void SIMIX_process_set_function(const char* process_host, const char* process_fu
 {
   simgrid::kernel::routing::ActorCreationArgs actor;
 
 {
   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;
   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:
   }
 
   // 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;
   xbt_assert(parse_code, "Function '%s' unknown", process_function);
 
   actor.function           = process_function;
index 68a74da..ee1a4ca 100644 (file)
@@ -595,6 +595,6 @@ int SIMIX_is_maestro()
 {
   if (simix_global == nullptr) // SimDag
     return true;
 {
   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_;
 }
   return self == nullptr || self == simix_global->maestro_;
 }