Fix win64 portability warning

Reported by Ozkan Sezer <sezeroz@gmail.com>:

There are also warnings wherever list_entry() macro is used, such as:

src/load.c: In function 'unlink_tempfiles':
src/load.c:404:8: warning: cast from pointer to integer of different size

... or:

options.c: In function 'usage':
options.c:52:8: warning: cast from pointer to integer of different size
options.c:57:8: warning: cast from pointer to integer of different size

... which may be cured by changing (unsigned long) cast with (size_t)

Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
master
Claudio Matsuoka 12 years ago
parent 17c0aff936
commit ca9e0f806b
  1. 2
      src/list.h

@ -133,7 +133,7 @@ static __inline__ void list_splice(struct list_head *list, struct list_head *hea
* @member: the name of the list_struct within the struct.
*/
#define list_entry(ptr, type, member) \
((type *)((char *)(ptr)-(unsigned long)(&((type *)0)->member)))
((type *)((char *)(ptr)-(size_t)(&((type *)0)->member)))
/**
* list_for_each - iterate over a list

Loading…
Cancel
Save