Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Remove dead code after exception throw.
[simgrid.git] / src / s4u / s4u_Exec.cpp
index 0ecdc72..d75abb1 100644 (file)
@@ -19,16 +19,14 @@ Exec::Exec(sg_host_t host, double flops_amount) : Activity(), host_(host), flops
 {
   Activity::set_remaining(flops_amount_);
   pimpl_ = simix::simcall([this] {
-    return kernel::activity::ExecImplPtr(new kernel::activity::ExecImpl(name_, tracing_category_,
-                                                                        /*timeout_detector*/ nullptr, host_));
+    return kernel::activity::ExecImplPtr(new kernel::activity::ExecImpl(name_, tracing_category_, host_));
   });
 }
 
 Exec* Exec::start()
 {
-  simix::simcall([this] {
-    dynamic_cast<kernel::activity::ExecImpl*>(pimpl_.get())->start(flops_amount_, 1. / priority_, bound_);
-  });
+  simix::simcall(
+      [this] { static_cast<kernel::activity::ExecImpl*>(pimpl_.get())->start(flops_amount_, 1. / priority_, bound_); });
   state_ = State::STARTED;
   on_start(Actor::self());
   return this;
@@ -36,7 +34,7 @@ Exec* Exec::start()
 
 Exec* Exec::cancel()
 {
-  simgrid::simix::simcall([this] { dynamic_cast<kernel::activity::ExecImpl*>(pimpl_.get())->cancel(); });
+  simgrid::simix::simcall([this] { static_cast<kernel::activity::ExecImpl*>(pimpl_.get())->cancel(); });
   state_ = State::CANCELED;
   return this;
 }
@@ -54,7 +52,6 @@ Exec* Exec::wait()
 Exec* Exec::wait_for(double)
 {
   THROW_UNIMPLEMENTED;
-  return this;
 }
 
 /** @brief Returns whether the state of the exec is finished */