summaryrefslogtreecommitdiffstats
path: root/libvo
diff options
context:
space:
mode:
authorwm4 <wm4@mplayer2.org>2012-02-27 19:15:13 +0100
committerUoti Urpala <uau@mplayer2.org>2012-03-01 00:22:30 +0200
commit24be34f1e9e37111a06108c090324426aff6f1db (patch)
treeaa28674a6d69dfb18fd102608f72e3081df6d1dd /libvo
parent25417a626d0b9077bfbb940952f3858d7b8b549b (diff)
downloadmpv-24be34f1e9e37111a06108c090324426aff6f1db.tar.bz2
mpv-24be34f1e9e37111a06108c090324426aff6f1db.tar.xz
cleanup: Silence compilation warnings on MinGW-w64
Some of the code, especially the dshow and windows codec loader parts, are extremely hacky and likely full of bugs. The goal is merely getting rid of warnings that could obscure more important warnings and actual bugs, instead of fixing actual problems. This reduces the number of warnings from over 500 to almost the same as when compiling on Linux. Note that many problems stem from using the ancient wine-derived windows headers. There are some differences to the "proper" windows header. Changing the code to compile with the proper headers would be too much trouble, and it still has to work on Unix. Some of the changes might actually break compilation on legacy MinGW, but we don't support that anymore. Always use MinGW-w64, even when compiling to 32 bit. Fixes some warnings in the win32 loader code on Linux too.
Diffstat (limited to 'libvo')
-rw-r--r--libvo/vo_directx.c6
-rw-r--r--libvo/w32_common.c14
2 files changed, 11 insertions, 9 deletions
diff --git a/libvo/vo_directx.c b/libvo/vo_directx.c
index 419c0f2b94..d504e23567 100644
--- a/libvo/vo_directx.c
+++ b/libvo/vo_directx.c
@@ -276,7 +276,7 @@ static uint32_t Directx_CreateOverlay(uint32_t imgfmt)
case DDERR_OUTOFVIDEOMEMORY:
{mp_msg(MSGT_VO, MSGL_ERR,"not enough video memory\n");break;}
default:
- mp_msg(MSGT_VO, MSGL_ERR,"create surface failed with 0x%x\n",ddrval);
+ mp_msg(MSGT_VO, MSGL_ERR,"create surface failed with 0x%xu\n",(unsigned)ddrval);
}
return 1;
}
@@ -588,7 +588,7 @@ static uint32_t Directx_ManageDisplay(void)
// we should try upping the destination size a bit, or
// perhaps shrinking the source size
mp_msg(MSGT_VO, MSGL_ERR ,"<vo_directx><ERROR>UpdateOverlay failed\n" );
- mp_msg(MSGT_VO, MSGL_ERR ,"<vo_directx><ERROR>Overlay:x1:%i,y1:%i,x2:%i,y2:%i,w:%i,h:%i\n",rd.left,rd.top,rd.right,rd.bottom,rd.right - rd.left,rd.bottom - rd.top );
+ mp_msg(MSGT_VO, MSGL_ERR ,"<vo_directx><ERROR>Overlay:x1:%li,y1:%li,x2:%li,y2:%li,w:%li,h:%li\n",rd.left,rd.top,rd.right,rd.bottom,rd.right - rd.left,rd.bottom - rd.top );
mp_msg(MSGT_VO, MSGL_ERR ,"<vo_directx><ERROR>");
switch (ddrval)
{
@@ -618,7 +618,7 @@ static uint32_t Directx_ManageDisplay(void)
break;
}
default:
- mp_msg(MSGT_VO, MSGL_ERR ," 0x%x\n",ddrval);
+ mp_msg(MSGT_VO, MSGL_ERR ," 0x%xu\n",(unsigned)ddrval);
}
/*ok we can't do anything about it -> hide overlay*/
if(ddrval != DD_OK)
diff --git a/libvo/w32_common.c b/libvo/w32_common.c
index a8a59d02c9..475327ce5c 100644
--- a/libvo/w32_common.c
+++ b/libvo/w32_common.c
@@ -41,6 +41,8 @@
#define MONITOR_DEFAULTTOPRIMARY 1
#endif
+#define WIN_ID_TO_HWND(x) ((HWND)(uint32_t)(x))
+
static const char classname[] = "MPlayer - The Movie Player";
int vo_vm = 0;
@@ -116,7 +118,7 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM l
break;
case WM_WINDOWPOSCHANGING:
if (vo_keepaspect && !vo_fs && WinID < 0) {
- WINDOWPOS *wpos = lParam;
+ WINDOWPOS *wpos = (WINDOWPOS*)lParam;
int xborder, yborder;
r.left = r.top = 0;
r.right = wpos->cx;
@@ -232,10 +234,10 @@ int vo_w32_check_events(void) {
vo_dx = p.x; vo_dy = p.y;
event_flags |= VO_EVENT_MOVE;
}
- res = GetClientRect(WinID, &r);
+ res = GetClientRect(WIN_ID_TO_HWND(WinID), &r);
if (res && (r.right != vo_dwidth || r.bottom != vo_dheight))
MoveWindow(vo_window, 0, 0, r.right, r.bottom, FALSE);
- if (!IsWindow(WinID))
+ if (!IsWindow(WIN_ID_TO_HWND(WinID)))
// Window has probably been closed, e.g. due to program crash
mplayer_put_key(KEY_CLOSE_WIN);
}
@@ -514,11 +516,11 @@ int vo_w32_init(void) {
if (WinID >= 0)
{
RECT r;
- GetClientRect(WinID, &r);
+ GetClientRect(WIN_ID_TO_HWND(WinID), &r);
vo_dwidth = r.right; vo_dheight = r.bottom;
vo_window = CreateWindowEx(WS_EX_NOPARENTNOTIFY, classname, classname,
- WS_CHILD | WS_VISIBLE,
- 0, 0, vo_dwidth, vo_dheight, WinID, 0, hInstance, 0);
+ WS_CHILD | WS_VISIBLE, 0, 0, vo_dwidth, vo_dheight,
+ WIN_ID_TO_HWND(WinID), 0, hInstance, 0);
EnableWindow(vo_window, 0);
} else
vo_window = CreateWindowEx(0, classname, classname,