X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=lib%2Flist.h;h=b9d8cba65aba6127f8af6f3b80427c91adbcf1bb;hb=9240af1ae3159c7ba2f1ff1152089efd7fa5e38e;hp=3a7688566a67afbd1b0c462216aeca33c905a4ca;hpb=54f1c58cef6764fdd611eedc267e7491e777c09b;p=Project_algorithmic_C.git diff --git a/lib/list.h b/lib/list.h index 3a76885..b9d8cba 100644 --- a/lib/list.h +++ b/lib/list.h @@ -1,8 +1,8 @@ #ifndef __LIST_H #define __LIST_H -/* This file is from Linux Kernel (include/linux/list.h) - * and modified by simply removing hardware prefetching of list items. +/* This file is from Linux Kernel (include/linux/list.h) + * and modified by simply removing hardware prefetching of list items. * Here by copyright, credits attributed to wherever they belong. * Kulesh Shanmugasundaram (kulesh [squiggly] isis.poly.edu) */ @@ -21,6 +21,8 @@ struct list_head { struct list_head *next, *prev; }; +#define typeof __typeof__ + #define LIST_HEAD_INIT(name) { &(name), &(name) } #define LIST_HEAD(name) \ @@ -31,7 +33,7 @@ struct list_head { } while (0) /* - * Insert a new entry between two known consecutive entries. + * Insert a new entry between two known consecutive entries. * * This is only for internal list manipulation where we know * the prev/next entries already! @@ -104,7 +106,7 @@ static inline void list_del(struct list_head *entry) static inline void list_del_init(struct list_head *entry) { __list_del(entry->prev, entry->next); - INIT_LIST_HEAD(entry); + INIT_LIST_HEAD(entry); } /** @@ -205,7 +207,7 @@ static inline void list_splice_init(struct list_head *list, #define list_for_each_prev(pos, head) \ for (pos = (head)->prev; pos != (head); \ pos = pos->prev) - + /** * list_for_each_safe - iterate over a list safe against removal of list entry * @pos: the &struct list_head to use as a loop counter.