[Python-checkins] r72482 - in python/branches/py3k: Modules/resource.c
mark.dickinson
python-checkins at python.org
Fri May 8 23:01:57 CEST 2009
Author: mark.dickinson
Date: Fri May 8 23:01:57 2009
New Revision: 72482
Log:
Merged revisions 72479 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r72479 | mark.dickinson | 2009-05-08 21:58:08 +0100 (Fri, 08 May 2009) | 3 lines
Issue #5933: Fix gcc -Wextra compiler warnings (and remove some
trailing whitespace).
........
Modified:
python/branches/py3k/ (props changed)
python/branches/py3k/Modules/resource.c
Modified: python/branches/py3k/Modules/resource.c
==============================================================================
--- python/branches/py3k/Modules/resource.c (original)
+++ python/branches/py3k/Modules/resource.c Fri May 8 23:01:57 2009
@@ -147,7 +147,7 @@
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 @@
#if !defined(HAVE_LARGEFILE_SUPPORT)
rl.rlim_cur = PyLong_AsLong(curobj);
- if (rl.rlim_cur == -1 && PyErr_Occurred())
+ if (rl.rlim_cur == (rlim_t)-1 && PyErr_Occurred())
return NULL;
rl.rlim_max = PyLong_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) : PyLong_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) : PyLong_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)
More information about the Python-checkins
mailing list