From: Fred Suter Date: Wed, 21 Jun 2023 18:25:39 +0000 (-0400) Subject: [Sonar] shadowed variable X-Git-Tag: v3.34~14^2~2 X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/cef59d338bade8ea4224fbe3eebb9ffe5bf08c4d [Sonar] shadowed variable --- diff --git a/examples/cpp/task-switch-host/s4u-task-switch-host.cpp b/examples/cpp/task-switch-host/s4u-task-switch-host.cpp index 3694a7d4e6..2a22323f45 100644 --- a/examples/cpp/task-switch-host/s4u-task-switch-host.cpp +++ b/examples/cpp/task-switch-host/s4u-task-switch-host.cpp @@ -53,8 +53,7 @@ int main(int argc, char* argv[]) // Add a function to be called before each executions of comm0 // This function modifies the graph of tasks by adding or removing // successors to comm0 - comm0->on_this_start_cb([exec1, exec2, jupiter, fafard](sg4::Task* t) { - auto* comm0 = dynamic_cast(t); + comm0->on_this_start_cb([comm0, exec1, exec2, jupiter, fafard](sg4::Task*) { static int count = 0; if (count % 2 == 0) { comm0->set_destination(jupiter);