From 4be6ff5ee33bf1c0fabd00d8f5280e2be222adea Mon Sep 17 00:00:00 2001 From: Kovensky Date: Sat, 23 Mar 2013 16:38:22 -0300 Subject: w32_common: Cygwin64 fixes Good news: MPV worked fine even without the fixes, but pointer size mismatch warnings aren't the nicest things to leave lying around. Fix macro that assumed HWND is uint32_t-sized. Win64 is also a special butterfly and is an LLP64 platform on amd64 CPUs, while all the other amd64 platforms are LP64. Cygwin decided to go with the other platforms, and thus sizeof(long) != sizeof(int), and in cygwin's windows headers LONG is int-sized. Fix an mp_msg that assumed LONG is long. --- video/out/w32_common.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/video/out/w32_common.c b/video/out/w32_common.c index 0a96af513a..f828f58a1a 100644 --- a/video/out/w32_common.c +++ b/video/out/w32_common.c @@ -33,7 +33,7 @@ #include "osdep/io.h" #include "talloc.h" -#define WIN_ID_TO_HWND(x) ((HWND)(uint32_t)(x)) +#define WIN_ID_TO_HWND(x) ((HWND)(intptr_t)(x)) static const wchar_t classname[] = L"mpv"; @@ -458,8 +458,9 @@ static int reinit_window_state(struct vo *vo) SetWindowLong(w32->window, GWL_STYLE, style); add_window_borders(w32->window, &r); - mp_msg(MSGT_VO, MSGL_V, "[vo] reset window bounds: %ld:%ld:%ld:%ld\n", - r.left, r.top, r.right - r.left, r.bottom - r.top); + mp_msg(MSGT_VO, MSGL_V, "[vo] reset window bounds: %d:%d:%d:%d\n", + (int) r.left, (int) r.top, (int)(r.right - r.left), + (int)(r.bottom - r.top)); SetWindowPos(w32->window, layer, r.left, r.top, r.right - r.left, r.bottom - r.top, SWP_FRAMECHANGED); -- cgit v1.2.3