Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
please sonar: replace void* by unsigned char* for raw buffer
[simgrid.git] / src / kernel / activity / CommImpl.cpp
index ae219f6..1410e40 100644 (file)
@@ -19,7 +19,7 @@
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_network, simix, "SIMIX network-related synchronization");
 
 XBT_PRIVATE void simcall_HANDLER_comm_send(smx_simcall_t simcall, smx_actor_t src, smx_mailbox_t mbox, double task_size,
-                                           double rate, void* src_buff, size_t src_buff_size,
+                                           double rate, unsigned char* src_buff, size_t src_buff_size,
                                            int (*match_fun)(void*, void*, simgrid::kernel::activity::CommImpl*),
                                            void (*copy_data_fun)(simgrid::kernel::activity::CommImpl*, void*, size_t),
                                            void* data, double timeout)
@@ -31,8 +31,8 @@ XBT_PRIVATE void simcall_HANDLER_comm_send(smx_simcall_t simcall, smx_actor_t sr
 }
 
 XBT_PRIVATE smx_activity_t simcall_HANDLER_comm_isend(
-    smx_simcall_t /*simcall*/, smx_actor_t src_proc, smx_mailbox_t mbox, double task_size, double rate, void* src_buff,
-    size_t src_buff_size, int (*match_fun)(void*, void*, simgrid::kernel::activity::CommImpl*),
+    smx_simcall_t /*simcall*/, smx_actor_t src_proc, smx_mailbox_t mbox, double task_size, double rate,
+    unsigned char* src_buff, size_t src_buff_size, int (*match_fun)(void*, void*, simgrid::kernel::activity::CommImpl*),
     void (*clean_fun)(void*), // used to free the synchro in case of problem after a detached send
     void (*copy_data_fun)(simgrid::kernel::activity::CommImpl*, void*, size_t), // used to copy data if not default one
     void* data, bool detached)
@@ -97,7 +97,7 @@ XBT_PRIVATE smx_activity_t simcall_HANDLER_comm_isend(
 }
 
 XBT_PRIVATE void simcall_HANDLER_comm_recv(smx_simcall_t simcall, smx_actor_t receiver, smx_mailbox_t mbox,
-                                           void* dst_buff, size_t* dst_buff_size,
+                                           unsigned char* dst_buff, size_t* dst_buff_size,
                                            int (*match_fun)(void*, void*, simgrid::kernel::activity::CommImpl*),
                                            void (*copy_data_fun)(simgrid::kernel::activity::CommImpl*, void*, size_t),
                                            void* data, double timeout, double rate)
@@ -109,7 +109,7 @@ XBT_PRIVATE void simcall_HANDLER_comm_recv(smx_simcall_t simcall, smx_actor_t re
 }
 
 XBT_PRIVATE smx_activity_t simcall_HANDLER_comm_irecv(
-    smx_simcall_t /*simcall*/, smx_actor_t receiver, smx_mailbox_t mbox, void* dst_buff, size_t* dst_buff_size,
+    smx_simcall_t /*simcall*/, smx_actor_t receiver, smx_mailbox_t mbox, unsigned char* dst_buff, size_t* dst_buff_size,
     simix_match_func_t match_fun, void (*copy_data_fun)(simgrid::kernel::activity::CommImpl*, void*, size_t),
     void* data, double rate)
 {
@@ -189,8 +189,7 @@ void simcall_HANDLER_comm_wait(smx_simcall_t simcall, simgrid::kernel::activity:
   /* Associate this simcall to the wait synchro */
   XBT_DEBUG("simcall_HANDLER_comm_wait, %p", comm);
 
-  comm->simcalls_.push_back(simcall);
-  simcall->issuer->waiting_synchro = comm;
+  comm->register_simcall(simcall);
 
   if (MC_is_active() || MC_record_replay_is_active()) {
     int idx = SIMCALL_GET_MC_VALUE(simcall);
@@ -381,14 +380,14 @@ CommImpl& CommImpl::set_rate(double rate)
   return *this;
 }
 
-CommImpl& CommImpl::set_src_buff(void* buff, size_t size)
+CommImpl& CommImpl::set_src_buff(unsigned char* buff, size_t size)
 {
   src_buff_      = buff;
   src_buff_size_ = size;
   return *this;
 }
 
-CommImpl& CommImpl::set_dst_buff(void* buff, size_t* size)
+CommImpl& CommImpl::set_dst_buff(unsigned char* buff, size_t* size)
 {
   dst_buff_      = buff;
   dst_buff_size_ = size;