Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use xbt_XXX_is_empty() instead of testing xbt_XXX_length() against 0.
[simgrid.git] / src / gras / Msg / gras_msg_exchange.c
index a992a81..66f6e64 100644 (file)
@@ -326,7 +326,7 @@ void gras_msg_handle(volatile double timeOut)
 
   /* get a message (from the queue or from the net) */
   timeouted = 0;
-  if (xbt_dynar_length(pd->msg_queue)) {
+  if (!xbt_dynar_is_empty(pd->msg_queue)) {
     XBT_DEBUG("Get a message from the queue");
     xbt_dynar_shift(pd->msg_queue, &msg);
   } else {
@@ -403,7 +403,7 @@ void gras_msg_handle(volatile double timeOut)
           XBT_DEBUG
               ("Use the callback #%d (@%p) for incomming msg '%s' (payload_size=%d)",
                cpt + 1, cb, msg.type->name, msg.payl_size);
-          if (!(*cb) (&ctx, msg.payl)) {
+          if (!cb(&ctx, msg.payl)) {
             /* cb handled the message */
             free(msg.payl);
             ran_ok = 1;