summaryrefslogtreecommitdiffstats
path: root/Include/fileobject.h
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2017-08-22 22:58:43 (GMT)
committerGitHub <noreply@github.com>2017-08-22 22:58:43 (GMT)
commitcb7fdf69ec9235cb358580f189089eaf575fb9df (patch)
treee4ab3983ce2c247b81ed6cbc5e611e4821114ae8 /Include/fileobject.h
parent8e572491b59c2334723bfd7411ab2a9fbd100f70 (diff)
downloadcpython-cb7fdf69ec9235cb358580f189089eaf575fb9df.zip
cpython-cb7fdf69ec9235cb358580f189089eaf575fb9df.tar.gz
cpython-cb7fdf69ec9235cb358580f189089eaf575fb9df.tar.bz2
bpo-28667: Fix a compile warning on FreeBSD when compare with FD_SETSIZE. (#501) (#3190)
FreeBSD is the only platforms with unsigned FD_SETSIZE. (cherry picked from commit 783d0c1a1c723733adcdf4249240246fc35a5bcb)
Diffstat (limited to 'Include/fileobject.h')
-rw-r--r--Include/fileobject.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/Include/fileobject.h b/Include/fileobject.h
index 6120e51..1dde17e 100644
--- a/Include/fileobject.h
+++ b/Include/fileobject.h
@@ -39,7 +39,7 @@ PyAPI_DATA(PyTypeObject) PyStdPrinter_Type;
/* A routine to check if a file descriptor can be select()-ed. */
#ifdef HAVE_SELECT
- #define _PyIsSelectable_fd(FD) (((FD) >= 0) && ((FD) < FD_SETSIZE))
+ #define _PyIsSelectable_fd(FD) ((unsigned int)(FD) < (unsigned int)FD_SETSIZE)
#else
#define _PyIsSelectable_fd(FD) (1)
#endif /* HAVE_SELECT */