Browse Source

Bugfix: elist: Use uintptr_t for member offset

Luke Dashjr 12 years ago
parent
commit
ddcf6c4164
1 changed files with 3 additions and 1 deletions
  1. 3 1
      elist.h

+ 3 - 1
elist.h

@@ -11,6 +11,8 @@
  * using the generic single-entry routines.
  */
 
+#include <stdint.h>
+
 struct list_head {
 	struct list_head *next, *prev;
 };
@@ -181,7 +183,7 @@ static inline void list_splice_init(struct list_head *list,
  * @member:	the name of the list_struct within the struct.
  */
 #define list_entry(ptr, type, member) \
-	((type *)((char *)(ptr)-(intptr_t)(&((type *)0)->member)))
+	((type *)((char *)(ptr)-(uintptr_t)(&((type *)0)->member)))
 
 /**
  * list_for_each	-	iterate over a list