From b3a504b9d74660efddcf6682451a78bca6fe8bf7 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Mon, 31 May 2021 11:32:23 +0200 Subject: [PATCH] A few more 'const'. --- src/kernel/context/ContextSwapped.cpp | 4 ++-- src/kernel/routing/NetZoneImpl.cpp | 2 +- src/simix/smx_private.hpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/kernel/context/ContextSwapped.cpp b/src/kernel/context/ContextSwapped.cpp index 65d170f61b..5c9f34b145 100644 --- a/src/kernel/context/ContextSwapped.cpp +++ b/src/kernel/context/ContextSwapped.cpp @@ -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_++; diff --git a/src/kernel/routing/NetZoneImpl.cpp b/src/kernel/routing/NetZoneImpl.cpp index 20ada8a44f..6d59bda4dc 100644 --- a/src/kernel/routing/NetZoneImpl.cpp +++ b/src/kernel/routing/NetZoneImpl.cpp @@ -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; diff --git a/src/simix/smx_private.hpp b/src/simix/smx_private.hpp index 6945526db1..f114e5ffef 100644 --- a/src/simix/smx_private.hpp +++ b/src/simix/smx_private.hpp @@ -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() -- 2.20.1