Re: Fix warning: cast from pointer to integer of different size

2008-04-23 Thread Juan Lang
3) Add a definition if FIELD_OFFSET wrapped in #ifndef. This is the least ugly option but would cause surprising results if one or the other was changed. Personally, I think this looks the best. As far as which is likely to get accepted.. often you have to try first to find that out

Re: Fix warning: cast from pointer to integer of different size

2008-04-23 Thread David Laight
On Tue, Apr 22, 2008 at 11:50:05PM +0900, Dmitry Timoshkov wrote: Erik de Castro Lopo [EMAIL PROTECTED] wrote: /* get pointer to object containing list element */ #define LIST_ENTRY(elem, type, field) \ -((type *)((char *)(elem) - (unsigned int)(((type *)0)-field))) +((type

Re: Fix warning: cast from pointer to integer of different size

2008-04-23 Thread Erik de Castro Lopo
David Laight wrote: On Tue, Apr 22, 2008 at 11:50:05PM +0900, Dmitry Timoshkov wrote: Erik de Castro Lopo [EMAIL PROTECTED] wrote: /* get pointer to object containing list element */ #define LIST_ENTRY(elem, type, field) \ -((type *)((char *)(elem) - (unsigned int)(((type

Re: Fix warning: cast from pointer to integer of different size

2008-04-22 Thread Dmitry Timoshkov
Erik de Castro Lopo [EMAIL PROTECTED] wrote: /* get pointer to object containing list element */ #define LIST_ENTRY(elem, type, field) \ -((type *)((char *)(elem) - (unsigned int)(((type *)0)-field))) +((type *)((char *)(elem) - (unsigned long)(((type *)0)-field))) It should be

Re: Fix warning: cast from pointer to integer of different size

2008-04-22 Thread Erik de Castro Lopo
Dmitry Timoshkov wrote: Erik de Castro Lopo [EMAIL PROTECTED] wrote: /* get pointer to object containing list element */ #define LIST_ENTRY(elem, type, field) \ -((type *)((char *)(elem) - (unsigned int)(((type *)0)-field))) +((type *)((char *)(elem) - (unsigned long)(((type

Re: Fix warning: cast from pointer to integer of different size

2008-04-22 Thread Dmitry Timoshkov
Erik de Castro Lopo [EMAIL PROTECTED] wrote: /* get pointer to object containing list element */ #define LIST_ENTRY(elem, type, field) \ -((type *)((char *)(elem) - (unsigned int)(((type *)0)-field))) +((type *)((char *)(elem) - (unsigned long)(((type *)0)-field))) It should be

Re: Fix warning: cast from pointer to integer of different size

2008-04-22 Thread Erik de Castro Lopo
Dmitry Timoshkov wrote: Erik de Castro Lopo [EMAIL PROTECTED] wrote: FIELD_OFFSET is defined in include/winnt.h. Now I could include winnt.h into include/wine/list.h but that doesn't seem right. I could also copy it,but having two definitions of the same macro is also not right.