Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
sed -i -e 's/\t/ /g' *.[ch] Please people, stop using tabs in your source
[simgrid.git] / src / gras / Msg / timer.c
index 3860423..1fff6ea 100644 (file)
@@ -23,7 +23,7 @@ void gras_timer_delay(double delay, void_f_void_t action)
 
   gras_timer_t timer = xbt_dynar_push_ptr(pd->timers);
 
-  VERB1("Register delayed action %p", action);
+  XBT_VERB("Register delayed action %p", action);
   timer->period = delay;
   timer->expiry = delay + gras_os_time();
   timer->action = action;
@@ -38,7 +38,7 @@ void gras_timer_repeat(double interval, void_f_void_t action)
 
   gras_timer_t timer = xbt_dynar_push_ptr(pd->timers);
 
-  VERB1("Register repetitive action %p", action);
+  XBT_VERB("Register repetitive action %p", action);
   timer->period = interval;
   timer->expiry = interval + gras_os_time();
   timer->action = action;
@@ -65,7 +65,7 @@ void gras_timer_cancel_delay(double interval, void_f_void_t action)
   }
 
   if (!found)
-    THROW2(mismatch_error, 0,
+    THROWF(mismatch_error, 0,
            "Cannot remove the action %p delayed of %f second: not found",
            action, interval);
 
@@ -91,7 +91,7 @@ void gras_timer_cancel_repeat(double interval, void_f_void_t action)
   }
 
   if (!found)
-    THROW2(mismatch_error, 0,
+    THROWF(mismatch_error, 0,
            "Cannot remove the action %p delayed of %f second: not found",
            action, interval);
 }
@@ -115,7 +115,7 @@ void gras_timer_cancel_delay_all(void)
   }
 
   if (!found)
-    THROW0(mismatch_error, 0, "No delayed action to remove");
+    THROWF(mismatch_error, 0, "No delayed action to remove");
 
 }
 
@@ -138,7 +138,7 @@ void gras_timer_cancel_repeat_all(void)
   }
 
   if (!found)
-    THROW0(mismatch_error, 0, "No repetitive action to remove");
+    THROWF(mismatch_error, 0, "No repetitive action to remove");
 }
 
 /** @brief Cancel all delayed and repetitive tasks */
@@ -166,26 +166,26 @@ double gras_msg_timer_handle(void)
     timer = xbt_dynar_get_ptr(pd->timers, cursor);
     untilthis = timer->expiry - now;
 
-    DEBUG2("Action %p expires in %f", timer->action, untilthis);
+    XBT_DEBUG("Action %p expires in %f", timer->action, untilthis);
 
     if (untilthis <= 0.0) {
       void_f_void_t action = timer->action;
 
-      DEBUG5("[%.0f] Serve %s action %p (%f<%f)", gras_os_time(),
+      XBT_DEBUG("[%.0f] Serve %s action %p (%f<%f)", gras_os_time(),
              timer->repeat ? "repetitive" : "delayed", timer->action,
              timer->expiry, now);
 
       if (timer->repeat) {
         timer->expiry = now + timer->period;
-        DEBUG4("[%.0f] Re-arm repetitive action %p for %f (period=%f)",
+        XBT_DEBUG("[%.0f] Re-arm repetitive action %p for %f (period=%f)",
                gras_os_time(), timer->action, timer->expiry,
                timer->period);
       } else {
-        DEBUG2("[%.0f] Remove %p now that it's done", gras_os_time(),
+        XBT_DEBUG("[%.0f] Remove %p now that it's done", gras_os_time(),
                timer->action);
         xbt_dynar_cursor_rm(pd->timers, &cursor);
       }
-      (*action) ();
+      action();
       return 0.0;
     } else if (untilthis < untilnext || untilnext == -1) {
       untilnext = untilthis;