changeset: 37673:606818c33e50 branch: legacy-trunk user: Martin v. Löwis date: Thu Apr 13 07:52:27 2006 +0000 files: Modules/functionalmodule.c Objects/listobject.c Python/bltinmodule.c Python/codecs.c Python/modsupport.c description: Replace INT_MAX with PY_SSIZE_T_MAX. diff -r 0a28f157875e -r 606818c33e50 Modules/functionalmodule.c --- a/Modules/functionalmodule.c Thu Apr 13 07:37:25 2006 +0000 +++ b/Modules/functionalmodule.c Thu Apr 13 07:52:27 2006 +0000 @@ -48,7 +48,7 @@ pto->fn = func; Py_INCREF(func); - pto->args = PyTuple_GetSlice(args, 1, INT_MAX); + pto->args = PyTuple_GetSlice(args, 1, PY_SSIZE_T_MAX); if (pto->args == NULL) { pto->kw = NULL; Py_DECREF(pto); diff -r 0a28f157875e -r 606818c33e50 Objects/listobject.c --- a/Objects/listobject.c Thu Apr 13 07:37:25 2006 +0000 +++ b/Objects/listobject.c Thu Apr 13 07:52:27 2006 +0000 @@ -181,7 +181,7 @@ PyErr_BadInternalCall(); return -1; } - if (n == INT_MAX) { + if (n == PY_SSIZE_T_MAX) { PyErr_SetString(PyExc_OverflowError, "cannot add more objects to list"); return -1; @@ -221,7 +221,7 @@ Py_ssize_t n = PyList_GET_SIZE(self); assert (v != NULL); - if (n == INT_MAX) { + if (n == PY_SSIZE_T_MAX) { PyErr_SetString(PyExc_OverflowError, "cannot add more objects to list"); return -1; diff -r 0a28f157875e -r 606818c33e50 Python/bltinmodule.c --- a/Python/bltinmodule.c Thu Apr 13 07:37:25 2006 +0000 +++ b/Python/bltinmodule.c Thu Apr 13 07:52:27 2006 +0000 @@ -1746,14 +1746,13 @@ } else { /* strip trailing '\n' */ size_t len = strlen(s); - if (len > INT_MAX) { + if (len > PY_SSIZE_T_MAX) { PyErr_SetString(PyExc_OverflowError, "[raw_]input: input too long"); result = NULL; } else { - result = PyString_FromStringAndSize(s, - (int)(len-1)); + result = PyString_FromStringAndSize(s, len-1); } } PyMem_FREE(s); diff -r 0a28f157875e -r 606818c33e50 Python/codecs.c --- a/Python/codecs.c Thu Apr 13 07:37:25 2006 +0000 +++ b/Python/codecs.c Thu Apr 13 07:52:27 2006 +0000 @@ -56,12 +56,12 @@ char *p; PyObject *v; - if (len > INT_MAX) { - PyErr_SetString(PyExc_OverflowError, "string is too large"); - return NULL; - } + if (len > PY_SSIZE_T_MAX) { + PyErr_SetString(PyExc_OverflowError, "string is too large"); + return NULL; + } - v = PyString_FromStringAndSize(NULL, (int)len); + v = PyString_FromStringAndSize(NULL, len); if (v == NULL) return NULL; p = PyString_AS_STRING(v); diff -r 0a28f157875e -r 606818c33e50 Python/modsupport.c --- a/Python/modsupport.c Thu Apr 13 07:37:25 2006 +0000 +++ b/Python/modsupport.c Thu Apr 13 07:52:27 2006 +0000 @@ -407,7 +407,7 @@ else { if (n < 0) { size_t m = strlen(str); - if (m > INT_MAX) { + if (m > PY_SSIZE_T_MAX) { PyErr_SetString(PyExc_OverflowError, "string too long for Python string"); return NULL;