Loads do not remove any nodes from the exec after sets. Also fix a 'node leak'.
[libfirm] / ir / adt / list.h
index 2f8a267..8b8f205 100644 (file)
@@ -1,14 +1,9 @@
-/**
- * Linked lists.
- * Shamelessly adapted from the linux kernel.
- */
-
-#ifndef _FIRM_LIST_H
-#define _FIRM_LIST_H
 
-#include "firm_config.h"
-
-/*
+/**
+ * @file
+ * @brief   Doubly linked lists.
+ * @version $Id$
+ *
  * Simple doubly linked list implementation.
  *
  * Some of the internal functions ("__xxx") are useful when
  * sometimes we already know the next/prev entries and we can
  * generate better code by using them directly rather than
  * using the generic single-entry routines.
- */
+  */
+#ifndef FIRM_ADT_LIST_H
+#define FIRM_ADT_LIST_H
+
+#include "firm_config.h"
 
 struct list_head {
        struct list_head *next, *prev;
@@ -206,8 +205,7 @@ static INLINE void list_splice_init(struct list_head *list,
  * @param head the head for your list.
  */
 #define list_for_each(pos, head) \
-       for (pos = (head)->next, (pos->next); pos != (head); \
-               pos = pos->next, (pos->next))
+       for (pos = (head)->next; pos != (head); pos = pos->next)
 
 /**
  * __list_for_each     -       iterate over a list
@@ -228,8 +226,7 @@ static INLINE void list_splice_init(struct list_head *list,
  * @param head the head for your list.
  */
 #define list_for_each_prev(pos, head) \
-       for (pos = (head)->prev, (pos->prev); pos != (head); \
-               pos = pos->prev, (pos->prev))
+       for (pos = (head)->prev; pos != (head); pos = pos->prev)
 
 /**
  * list_for_each_safe  -       iterate over a list safe against removal of list entry