mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
Change int to Py_ssize_t in several places.
Add (int) casts to silence compiler warnings. Raise Python exceptions for overflows.
This commit is contained in:
parent
8eb8a829c1
commit
725507b52e
11 changed files with 57 additions and 32 deletions
|
|
@ -4244,7 +4244,8 @@ slot_sq_contains(PyObject *self, PyObject *value)
|
|||
}
|
||||
}
|
||||
else if (! PyErr_Occurred()) {
|
||||
result = _PySequence_IterSearch(self, value,
|
||||
/* Possible results: -1 and 1 */
|
||||
result = (int)_PySequence_IterSearch(self, value,
|
||||
PY_ITERSEARCH_CONTAINS);
|
||||
}
|
||||
return result;
|
||||
|
|
@ -4880,7 +4881,7 @@ slot_tp_del(PyObject *self)
|
|||
* never happened.
|
||||
*/
|
||||
{
|
||||
int refcnt = self->ob_refcnt;
|
||||
Py_ssize_t refcnt = self->ob_refcnt;
|
||||
_Py_NewReference(self);
|
||||
self->ob_refcnt = refcnt;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue