From 689e7ad9b0fccd582cd63796cc90a999f141f589 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Sun, 31 Mar 2013 18:36:37 +0100 Subject: [PATCH] hw/xwin: Win32 Windows properties are of pointer type HANDLE, not an integer type Win32 Windows properties are of pointer type HANDLE, not an integer type, but we use the Windows property WINDOW_WID_PROP to store the X window XID. Add appropriate casts to show it doesn't matter that an XID is smaller than a pointer on 64-bit build. Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison --- hw/xwin/winmultiwindowwindow.c | 4 ++-- hw/xwin/winmultiwindowwndproc.c | 6 +++--- hw/xwin/winprefs.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/xwin/winmultiwindowwindow.c b/hw/xwin/winmultiwindowwindow.c index dcbfaff72..44ad19302 100644 --- a/hw/xwin/winmultiwindowwindow.c +++ b/hw/xwin/winmultiwindowwindow.c @@ -519,7 +519,7 @@ winCreateWindowsWindow(WindowPtr pWin) if (winMultiWindowGetTransientFor(pWin, &daddyId)) { if (daddyId) { hFore = GetForegroundWindow(); - if (hFore && (daddyId != (Window) GetProp(hFore, WIN_WID_PROP))) + if (hFore && (daddyId != (Window) (INT_PTR) GetProp(hFore, WIN_WID_PROP))) hFore = NULL; } } @@ -593,7 +593,7 @@ winCreateWindowsWindow(WindowPtr pWin) /* Cause any .XWinrc menus to be added in main WNDPROC */ PostMessage(hWnd, WM_INIT_SYS_MENU, 0, 0); - SetProp(hWnd, WIN_WID_PROP, (HANDLE) winGetWindowID(pWin)); + SetProp(hWnd, WIN_WID_PROP, (HANDLE) (INT_PTR) winGetWindowID(pWin)); /* Flag that this Windows window handles its own activation */ SetProp(hWnd, WIN_NEEDMANAGE_PROP, (HANDLE) 0); diff --git a/hw/xwin/winmultiwindowwndproc.c b/hw/xwin/winmultiwindowwndproc.c index 0e46ea7fe..381818789 100644 --- a/hw/xwin/winmultiwindowwndproc.c +++ b/hw/xwin/winmultiwindowwndproc.c @@ -343,7 +343,7 @@ winTopLevelWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) /* */ wmMsg.msg = 0; wmMsg.hwndWindow = hwnd; - wmMsg.iWindow = (Window) GetProp(hwnd, WIN_WID_PROP); + wmMsg.iWindow = (Window) (INT_PTR) GetProp(hwnd, WIN_WID_PROP); wmMsg.iX = pDraw->x; wmMsg.iY = pDraw->y; @@ -391,8 +391,8 @@ winTopLevelWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) /* */ SetProp(hwnd, WIN_WID_PROP, - (HANDLE) winGetWindowID(((LPCREATESTRUCT) lParam)-> - lpCreateParams)); + (HANDLE) (INT_PTR) winGetWindowID(((LPCREATESTRUCT) lParam)-> + lpCreateParams)); /* * Make X windows' Z orders sync with Windows windows because diff --git a/hw/xwin/winprefs.c b/hw/xwin/winprefs.c index 05d8c874d..8936aae63 100644 --- a/hw/xwin/winprefs.c +++ b/hw/xwin/winprefs.c @@ -181,7 +181,7 @@ ReloadEnumWindowsProc(HWND hwnd, LPARAM lParam) wmMsg.msg = WM_WM_ICON_EVENT; wmMsg.hwndWindow = hwnd; - wmMsg.iWindow = (Window) GetProp(hwnd, WIN_WID_PROP); + wmMsg.iWindow = (Window) (INT_PTR) GetProp(hwnd, WIN_WID_PROP); winSendMessageToWM(s_pScreenPriv->pWMInfo, &wmMsg); }