diff options
author | Mark Dickinson <dickinsm@gmail.com> | 2009-05-08 20:58:08 (GMT) |
---|---|---|
committer | Mark Dickinson <dickinsm@gmail.com> | 2009-05-08 20:58:08 (GMT) |
commit | 083d1f9f9a26486cf9f0d85fb0e76e6cf9474b0c (patch) | |
tree | bb403fffb09b39482326a29c927a0d262ef75469 /Modules/resource.c | |
parent | fd1ee7a8a02a6785329ae31971d910d15e5235f3 (diff) | |
download | cpython-083d1f9f9a26486cf9f0d85fb0e76e6cf9474b0c.zip cpython-083d1f9f9a26486cf9f0d85fb0e76e6cf9474b0c.tar.gz cpython-083d1f9f9a26486cf9f0d85fb0e76e6cf9474b0c.tar.bz2 |
Issue #5933: Fix gcc -Wextra compiler warnings (and remove some
trailing whitespace).
Diffstat (limited to 'Modules/resource.c')
-rw-r--r-- | Modules/resource.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Modules/resource.c b/Modules/resource.c index d38c660..38974f9 100644 --- a/Modules/resource.c +++ b/Modules/resource.c @@ -147,7 +147,7 @@ resource_setrlimit(PyObject *self, PyObject *args) int resource; PyObject *curobj, *maxobj; - if (!PyArg_ParseTuple(args, "i(OO):setrlimit", + if (!PyArg_ParseTuple(args, "i(OO):setrlimit", &resource, &curobj, &maxobj)) return NULL; @@ -159,27 +159,27 @@ resource_setrlimit(PyObject *self, PyObject *args) #if !defined(HAVE_LARGEFILE_SUPPORT) rl.rlim_cur = PyInt_AsLong(curobj); - if (rl.rlim_cur == -1 && PyErr_Occurred()) + if (rl.rlim_cur == (rlim_t)-1 && PyErr_Occurred()) return NULL; rl.rlim_max = PyInt_AsLong(maxobj); - if (rl.rlim_max == -1 && PyErr_Occurred()) + if (rl.rlim_max == (rlim_t)-1 && PyErr_Occurred()) return NULL; #else /* The limits are probably bigger than a long */ rl.rlim_cur = PyLong_Check(curobj) ? PyLong_AsLongLong(curobj) : PyInt_AsLong(curobj); - if (rl.rlim_cur == -1 && PyErr_Occurred()) + if (rl.rlim_cur == (rlim_t)-1 && PyErr_Occurred()) return NULL; rl.rlim_max = PyLong_Check(maxobj) ? PyLong_AsLongLong(maxobj) : PyInt_AsLong(maxobj); - if (rl.rlim_max == -1 && PyErr_Occurred()) + if (rl.rlim_max == (rlim_t)-1 && PyErr_Occurred()) return NULL; #endif rl.rlim_cur = rl.rlim_cur & RLIM_INFINITY; rl.rlim_max = rl.rlim_max & RLIM_INFINITY; if (setrlimit(resource, &rl) == -1) { - if (errno == EINVAL) + if (errno == EINVAL) PyErr_SetString(PyExc_ValueError, "current limit exceeds maximum limit"); else if (errno == EPERM) |