summaryrefslogtreecommitdiff
path: root/pyuno/source/module/pyuno_callable.cxx
AgeCommit message (Collapse)Author
2020-11-14Fix initialization of Python-3.8--only at-end tp_print memberStephan Bergmann
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 <sbergman@redhat.com> (cherry picked from commit 23d9966751566028c50ca95ca203d20f36c64f30) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105850 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Muhammet Kara <muhammet.kara@collabora.com>
2020-06-12More targeted silencing of -Wdeprecated-declarationsStephan Bergmann
...compared to d1786724b8e8e474e1f7e39012c1f19611841dc0 "prevent warnings in pyuno with latest python". For one it is only the /* bpo-37250: kept for backwards compatibility in CPython 3.8 only */ Py_DEPRECATED(3.8) int (*tp_print)(PyObject *, FILE *, int); member (in /usr/include/python3.8/cpython/object.h) that causes a warning. And for another it is only Clang that emits a warning when initializing a deprecated member that way, <http://lists.llvm.org/pipermail/cfe-dev/2020-May/065392.html> "[cfe-dev] Diagnosing initialization of deprecated data member?" Change-Id: I36625118a6bb26f5468d436da4caa82911181202 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94016 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96195 Tested-by: Tor Lillqvist <tml@collabora.com> Reviewed-by: Tor Lillqvist <tml@collabora.com>
2020-06-12prevent warnings in pyuno with latest pythonNoel Grandin
which has marked some members deprecated, but we can't stop initialising them or we run the risk of ASAN complaining Change-Id: I8f4ad0ae083fad9c040613ddde7c40f20d68c7d7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93580 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96194 Tested-by: Tor Lillqvist <tml@collabora.com> Reviewed-by: Tor Lillqvist <tml@collabora.com>
2020-05-24python 3.8.2 compile: add tp_print to PyTypeObjectJustin Luth
I couldn't find this documented on the Internet though, as the 3.9 and 3.8.2rc documentation didn't mention it as an added item... I'm using Ubuntu 20.04 alpha with python3 --version Python 3.8.2rc1 This fixes pyuno/source/module/pyuno.cxx:1689:1: error: missing initializer for member ‘_typeobject::tp_print’ [-Werror=missing-field-initializers] Change-Id: Idec5720050572b34628267cd94557dabf7edbf3c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89247 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> (cherry picked from commit 50ccb7e82b7053306721cbe220323be072306a29)
2019-06-10Adapt to upcoming Python 3.8Stephan Bergmann
...which changed PyTypeObject in <https://github.com/python/cpython/commit/ aacc77fbd77640a8f03638216fa09372cc21673d> "bpo-36974: implement PEP 590 (GH-13185)". Change-Id: I687ec38aeda05d0747b9ed08221db75a758bed51 Reviewed-on: https://gerrit.libreoffice.org/73664 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-04-26tdf#42949 Fix IWYU warnings in pyuno/Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I95575d41a822ff7b1ac5bdba03057f6d3fa61b51 Reviewed-on: https://gerrit.libreoffice.org/71141 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-03-06remove some unnecessary typedef struct... sugarNoel Grandin
Change-Id: I1576282b0a0a3af8ae14c04725d9c4900073f2c4 Reviewed-on: https://gerrit.libreoffice.org/68758 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-17New loplugin:externalStephan Bergmann
...warning about (for now only) functions and variables with external linkage that likely don't need it. The problems with moving entities into unnamed namespacs and breaking ADL (as alluded to in comments in compilerplugins/clang/external.cxx) are illustrated by the fact that while struct S1 { int f() { return 0; } }; int f(S1 s) { return s.f(); } namespace N { struct S2: S1 { int f() { return 1; } }; int f(S2 s) { return s.f(); } } int main() { return f(N::S2()); } returns 1, both moving just the struct S2 into an nunnamed namespace, struct S1 { int f() { return 0; } }; int f(S1 s) { return s.f(); } namespace N { namespace { struct S2: S1 { int f() { return 1; } }; } int f(S2 s) { return s.f(); } } int main() { return f(N::S2()); } as well as moving just the function f overload into an unnamed namespace, struct S1 { int f() { return 0; } }; int f(S1 s) { return s.f(); } namespace N { struct S2: S1 { int f() { return 1; } }; namespace { int f(S2 s) { return s.f(); } } } int main() { return f(N::S2()); } would each change the program to return 0 instead. Change-Id: I4d09f7ac5e8f9bcd6e6bde4712608444b642265c Reviewed-on: https://gerrit.libreoffice.org/60539 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-04-09configure,pyuno: require at least Python 2.7Michael Stahl
Nobody needs to use 2.6 any more, so reduce the maintenance burden. https://lists.freedesktop.org/archives/libreoffice/2018-March/079670.html Change-Id: I101e26fbceffbe6119f4a6484530f27760b03eb4 Reviewed-on: https://gerrit.libreoffice.org/50816 Reviewed-by: Michael Stahl <Michael.Stahl@cib.de> Tested-by: Jenkins <ci@libreoffice.org>
2017-05-31clang-tidy readability-redundant-control-flowNoel Grandin
Change-Id: I832f7ef0f1bd55e365db7e49823fe8bc30390c04 Reviewed-on: https://gerrit.libreoffice.org/38215 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-10-18replace <<= with assign for <<= with rhs AnyJochen Nitschke
found by deleting specialization of '<<=' template Change-Id: I253f15177ab20fd3ef9baf4158da8c662cb47e6c Reviewed-on: https://gerrit.libreoffice.org/29956 Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de> Tested-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
2016-04-18clean-up: unused using declarations and includesJochen Nitschke
Searched source for using declarations. Checked if those symbols reappear in the source file, even in comments or dead code but not in #include statements. If they don't reappear, remove the declaration. Remove includes whose symbol got removed. Change-Id: Ibb77163f63c1120070e9518e3dc0a78c6c59fab0 Reviewed-on: https://gerrit.libreoffice.org/24148 Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de> Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-12cleanup: remove unused com/sun/star/uno includesJochen Nitschke
Sequence.h(xx), Any.h(xx) and Type.h(xx) and remove unused using-declarations from these files. Add a few missing includes provided by them. Change-Id: I6b91b6d1fdf9d0496dd546c0aab9bdcc6831a5d4 Reviewed-on: https://gerrit.libreoffice.org/23805 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2015-11-10loplugin:nullptr (automatic rewrite)Stephan Bergmann
Change-Id: I7a5fda2606f42e2736ad0618f2d8bcc5ba4028fb
2015-10-23com::sun::star->css in package,pyunoNoel Grandin
Change-Id: I7b7b0e7fea2d1a2b9f6f5501ad5e0b8c1b4a17b9
2015-06-14Typo: pyhton->pythonJulien Nabet
Change-Id: I16d99991b8b88753c593a5a1ab9e32a8e0264514
2015-06-08loplugin:cstylecast: deal with remaining pointer castsStephan Bergmann
Change-Id: Iffa346c16a6775b206c8f8613eee9e7201e3badb
2015-04-01Replace remaining getCppuType et al with cppu::UnoTypeStephan Bergmann
Change-Id: Id848d14133fee5104e79ba0683cbaf942598faa7
2015-01-20Some more loplugin:cstylecast: pyunoStephan Bergmann
Change-Id: I80c9fdb45c9f58ac3cd1b0fab2631b903194e268
2014-11-17sal: clean up public headers with include-what-you-useMichael Stahl
Sadly cannot forward declare "struct {...} TimeValue;". rtl/(u)?string.hxx still include sal/log.hxx but removing osl/diagnose.h was painful enough for now... Change-Id: Id41e17f3870c4f24c53ce7b11f2c40a3d14d1f05
2014-06-03coverity#982753 Dereference null return valueCaolán McNamara
Change-Id: I011a600a27c801dca32734e680ea5a13dfebdfe3
2014-05-19pyuno: fix warnings with system python 3.4.0Thomas Arnhold
warning: missing initializer for member '_typeobject::tp_finalize' [-Wmissing-field-initializers] Change-Id: I7ab82025fd8c2f0d8fa4943690a217c4a4dc369d
2013-11-14SAL_WARN_UNUSED com::sun::star::uno::AnyStephan Bergmann
Change-Id: I9058044d13f696e07667dce706f6c311af6dbea0
2013-10-02WaE: unused variableTor Lillqvist
Change-Id: Iea8461444c29de9968a5bfa85a2dabb186db47ca
2013-07-12Resolves: #i120788# remove unused members from PyUNO_callable_InternalsHerbert Dürr
Patch by: Tsutomu Uchino <hanya.runo@gmail.com> (cherry picked from commit 5e2c3fd88906494965979bd20ca852391bee3bac) Conflicts: pyuno/source/module/pyuno_impl.hxx Change-Id: If73d5f7b799f04b79b5cc71d2d44c797851b18d0
2013-04-07mass removal of rtl:: prefixes for O(U)String*Luboš Luňák
Modules sal, salhelper, cppu, cppuhelper, codemaker (selectively) and odk have kept them, in order not to break external API (the automatic using declaration is LO-internal). Change-Id: I588fc9e0c45b914f824f91c0376980621d730f09
2012-07-02re-base on ALv2 code. Removing:Michael Meeks
a patch contributed by Pedro Giffuni to handle FreeBSD issues that are unlikely to be an issue with a two-layer LibreOffice. http://svn.apache.org/viewvc?view=revision&revision=1180509
2012-01-21Removed some unused parameters; added SAL_UNUSED_PARAMETER.Stephan Bergmann
SAL_UNUSED_PARAMETER (expanding to __attribute__ ((unused)) for GCC) is used to annotate legitimately unused parameters, so that static analysis tools can tell legitimately unused parameters from truly unnecessary ones. To that end, some patches for external modules are also added, that are only applied when compiling with GCC and add necessary __attribute__ ((unused)) in headers.
2011-12-21catch exception by constant referenceTakeshi Abe
2011-08-21Janitorial: remove unnecessary const_castsLionel Elie Mamane
The python C API has consts at these places
2011-05-19don't crash when interacting with a class that implements XInvocationMichael Meeks
VclStringResourceLoader eg. test = smgr.createInstance("com.sun.star.resource.VclStringResourceLoader") invocation = test.setValue("FileName", "test") It seems we can't cope with XInvocation implementors, so give a nice exception instead
2011-05-07Port PyUno to support Python 3Andreas Becker
2010-10-14Add vim/emacs modelines to all source filesSebastian Spaeth
Fixes #fdo30794 Based on bin/add-modelines script (originally posted in mail 1286706307.1871.1399280959@webmail.messagingengine.com) Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2010-02-12changefileheader2: #i109125#: change source file copyright notice from Sun ↵Jens-Heiner Rechtien
Microsystems to Oracle; remove CVS style keywords (RCSfile, Revision)
2009-03-14CWS-TOOLING: integrate CWS cmcfixes55Vladimir Glazounov
2009-03-03 10:04:14 +0100 cmc r268711 : #i99765# silence warning 2009-03-02 12:18:48 +0100 cmc r268647 : #i99772# silence warnings under >= python 2.6 and gcc 4.4 2009-03-02 10:51:12 +0100 cmc r268641 : #i99767# fix up trivial && || 2009-03-02 10:32:02 +0100 cmc r268640 : #i99766 remove && || warning 2009-03-02 10:01:05 +0100 cmc r268638 : #i99764# easy && || warnings 2009-02-27 13:03:08 +0100 cmc r268583 : #i96059# fix dodgy code 2009-02-27 12:57:38 +0100 cmc r268582 : #i99718# don't leave unused methods on non-win platform
2008-04-11INTEGRATION: CWS changefileheader (1.7.38); FILE MERGEDRüdiger Timm
2008/03/31 07:24:58 rt 1.7.38.1: #i87441# Change license header to LPGL v3.
2006-11-14INTEGRATION: CWS pyunofixes3_SRC680 (1.6.20); FILE MERGEDIvo Hinkelmann
2006/11/06 18:11:11 pmladek 1.6.20.1: #i71078# Fix allocating and deleting python objects
2006-06-20INTEGRATION: CWS warnings01 (1.3.56); FILE MERGEDJens-Heiner Rechtien
2006/04/20 14:46:08 sb 1.3.56.6: #i53898# Made code warning-free again after resync to SRC680m162. 2006/04/07 21:24:17 sb 1.3.56.5: RESYNC: (1.4-1.5); FILE MERGED 2005/11/10 09:12:37 pl 1.3.56.4: #i53898# removed warnings 2005/10/31 16:04:23 sb 1.3.56.3: #i53898# Made code warning-free. 2005/09/23 02:08:09 sb 1.3.56.2: RESYNC: (1.3-1.4); FILE MERGED 2005/09/09 15:31:17 sb 1.3.56.1: #i53898# Made code warning-free.
2006-03-22INTEGRATION: CWS pyunofixes2 (1.3.52); FILE MERGEDOliver Bolte
2006/01/07 21:35:08 jbu 1.3.52.2: RESYNC: (1.3-1.4); FILE MERGED 2005/09/09 18:43:07 jbu 1.3.52.1: #i54416#,#i47270# added logging support for pyuno + refcounting bug for __members__ variable fixed
2005-09-08INTEGRATION: CWS ooo19126 (1.3.54); FILE MERGEDRüdiger Timm
2005/09/05 18:39:20 rt 1.3.54.1: #i54170# Change license header: remove SISSL
2003-08-18INTEGRATION: CWS geordi2q01 (1.2.14); FILE MERGEDHans-Joachim Lankenau
2003/08/18 13:04:06 hr 1.2.14.1: #i18350#: join changes from CWS ooo11rc3
2003-05-24#i12504# added conversion modeJörg Budischewski
2003-03-23initial checkin for the pyuno-0.9.2 releaseJörg Budischewski