From efd71aad4f22ec0073d80b8dd296015d3f395aa8 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 10 Nov 2020 09:39:42 +1100 Subject: Cleanup: clang-tidy suppress warnings for PyTypeObject.tp_print Clang-tidy behavior changes from Python 3.7 to 3.8+ so it's simplest to suppress the warning in this instance. --- .../UnaryFunction0D_unsigned_int/BPy_QuantitativeInvisibilityF0D.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_unsigned_int/BPy_QuantitativeInvisibilityF0D.cpp') diff --git a/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_unsigned_int/BPy_QuantitativeInvisibilityF0D.cpp b/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_unsigned_int/BPy_QuantitativeInvisibilityF0D.cpp index 4741bdaa1ad..f824acdc86e 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_unsigned_int/BPy_QuantitativeInvisibilityF0D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_unsigned_int/BPy_QuantitativeInvisibilityF0D.cpp @@ -75,6 +75,8 @@ PyTypeObject QuantitativeInvisibilityF0D_Type = { sizeof(BPy_QuantitativeInvisibilityF0D), /* tp_basicsize */ 0, /* tp_itemsize */ nullptr, /* tp_dealloc */ + /* Incompatible with Python3.8+ (deprecated function). + * NOLINTNEXTLINE: modernize-use-nullptr. */ 0, /* tp_print */ nullptr, /* tp_getattr */ nullptr, /* tp_setattr */ -- cgit v1.2.3 From b5d310b569e07a937798a2d38539cfd290149f1c Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 10 Nov 2020 09:42:03 +1100 Subject: Cleanup: clang-format --- .../BPy_QuantitativeInvisibilityF0D.cpp | 66 +++++++++++----------- 1 file changed, 33 insertions(+), 33 deletions(-) (limited to 'source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_unsigned_int/BPy_QuantitativeInvisibilityF0D.cpp') diff --git a/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_unsigned_int/BPy_QuantitativeInvisibilityF0D.cpp b/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_unsigned_int/BPy_QuantitativeInvisibilityF0D.cpp index f824acdc86e..ae1971bf9b9 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_unsigned_int/BPy_QuantitativeInvisibilityF0D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_unsigned_int/BPy_QuantitativeInvisibilityF0D.cpp @@ -77,39 +77,39 @@ PyTypeObject QuantitativeInvisibilityF0D_Type = { nullptr, /* tp_dealloc */ /* Incompatible with Python3.8+ (deprecated function). * NOLINTNEXTLINE: modernize-use-nullptr. */ - 0, /* tp_print */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_reserved */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - QuantitativeInvisibilityF0D___doc__, /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - nullptr, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - &UnaryFunction0DUnsigned_Type, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)QuantitativeInvisibilityF0D___init__, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ + 0, /* tp_print */ + nullptr, /* tp_getattr */ + nullptr, /* tp_setattr */ + nullptr, /* tp_reserved */ + nullptr, /* tp_repr */ + nullptr, /* tp_as_number */ + nullptr, /* tp_as_sequence */ + nullptr, /* tp_as_mapping */ + nullptr, /* tp_hash */ + nullptr, /* tp_call */ + nullptr, /* tp_str */ + nullptr, /* tp_getattro */ + nullptr, /* tp_setattro */ + nullptr, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ + QuantitativeInvisibilityF0D___doc__, /* tp_doc */ + nullptr, /* tp_traverse */ + nullptr, /* tp_clear */ + nullptr, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + nullptr, /* tp_iter */ + nullptr, /* tp_iternext */ + nullptr, /* tp_methods */ + nullptr, /* tp_members */ + nullptr, /* tp_getset */ + &UnaryFunction0DUnsigned_Type, /* tp_base */ + nullptr, /* tp_dict */ + nullptr, /* tp_descr_get */ + nullptr, /* tp_descr_set */ + 0, /* tp_dictoffset */ + (initproc)QuantitativeInvisibilityF0D___init__, /* tp_init */ + nullptr, /* tp_alloc */ + nullptr, /* tp_new */ }; /////////////////////////////////////////////////////////////////////////////////////////// -- cgit v1.2.3 From cd9acfed4f7674b84be965d469a367aef96f8af3 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 11 Nov 2020 08:36:54 +1100 Subject: Cleanup: use preprocessor version check for PyTypeObject declaration While `tp_print` was deprecated, Python 3.8+ uses this for 'tp_vectorcall_offset' which wasn't stated in the comment from efd71aad4f22ec0073d80b8dd296015d3f395aa8. Instead of suppressing clang-tidy, use preprocessor a check since this properly represents the difference between Python versions. --- .../BPy_QuantitativeInvisibilityF0D.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_unsigned_int/BPy_QuantitativeInvisibilityF0D.cpp') diff --git a/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_unsigned_int/BPy_QuantitativeInvisibilityF0D.cpp b/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_unsigned_int/BPy_QuantitativeInvisibilityF0D.cpp index ae1971bf9b9..d6e00988e68 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_unsigned_int/BPy_QuantitativeInvisibilityF0D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction0D/UnaryFunction0D_unsigned_int/BPy_QuantitativeInvisibilityF0D.cpp @@ -75,9 +75,11 @@ PyTypeObject QuantitativeInvisibilityF0D_Type = { sizeof(BPy_QuantitativeInvisibilityF0D), /* tp_basicsize */ 0, /* tp_itemsize */ nullptr, /* tp_dealloc */ - /* Incompatible with Python3.8+ (deprecated function). - * NOLINTNEXTLINE: modernize-use-nullptr. */ - 0, /* tp_print */ +#if PY_VERSION_HEX >= 0x03080000 + 0, /* tp_vectorcall_offset */ +#else + nullptr, /* tp_print */ +#endif nullptr, /* tp_getattr */ nullptr, /* tp_setattr */ nullptr, /* tp_reserved */ -- cgit v1.2.3