Alexandre Julliard : include: Fix a few compiler warnings for the Mingw64 build.
Alexandre Julliard
julliard at winehq.org
Wed Dec 10 07:41:28 CST 2008
Module: wine
Branch: master
Commit: baaaa58b506a728dceaf11d1afa8ace55c7e1b67
URL: http://source.winehq.org/git/wine.git/?a=commit;h=baaaa58b506a728dceaf11d1afa8ace55c7e1b67
Author: Alexandre Julliard <julliard at winehq.org>
Date: Tue Dec 9 17:56:16 2008 +0100
include: Fix a few compiler warnings for the Mingw64 build.
---
include/wine/debug.h | 2 +-
include/wine/library.h | 10 +++++-----
include/winnt.h | 2 ++
include/winsock.h | 3 ++-
4 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/include/wine/debug.h b/include/wine/debug.h
index adab558..ba6fabe 100644
--- a/include/wine/debug.h
+++ b/include/wine/debug.h
@@ -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],
diff --git a/include/wine/library.h b/include/wine/library.h
index 84d0a60..52186c6 100644
--- a/include/wine/library.h
+++ b/include/wine/library.h
@@ -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 )
{
diff --git a/include/winnt.h b/include/winnt.h
index 1a71f88..083bd96 100644
--- a/include/winnt.h
+++ b/include/winnt.h
@@ -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 */
diff --git a/include/winsock.h b/include/winsock.h
index 4dafb9c..b531bb3 100644
--- a/include/winsock.h
+++ b/include/winsock.h
@@ -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;
More information about the wine-cvs
mailing list