]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.13] Fix a compiler warning in _randommodule.c (GH-141058) (#141064)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 5 Nov 2025 19:08:41 +0000 (20:08 +0100)
committerGitHub <noreply@github.com>
Wed, 5 Nov 2025 19:08:41 +0000 (19:08 +0000)
commit3ecf63754ea2ea4114c9ec51d0b95ca218762706
tree4067706a2f9916144662b42e2d3c4f1c9095845a
parent91b85c534678fc21facb04530eac3609116b4dc9
[3.13] Fix a compiler warning in _randommodule.c (GH-141058) (#141064)

Fix a compiler warning in _randommodule.c (GH-141058)

The test just before the cast ensures that the cast cannot overflow.

Fix the warning on 32-bit Windows:

    Modules\_randommodule.c(525,28): warning C4244: '=': conversion
    from 'uint64_t' to 'Py_ssize_t', possible loss of data
(cherry picked from commit 4ac16dd10950fad2d3e58e8b0ba5f2e621af3cc1)

Co-authored-by: Victor Stinner <vstinner@python.org>
Modules/_randommodule.c