Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
save some hidden calls to Engine::get_instance
[simgrid.git] / teshsuite / s4u / actor-suspend / actor-suspend.cpp
index 3e82259..657b2fc 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2020. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2020-2021. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -22,7 +22,7 @@ public:
   {
     XBT_INFO("Starting.");
     auto mailbox = simgrid::s4u::Mailbox::by_name("receiver");
-    int data     = *(int*)mailbox->get();
+    int data     = *mailbox->get<int>();
     XBT_INFO("Got %d at the end", data);
   }
 };
@@ -53,7 +53,7 @@ int main(int argc, char** argv)
   simgrid::s4u::Engine engine(&argc, argv);
 
   engine.load_platform(argv[1]);
-  simgrid::s4u::Host* host = simgrid::s4u::Host::by_name("Tremblay");
+  simgrid::s4u::Host* host = engine.host_by_name("Tremblay");
 
   simgrid::s4u::Actor::create("Suspender", host, Suspender());
   receiver = simgrid::s4u::Actor::create("Receiver", host, Receiver());