include: Fix a few compiler warnings for the Mingw64 build.
authorAlexandre Julliard <julliard@winehq.org>
Tue, 9 Dec 2008 16:56:16 +0000 (17:56 +0100)
committerAlexandre Julliard <julliard@winehq.org>
Tue, 9 Dec 2008 16:56:16 +0000 (17:56 +0100)
include/wine/debug.h
include/wine/library.h
include/winnt.h
include/winsock.h

index adab5581583fbba4dccb3c6b3c0e9a0abf372140..ba6fabef1ab1be9293ccb5291ba77d5b85f0b47c 100644 (file)
@@ -186,7 +186,7 @@ static inline const char *wine_dbgstr_w( const WCHAR *s )
 static inline const char *wine_dbgstr_guid( const GUID *id )
 {
     if (!id) return "(null)";
-    if (!((ULONG_PTR)id >> 16)) return wine_dbg_sprintf( "<guid-0x%04lx>", (ULONG_PTR)id & 0xffff );
+    if (!((ULONG_PTR)id >> 16)) return wine_dbg_sprintf( "<guid-0x%04hx>", (WORD)(ULONG_PTR)id );
     return wine_dbg_sprintf( "{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
                              id->Data1, id->Data2, id->Data3,
                              id->Data4[0], id->Data4[1], id->Data4[2], id->Data4[3],
index 84d0a60d26fb17ba79d274792cc1e0170041ff63..52186c612f247ef111722561d8c4d835ad422a73 100644 (file)
@@ -132,9 +132,9 @@ WINE_LDT_EXTERN struct __wine_ldt_copy
 /* helper functions to manipulate the LDT_ENTRY structure */
 static inline void wine_ldt_set_base( LDT_ENTRY *ent, const void *base )
 {
-    ent->BaseLow               = (WORD)(unsigned long)base;
-    ent->HighWord.Bits.BaseMid = (BYTE)((unsigned long)base >> 16);
-    ent->HighWord.Bits.BaseHi  = (BYTE)((unsigned long)base >> 24);
+    ent->BaseLow               = (WORD)(ULONG_PTR)base;
+    ent->HighWord.Bits.BaseMid = (BYTE)((ULONG_PTR)base >> 16);
+    ent->HighWord.Bits.BaseHi  = (BYTE)((ULONG_PTR)base >> 24);
 }
 static inline void wine_ldt_set_limit( LDT_ENTRY *ent, unsigned int limit )
 {
@@ -145,8 +145,8 @@ static inline void wine_ldt_set_limit( LDT_ENTRY *ent, unsigned int limit )
 static inline void *wine_ldt_get_base( const LDT_ENTRY *ent )
 {
     return (void *)(ent->BaseLow |
-                    (unsigned long)ent->HighWord.Bits.BaseMid << 16 |
-                    (unsigned long)ent->HighWord.Bits.BaseHi << 24);
+                    (ULONG_PTR)ent->HighWord.Bits.BaseMid << 16 |
+                    (ULONG_PTR)ent->HighWord.Bits.BaseHi << 24);
 }
 static inline unsigned int wine_ldt_get_limit( const LDT_ENTRY *ent )
 {
index 1a71f88fe609af985ae26c4263f8eed50b90b65a..083bd961701f5bf362b1f9ddb9b20223d0c6819f 100644 (file)
@@ -246,6 +246,7 @@ extern "C" {
 
 /* C99 unaligned support */
 
+#ifndef UNALIGNED
 #if defined(_MSC_VER) && (defined(_M_MRX000) || defined(_M_ALPHA) || defined(_M_PPC) || defined(_M_IA64) || defined(_M_AMD64))
 # define UNALIGNED __unaligned
 # ifdef _WIN64
@@ -257,6 +258,7 @@ extern "C" {
 # define UNALIGNED
 # define UNALIGNED64
 #endif
+#endif
 
 /* Alignment macros */
 
index 4dafb9cd258eee12248072975200a5a353f332a5..b531bb3975c1ef5f7b5da12d9a5a93549ec50f4a 100644 (file)
@@ -90,6 +90,7 @@
 #  undef FD_SET
 #  undef FD_ZERO
 #  undef FD_ISSET
+#  undef _TIMEVAL_DEFINED
 
 #  define WS_DEFINE_SELECT
 # endif /* FD_CLR */
@@ -120,7 +121,7 @@ typedef unsigned long  WS_u_long;
 #else
 typedef unsigned int   WS_u_long;
 #endif
-#elif (defined(_MSC_VER) || defined(__MINGW_H) || defined(__WATCOMC__)) && !defined(_BSDTYPES_DEFINED)
+#elif (defined(_MSC_VER) || defined(__MINGW32__) || defined(__WATCOMC__)) && !defined(_BSDTYPES_DEFINED)
 /* MinGW doesn't define the u_xxx types */
 typedef unsigned char  u_char;
 typedef unsigned short u_short;