Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
A few more 'const'.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Mon, 31 May 2021 09:32:23 +0000 (11:32 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Mon, 31 May 2021 09:36:10 +0000 (11:36 +0200)
src/kernel/context/ContextSwapped.cpp
src/kernel/routing/NetZoneImpl.cpp
src/simix/smx_private.hpp

index 65d170f..5c9f34b 100644 (file)
@@ -207,7 +207,7 @@ void SwappedContext::swap_into(SwappedContext* to)
 /** Maestro wants to run all ready actors */
 void SwappedContextFactory::run_all()
 {
-  auto* engine = EngineImpl::get_instance();
+  const auto* engine = EngineImpl::get_instance();
   /* This function is called by maestro at the beginning of a scheduling round to get all working threads executing some
    * stuff It is much easier to understand what happens if you see the working threads as bodies that swap their soul
    * for the ones of the simulated processes that must run.
@@ -288,7 +288,7 @@ void SwappedContext::suspend()
       // When given that soul, the body will wait for the next scheduling round
     }
   } else { // sequential execution
-    auto* engine = EngineImpl::get_instance();
+    const auto* engine = EngineImpl::get_instance();
     /* determine the next context */
     unsigned long int i = factory_.process_index_;
     factory_.process_index_++;
index 20ada8a..6d59bda 100644 (file)
@@ -547,7 +547,7 @@ const NetZoneImpl* NetZoneImpl::get_netzone_recursive(const NetPoint* netpoint)
   if (netpoint == netpoint_)
     return this;
 
-  for (auto* children : children_) {
+  for (const auto* children : children_) {
     const NetZoneImpl* netzone = children->get_netzone_recursive(netpoint);
     if (netzone)
       return netzone;
index 6945526..f114e5f 100644 (file)
@@ -20,7 +20,7 @@ class Global {
   kernel::actor::ActorImpl* maestro_                = nullptr;
 
 public:
-  bool is_maestro(kernel::actor::ActorImpl* actor) const { return actor == maestro_; }
+  bool is_maestro(const kernel::actor::ActorImpl* actor) const { return actor == maestro_; }
   void set_maestro(kernel::actor::ActorImpl* actor) { maestro_ = actor; }
   kernel::actor::ActorImpl* get_maestro() const { return maestro_; }
   void destroy_maestro()