mirror of
https://github.com/python/cpython.git
synced 2025-07-31 07:04:42 +00:00
Update function name to reflect params and stop casting to long to avoid losing data
This commit is contained in:
parent
2aa9a5dfdd
commit
29892cc386
1 changed files with 5 additions and 5 deletions
|
@ -1248,13 +1248,13 @@ PySequence_GetItem(PyObject *s, Py_ssize_t i)
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
sliceobj_from_intint(Py_ssize_t i, Py_ssize_t j)
|
sliceobj_from_ssizet_ssizet(Py_ssize_t i, Py_ssize_t j)
|
||||||
{
|
{
|
||||||
PyObject *start, *end, *slice;
|
PyObject *start, *end, *slice;
|
||||||
start = PyInt_FromLong((long)i);
|
start = PyInt_FromSsize_t(i);
|
||||||
if (!start)
|
if (!start)
|
||||||
return NULL;
|
return NULL;
|
||||||
end = PyInt_FromLong((long)j);
|
end = PyInt_FromSsize_t(j);
|
||||||
if (!end) {
|
if (!end) {
|
||||||
Py_DECREF(start);
|
Py_DECREF(start);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -1289,7 +1289,7 @@ PySequence_GetSlice(PyObject *s, Py_ssize_t i1, Py_ssize_t i2)
|
||||||
return m->sq_slice(s, i1, i2);
|
return m->sq_slice(s, i1, i2);
|
||||||
} else if ((mp = s->ob_type->tp_as_mapping) && mp->mp_subscript) {
|
} else if ((mp = s->ob_type->tp_as_mapping) && mp->mp_subscript) {
|
||||||
PyObject *res;
|
PyObject *res;
|
||||||
PyObject *slice = sliceobj_from_intint(i1, i2);
|
PyObject *slice = sliceobj_from_ssizet_ssizet(i1, i2);
|
||||||
if (!slice)
|
if (!slice)
|
||||||
return NULL;
|
return NULL;
|
||||||
res = mp->mp_subscript(s, slice);
|
res = mp->mp_subscript(s, slice);
|
||||||
|
@ -1381,7 +1381,7 @@ PySequence_SetSlice(PyObject *s, Py_ssize_t i1, Py_ssize_t i2, PyObject *o)
|
||||||
return m->sq_ass_slice(s, i1, i2, o);
|
return m->sq_ass_slice(s, i1, i2, o);
|
||||||
} else if ((mp = s->ob_type->tp_as_mapping) && mp->mp_ass_subscript) {
|
} else if ((mp = s->ob_type->tp_as_mapping) && mp->mp_ass_subscript) {
|
||||||
int res;
|
int res;
|
||||||
PyObject *slice = sliceobj_from_intint(i1, i2);
|
PyObject *slice = sliceobj_from_ssizet_ssizet(i1, i2);
|
||||||
if (!slice)
|
if (!slice)
|
||||||
return -1;
|
return -1;
|
||||||
res = mp->mp_ass_subscript(s, slice, o);
|
res = mp->mp_ass_subscript(s, slice, o);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue