Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
avoid double to size_t to double
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Wed, 15 Mar 2017 17:13:59 +0000 (18:13 +0100)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Wed, 15 Mar 2017 17:13:59 +0000 (18:13 +0100)
examples/s4u/actions-comm/s4u_actions-comm.cpp
include/simgrid/s4u/Actor.hpp
src/s4u/s4u_actor.cpp

index 2e205f7..eff4f23 100644 (file)
@@ -55,11 +55,11 @@ public:
 
   static void send(const char* const* action)
   {
 
   static void send(const char* const* action)
   {
-    size_t size                 = static_cast<size_t>(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]);
     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);
               simgrid::s4u::this_actor::name().c_str(), to->name());
     simgrid::s4u::this_actor::send(to, payload, size);
     xbt_free(payload);
index c7acc5b..5aee78c 100644 (file)
@@ -288,7 +288,7 @@ namespace this_actor {
    *
    * See \ref Comm for the full communication API (including non blocking communications).
   */
    *
    * 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();
 
   /** @brief Returns the PID of the current actor. */
   XBT_PUBLIC(int) pid();
index f58240a..abc984a 100644 (file)
@@ -150,7 +150,8 @@ void* recv(MailboxPtr chan) {
   return res;
 }
 
   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);
   Comm& c = Comm::send_init(chan);
   c.setRemains(simulatedSize);
   c.setSrcData(payload);