From 7ab2813735d74fa217fac46ddb2d5c82a71404dd Mon Sep 17 00:00:00 2001 From: Kevin Koltzau Date: Tue, 23 Aug 2005 09:36:34 +0000 Subject: [PATCH] Fix pointer cast warnings in 64bit. --- include/windef.h | 12 ++++++------ include/wine/debug.h | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/windef.h b/include/windef.h index c9f64cd3213..ef6e7ef19ba 100644 --- a/include/windef.h +++ b/include/windef.h @@ -267,14 +267,14 @@ typedef INT (CALLBACK *PROC)(); /* Macros to split words and longs. */ -#define LOBYTE(w) ((BYTE)(WORD)(w)) -#define HIBYTE(w) ((BYTE)((WORD)(w) >> 8)) +#define LOBYTE(w) ((BYTE)((DWORD_PTR)(w) & 0xFF)) +#define HIBYTE(w) ((BYTE)((DWORD_PTR)(w) >> 8)) -#define LOWORD(l) ((WORD)(DWORD)(l)) -#define HIWORD(l) ((WORD)((DWORD)(l) >> 16)) +#define LOWORD(l) ((WORD)((DWORD_PTR)(l) & 0xFFFF)) +#define HIWORD(l) ((WORD)((DWORD_PTR)(l) >> 16)) -#define MAKEWORD(low,high) ((WORD)(((BYTE)(low)) | ((WORD)((BYTE)(high))) << 8)) -#define MAKELONG(low,high) ((LONG)(((WORD)(low)) | (((DWORD)((WORD)(high))) << 16))) +#define MAKEWORD(low,high) ((WORD)(((BYTE)((DWORD_PTR)(low) & 0xFF)) | ((WORD)((BYTE)((DWORD_PTR)(high) & 0xFF))) << 8)) +#define MAKELONG(low,high) ((LONG)(((WORD)((DWORD_PTR)(low) & 0xFFFF)) | ((DWORD)((WORD)((DWORD_PTR)(high) & 0xFFFF))) << 16)) /* min and max macros */ #ifndef NOMINMAX diff --git a/include/wine/debug.h b/include/wine/debug.h index b794d732b67..0b5c2491020 100644 --- a/include/wine/debug.h +++ b/include/wine/debug.h @@ -149,7 +149,7 @@ extern int wine_dbg_log( unsigned int cls, const char *ch, const char *func, static inline const char *wine_dbgstr_guid( const GUID *id ) { if (!id) return "(null)"; - if (!((int)id >> 16)) return wine_dbg_sprintf( "", (int)id & 0xffff ); + if (!((INT_PTR)id >> 16)) return wine_dbg_sprintf( "", (INT_PTR)id & 0xffff ); return wine_dbg_sprintf( "{%08lx-%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], -- 2.11.4.GIT