summaryrefslogtreecommitdiffstats
path: root/Objects/funcobject.c
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2006-02-15 17:27:45 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2006-02-15 17:27:45 (GMT)
commit18e165558b24d29e7e0ca501842b9236589b012a (patch)
tree841678b5dc1aff3aa48701fee33a6ba7be00a72b /Objects/funcobject.c
parent44829297348d9121a03fc7df2fac557b583cc7fa (diff)
downloadcpython-18e165558b24d29e7e0ca501842b9236589b012a.zip
cpython-18e165558b24d29e7e0ca501842b9236589b012a.tar.gz
cpython-18e165558b24d29e7e0ca501842b9236589b012a.tar.bz2
Merge ssize_t branch.
Diffstat (limited to 'Objects/funcobject.c')
-rw-r--r--Objects/funcobject.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/Objects/funcobject.c b/Objects/funcobject.c
index d0e3a25..4abf51a 100644
--- a/Objects/funcobject.c
+++ b/Objects/funcobject.c
@@ -232,7 +232,7 @@ static int
func_set_code(PyFunctionObject *op, PyObject *value)
{
PyObject *tmp;
- int nfree, nclosure;
+ Py_ssize_t nfree, nclosure;
if (restricted())
return -1;
@@ -248,8 +248,8 @@ func_set_code(PyFunctionObject *op, PyObject *value)
PyTuple_GET_SIZE(op->func_closure));
if (nclosure != nfree) {
PyErr_Format(PyExc_ValueError,
- "%s() requires a code object with %d free vars,"
- " not %d",
+ "%s() requires a code object with %ld free vars,"
+ " not %ld",
PyString_AsString(op->func_name),
nclosure, nfree);
return -1;
@@ -363,7 +363,7 @@ func_new(PyTypeObject* type, PyObject* args, PyObject* kw)
PyObject *defaults = Py_None;
PyObject *closure = Py_None;
PyFunctionObject *newfunc;
- int nfree, nclosure;
+ Py_ssize_t nfree, nclosure;
static const char *kwlist[] = {"code", "globals", "name",
"argdefs", "closure", 0};
@@ -401,11 +401,11 @@ func_new(PyTypeObject* type, PyObject* args, PyObject* kw)
nclosure = closure == Py_None ? 0 : PyTuple_GET_SIZE(closure);
if (nfree != nclosure)
return PyErr_Format(PyExc_ValueError,
- "%s requires closure of length %d, not %d",
+ "%s requires closure of length %ld, not %ld",
PyString_AS_STRING(code->co_name),
nfree, nclosure);
if (nclosure) {
- int i;
+ Py_ssize_t i;
for (i = 0; i < nclosure; i++) {
PyObject *o = PyTuple_GET_ITEM(closure, i);
if (!PyCell_Check(o)) {
@@ -516,7 +516,7 @@ function_call(PyObject *func, PyObject *arg, PyObject *kw)
PyObject *result;
PyObject *argdefs;
PyObject **d, **k;
- int nk, nd;
+ Py_ssize_t nk, nd;
argdefs = PyFunction_GET_DEFAULTS(func);
if (argdefs != NULL && PyTuple_Check(argdefs)) {
@@ -529,7 +529,7 @@ function_call(PyObject *func, PyObject *arg, PyObject *kw)
}
if (kw != NULL && PyDict_Check(kw)) {
- int pos, i;
+ Py_ssize_t pos, i;
nk = PyDict_Size(kw);
k = PyMem_NEW(PyObject *, 2*nk);
if (k == NULL) {