Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
easy sonar fixes
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Thu, 10 Mar 2022 07:28:35 +0000 (08:28 +0100)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Thu, 10 Mar 2022 07:28:35 +0000 (08:28 +0100)
include/simgrid/s4u/Actor.hpp
src/kernel/EngineImpl.cpp
src/kernel/actor/ActorImpl.hpp
src/s4u/s4u_Actor.cpp

index afa8941..83d342f 100644 (file)
@@ -354,7 +354,7 @@ public:
    */
   Actor* set_auto_restart(bool autorestart = true);
   /** Returns the number of reboots that this actor did. Before the first reboot, this function returns 0. */
-  int get_restart_count();
+  int get_restart_count() const;
 
   /** Add a function to the list of "on_exit" functions for the current actor. The on_exit functions are the functions
    * executed when your actor is killed. You should use them to free the data used by your actor.
index 67e9ae8..39f49ee 100644 (file)
@@ -697,7 +697,7 @@ void EngineImpl::run(double max_date)
 #else
     xbt_die("MC_is_active() is not supposed to return true in non-MC settings");
 #endif
-    return;
+    THROW_IMPOSSIBLE; // main_loop never returns
   }
 
   if (MC_record_replay_is_active()) {
index f0fb5c2..e54682c 100644 (file)
@@ -35,6 +35,7 @@ public:
 
 class XBT_PUBLIC ActorImpl : public xbt::PropertyHolder, public ActorRestartingTrait {
   s4u::Host* host_   = nullptr; /* the host on which the actor is running */
+  xbt::string name_;
   aid_t pid_         = 0;
   aid_t ppid_        = -1;
   bool daemon_       = false; /* Daemon actors are automatically killed when the last non-daemon leaves */
@@ -44,7 +45,6 @@ class XBT_PUBLIC ActorImpl : public xbt::PropertyHolder, public ActorRestartingT
   friend activity::MailboxImpl;
 
 public:
-  xbt::string name_;
   ActorImpl(xbt::string name, s4u::Host* host);
   ActorImpl(const ActorImpl&) = delete;
   ActorImpl& operator=(const ActorImpl&) = delete;
index 1d563c4..7206d09 100644 (file)
@@ -137,7 +137,7 @@ Actor* Actor::set_auto_restart(bool autorestart)
   });
   return this;
 }
-int Actor::get_restart_count()
+int Actor::get_restart_count() const
 {
   return pimpl_->get_restart_count();
 }