Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[sonar] A few more const local pointers.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Thu, 26 Dec 2019 16:40:24 +0000 (17:40 +0100)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Fri, 27 Dec 2019 10:03:11 +0000 (11:03 +0100)
examples/s4u/replay-io/s4u-replay-io.cpp
src/s4u/s4u_Host.cpp
teshsuite/simdag/is-router/is-router.cpp

index 93af1ff..07ea1ea 100644 (file)
@@ -83,7 +83,7 @@ public:
     std::string file_name = action[2];
     double clock          = simgrid::s4u::Engine::get_clock();
 
-    simgrid::s4u::File* file = get_file_descriptor(file_name);
+    const simgrid::s4u::File* file = get_file_descriptor(file_name);
 
     ACT_DEBUG("Entering Close: %s (filename: %s)", NAME.c_str(), file_name.c_str());
     delete file;
index 5022080..4401c47 100644 (file)
@@ -662,7 +662,7 @@ const char* sg_host_self_get_name()
 {
   const char* res = "";
   if (not SIMIX_is_maestro()) {
-    simgrid::s4u::Host* host = simgrid::kernel::actor::ActorImpl::self()->get_host();
+    const simgrid::s4u::Host* host = simgrid::kernel::actor::ActorImpl::self()->get_host();
     if (host != nullptr)
       res = host->get_cname();
   }
index e48c032..fb56b86 100644 (file)
@@ -29,7 +29,7 @@ int main(int argc, char **argv)
   int it;
   sg_host_t host;
   xbt_dynar_foreach(hosts, it, host) {
-    simgrid::kernel::routing::NetPoint* nc = host->get_netpoint();
+    const simgrid::kernel::routing::NetPoint* nc = host->get_netpoint();
     const char *type = "buggy";
     if (nc->is_router())
       type = "router";