From: Arnaud Giersch Date: Wed, 17 Apr 2019 19:13:16 +0000 (+0200) Subject: Smart pointer is not necessary for Actor::self. X-Git-Tag: v3.22.2~113 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/052f2deb51abb0bdbb2a2b6c7d052acdc030cfd5 Smart pointer is not necessary for Actor::self. --- diff --git a/include/simgrid/s4u/Actor.hpp b/include/simgrid/s4u/Actor.hpp index 7bde9ca723..1dc179f78a 100644 --- a/include/simgrid/s4u/Actor.hpp +++ b/include/simgrid/s4u/Actor.hpp @@ -142,7 +142,7 @@ public: // ***** Actor creation ***** /** Retrieve a reference to myself */ - static ActorPtr self(); + static Actor* self(); /** Signal to others that a new actor has been created **/ static xbt::signal on_creation; diff --git a/src/s4u/s4u_Actor.cpp b/src/s4u/s4u_Actor.cpp index ef457c6d7e..99d80a7781 100644 --- a/src/s4u/s4u_Actor.cpp +++ b/src/s4u/s4u_Actor.cpp @@ -31,13 +31,13 @@ xbt::signal s4u::Actor::on_migration_end; xbt::signal s4u::Actor::on_destruction; // ***** Actor creation ***** -ActorPtr Actor::self() +Actor* Actor::self() { kernel::context::Context* self_context = kernel::context::Context::self(); if (self_context == nullptr) - return ActorPtr(); + return nullptr; - return self_context->get_actor()->iface(); + return self_context->get_actor()->ciface(); } ActorPtr Actor::init(const std::string& name, s4u::Host* host) { diff --git a/src/smpi/smpi_replay_main.cpp b/src/smpi/smpi_replay_main.cpp index 72898c5ca7..240454190c 100644 --- a/src/smpi/smpi_replay_main.cpp +++ b/src/smpi/smpi_replay_main.cpp @@ -6,7 +6,7 @@ int main(int argc, char* argv[]) { - if (simgrid::s4u::Actor::self().get() == nullptr) { + if (simgrid::s4u::Actor::self() == nullptr) { printf("smpireplaymain should not be called directly. Please use smpirun -replay instead.\n"); return 1; }