]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-115827: Fix compile warning in `longobject.c` (#115828)
authorNikita Sobolev <mail@sobolevn.me>
Thu, 22 Feb 2024 17:57:12 +0000 (20:57 +0300)
committerGitHub <noreply@github.com>
Thu, 22 Feb 2024 17:57:12 +0000 (17:57 +0000)
Objects/longobject.c:1186:42: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]

Objects/longobject.c

index fe78298333432364ebd7f84e573c212519743065..2d1c6ad788e281e39913a0b1b9c1dd82cd87215d 100644 (file)
@@ -1183,7 +1183,7 @@ PyLong_AsNativeBytes(PyObject* vv, void* buffer, Py_ssize_t n, int endianness)
                 for (Py_ssize_t i = sizeof(cv.b); i > 0; --i) {
                     *b++ = cv.b[i - 1];
                 }
-                for (Py_ssize_t i = 0; i < n - sizeof(cv.b); ++i) {
+                for (Py_ssize_t i = 0; i < n - (int)sizeof(cv.b); ++i) {
                     *b++ = fill;
                 }
             }