X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/7749be177cbd7d433ec389a155efff301969c6ee..f1671393f75bd162d50e64573db72c0e80cd137f:/examples/s4u/actor-create/s4u-actor-create.cpp diff --git a/examples/s4u/actor-create/s4u-actor-create.cpp b/examples/s4u/actor-create/s4u-actor-create.cpp index 2bd2508328..ee1e6ef49a 100644 --- a/examples/s4u/actor-create/s4u-actor-create.cpp +++ b/examples/s4u/actor-create/s4u-actor-create.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2019. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2006-2020. 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. */ @@ -44,7 +44,7 @@ static void receiver(const std::string& mailbox_name) } /* Our second class of actors is also a function */ -static int forwarder(int argc, char** argv) +static void forwarder(int argc, char** argv) { xbt_assert(argc >= 3, "Actor forwarder requires 2 parameters, but got only %d", argc - 1); simgrid::s4u::Mailbox* in = simgrid::s4u::Mailbox::by_name(argv[1]); @@ -52,7 +52,6 @@ static int forwarder(int argc, char** argv) std::string* msg = static_cast(in->get()); XBT_INFO("Forward '%s'.", msg->c_str()); out->put(msg, msg->size()); - return 0; } /* Declares a third class of actors which sends a message to the mailbox 'mb42'. @@ -76,7 +75,7 @@ public: msg = args[1]; mbox = args[2]; } - void operator()() /* This is the main code of the actor */ + void operator()() const /* This is the main code of the actor */ { XBT_INFO("Hello s4u, I have something to send"); simgrid::s4u::Mailbox* mailbox = simgrid::s4u::Mailbox::by_name(mbox);