https://github.com/python/cpython/commit/67f2c84bff06eb837fd5ca64466d79f038e22ef8
commit: 67f2c84bff06eb837fd5ca64466d79f038e22ef8
branch: main
author: Kirill Podoprigora <[email protected]>
committer: colesbury <[email protected]>
date: 2024-08-23T15:35:25-04:00
summary:

gh-123205: `Python/bytecodes.c`: Fix compiler warning (#123206)

Fix MSVC warning "conversion from '__int64' to 'int'"

files:
M Python/bytecodes.c
M Python/executor_cases.c.h
M Python/generated_cases.c.h

diff --git a/Python/bytecodes.c b/Python/bytecodes.c
index fefa3af37a16b0..ad30fb3db0360a 100644
--- a/Python/bytecodes.c
+++ b/Python/bytecodes.c
@@ -2215,7 +2215,7 @@ dummy_func(
             *value_ptr = PyStackRef_AsPyObjectSteal(value);
             if (old_value == NULL) {
                 PyDictValues *values = _PyObject_InlineValues(owner_o);
-                int index = value_ptr - values->values;
+                Py_ssize_t index = value_ptr - values->values;
                 _PyDictValues_AddToInsertionOrder(values, index);
             }
             else {
diff --git a/Python/executor_cases.c.h b/Python/executor_cases.c.h
index 8726adeeeadc10..3d0f3b36a40ed2 100644
--- a/Python/executor_cases.c.h
+++ b/Python/executor_cases.c.h
@@ -2596,7 +2596,7 @@
             *value_ptr = PyStackRef_AsPyObjectSteal(value);
             if (old_value == NULL) {
                 PyDictValues *values = _PyObject_InlineValues(owner_o);
-                int index = value_ptr - values->values;
+                Py_ssize_t index = value_ptr - values->values;
                 _PyDictValues_AddToInsertionOrder(values, index);
             }
             else {
diff --git a/Python/generated_cases.c.h b/Python/generated_cases.c.h
index 69f5dc5a54378f..bf75cb901bc46d 100644
--- a/Python/generated_cases.c.h
+++ b/Python/generated_cases.c.h
@@ -6881,7 +6881,7 @@
                 *value_ptr = PyStackRef_AsPyObjectSteal(value);
                 if (old_value == NULL) {
                     PyDictValues *values = _PyObject_InlineValues(owner_o);
-                    int index = value_ptr - values->values;
+                    Py_ssize_t index = value_ptr - values->values;
                     _PyDictValues_AddToInsertionOrder(values, index);
                 }
                 else {

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to