]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-99845: Use size_t type in __sizeof__() methods (#99846)
authorVictor Stinner <vstinner@python.org>
Wed, 30 Nov 2022 16:22:52 +0000 (17:22 +0100)
committerGitHub <noreply@github.com>
Wed, 30 Nov 2022 16:22:52 +0000 (17:22 +0100)
commit85dd6cb6df996b1197266d1a50ecc9187a91e481
tree774e93130f5e1b81dcd7a94982c189c718e84b91
parent18a6967544795cdcce45b45700b7a9ed3994b8fb
gh-99845: Use size_t type in __sizeof__() methods (#99846)

The implementation of __sizeof__() methods using _PyObject_SIZE() now
use an unsigned type (size_t) to compute the size, rather than a signed
type (Py_ssize_t).

Cast explicitly signed (Py_ssize_t) values to unsigned type
(Py_ssize_t).
15 files changed:
Modules/_collectionsmodule.c
Modules/_decimal/_decimal.c
Modules/_elementtree.c
Modules/_io/bufferedio.c
Modules/_io/bytesio.c
Modules/_pickle.c
Modules/_struct.c
Modules/arraymodule.c
Modules/clinic/_elementtree.c.h
Modules/clinic/_pickle.c.h
Modules/itertoolsmodule.c
Modules/mmapmodule.c
Objects/bytearrayobject.c
Objects/listobject.c
Objects/setobject.c