From: Frederic Suter Date: Thu, 26 Jul 2018 07:51:00 +0000 (+0200) Subject: sonar X-Git-Tag: v3_21~355^2~25 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/c4f0716bba4bda0483e7a7c141417ace93d3c180 sonar --- diff --git a/examples/s4u/platform-failures/s4u-platform-failures.cpp b/examples/s4u/platform-failures/s4u-platform-failures.cpp index e62f6ed8db..941ea2aba8 100644 --- a/examples/s4u/platform-failures/s4u-platform-failures.cpp +++ b/examples/s4u/platform-failures/s4u-platform-failures.cpp @@ -108,13 +108,11 @@ static int worker(int argc, char* argv[]) try { simgrid::s4u::this_actor::execute(comp_size); } catch (xbt_ex& e) { - switch (e.category) { - case host_error: - XBT_INFO("Gloups. The cpu on which I'm running just turned off!. See you!"); - return -1; - default: - xbt_die("Unexpected behavior"); - } + if (e.category == host_error) { + XBT_INFO("Gloups. The cpu on which I'm running just turned off!. See you!"); + return -1; + } else + xbt_die("Unexpected behavior"); } } XBT_INFO("I'm done. See you!"); diff --git a/src/simix/smx_host.cpp b/src/simix/smx_host.cpp index d814cd7c40..05dc306c6f 100644 --- a/src/simix/smx_host.cpp +++ b/src/simix/smx_host.cpp @@ -76,7 +76,7 @@ simgrid::kernel::activity::ExecImplPtr SIMIX_execution_start(std::string name, s simgrid::kernel::activity::ExecImplPtr exec = simgrid::kernel::activity::ExecImplPtr( new simgrid::kernel::activity::ExecImpl(name, surf_action, /*timeout_detector*/ nullptr, host)); - exec->set_category(name); + exec->set_category(category); XBT_DEBUG("Create execute synchro %p: %s", exec.get(), exec->name_.c_str()); simgrid::kernel::activity::ExecImpl::on_creation(exec);