Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
bools are not ints anymore
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Sun, 20 Jan 2019 00:24:11 +0000 (01:24 +0100)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Sun, 20 Jan 2019 00:30:31 +0000 (01:30 +0100)
src/kernel/activity/SleepImpl.cpp
src/kernel/context/Context.cpp
src/simix/smx_network.cpp
src/simix/smx_synchro.cpp

index efe42c4..e683dd5 100644 (file)
@@ -43,7 +43,7 @@ void simgrid::kernel::activity::SleepImpl::post()
 
     switch (surf_sleep->get_state()) {
       case simgrid::kernel::resource::Action::State::FAILED:
-        simcall->issuer->context_->iwannadie = 1;
+        simcall->issuer->context_->iwannadie = true;
         result                               = SIMIX_FAILED;
         break;
 
@@ -56,13 +56,13 @@ void simgrid::kernel::activity::SleepImpl::post()
         break;
     }
     if (simcall->issuer->host_->is_off()) {
-      simcall->issuer->context_->iwannadie = 1;
+      simcall->issuer->context_->iwannadie = true;
     }
     simcall_process_sleep__set__result(simcall, result);
     simcall->issuer->waiting_synchro = nullptr;
     if (simcall->issuer->suspended_) {
       XBT_DEBUG("Wait! This process is suspended and can't wake up now.");
-      simcall->issuer->suspended_ = 0;
+      simcall->issuer->suspended_ = false;
       simcall_HANDLER_process_suspend(simcall, simcall->issuer);
     } else {
       SIMIX_simcall_answer(simcall);
index 7e3ce08..385753e 100644 (file)
@@ -83,7 +83,7 @@ void Context::stop()
 {
   if (this->cleanup_func_)
     this->cleanup_func_(this->actor_);
-  this->actor_->suspended_ = 0;
+  this->actor_->suspended_ = false;
 
   this->iwannadie = false;
   simgrid::simix::simcall([this] { SIMIX_process_cleanup(this->actor_); });
index 9e479f3..1d8f5fc 100644 (file)
@@ -521,7 +521,7 @@ void SIMIX_comm_finish(smx_activity_t synchro)
     /* Check out for errors */
 
     if (simcall->issuer->host_->is_off()) {
-      simcall->issuer->context_->iwannadie = 1;
+      simcall->issuer->context_->iwannadie = true;
       simcall->issuer->exception =
           std::make_exception_ptr(simgrid::HostFailureException(XBT_THROW_POINT, "Host failed"));
     } else {
@@ -544,7 +544,7 @@ void SIMIX_comm_finish(smx_activity_t synchro)
 
         case SIMIX_SRC_HOST_FAILURE:
           if (simcall->issuer == comm->src_proc)
-            simcall->issuer->context_->iwannadie = 1;
+            simcall->issuer->context_->iwannadie = true;
           else
             simcall->issuer->exception =
                 std::make_exception_ptr(simgrid::NetworkFailureException(XBT_THROW_POINT, "Remote peer failed"));
@@ -552,7 +552,7 @@ void SIMIX_comm_finish(smx_activity_t synchro)
 
         case SIMIX_DST_HOST_FAILURE:
           if (simcall->issuer == comm->dst_proc)
-            simcall->issuer->context_->iwannadie = 1;
+            simcall->issuer->context_->iwannadie = true;
           else
             simcall->issuer->exception =
                 std::make_exception_ptr(simgrid::NetworkFailureException(XBT_THROW_POINT, "Remote peer failed"));
@@ -624,9 +624,8 @@ void SIMIX_comm_finish(smx_activity_t synchro)
       }
     }
 
-    if (simcall->issuer->host_->is_off()) {
-      simcall->issuer->context_->iwannadie = 1;
-    }
+    if (simcall->issuer->host_->is_off())
+      simcall->issuer->context_->iwannadie = true;
 
     simcall->issuer->waiting_synchro = nullptr;
     simcall->issuer->comms.remove(synchro);
index b560ccd..7fa94bf 100644 (file)
@@ -67,7 +67,7 @@ void SIMIX_synchro_finish(smx_activity_t synchro)
 
   if (synchro->state_ != SIMIX_SRC_TIMEOUT) {
     if (synchro->state_ == SIMIX_FAILED)
-      simcall->issuer->context_->iwannadie = 1;
+      simcall->issuer->context_->iwannadie = true;
     else
       THROW_IMPOSSIBLE;
   }