fix
[libfirm] / ir / adt / list.h
index 034f467..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;
@@ -55,8 +54,8 @@ static INLINE void __list_add(struct list_head *new_node,
 
 /**
  * list_add - add a new entry
- * @param new   new entry to be added
- * @param head  list head to add it after
+ * @param new_node   new entry to be added
+ * @param head       list head to add it after
  *
  * Insert a new entry after the specified head.
  * This is good for implementing stacks.
@@ -68,8 +67,8 @@ static INLINE void list_add(struct list_head *new_node, struct list_head *head)
 
 /**
  * list_add_tail - add a new entry
- * @param new   new entry to be added
- * @param head  list head to add it before
+ * @param new_node   new entry to be added
+ * @param head       list head to add it before
  *
  * Insert a new entry before the specified head.
  * This is useful for implementing queues.
@@ -176,11 +175,11 @@ static INLINE void list_splice(struct list_head *list, struct list_head *head)
 }
 
 /**
- * list_splice_init - join two lists and reinitialise the emptied list.
+ * list_splice_init - join two lists and reinitialize the emptied list.
  * @param list   the new list to add.
  * @param head   the place to add it in the first list.
  *
- * The list at @list is reinitialised
+ * The list at list is reinitialized
  */
 static INLINE void list_splice_init(struct list_head *list,
                                    struct list_head *head)
@@ -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