From 6f5b0811b85b583a9b66992386610b3536516487 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Tue, 4 May 2021 11:18:17 +0200 Subject: [PATCH] Const pointer/reference. --- src/kernel/actor/ActorImpl.cpp | 6 +++--- src/s4u/s4u_Actor.cpp | 2 +- src/surf/sg_platf.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/kernel/actor/ActorImpl.cpp b/src/kernel/actor/ActorImpl.cpp index e7e2b7f496..06d324c478 100644 --- a/src/kernel/actor/ActorImpl.cpp +++ b/src/kernel/actor/ActorImpl.cpp @@ -230,7 +230,7 @@ void ActorImpl::exit() activities_.remove(waiting_synchro_); waiting_synchro_ = nullptr; } - for (auto& activity : activities_) + for (auto const& activity : activities_) activity->cancel(); activities_.clear(); @@ -379,7 +379,7 @@ void ActorImpl::suspend() suspended_ = true; /* Suspend the activities associated with this actor. */ - for (auto& activity : activities_) + for (auto const& activity : activities_) activity->suspend(); } @@ -397,7 +397,7 @@ void ActorImpl::resume() suspended_ = false; /* resume the activities that were blocked when suspending the actor. */ - for (auto& activity : activities_) + for (auto const& activity : activities_) activity->resume(); if (not waiting_synchro_) // Reschedule the actor if it was forcefully unscheduled in yield() simix_global->actors_to_run.push_back(this); diff --git a/src/s4u/s4u_Actor.cpp b/src/s4u/s4u_Actor.cpp index 0528b7116c..2a640c44b8 100644 --- a/src/s4u/s4u_Actor.cpp +++ b/src/s4u/s4u_Actor.cpp @@ -157,7 +157,7 @@ void Actor::set_host(Host* new_host) const s4u::Host* previous_location = get_host(); kernel::actor::simcall([this, new_host]() { - for (auto& activity : pimpl_->activities_) { + for (auto const& activity : pimpl_->activities_) { // FIXME: implement the migration of other kinds of activities if (auto exec = boost::dynamic_pointer_cast(activity)) exec->migrate(new_host); diff --git a/src/surf/sg_platf.cpp b/src/surf/sg_platf.cpp index ce57d37743..371892ec8d 100644 --- a/src/surf/sg_platf.cpp +++ b/src/surf/sg_platf.cpp @@ -228,7 +228,7 @@ static void sg_platf_new_cluster_hierarchical(const simgrid::kernel::routing::Cl set_limiter = std::bind(sg_platf_cluster_create_limiter, cluster, _1, _2, _3); } - simgrid::s4u::NetZone* parent = routing_get_current() ? routing_get_current()->get_iface() : nullptr; + simgrid::s4u::NetZone const* parent = routing_get_current() ? routing_get_current()->get_iface() : nullptr; simgrid::s4u::NetZone* zone; switch (cluster->topology) { case simgrid::kernel::routing::ClusterTopology::TORUS: -- 2.20.1