pyuno/source/module/pyuno.cxx | 4 ++-- pyuno/source/module/pyuno_callable.cxx | 4 ++-- pyuno/source/module/pyuno_iterator.cxx | 8 ++++---- pyuno/source/module/pyuno_runtime.cxx | 4 ++-- pyuno/source/module/pyuno_struct.cxx | 4 ++-- 5 files changed, 12 insertions(+), 12 deletions(-)
New commits: commit cef33044bcc72181824f32aaa84555447629852d Author: Stephan Bergmann <sberg...@redhat.com> AuthorDate: Mon May 11 22:46:12 2020 +0200 Commit: Muhammet Kara <muhammet.k...@collabora.com> CommitDate: Sat Nov 14 22:44:38 2020 +0100 Fix initialization of Python-3.8--only at-end tp_print member Until Python 3.7, PyTypeObject had a member tp_print following tp_dealloc, which had then been repurposed as > /* Methods to implement standard operations */ > > destructor tp_dealloc; > - printfunc tp_print; > + Py_ssize_t tp_vectorcall_offset; > getattrfunc tp_getattr; > setattrfunc tp_setattr; > PyAsyncMethods *tp_as_async; /* formerly known as tp_compare (Python 2) in <https://github.com/python/cpython/commit/ aacc77fbd77640a8f03638216fa09372cc21673d> "bpo-36974: implement PEP 590 (GH-13185)" towards Python 3.8. Then only on the 3.8 branch (and prior to tag v3.8.0), <https://github.com/python/cpython/commit/ d917cfe4051d45b2b755c726c096ecfcc4869ceb> "[3.8] bpo-37250: put back tp_print for backwards compatibility (GH-14193)" added > destructor tp_finalize; > vectorcallfunc tp_vectorcall; > > + /* bpo-37250: kept for backwards compatibility in CPython 3.8 only */ > + Py_DEPRECATED(3.8) int (*tp_print)(PyObject *, FILE *, int); > + > #ifdef COUNT_ALLOCS > /* these must be last and never explicitly initialized */ > Py_ssize_t tp_allocs; at the end of PyTypeObject. This was apparently done so that third-party code containing initialization code like X.tp_print = 0; would continue to compile (by just adding back a member with that name, even if at a "random" new---and otherwise unused---location). However, for our way of list-initializing PyTypeObject instances in pyuno that new member caused "missing field 'tp_print' initializer" -Wmissing-field-initializers warnings, so 50ccb7e82b7053306721cbe220323be072306a29 "python 3.8.2 compile: add tp_print to PyTypeObject" added initializers for this new at-end member. But it did so in a way that raises three concerns: 1 The new member was already added in Python 3.8.0 (prior to tag v3.8.0), not only in 3.8.2. 2 The new member was only added to Python 3.8. It has not been added to current master towards 3.9. 3 It is unclear why the comments mention "Py_ssize_t" as the type of that new member, when actually it is of a function pointer type (see above). Probably best to just drop that from the comments, to avoid confusion. Change-Id: Ib44f43befd5f28d4c1ac1e9e14bd55bfb4473507 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94019 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sberg...@redhat.com> (cherry picked from commit 23d9966751566028c50ca95ca203d20f36c64f30) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105850 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Muhammet Kara <muhammet.k...@collabora.com> diff --git a/pyuno/source/module/pyuno.cxx b/pyuno/source/module/pyuno.cxx index 63117fc4acdc..7246658df6ca 100644 --- a/pyuno/source/module/pyuno.cxx +++ b/pyuno/source/module/pyuno.cxx @@ -1684,12 +1684,12 @@ static PyTypeObject PyUNOType = , nullptr #if PY_VERSION_HEX >= 0x03080000 , nullptr // vectorcallfunc tp_vectorcall -#if PY_VERSION_HEX >= 0x03080200 +#if PY_VERSION_HEX < 0x03090000 #if defined __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" #endif - , nullptr //Py_ssize_t tp_print + , nullptr // tp_print #if defined __clang__ #pragma clang diagnostic pop #endif diff --git a/pyuno/source/module/pyuno_callable.cxx b/pyuno/source/module/pyuno_callable.cxx index 02aa082025ba..73bec5d34b5b 100644 --- a/pyuno/source/module/pyuno_callable.cxx +++ b/pyuno/source/module/pyuno_callable.cxx @@ -231,12 +231,12 @@ static PyTypeObject PyUNO_callable_Type = , nullptr #if PY_VERSION_HEX >= 0x03080000 , nullptr // vectorcallfunc tp_vectorcall -#if PY_VERSION_HEX >= 0x03080200 +#if PY_VERSION_HEX < 0x03090000 #if defined __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" #endif - , nullptr //Py_ssize_t tp_print + , nullptr // tp_print #if defined __clang__ #pragma clang diagnostic pop #endif diff --git a/pyuno/source/module/pyuno_iterator.cxx b/pyuno/source/module/pyuno_iterator.cxx index 8337feba9a9d..840fc977014a 100644 --- a/pyuno/source/module/pyuno_iterator.cxx +++ b/pyuno/source/module/pyuno_iterator.cxx @@ -167,12 +167,12 @@ static PyTypeObject PyUNO_iterator_Type = , nullptr #if PY_VERSION_HEX >= 0x03080000 , nullptr // vectorcallfunc tp_vectorcall -#if PY_VERSION_HEX >= 0x03080200 +#if PY_VERSION_HEX < 0x03090000 #if defined __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" #endif - , nullptr //Py_ssize_t tp_print + , nullptr // tp_print #if defined __clang__ #pragma clang diagnostic pop #endif @@ -313,12 +313,12 @@ static PyTypeObject PyUNO_list_iterator_Type = , nullptr #if PY_VERSION_HEX >= 0x03080000 , nullptr // vectorcallfunc tp_vectorcall -#if PY_VERSION_HEX >= 0x03080200 +#if PY_VERSION_HEX < 0x03090000 #if defined __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" #endif - , nullptr //Py_ssize_t tp_print + , nullptr // tp_print #if defined __clang__ #pragma clang diagnostic pop #endif diff --git a/pyuno/source/module/pyuno_runtime.cxx b/pyuno/source/module/pyuno_runtime.cxx index d8b5e71335ad..973c95e57184 100644 --- a/pyuno/source/module/pyuno_runtime.cxx +++ b/pyuno/source/module/pyuno_runtime.cxx @@ -126,12 +126,12 @@ static PyTypeObject RuntimeImpl_Type = , nullptr #if PY_VERSION_HEX >= 0x03080000 , nullptr // vectorcallfunc tp_vectorcall -#if PY_VERSION_HEX >= 0x03080200 +#if PY_VERSION_HEX < 0x03090000 #if defined __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" #endif - , nullptr //Py_ssize_t tp_print + , nullptr // tp_print #if defined __clang__ #pragma clang diagnostic pop #endif diff --git a/pyuno/source/module/pyuno_struct.cxx b/pyuno/source/module/pyuno_struct.cxx index 7abd0545ddf8..f420575e5e5b 100644 --- a/pyuno/source/module/pyuno_struct.cxx +++ b/pyuno/source/module/pyuno_struct.cxx @@ -347,12 +347,12 @@ static PyTypeObject PyUNOStructType = , nullptr #if PY_VERSION_HEX >= 0x03080000 , nullptr // vectorcallfunc tp_vectorcall -#if PY_VERSION_HEX >= 0x03080200 +#if PY_VERSION_HEX < 0x03090000 #if defined __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" #endif - , nullptr //Py_ssize_t tp_print + , nullptr // tp_print #if defined __clang__ #pragma clang diagnostic pop #endif _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits