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
efd71aad4f.

Instead of suppressing clang-tidy, use preprocessor a check since
this properly represents the difference between Python versions.
This commit is contained in:
2020-11-11 08:36:54 +11:00
parent 86bdd2acc6
commit cd9acfed4f
156 changed files with 825 additions and 463 deletions

View File

@@ -186,9 +186,11 @@ PyTypeObject AdjacencyIterator_Type = {
sizeof(BPy_AdjacencyIterator), /* 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 */

View File

@@ -167,9 +167,11 @@ PyTypeObject ChainPredicateIterator_Type = {
sizeof(BPy_ChainPredicateIterator), /* tp_basicsize */
0, /* tp_itemsize */
(destructor)ChainPredicateIterator_dealloc, /* 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 */

View File

@@ -121,9 +121,11 @@ PyTypeObject ChainSilhouetteIterator_Type = {
sizeof(BPy_ChainSilhouetteIterator), /* 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 */

View File

@@ -255,9 +255,11 @@ PyTypeObject ChainingIterator_Type = {
sizeof(BPy_ChainingIterator), /* 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 */

View File

@@ -135,9 +135,11 @@ PyTypeObject CurvePointIterator_Type = {
sizeof(BPy_CurvePointIterator), /* 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 */

View File

@@ -210,9 +210,11 @@ PyTypeObject Interface0DIterator_Type = {
sizeof(BPy_Interface0DIterator), /* 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 */

View File

@@ -162,9 +162,11 @@ PyTypeObject SVertexIterator_Type = {
sizeof(BPy_SVertexIterator), /* 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 */

View File

@@ -293,9 +293,11 @@ PyTypeObject StrokeVertexIterator_Type = {
sizeof(BPy_StrokeVertexIterator), /* 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 */

View File

@@ -240,9 +240,11 @@ PyTypeObject ViewEdgeIterator_Type = {
sizeof(BPy_ViewEdgeIterator), /* 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 */

View File

@@ -144,9 +144,11 @@ PyTypeObject orientedViewEdgeIterator_Type = {
sizeof(BPy_orientedViewEdgeIterator), /* 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 */