Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix another bunch of dead links in docs.
[simgrid.git] / src / msg / msg_comm.cpp
index 3a4bca2..91f56b0 100644 (file)
@@ -84,7 +84,7 @@ int MSG_comm_test(msg_comm_t comm)
  */
 int MSG_comm_testany(const_xbt_dynar_t comms)
 {
-  int finished_index = -1;
+  ssize_t finished_index = -1;
 
   /* Create the equivalent array with SIMIX objects: */
   std::vector<simgrid::kernel::activity::CommImpl*> s_comms;
@@ -99,13 +99,13 @@ int MSG_comm_testany(const_xbt_dynar_t comms)
   try {
     finished_index = simcall_comm_testany(s_comms.data(), s_comms.size());
   } catch (const simgrid::TimeoutException& e) {
-    finished_index = e.value;
+    finished_index = e.get_value();
     status         = MSG_TIMEOUT;
   } catch (const simgrid::CancelException& e) {
-    finished_index = e.value;
+    finished_index = e.get_value();
     status         = MSG_TASK_CANCELED;
   } catch (const simgrid::NetworkFailureException& e) {
-    finished_index = e.value;
+    finished_index = e.get_value();
     status         = MSG_TRANSFER_FAILURE;
   }
 
@@ -120,7 +120,7 @@ int MSG_comm_testany(const_xbt_dynar_t comms)
     }
   }
 
-  return finished_index;
+  return static_cast<int>(finished_index);
 }
 
 /** @brief Destroys the provided communication. */
@@ -161,7 +161,7 @@ void MSG_comm_waitall(msg_comm_t* comm, int nb_elem, double timeout)
  */
 int MSG_comm_waitany(const_xbt_dynar_t comms)
 {
-  int finished_index = -1;
+  ssize_t finished_index = -1;
 
   /* Create the equivalent array with SIMIX objects: */
   std::vector<simgrid::kernel::activity::CommImpl*> s_comms;
@@ -176,13 +176,13 @@ int MSG_comm_waitany(const_xbt_dynar_t comms)
   try {
     finished_index = simcall_comm_waitany(s_comms.data(), s_comms.size(), -1);
   } catch (const simgrid::TimeoutException& e) {
-    finished_index = e.value;
+    finished_index = e.get_value();
     status         = MSG_TIMEOUT;
   } catch (const simgrid::CancelException& e) {
-    finished_index = e.value;
+    finished_index = e.get_value();
     status         = MSG_TASK_CANCELED;
   } catch (const simgrid::NetworkFailureException& e) {
-    finished_index = e.value;
+    finished_index = e.get_value();
     status         = MSG_TRANSFER_FAILURE;
   }
 
@@ -197,7 +197,7 @@ int MSG_comm_waitany(const_xbt_dynar_t comms)
     (*comm->task_received)->set_not_used();
   }
 
-  return finished_index;
+  return static_cast<int>(finished_index);
 }
 
 /**