From: Frederic Suter Date: Wed, 15 Mar 2017 17:13:59 +0000 (+0100) Subject: avoid double to size_t to double X-Git-Tag: v3_15~105 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/08ebacab3b8aeb2d74f811f8631e9c1c8c3938ed avoid double to size_t to double --- diff --git a/examples/s4u/actions-comm/s4u_actions-comm.cpp b/examples/s4u/actions-comm/s4u_actions-comm.cpp index 2e205f71d0..eff4f23b81 100644 --- a/examples/s4u/actions-comm/s4u_actions-comm.cpp +++ b/examples/s4u/actions-comm/s4u_actions-comm.cpp @@ -55,11 +55,11 @@ public: static void send(const char* const* action) { - size_t size = static_cast(std::stod(action[3])); + double size = std::stod(action[3]); char* payload = xbt_strdup(action[3]); double clock = simgrid::s4u::Engine::instance()->getClock(); simgrid::s4u::MailboxPtr to = simgrid::s4u::Mailbox::byName(simgrid::s4u::this_actor::name() + "_" + action[2]); - ACT_DEBUG("Entering Send: %s (size: %zu) -- Actor %s on mailbox %s", NAME, size, + ACT_DEBUG("Entering Send: %s (size: %g) -- Actor %s on mailbox %s", NAME, size, simgrid::s4u::this_actor::name().c_str(), to->name()); simgrid::s4u::this_actor::send(to, payload, size); xbt_free(payload); diff --git a/include/simgrid/s4u/Actor.hpp b/include/simgrid/s4u/Actor.hpp index c7acc5b97a..5aee78cd03 100644 --- a/include/simgrid/s4u/Actor.hpp +++ b/include/simgrid/s4u/Actor.hpp @@ -288,7 +288,7 @@ namespace this_actor { * * See \ref Comm for the full communication API (including non blocking communications). */ - XBT_PUBLIC(void) send(MailboxPtr chan, void*payload, size_t simulatedSize); + XBT_PUBLIC(void) send(MailboxPtr chan, void* payload, double simulatedSize); /** @brief Returns the PID of the current actor. */ XBT_PUBLIC(int) pid(); diff --git a/src/s4u/s4u_actor.cpp b/src/s4u/s4u_actor.cpp index f58240a8ce..abc984afc5 100644 --- a/src/s4u/s4u_actor.cpp +++ b/src/s4u/s4u_actor.cpp @@ -150,7 +150,8 @@ void* recv(MailboxPtr chan) { return res; } -void send(MailboxPtr chan, void *payload, size_t simulatedSize) { +void send(MailboxPtr chan, void* payload, double simulatedSize) +{ Comm& c = Comm::send_init(chan); c.setRemains(simulatedSize); c.setSrcData(payload);