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

Erik de Castro Lopo mle+win at mega-nerd.com
Tue Apr 22 07:24:41 CDT 2008


Hi all,

Compiling after configuring with --enable-win64 I get a huge number
of the above warnings from all over the wine sources due to the
LIST_ENTRY macro in include/wine/list.h.

The following patch chnages a cast from a pointer to "unsigned int"
to a cast to "unsigned long".

Changelog:
* Cast from pointer to unsigned long instead of unsigned int

diff --git a/include/wine/list.h b/include/wine/list.h
index b018a1f..b610e5e 100644
--- a/include/wine/list.h
+++ b/include/wine/list.h
@@ -225,6 +225,6 @@ static inline void list_move_head( struct list *dst, struct list *src )
 
 /* 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)))
 
 #endif  /* __WINE_SERVER_LIST_H */






-- 
-----------------------------------------------------------------
Erik de Castro Lopo
-----------------------------------------------------------------
"Lumping configuration data, security data, kernel tuning parameters,
etc. into one monstrous fragile binary data structure is really dumb."
- David F. Skoll



More information about the wine-patches mailing list