From: Arnaud Giersch Date: Tue, 16 May 2023 09:29:39 +0000 (+0200) Subject: Don't shadow outer variables. X-Git-Tag: v3.34~120 X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/2188aef62f0eb6434f8d58adcc32b652cbebffc7 Don't shadow outer variables. --- diff --git a/examples/cpp/dag-scheduling/s4u-dag-scheduling.cpp b/examples/cpp/dag-scheduling/s4u-dag-scheduling.cpp index 59814cdcf0..6c82ad0350 100644 --- a/examples/cpp/dag-scheduling/s4u-dag-scheduling.cpp +++ b/examples/cpp/dag-scheduling/s4u-dag-scheduling.cpp @@ -66,11 +66,11 @@ static sg4::Host* get_best_host(const sg4::ExecPtr exec, double* min_finish_time // We use the user data field to store the finish time of the predecessor of the comm, i.e., its potential // start time data_available = *comm->get_data() + redist_time; - } + } /* no transfer, control dependency */ - if (const auto* exec = dynamic_cast(parent.get())) - data_available = exec->get_finish_time(); + if (const auto* parent_exec = dynamic_cast(parent.get())) + data_available = parent_exec->get_finish_time(); if (last_data_available < data_available) last_data_available = data_available; @@ -148,9 +148,9 @@ int main(int argc, char** argv) auto dax = sg4::create_DAG_from_DAX(argv[2]); /* Schedule the root first */ - double finish_time; + double root_finish_time; auto* root = static_cast(dax.front().get()); - auto host = get_best_host(root, &finish_time); + auto* host = get_best_host(root, &root_finish_time); schedule_on(root, host); e.run();