win-capture: deal with a 32bit handle cast errors

The HWND type is a void pointer, but HWND values are global and always
32bit despite, so casting to 32bit can cause cast warnings on actual
good compilers like gcc via mingw.  This change correctly handles the
casting to 32bits without producing unwanted warnings or errors on
mingw.
master
martell 2015-02-05 07:21:42 +00:00 committed by jp9000
parent c5fa22ae93
commit 1e056fd7ec
5 changed files with 6 additions and 6 deletions

View File

@ -510,7 +510,7 @@ static bool d3d10_shtex_init(HWND window)
}
if (!capture_init_shtex(&data.shtex_info, window,
data.base_cx, data.base_cy, data.cx, data.cy,
data.format, false, (uint32_t)data.handle)) {
data.format, false, (uintptr_t)data.handle)) {
return false;
}

View File

@ -516,7 +516,7 @@ static bool d3d11_shtex_init(HWND window)
}
if (!capture_init_shtex(&data.shtex_info, window,
data.base_cx, data.base_cy, data.cx, data.cy,
data.format, false, (uint32_t)data.handle)) {
data.format, false, (uintptr_t)data.handle)) {
return false;
}

View File

@ -285,7 +285,7 @@ static bool d3d9_shtex_init(uint32_t cx, uint32_t cy, HWND window)
}
if (!capture_init_shtex(&data.shtex_info, window, cx, cy,
data.cx, data.cy, data.dxgi_format, false,
(uint32_t)data.handle)) {
(uintptr_t)data.handle)) {
return false;
}

View File

@ -581,7 +581,7 @@ static inline bool init_shared_info(size_t size)
bool capture_init_shtex(struct shtex_data **data, HWND window,
uint32_t base_cx, uint32_t base_cy, uint32_t cx, uint32_t cy,
uint32_t format, bool flip, uint32_t handle)
uint32_t format, bool flip, uintptr_t handle)
{
if (!init_shared_info(sizeof(struct shtex_data))) {
hlog("capture_init_shtex: Failed to initialize memory");
@ -589,7 +589,7 @@ bool capture_init_shtex(struct shtex_data **data, HWND window,
}
*data = shmem_info;
(*data)->tex_handle = handle;
(*data)->tex_handle = (uint32_t)handle;
global_hook_info->window = (uint32_t)window;
global_hook_info->type = CAPTURE_TYPE_TEXTURE;

View File

@ -49,7 +49,7 @@ extern bool rehook_gl(void);
extern bool capture_init_shtex(struct shtex_data **data, HWND window,
uint32_t base_cx, uint32_t base_cy, uint32_t cx, uint32_t cy,
uint32_t format, bool flip, uint32_t handle);
uint32_t format, bool flip, uintptr_t handle);
extern bool capture_init_shmem(struct shmem_data **data, HWND window,
uint32_t base_cx, uint32_t base_cy, uint32_t cx, uint32_t cy,
uint32_t pitch, uint32_t format, bool flip);