aboutsummaryrefslogtreecommitdiffstats
path: root/include/openbsc
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2009-05-23 05:24:48 +0000
committerHarald Welte <laforge@gnumonks.org>2009-05-23 05:24:48 +0000
commitbe68f6fc6cde1367a4481d2e774a64e2cd657267 (patch)
treea19a44427b7b8b45fcc5e6bcb18f8659e50dd9ea /include/openbsc
parentff117a8d1138d9629df543ed00e698ee3a0bdb73 (diff)
Change the variable "new" to "_new" in order to include it from C++ code.
The define "container_of" will cast pointer before assigning. Compilers with stricter options require this. (Andreas Eversberg)
Diffstat (limited to 'include/openbsc')
-rw-r--r--include/openbsc/linuxlist.h26
1 files changed, 13 insertions, 13 deletions
diff --git a/include/openbsc/linuxlist.h b/include/openbsc/linuxlist.h
index a89375e2..fb99c5ec 100644
--- a/include/openbsc/linuxlist.h
+++ b/include/openbsc/linuxlist.h
@@ -18,8 +18,8 @@ static inline void prefetch(const void *x) {;}
*
*/
#define container_of(ptr, type, member) ({ \
- const typeof( ((type *)0)->member ) *__mptr = (ptr); \
- (type *)( (char *)__mptr - offsetof(type,member) );})
+ const typeof( ((type *)0)->member ) *__mptr = (typeof( ((type *)0)->member ) *)(ptr); \
+ (type *)( (char *)__mptr - offsetof(type, member) );})
/*
@@ -59,14 +59,14 @@ struct llist_head {
* This is only for internal llist manipulation where we know
* the prev/next entries already!
*/
-static inline void __llist_add(struct llist_head *new,
+static inline void __llist_add(struct llist_head *_new,
struct llist_head *prev,
struct llist_head *next)
{
- next->prev = new;
- new->next = next;
- new->prev = prev;
- prev->next = new;
+ next->prev = _new;
+ _new->next = next;
+ _new->prev = prev;
+ prev->next = _new;
}
/**
@@ -77,9 +77,9 @@ static inline void __llist_add(struct llist_head *new,
* Insert a new entry after the specified head.
* This is good for implementing stacks.
*/
-static inline void llist_add(struct llist_head *new, struct llist_head *head)
+static inline void llist_add(struct llist_head *_new, struct llist_head *head)
{
- __llist_add(new, head, head->next);
+ __llist_add(_new, head, head->next);
}
/**
@@ -90,9 +90,9 @@ static inline void llist_add(struct llist_head *new, struct llist_head *head)
* Insert a new entry before the specified head.
* This is useful for implementing queues.
*/
-static inline void llist_add_tail(struct llist_head *new, struct llist_head *head)
+static inline void llist_add_tail(struct llist_head *_new, struct llist_head *head)
{
- __llist_add(new, head->prev, head);
+ __llist_add(_new, head->prev, head);
}
/*
@@ -117,8 +117,8 @@ static inline void __llist_del(struct llist_head * prev, struct llist_head * nex
static inline void llist_del(struct llist_head *entry)
{
__llist_del(entry->prev, entry->next);
- entry->next = LLIST_POISON1;
- entry->prev = LLIST_POISON2;
+ entry->next = (struct llist_head *)LLIST_POISON1;
+ entry->prev = (struct llist_head *)LLIST_POISON2;
}
/**