From d295f6c556e61bc10c19abd0d48978213cbf7bc8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marc-Andr=C3=A9=20Lureau?= Date: Sat, 28 Jan 2012 12:39:43 +0100 Subject: [PATCH] select, poll, isatty: Avoid warnings on x86_64 mingw64. * lib/select.c (IsConsoleHandle): Use intptr_t to convert handle pointer to an integer. * lib/poll.c (IsConsoleHandle): Likewise. * lib/isatty.c (IsConsoleHandle): Likewise. --- ChangeLog | 8 ++++++++ lib/isatty.c | 2 +- lib/poll.c | 2 +- lib/select.c | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index e3781117c..c49da7fbc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2012-01-28 Marc-André Lureau (tiny change) + + select, poll, isatty: Avoid warnings on x86_64 mingw64. + * lib/select.c (IsConsoleHandle): Use intptr_t to convert handle + pointer to an integer. + * lib/poll.c (IsConsoleHandle): Likewise. + * lib/isatty.c (IsConsoleHandle): Likewise. + 2012-01-28 Jim Meyering doc: clarify README-release diff --git a/lib/isatty.c b/lib/isatty.c index fa70001ee..424245358 100644 --- a/lib/isatty.c +++ b/lib/isatty.c @@ -34,7 +34,7 @@ /* Optimized test whether a HANDLE refers to a console. See . */ -#define IsConsoleHandle(h) (((long) (h) & 3) == 3) +#define IsConsoleHandle(h) (((intptr_t) (h) & 3) == 3) #if HAVE_MSVC_INVALID_PARAMETER_HANDLER static inline int diff --git a/lib/poll.c b/lib/poll.c index 780a6d67b..47b6a7d4a 100644 --- a/lib/poll.c +++ b/lib/poll.c @@ -73,7 +73,7 @@ /* Optimized test whether a HANDLE refers to a console. See . */ -#define IsConsoleHandle(h) (((long) (h) & 3) == 3) +#define IsConsoleHandle(h) (((intptr_t) (h) & 3) == 3) static BOOL IsSocketHandle (HANDLE h) diff --git a/lib/select.c b/lib/select.c index c5522a056..7813f2f4e 100644 --- a/lib/select.c +++ b/lib/select.c @@ -80,7 +80,7 @@ typedef DWORD (WINAPI *PNtQueryInformationFile) /* Optimized test whether a HANDLE refers to a console. See . */ -#define IsConsoleHandle(h) (((long) (h) & 3) == 3) +#define IsConsoleHandle(h) (((intptr_t) (h) & 3) == 3) static BOOL IsSocketHandle (HANDLE h) -- 2.11.0