From 8e62de4f0c45a5c6a2a729aa005f5768327ffd1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A9n=C3=A9dikt=20Tran?= <10796600+picnixz@users.noreply.github.com> Date: Thu, 22 Aug 2024 11:23:54 +0200 Subject: [PATCH 1/2] fix pointer diff warnings --- Python/bytecodes.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Python/bytecodes.c b/Python/bytecodes.c index 250e2d12a9de0b..e180613eae2526 100644 --- a/Python/bytecodes.c +++ b/Python/bytecodes.c @@ -39,6 +39,8 @@ #include "pydtrace.h" #include "setobject.h" +#include // ptrdiff_t + #define USE_COMPUTED_GOTOS 0 #include "ceval_macros.h" @@ -2207,8 +2209,8 @@ dummy_func( *value_ptr = PyStackRef_AsPyObjectSteal(value); if (old_value == NULL) { PyDictValues *values = _PyObject_InlineValues(owner_o); - int index = value_ptr - values->values; - _PyDictValues_AddToInsertionOrder(values, index); + ptrdiff_t index = value_ptr - values->values; + _PyDictValues_AddToInsertionOrder(values, (Py_ssize_t)index); } else { Py_DECREF(old_value); From 1e480c12b5a02e40745fd28f7e228145b8c3baca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A9n=C3=A9dikt=20Tran?= <10796600+picnixz@users.noreply.github.com> Date: Thu, 22 Aug 2024 12:03:22 +0200 Subject: [PATCH 2/2] add generated files --- Python/executor_cases.c.h | 4 ++-- Python/generated_cases.c.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Python/executor_cases.c.h b/Python/executor_cases.c.h index 55b06a0e235dac..e7ca608d97d2fa 100644 --- a/Python/executor_cases.c.h +++ b/Python/executor_cases.c.h @@ -2594,8 +2594,8 @@ *value_ptr = PyStackRef_AsPyObjectSteal(value); if (old_value == NULL) { PyDictValues *values = _PyObject_InlineValues(owner_o); - int index = value_ptr - values->values; - _PyDictValues_AddToInsertionOrder(values, index); + ptrdiff_t index = value_ptr - values->values; + _PyDictValues_AddToInsertionOrder(values, (Py_ssize_t)index); } else { Py_DECREF(old_value); diff --git a/Python/generated_cases.c.h b/Python/generated_cases.c.h index 13bbff29d09133..eff5beda30f9f5 100644 --- a/Python/generated_cases.c.h +++ b/Python/generated_cases.c.h @@ -6839,8 +6839,8 @@ *value_ptr = PyStackRef_AsPyObjectSteal(value); if (old_value == NULL) { PyDictValues *values = _PyObject_InlineValues(owner_o); - int index = value_ptr - values->values; - _PyDictValues_AddToInsertionOrder(values, index); + ptrdiff_t index = value_ptr - values->values; + _PyDictValues_AddToInsertionOrder(values, (Py_ssize_t)index); } else { Py_DECREF(old_value);