mirror of https://github.com/mpv-player/mpv
win32: fix some Clang warnings
- win32-console-wrapper.c was inconsistently using the explicit Unicode versions of some Windows API functions and structures. - vo.c should use llabs for int64_t, since long is 32-bit on Windows. - vo_direct3d.c had a potential use of an uninitialized variable if it took the first goto error_exit.
This commit is contained in:
parent
40b626fd9b
commit
803e2c5f87
|
@ -36,8 +36,8 @@ void cr_perror(const wchar_t *prefix)
|
||||||
|
|
||||||
int cr_runproc(wchar_t *name, wchar_t *cmdline)
|
int cr_runproc(wchar_t *name, wchar_t *cmdline)
|
||||||
{
|
{
|
||||||
STARTUPINFO si;
|
STARTUPINFOW si;
|
||||||
STARTUPINFO our_si;
|
STARTUPINFOW our_si;
|
||||||
PROCESS_INFORMATION pi;
|
PROCESS_INFORMATION pi;
|
||||||
DWORD retval = 1;
|
DWORD retval = 1;
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ int cr_runproc(wchar_t *name, wchar_t *cmdline)
|
||||||
|
|
||||||
// Copy the list of inherited CRT file descriptors to the new process
|
// Copy the list of inherited CRT file descriptors to the new process
|
||||||
our_si.cb = sizeof(our_si);
|
our_si.cb = sizeof(our_si);
|
||||||
GetStartupInfo(&our_si);
|
GetStartupInfoW(&our_si);
|
||||||
si.lpReserved2 = our_si.lpReserved2;
|
si.lpReserved2 = our_si.lpReserved2;
|
||||||
si.cbReserved2 = our_si.cbReserved2;
|
si.cbReserved2 = our_si.cbReserved2;
|
||||||
|
|
||||||
|
|
|
@ -401,7 +401,7 @@ static void vsync_skip_detection(struct vo *vo)
|
||||||
}
|
}
|
||||||
int64_t desync = diff / in->num_vsync_samples;
|
int64_t desync = diff / in->num_vsync_samples;
|
||||||
if (in->drop_point > window * 2 &&
|
if (in->drop_point > window * 2 &&
|
||||||
labs(desync - desync_early) >= in->vsync_interval * 3 / 4)
|
llabs(desync - desync_early) >= in->vsync_interval * 3 / 4)
|
||||||
{
|
{
|
||||||
// Assume a drop. An underflow can technically speaking not be a drop
|
// Assume a drop. An underflow can technically speaking not be a drop
|
||||||
// (it's up to the driver what this is supposed to mean), but no reason
|
// (it's up to the driver what this is supposed to mean), but no reason
|
||||||
|
|
|
@ -1466,13 +1466,13 @@ static mp_image_t *get_window_screenshot(d3d_priv *priv)
|
||||||
POINT pt;
|
POINT pt;
|
||||||
D3DLOCKED_RECT locked_rect;
|
D3DLOCKED_RECT locked_rect;
|
||||||
int width, height;
|
int width, height;
|
||||||
|
IDirect3DSurface9 *surface = NULL;
|
||||||
|
|
||||||
if (FAILED(IDirect3DDevice9_GetDisplayMode(priv->d3d_device, 0, &mode))) {
|
if (FAILED(IDirect3DDevice9_GetDisplayMode(priv->d3d_device, 0, &mode))) {
|
||||||
MP_ERR(priv, "GetDisplayMode failed.\n");
|
MP_ERR(priv, "GetDisplayMode failed.\n");
|
||||||
goto error_exit;
|
goto error_exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
IDirect3DSurface9 *surface = NULL;
|
|
||||||
if (FAILED(IDirect3DDevice9_CreateOffscreenPlainSurface(priv->d3d_device,
|
if (FAILED(IDirect3DDevice9_CreateOffscreenPlainSurface(priv->d3d_device,
|
||||||
mode.Width, mode.Height, D3DFMT_A8R8G8B8, D3DPOOL_SYSTEMMEM, &surface,
|
mode.Width, mode.Height, D3DFMT_A8R8G8B8, D3DPOOL_SYSTEMMEM, &surface,
|
||||||
NULL)))
|
NULL)))
|
||||||
|
|
Loading…
Reference in New Issue