diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-01-04 12:59:15 +0000 |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-01-04 12:59:15 +0000 |
commit | d4a9fa435abe536522fb0343710feac61914ce00 (patch) | |
tree | bc3eca8520bc3115c78193f855a198077d4494bb /Objects | |
parent | 6509b37bb8032193baa39e2526501b96bc763b75 (diff) | |
download | cpython-d4a9fa435abe536522fb0343710feac61914ce00.tar.gz |
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 54c23aec36..e9cae134c0 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 bcc6bc0c9b..2e0c8aac0e 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 a5863dd0a4..1fefe8414f 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"); |