irop_flag_highlevel flag added to Confirm and Cast
[libfirm] / ir / adt / list.h
index af083a7..9664906 100644 (file)
@@ -6,15 +6,7 @@
 #ifndef _FIRM_LIST_H
 #define _FIRM_LIST_H
 
-#include "config.h"
-
-/*
- * These are non-NULL pointers that will result in page faults
- * under normal circumstances, used to verify that nobody uses
- * non-initialized list entries.
- */
-#define LIST_POISON1  ((void *) 0x00100100)
-#define LIST_POISON2  ((void *) 0x00200200)
+#include "firm_config.h"
 
 /*
  * Simple doubly linked list implementation.
@@ -51,14 +43,14 @@ struct list_head {
  * This is only for internal list manipulation where we know
  * the prev/next entries already!
  */
-static INLINE void __list_add(struct list_head *new,
+static INLINE void __list_add(struct list_head *new_node,
                              struct list_head *prev,
                              struct list_head *next)
 {
-       next->prev = new;
-       new->next = next;
-       new->prev = prev;
-       prev->next = new;
+       next->prev = new_node;
+       new_node->next = next;
+       new_node->prev = prev;
+       prev->next = new_node;
 }
 
 /**
@@ -69,9 +61,9 @@ static INLINE void __list_add(struct list_head *new,
  * Insert a new entry after the specified head.
  * This is good for implementing stacks.
  */
-static INLINE void list_add(struct list_head *new, struct list_head *head)
+static INLINE void list_add(struct list_head *new_node, struct list_head *head)
 {
-       __list_add(new, head, head->next);
+       __list_add(new_node, head, head->next);
 }
 
 /**
@@ -82,9 +74,9 @@ static INLINE void list_add(struct list_head *new, struct list_head *head)
  * Insert a new entry before the specified head.
  * This is useful for implementing queues.
  */
-static INLINE void list_add_tail(struct list_head *new, struct list_head *head)
+static INLINE void list_add_tail(struct list_head *new_node, struct list_head *head)
 {
-       __list_add(new, head->prev, head);
+       __list_add(new_node, head->prev, head);
 }
 
 /*
@@ -109,8 +101,8 @@ static INLINE void __list_del(struct list_head * prev, struct list_head * next)
 static INLINE void list_del(struct list_head *entry)
 {
        __list_del(entry->prev, entry->next);
-       entry->next = LIST_POISON1;
-       entry->prev = LIST_POISON2;
+       entry->next = NULL;
+       entry->prev = NULL;
 }
 
 
@@ -151,7 +143,7 @@ static INLINE void list_move_tail(struct list_head *list,
  * list_empty - tests whether a list is empty
  * @head: the list to test.
  */
-static INLINE int list_empty(struct list_head *head)
+static INLINE int list_empty(const struct list_head *head)
 {
        return head->next == head;
 }