diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-01-04 12:59:15 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-01-04 12:59:15 (GMT) |
commit | 0fcab4a3ed5e39769609b60d6179c4c801e45985 (patch) | |
tree | fc5592e351ed18a96d7e94aeb2ced52c0ba2fd0d /Objects | |
parent | 6ab8e8298eba1d52debc53d6e6a38d419bb255c0 (diff) | |
download | cpython-0fcab4a3ed5e39769609b60d6179c4c801e45985.zip cpython-0fcab4a3ed5e39769609b60d6179c4c801e45985.tar.gz cpython-0fcab4a3ed5e39769609b60d6179c4c801e45985.tar.bz2 |
Issue #9566: use Py_ssize_t instead of int
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/codeobject.c | 5 | ||||
-rw-r--r-- | Objects/listobject.c | 2 | ||||
-rw-r--r-- | Objects/typeobject.c | 6 |
3 files changed, 7 insertions, 6 deletions
diff --git a/Objects/codeobject.c b/Objects/codeobject.c index 54c23ae..e9cae13 100644 --- a/Objects/codeobject.c +++ b/Objects/codeobject.c @@ -492,7 +492,7 @@ PyTypeObject PyCode_Type = { int PyCode_Addr2Line(PyCodeObject *co, int addrq) { - int size = PyBytes_Size(co->co_lnotab) / 2; + Py_ssize_t size = PyBytes_Size(co->co_lnotab) / 2; unsigned char *p = (unsigned char*)PyBytes_AsString(co->co_lnotab); int line = co->co_firstlineno; int addr = 0; @@ -510,7 +510,8 @@ PyCode_Addr2Line(PyCodeObject *co, int addrq) int _PyCode_CheckLineNumber(PyCodeObject* co, int lasti, PyAddrPair *bounds) { - int size, addr, line; + Py_ssize_t size; + int addr, line; unsigned char* p; p = (unsigned char*)PyBytes_AS_STRING(co->co_lnotab); diff --git a/Objects/listobject.c b/Objects/listobject.c index bcc6bc0..2e0c8aa 100644 --- a/Objects/listobject.c +++ b/Objects/listobject.c @@ -1381,7 +1381,7 @@ typedef struct s_MergeState { /* Conceptually a MergeState's constructor. */ static void -merge_init(MergeState *ms, int list_size, int has_keyfunc) +merge_init(MergeState *ms, Py_ssize_t list_size, int has_keyfunc) { assert(ms != NULL); if (has_keyfunc) { diff --git a/Objects/typeobject.c b/Objects/typeobject.c index a5863dd..1fefe84 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -2325,7 +2325,7 @@ PyObject* PyType_FromSpec(PyType_Spec *spec) res->ht_type.tp_basicsize = spec->basicsize; res->ht_type.tp_itemsize = spec->itemsize; res->ht_type.tp_flags = spec->flags | Py_TPFLAGS_HEAPTYPE; - + for (slot = spec->slots; slot->slot; slot++) { if (slot->slot >= sizeof(slotoffsets)/sizeof(slotoffsets[0])) { PyErr_SetString(PyExc_RuntimeError, "invalid slot offset"); @@ -2335,7 +2335,7 @@ PyObject* PyType_FromSpec(PyType_Spec *spec) } return (PyObject*)res; - + fail: Py_DECREF(res); return NULL; @@ -6202,7 +6202,7 @@ super_init(PyObject *self, PyObject *args, PyObject *kwds) and first local variable on the stack. */ PyFrameObject *f = PyThreadState_GET()->frame; PyCodeObject *co = f->f_code; - int i, n; + Py_ssize_t i, n; if (co == NULL) { PyErr_SetString(PyExc_SystemError, "super(): no code object"); |