diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2017-03-12 12:43:12 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-12 12:43:12 (GMT) |
commit | 783d0c1a1c723733adcdf4249240246fc35a5bcb (patch) | |
tree | 15745c18439463475dbc63be52fbad5fff4f6868 /Modules | |
parent | bc44f045e6a801903bd7530a4fc5474e657832da (diff) | |
download | cpython-783d0c1a1c723733adcdf4249240246fc35a5bcb.zip cpython-783d0c1a1c723733adcdf4249240246fc35a5bcb.tar.gz cpython-783d0c1a1c723733adcdf4249240246fc35a5bcb.tar.bz2 |
bpo-28667: Fix a compile warning on FreeBSD when compare with FD_SETSIZE. (#501)
FreeBSD is the only platforms with unsigned FD_SETSIZE.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/selectmodule.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Modules/selectmodule.c b/Modules/selectmodule.c index 8bdf335..6f71d58 100644 --- a/Modules/selectmodule.c +++ b/Modules/selectmodule.c @@ -68,8 +68,8 @@ typedef struct { static void reap_obj(pylist fd2obj[FD_SETSIZE + 1]) { - int i; - for (i = 0; i < FD_SETSIZE + 1 && fd2obj[i].sentinel >= 0; i++) { + unsigned int i; + for (i = 0; i < (unsigned int)FD_SETSIZE + 1 && fd2obj[i].sentinel >= 0; i++) { Py_CLEAR(fd2obj[i].obj); } fd2obj[0].sentinel = -1; @@ -83,7 +83,7 @@ static int seq2set(PyObject *seq, fd_set *set, pylist fd2obj[FD_SETSIZE + 1]) { int max = -1; - int index = 0; + unsigned int index = 0; Py_ssize_t i; PyObject* fast_seq = NULL; PyObject* o = NULL; @@ -120,7 +120,7 @@ seq2set(PyObject *seq, fd_set *set, pylist fd2obj[FD_SETSIZE + 1]) FD_SET(v, set); /* add object and its file descriptor to the list */ - if (index >= FD_SETSIZE) { + if (index >= (unsigned int)FD_SETSIZE) { PyErr_SetString(PyExc_ValueError, "too many file descriptors in select()"); goto finally; |