aboutsummaryrefslogtreecommitdiff
path: root/compat/winansi.c
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2016-01-15 14:24:34 +0100
committerJunio C Hamano <gitster@pobox.com>2016-01-15 14:01:52 -0800
commit7c00bc39eb39a26a9ad33de6e4a03fff45e86f5e (patch)
tree0ce5e3f9579a4dc1e3dcc32f48f61e36c35489c5 /compat/winansi.c
parent59de49f80d8f6067f19496750cc79632b2959ad9 (diff)
downloadgit-7c00bc39eb39a26a9ad33de6e4a03fff45e86f5e.tar.gz
git-7c00bc39eb39a26a9ad33de6e4a03fff45e86f5e.tar.xz
mingw: avoid warnings when casting HANDLEs to int
HANDLE is defined internally as a void *, but in many cases it is actually guaranteed to be a 32-bit integer. In these cases, GCC should not warn about a cast of a pointer to an integer of a different type because we know exactly what we are doing. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'compat/winansi.c')
-rw-r--r--compat/winansi.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/compat/winansi.c b/compat/winansi.c
index 3aa5535f5..5dfa5ed61 100644
--- a/compat/winansi.c
+++ b/compat/winansi.c
@@ -454,7 +454,8 @@ static HANDLE duplicate_handle(HANDLE hnd)
HANDLE hresult, hproc = GetCurrentProcess();
if (!DuplicateHandle(hproc, hnd, hproc, &hresult, 0, TRUE,
DUPLICATE_SAME_ACCESS))
- die_lasterr("DuplicateHandle(%li) failed", (long) hnd);
+ die_lasterr("DuplicateHandle(%li) failed",
+ (long) (intptr_t) hnd);
return hresult;
}