From 50a4885174c24ef510fcd55dbba5a2199e31816d Mon Sep 17 00:00:00 2001 From: Dimitar Zhekov Date: Sun, 1 Nov 2015 20:23:35 +0200 Subject: [PATCH 1/2] Cast windows HANDLE to intptr_t, not long The cast in g_warning is not fixed. It's unimportant, displaying a handle value does not provide any meaningful information anyway. --- src/win32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/win32.c b/src/win32.c index a1398a9d9e..bbf9e7f82c 100644 --- a/src/win32.c +++ b/src/win32.c @@ -812,7 +812,7 @@ static FILE *open_std_handle(DWORD handle, const char *mode) g_free(err); return NULL; } - hConHandle = _open_osfhandle((long)lStdHandle, _O_TEXT); + hConHandle = _open_osfhandle(((intptr_t))lStdHandle, _O_TEXT); if (hConHandle == -1) { gchar *err = g_win32_error_message(GetLastError()); From a6a76bfe0d4d5c1af4033eed923ee6ddf81dca12 Mon Sep 17 00:00:00 2001 From: Dimitar Zhekov Date: Mon, 2 Nov 2015 20:15:23 +0200 Subject: [PATCH 2/2] Fix windows handle-to-intptr_t cast to use single parentheses --- src/win32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/win32.c b/src/win32.c index bbf9e7f82c..dc000780da 100644 --- a/src/win32.c +++ b/src/win32.c @@ -812,7 +812,7 @@ static FILE *open_std_handle(DWORD handle, const char *mode) g_free(err); return NULL; } - hConHandle = _open_osfhandle(((intptr_t))lStdHandle, _O_TEXT); + hConHandle = _open_osfhandle((intptr_t)lStdHandle, _O_TEXT); if (hConHandle == -1) { gchar *err = g_win32_error_message(GetLastError());