Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
kill a useless function
[simgrid.git] / src / xbt / fifo.c
index 9e022d7..3f6714b 100644 (file)
@@ -48,9 +48,13 @@ void xbt_fifo_free(xbt_fifo_t l)
  */
 void xbt_fifo_reset(xbt_fifo_t l)
 {
-  xbt_fifo_item_t b, tmp;
+  xbt_fifo_item_t b = xbt_fifo_get_first_item(l);
 
-  for (b = xbt_fifo_get_first_item(l); b; tmp = b, b = b->next, xbt_fifo_free_item(tmp));
+  while (b) {
+    xbt_fifo_item_t tmp = b;
+    b = b->next;
+    xbt_fifo_free_item(tmp);
+  }
   l->head = NULL;
   l->tail = NULL;
 }
@@ -555,13 +559,13 @@ xbt_fifo_item_t xbt_fifo_getPrevItem(xbt_fifo_item_t i)
  * These are internal XBT functions called by xbt_preinit/postexit().
  * It can be used several times to recreate the mallocator, for example when you switch to MC mode
  */
-void xbt_fifo_preinit(void)
+void xbt_fifo_preinit()
 {
   item_mallocator = xbt_mallocator_new(65536, fifo_item_mallocator_new_f,
                                        fifo_item_mallocator_free_f, fifo_item_mallocator_reset_f);
 }
 
-void xbt_fifo_postexit(void)
+void xbt_fifo_postexit()
 {
   if (item_mallocator != NULL) {
     xbt_mallocator_free(item_mallocator);