diff options
Diffstat (limited to 'source/blender/python')
26 files changed, 1777 insertions, 2106 deletions
diff --git a/source/blender/python/bmesh/bmesh_py_ops.c b/source/blender/python/bmesh/bmesh_py_ops.c index 37e2b009f55..35f87172d78 100644 --- a/source/blender/python/bmesh/bmesh_py_ops.c +++ b/source/blender/python/bmesh/bmesh_py_ops.c @@ -146,82 +146,54 @@ static PyGetSetDef bpy_bmesh_op_getseters[] = { * ===== */ static PyTypeObject bmesh_op_Type = { - PyVarObject_HEAD_INIT(NULL, 0) "BMeshOpFunc", /* tp_name */ - sizeof(BPy_BMeshOpFunc), /* tp_basicsize */ - 0, /* tp_itemsize */ - /* methods */ - NULL, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - NULL, /* getattrfunc tp_getattr; */ - NULL, /* setattrfunc tp_setattr; */ - NULL, - /* tp_compare */ /* DEPRECATED in python 3.0! */ - (reprfunc)bpy_bmesh_op_repr, /* tp_repr */ - - /* Method suites for standard classes */ - - NULL, /* PyNumberMethods *tp_as_number; */ - NULL, /* PySequenceMethods *tp_as_sequence; */ - NULL, /* PyMappingMethods *tp_as_mapping; */ - - /* More standard operations (here for binary compatibility) */ - - NULL, /* hashfunc tp_hash; */ - (ternaryfunc)BPy_BMO_call, /* ternaryfunc tp_call; */ - NULL, /* reprfunc tp_str; */ - - /* will only use these if this is a subtype of a py class */ - NULL, /* getattrofunc tp_getattro; */ - NULL, /* setattrofunc tp_setattro; */ - - /* Functions to access object as input/output buffer */ - NULL, /* PyBufferProcs *tp_as_buffer; */ - - /*** Flags to define presence of optional/expanded features ***/ - Py_TPFLAGS_DEFAULT, /* long tp_flags; */ - - NULL, /* char *tp_doc; Documentation string */ - /*** Assigned meaning in release 2.0 ***/ - /* call function for all accessible objects */ - NULL, /* traverseproc tp_traverse; */ - - /* delete references to contained objects */ - NULL, /* inquiry tp_clear; */ - - /*** Assigned meaning in release 2.1 ***/ - /*** rich comparisons ***/ - NULL, /* richcmpfunc tp_richcompare; */ - - /*** weak reference enabler ***/ - 0, - /*** Added in release 2.2 ***/ - /* Iterators */ - NULL, /* getiterfunc tp_iter; */ - NULL, /* iternextfunc tp_iternext; */ - - /*** Attribute descriptor and subclassing stuff ***/ - NULL, /* struct PyMethodDef *tp_methods; */ - NULL, /* struct PyMemberDef *tp_members; */ - bpy_bmesh_op_getseters, /* struct PyGetSetDef *tp_getset; */ - NULL, /* struct _typeobject *tp_base; */ - NULL, /* PyObject *tp_dict; */ - NULL, /* descrgetfunc tp_descr_get; */ - NULL, /* descrsetfunc tp_descr_set; */ - 0, /* long tp_dictoffset; */ - NULL, /* initproc tp_init; */ - NULL, /* allocfunc tp_alloc; */ - NULL, /* newfunc tp_new; */ - /* Low-level free-memory routine */ - NULL, /* freefunc tp_free; */ - /* For PyObject_IS_GC */ - NULL, /* inquiry tp_is_gc; */ - NULL, /* PyObject *tp_bases; */ - /* method resolution order */ - NULL, /* PyObject *tp_mro; */ - NULL, /* PyObject *tp_cache; */ - NULL, /* PyObject *tp_subclasses; */ - NULL, /* PyObject *tp_weaklist; */ - NULL, + /*tp_name*/ PyVarObject_HEAD_INIT(NULL, 0) "BMeshOpFunc", + /*tp_basicsize*/ sizeof(BPy_BMeshOpFunc), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ NULL, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ NULL, + /*tp_setattr*/ NULL, + /*tp_as_async*/ NULL, + /*tp_repr*/ (reprfunc)bpy_bmesh_op_repr, + /*tp_as_number*/ NULL, + /*tp_as_sequence*/ NULL, + /*tp_as_mapping*/ NULL, + /*tp_hash*/ NULL, + /*tp_call*/ (ternaryfunc)BPy_BMO_call, + /*tp_str*/ NULL, + /*tp_getattro*/ NULL, + /*tp_setattro*/ NULL, + /*tp_as_buffer*/ NULL, + /*tp_flags*/ Py_TPFLAGS_DEFAULT, + /*tp_doc*/ NULL, + /*tp_traverse*/ NULL, + /*tp_clear*/ NULL, + /*tp_richcompare*/ NULL, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ NULL, + /*tp_iternext*/ NULL, + /*tp_methods*/ NULL, + /*tp_members*/ NULL, + /*tp_getset*/ bpy_bmesh_op_getseters, + /*tp_base*/ NULL, + /*tp_dict*/ NULL, + /*tp_descr_get*/ NULL, + /*tp_descr_set*/ NULL, + /*tp_dictoffset*/ 0, + /*tp_init*/ NULL, + /*tp_alloc*/ NULL, + /*tp_new*/ NULL, + /*tp_free*/ NULL, + /*tp_is_gc*/ NULL, + /*tp_bases*/ NULL, + /*tp_mro*/ NULL, + /*tp_cache*/ NULL, + /*tp_subclasses*/ NULL, + /*tp_weaklist*/ NULL, + /*tp_del*/ NULL, + /*tp_version_tag*/ 0, + /*tp_finalize*/ NULL, + /*tp_vectorcall*/ NULL, }; /* bmesh module 'bmesh.ops' diff --git a/source/blender/python/bmesh/bmesh_py_types.c b/source/blender/python/bmesh/bmesh_py_types.c index 364adb5458b..cf20e1349ee 100644 --- a/source/blender/python/bmesh/bmesh_py_types.c +++ b/source/blender/python/bmesh/bmesh_py_types.c @@ -3313,31 +3313,30 @@ static int bpy_bmelem_ass_subscript(BPy_BMElem *self, BPy_BMLayerItem *key, PyOb } static PySequenceMethods bpy_bmelemseq_as_sequence = { - (lenfunc)bpy_bmelemseq_length, /* sq_length */ - NULL, /* sq_concat */ - NULL, /* sq_repeat */ - (ssizeargfunc)bpy_bmelemseq_subscript_int, - /* sq_item */ /* Only set this so PySequence_Check() returns True */ - NULL, /* sq_slice */ - (ssizeobjargproc)NULL, /* sq_ass_item */ - NULL, /* *was* sq_ass_slice */ - (objobjproc)bpy_bmelemseq_contains, /* sq_contains */ - (binaryfunc)NULL, /* sq_inplace_concat */ - (ssizeargfunc)NULL, /* sq_inplace_repeat */ + /*sq_length*/ (lenfunc)bpy_bmelemseq_length, + /*sq_concat*/ NULL, + /*sq_repeat*/ NULL, + /* Only set this so `PySequence_Check()` returns True. */ + /*sq_item*/ (ssizeargfunc)bpy_bmelemseq_subscript_int, + /*was_sq_slice*/ NULL, + /*sq_ass_item*/ NULL, + /*was_sq_ass_slice*/ NULL, + /*sq_contains*/ (objobjproc)bpy_bmelemseq_contains, + /*sq_inplace_concat*/ NULL, + /*sq_inplace_repeat*/ NULL, }; static PyMappingMethods bpy_bmelemseq_as_mapping = { - (lenfunc)bpy_bmelemseq_length, /* mp_length */ - (binaryfunc)bpy_bmelemseq_subscript, /* mp_subscript */ - (objobjargproc)NULL, /* mp_ass_subscript */ + /*mp_len*/ (lenfunc)bpy_bmelemseq_length, + /*mp_subscript*/ (binaryfunc)bpy_bmelemseq_subscript, + /*mp_ass_subscript*/ (objobjargproc)NULL, }; /* for customdata access */ static PyMappingMethods bpy_bm_elem_as_mapping = { - (lenfunc)NULL, - /* mp_length */ /* keep this empty, messes up 'if elem: ...' test */ - (binaryfunc)bpy_bmelem_subscript, /* mp_subscript */ - (objobjargproc)bpy_bmelem_ass_subscript, /* mp_ass_subscript */ + /*mp_len*/ (lenfunc)NULL, /* Keep this empty, messes up `if elem: ...` test. */ + /*mp_subscript*/ (binaryfunc)bpy_bmelem_subscript, + /*mp_ass_subscript*/ (objobjargproc)bpy_bmelem_ass_subscript, }; /* Iterator diff --git a/source/blender/python/bmesh/bmesh_py_types_customdata.c b/source/blender/python/bmesh/bmesh_py_types_customdata.c index 58bfb922327..2d0e31b9e3f 100644 --- a/source/blender/python/bmesh/bmesh_py_types_customdata.c +++ b/source/blender/python/bmesh/bmesh_py_types_customdata.c @@ -871,23 +871,23 @@ static int bpy_bmlayercollection_contains(BPy_BMLayerCollection *self, PyObject } static PySequenceMethods bpy_bmlayercollection_as_sequence = { - (lenfunc)bpy_bmlayercollection_length, /* sq_length */ - NULL, /* sq_concat */ - NULL, /* sq_repeat */ - (ssizeargfunc)bpy_bmlayercollection_subscript_int, - /* sq_item */ /* Only set this so PySequence_Check() returns True */ - NULL, /* sq_slice */ - (ssizeobjargproc)NULL, /* sq_ass_item */ - NULL, /* *was* sq_ass_slice */ - (objobjproc)bpy_bmlayercollection_contains, /* sq_contains */ - (binaryfunc)NULL, /* sq_inplace_concat */ - (ssizeargfunc)NULL, /* sq_inplace_repeat */ + /*sq_length*/ (lenfunc)bpy_bmlayercollection_length, + /*sq_concat*/ NULL, + /*sq_repeat*/ NULL, + /* Only set this so `PySequence_Check()` returns True. */ + /*sq_item*/ (ssizeargfunc)bpy_bmlayercollection_subscript_int, + /*was_sq_slice*/ NULL, /* DEPRECATED. */ + /*sq_ass_item*/ NULL, + /*was_sq_ass_slice*/ NULL, /* DEPRECATED. */ + /*sq_contains*/ (objobjproc)bpy_bmlayercollection_contains, + /*sq_inplace_concat*/ NULL, + /*sq_inplace_repeat*/ NULL, }; static PyMappingMethods bpy_bmlayercollection_as_mapping = { - (lenfunc)bpy_bmlayercollection_length, /* mp_length */ - (binaryfunc)bpy_bmlayercollection_subscript, /* mp_subscript */ - (objobjargproc)NULL, /* mp_ass_subscript */ + /*mp_len*/ (lenfunc)bpy_bmlayercollection_length, + /*mp_subscript*/ (binaryfunc)bpy_bmlayercollection_subscript, + /*mp_ass_subscript*/ (objobjargproc)NULL, }; /* Iterator diff --git a/source/blender/python/bmesh/bmesh_py_types_meshdata.c b/source/blender/python/bmesh/bmesh_py_types_meshdata.c index 9f200734786..c58c9caf0a8 100644 --- a/source/blender/python/bmesh/bmesh_py_types_meshdata.c +++ b/source/blender/python/bmesh/bmesh_py_types_meshdata.c @@ -486,26 +486,24 @@ static int bpy_bmdeformvert_contains(BPy_BMDeformVert *self, PyObject *value) /* only defined for __contains__ */ static PySequenceMethods bpy_bmdeformvert_as_sequence = { - (lenfunc)bpy_bmdeformvert_len, /* sq_length */ - NULL, /* sq_concat */ - NULL, /* sq_repeat */ - + /*sq_length*/ (lenfunc)bpy_bmdeformvert_len, + /*sq_concat*/ NULL, + /*sq_repeat*/ NULL, /* NOTE: if this is set #PySequence_Check() returns True, * but in this case we don't want to be treated as a seq. */ - NULL, /* sq_item */ - - NULL, /* sq_slice */ - NULL, /* sq_ass_item */ - NULL, /* *was* sq_ass_slice */ - (objobjproc)bpy_bmdeformvert_contains, /* sq_contains */ - (binaryfunc)NULL, /* sq_inplace_concat */ - (ssizeargfunc)NULL, /* sq_inplace_repeat */ + /*sq_item*/ NULL, + /*was_sq_slice*/ NULL, /* DEPRECATED. */ + /*sq_ass_item*/ NULL, + /*was_sq_ass_slice*/ NULL, /* DEPRECATED. */ + /*sq_contains*/ (objobjproc)bpy_bmdeformvert_contains, + /*sq_inplace_concat*/ NULL, + /*sq_inplace_repeat*/ NULL, }; static PyMappingMethods bpy_bmdeformvert_as_mapping = { - (lenfunc)bpy_bmdeformvert_len, - (binaryfunc)bpy_bmdeformvert_subscript, - (objobjargproc)bpy_bmdeformvert_ass_subscript, + /*mp_len*/ (lenfunc)bpy_bmdeformvert_len, + /*mp_subscript*/ (binaryfunc)bpy_bmdeformvert_subscript, + /*mp_ass_subscript*/ (objobjargproc)bpy_bmdeformvert_ass_subscript, }; /* Methods diff --git a/source/blender/python/bmesh/bmesh_py_types_select.c b/source/blender/python/bmesh/bmesh_py_types_select.c index 93bce055b12..20bf06e8016 100644 --- a/source/blender/python/bmesh/bmesh_py_types_select.c +++ b/source/blender/python/bmesh/bmesh_py_types_select.c @@ -291,23 +291,23 @@ static int bpy_bmeditselseq_contains(BPy_BMEditSelSeq *self, PyObject *value) } static PySequenceMethods bpy_bmeditselseq_as_sequence = { - (lenfunc)bpy_bmeditselseq_length, /* sq_length */ - NULL, /* sq_concat */ - NULL, /* sq_repeat */ - (ssizeargfunc)bpy_bmeditselseq_subscript_int, - /* sq_item */ /* Only set this so PySequence_Check() returns True */ - NULL, /* sq_slice */ - (ssizeobjargproc)NULL, /* sq_ass_item */ - NULL, /* *was* sq_ass_slice */ - (objobjproc)bpy_bmeditselseq_contains, /* sq_contains */ - (binaryfunc)NULL, /* sq_inplace_concat */ - (ssizeargfunc)NULL, /* sq_inplace_repeat */ + /*sq_length*/ (lenfunc)bpy_bmeditselseq_length, + /*sq_concat*/ NULL, + /*sq_repeat*/ NULL, + /* Only set this so `PySequence_Check()` returns True. */ + /*sq_item*/ (ssizeargfunc)bpy_bmeditselseq_subscript_int, + /*sq_slice */ NULL, + /*sq_ass_item */ NULL, + /*was_sq_ass_slice*/ NULL, + /*sq_contains*/ (objobjproc)bpy_bmeditselseq_contains, + /*sq_inplace_concat*/ NULL, + /*sq_inplace_repeat*/ NULL, }; static PyMappingMethods bpy_bmeditselseq_as_mapping = { - (lenfunc)bpy_bmeditselseq_length, /* mp_length */ - (binaryfunc)bpy_bmeditselseq_subscript, /* mp_subscript */ - (objobjargproc)NULL, /* mp_ass_subscript */ + /*mp_len*/ (lenfunc)bpy_bmeditselseq_length, + /*mp_subscript*/ (binaryfunc)bpy_bmeditselseq_subscript, + /*mp_ass_subscript*/ (objobjargproc)NULL, }; /* Iterator diff --git a/source/blender/python/generic/bgl.c b/source/blender/python/generic/bgl.c index fd5f2e77672..a03e0ab31eb 100644 --- a/source/blender/python/generic/bgl.c +++ b/source/blender/python/generic/bgl.c @@ -491,22 +491,22 @@ static bool compare_dimensions(int ndim, const int *dim1, const Py_ssize_t *dim2 * \{ */ static PySequenceMethods Buffer_SeqMethods = { - (lenfunc)Buffer_len, /* sq_length */ - (binaryfunc)NULL, /* sq_concat */ - (ssizeargfunc)NULL, /* sq_repeat */ - (ssizeargfunc)Buffer_item, /* sq_item */ - (ssizessizeargfunc)NULL, /* sq_slice, deprecated, handled in Buffer_item */ - (ssizeobjargproc)Buffer_ass_item, /* sq_ass_item */ - (ssizessizeobjargproc)NULL, /* sq_ass_slice, deprecated handled in Buffer_ass_item */ - (objobjproc)NULL, /* sq_contains */ - (binaryfunc)NULL, /* sq_inplace_concat */ - (ssizeargfunc)NULL, /* sq_inplace_repeat */ + /*sq_length*/ (lenfunc)Buffer_len, + /*sq_concat*/ NULL, + /*sq_repeat*/ NULL, + /*sq_item*/ (ssizeargfunc)Buffer_item, + /*was_sq_slice*/ NULL, /* DEPRECATED. Handled by #Buffer_item. */ + /*sq_ass_item*/ (ssizeobjargproc)Buffer_ass_item, + /*was_sq_ass_slice*/ NULL, /* DEPRECATED. Handled by #Buffer_ass_item. */ + /*sq_contains*/ NULL, + /*sq_inplace_concat*/ NULL, + /*sq_inplace_repeat*/ NULL, }; static PyMappingMethods Buffer_AsMapping = { - (lenfunc)Buffer_len, - (binaryfunc)Buffer_subscript, - (objobjargproc)Buffer_ass_subscript, + /*mp_len*/ (lenfunc)Buffer_len, + /*mp_subscript*/ (binaryfunc)Buffer_subscript, + /*mp_ass_subscript*/ (objobjargproc)Buffer_ass_subscript, }; static void Buffer_dealloc(Buffer *self); @@ -568,72 +568,55 @@ static PyGetSetDef Buffer_getseters[] = { }; PyTypeObject BGL_bufferType = { - PyVarObject_HEAD_INIT(NULL, 0) "bgl.Buffer", /* tp_name */ - sizeof(Buffer), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)Buffer_dealloc, /* tp_dealloc */ - (printfunc)NULL, /* tp_print */ - NULL, /* tp_getattr */ - NULL, /* tp_setattr */ - NULL, /* tp_compare */ - (reprfunc)Buffer_repr, /* tp_repr */ - NULL, /* tp_as_number */ - &Buffer_SeqMethods, /* tp_as_sequence */ - &Buffer_AsMapping, /* PyMappingMethods *tp_as_mapping; */ - - /* More standard operations (here for binary compatibility) */ - - NULL, /* hashfunc tp_hash; */ - NULL, /* ternaryfunc tp_call; */ - NULL, /* reprfunc tp_str; */ - NULL, /* getattrofunc tp_getattro; */ - NULL, /* setattrofunc tp_setattro; */ - - /* Functions to access object as input/output buffer */ - NULL, /* PyBufferProcs *tp_as_buffer; */ - - /*** Flags to define presence of optional/expanded features ***/ - Py_TPFLAGS_DEFAULT, /* long tp_flags; */ - - NULL, /* char *tp_doc; Documentation string */ - /*** Assigned meaning in release 2.0 ***/ - /* call function for all accessible objects */ - NULL, /* traverseproc tp_traverse; */ - - /* delete references to contained objects */ - NULL, /* inquiry tp_clear; */ - - /*** Assigned meaning in release 2.1 ***/ - /*** rich comparisons ***/ - NULL, /* richcmpfunc tp_richcompare; */ - - /*** weak reference enabler ***/ - 0, /* long tp_weaklistoffset; */ - - /*** Added in release 2.2 ***/ - /* Iterators */ - NULL, /* getiterfunc tp_iter; */ - NULL, /* iternextfunc tp_iternext; */ - /*** Attribute descriptor and subclassing stuff ***/ - Buffer_methods, /* struct PyMethodDef *tp_methods; */ - NULL, /* struct PyMemberDef *tp_members; */ - Buffer_getseters, /* struct PyGetSetDef *tp_getset; */ - NULL, /*tp_base*/ - NULL, /*tp_dict*/ - NULL, /*tp_descr_get*/ - NULL, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ - NULL, /*tp_init*/ - NULL, /*tp_alloc*/ - Buffer_new, /*tp_new*/ - NULL, /*tp_free*/ - NULL, /*tp_is_gc*/ - NULL, /*tp_bases*/ - NULL, /*tp_mro*/ - NULL, /*tp_cache*/ - NULL, /*tp_subclasses*/ - NULL, /*tp_weaklist*/ - NULL, /*tp_del*/ + PyVarObject_HEAD_INIT(NULL, 0) + /*tp_name*/ "bgl.Buffer", + /*tp_basicsize*/ sizeof(Buffer), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ (destructor)Buffer_dealloc, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ NULL, + /*tp_setattr*/ NULL, + /*tp_as_async*/ NULL, + /*tp_repr*/ (reprfunc)Buffer_repr, + /*tp_as_number*/ NULL, + /*tp_as_sequence*/ &Buffer_SeqMethods, + /*tp_as_mapping*/ &Buffer_AsMapping, + /*tp_hash*/ NULL, + /*tp_call*/ NULL, + /*tp_str*/ NULL, + /*tp_getattro*/ NULL, + /*tp_setattro*/ NULL, + /*tp_as_buffer*/ NULL, + /*tp_flags*/ Py_TPFLAGS_DEFAULT, + /*tp_doc*/ NULL, + /*tp_traverse*/ NULL, + /*tp_clear*/ NULL, + /*tp_richcompare*/ NULL, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ NULL, + /*tp_iternext*/ NULL, + /*tp_methods*/ Buffer_methods, + /*tp_members*/ NULL, + /*tp_getset*/ Buffer_getseters, + /*tp_base*/ NULL, + /*tp_dict*/ NULL, + /*tp_descr_get*/ NULL, + /*tp_descr_set*/ NULL, + /*tp_dictoffset*/ 0, + /*tp_init*/ NULL, + /*tp_alloc*/ NULL, + /*tp_new*/ Buffer_new, + /*tp_free*/ NULL, + /*tp_is_gc*/ NULL, + /*tp_bases*/ NULL, + /*tp_mro*/ NULL, + /*tp_cache*/ NULL, + /*tp_subclasses*/ NULL, + /*tp_weaklist*/ NULL, + /*tp_del*/ NULL, + /*tp_version_tag*/ 0, + /*tp_finalize*/ NULL, + /*tp_vectorcall*/ NULL, }; static Buffer *BGL_MakeBuffer_FromData( diff --git a/source/blender/python/generic/idprop_py_api.c b/source/blender/python/generic/idprop_py_api.c index 3978f7f37cc..a5599a3622e 100644 --- a/source/blender/python/generic/idprop_py_api.c +++ b/source/blender/python/generic/idprop_py_api.c @@ -1156,36 +1156,36 @@ static int BPy_Group_ViewItems_Contains(BPy_IDGroup_View *self, PyObject *value) } static PySequenceMethods BPy_IDGroup_ViewKeys_as_sequence = { - (lenfunc)BPy_Group_View_len, /* sq_length */ - 0, /* sq_concat */ - 0, /* sq_repeat */ - 0, /* sq_item */ - 0, /* sq_slice */ - 0, /* sq_ass_item */ - 0, /* sq_ass_slice */ - (objobjproc)BPy_Group_ViewKeys_Contains, /* sq_contains */ + /*sq_length*/ (lenfunc)BPy_Group_View_len, + /*sq_concat*/ NULL, + /*sq_repeat*/ NULL, + /*sq_item*/ NULL, + /*was_sq_slice*/ NULL, + /*sq_ass_item*/ NULL, + /*was_sq_ass_slice*/ NULL, + /*sq_contains*/ (objobjproc)BPy_Group_ViewKeys_Contains, }; static PySequenceMethods BPy_IDGroup_ViewValues_as_sequence = { - (lenfunc)BPy_Group_View_len, /* sq_length */ - 0, /* sq_concat */ - 0, /* sq_repeat */ - 0, /* sq_item */ - 0, /* sq_slice */ - 0, /* sq_ass_item */ - 0, /* sq_ass_slice */ - (objobjproc)BPy_Group_ViewValues_Contains, /* sq_contains */ + /*sq_length*/ (lenfunc)BPy_Group_View_len, + /*sq_concat*/ NULL, + /*sq_repeat*/ NULL, + /*sq_item*/ NULL, + /*was_sq_slice*/ NULL, + /*sq_ass_item*/ NULL, + /*was_sq_ass_slice*/ NULL, + /*sq_contains*/ (objobjproc)BPy_Group_ViewValues_Contains, }; static PySequenceMethods BPy_IDGroup_ViewItems_as_sequence = { - (lenfunc)BPy_Group_View_len, /* sq_length */ - 0, /* sq_concat */ - 0, /* sq_repeat */ - 0, /* sq_item */ - 0, /* sq_slice */ - 0, /* sq_ass_item */ - 0, /* sq_ass_slice */ - (objobjproc)BPy_Group_ViewItems_Contains, /* sq_contains */ + /*sq_length*/ (lenfunc)BPy_Group_View_len, + /*sq_concat*/ NULL, + /*sq_repeat*/ NULL, + /*sq_item*/ NULL, + /*was_sq_slice*/ NULL, + /*sq_ass_item*/ NULL, + /*was_sq_ass_slice*/ NULL, + /*sq_contains*/ (objobjproc)BPy_Group_ViewItems_Contains, }; /* Methods. */ @@ -1551,84 +1551,76 @@ static struct PyMethodDef BPy_IDGroup_methods[] = { * \{ */ static PySequenceMethods BPy_IDGroup_Seq = { - (lenfunc)BPy_IDGroup_Map_Len, /* lenfunc sq_length */ - NULL, /* binaryfunc sq_concat */ - NULL, /* ssizeargfunc sq_repeat */ - NULL, - /* ssizeargfunc sq_item */ /* TODO: setting this will allow PySequence_Check to return True. */ - NULL, /* intintargfunc ***was_sq_slice*** */ - NULL, /* intobjargproc sq_ass_item */ - NULL, /* ssizeobjargproc ***was_sq_ass_slice*** */ - (objobjproc)BPy_IDGroup_Contains, /* objobjproc sq_contains */ - NULL, /* binaryfunc sq_inplace_concat */ - NULL, /* ssizeargfunc sq_inplace_repeat */ + /*sq_length*/ (lenfunc)BPy_IDGroup_Map_Len, + /*sq_concat*/ NULL, + /*sq_repeat*/ NULL, + /* TODO: setting this will allow `PySequence_Check()` to return True. */ + /*sq_item*/ NULL, + /*was_sq_slice*/ NULL, /* DEPRECATED. */ + /*sq_ass_item*/ NULL, + /*was_sq_ass_slice*/ NULL, /* DEPRECATED. */ + /*sq_contains*/ (objobjproc)BPy_IDGroup_Contains, + /*sq_inplace_concat*/ NULL, + /*sq_inplace_repeat*/ NULL, }; static PyMappingMethods BPy_IDGroup_Mapping = { - (lenfunc)BPy_IDGroup_Map_Len, /* inquiry mp_length */ - (binaryfunc)BPy_IDGroup_Map_GetItem, /* binaryfunc mp_subscript */ - (objobjargproc)BPy_IDGroup_Map_SetItem, /* objobjargproc mp_ass_subscript */ + /*mp_len*/ (lenfunc)BPy_IDGroup_Map_Len, + /*mp_subscript*/ (binaryfunc)BPy_IDGroup_Map_GetItem, + /*mp_ass_subscript*/ (objobjargproc)BPy_IDGroup_Map_SetItem, }; PyTypeObject BPy_IDGroup_Type = { PyVarObject_HEAD_INIT(NULL, 0) - /* For printing, in format "<module>.<name>" */ - "IDPropertyGroup", /* char *tp_name; */ - sizeof(BPy_IDProperty), /* int tp_basicsize; */ - 0, /* tp_itemsize; For allocation */ - - /* Methods to implement standard operations */ - - NULL, /* destructor tp_dealloc; */ - 0, /* tp_vectorcall_offset */ - NULL, /* getattrfunc tp_getattr; */ - NULL, /* setattrfunc tp_setattr; */ - NULL, /* cmpfunc tp_compare; */ - (reprfunc)BPy_IDGroup_repr, /* reprfunc tp_repr; */ - - /* Method suites for standard classes */ - - NULL, /* PyNumberMethods *tp_as_number; */ - &BPy_IDGroup_Seq, /* PySequenceMethods *tp_as_sequence; */ - &BPy_IDGroup_Mapping, /* PyMappingMethods *tp_as_mapping; */ - - /* More standard operations (here for binary compatibility) */ - - (hashfunc)BPy_IDGroup_hash, /* hashfunc tp_hash; */ - NULL, /* ternaryfunc tp_call; */ - NULL, /* reprfunc tp_str; */ - NULL, /* getattrofunc tp_getattro; */ - NULL, /* setattrofunc tp_setattro; */ - - /* Functions to access object as input/output buffer */ - NULL, /* PyBufferProcs *tp_as_buffer; */ - - /*** Flags to define presence of optional/expanded features ***/ - Py_TPFLAGS_DEFAULT, /* long tp_flags; */ - - NULL, /* char *tp_doc; Documentation string */ - /*** Assigned meaning in release 2.0 ***/ - /* call function for all accessible objects */ - NULL, /* traverseproc tp_traverse; */ - - /* delete references to contained objects */ - NULL, /* inquiry tp_clear; */ - - /*** Assigned meaning in release 2.1 ***/ - /*** rich comparisons ***/ - NULL, /* richcmpfunc tp_richcompare; */ - - /*** weak reference enabler ***/ - 0, /* long tp_weaklistoffset; */ - - /*** Added in release 2.2 ***/ - /* Iterators */ - (getiterfunc)BPy_IDGroup_iter, /* getiterfunc tp_iter; */ - NULL, /* iternextfunc tp_iternext; */ - /*** Attribute descriptor and subclassing stuff ***/ - BPy_IDGroup_methods, /* struct PyMethodDef *tp_methods; */ - NULL, /* struct PyMemberDef *tp_members; */ - BPy_IDGroup_getseters, /* struct PyGetSetDef *tp_getset; */ + /* For printing, in format `<module>.<name>`. */ + /*tp_name*/ "IDPropertyGroup", + /*tp_basicsize*/ sizeof(BPy_IDProperty), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ NULL, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ NULL, + /*tp_setattr*/ NULL, + /*tp_as_async*/ NULL, + /*tp_repr*/ (reprfunc)BPy_IDGroup_repr, + /*tp_as_number*/ NULL, + /*tp_as_sequence*/ &BPy_IDGroup_Seq, + /*tp_as_mapping*/ &BPy_IDGroup_Mapping, + /*tp_hash*/ (hashfunc)BPy_IDGroup_hash, + /*tp_call*/ NULL, + /*tp_str*/ NULL, + /*tp_getattro*/ NULL, + /*tp_setattro*/ NULL, + /*tp_as_buffer*/ NULL, + /*tp_flags*/ Py_TPFLAGS_DEFAULT, + /*tp_doc*/ NULL, + /*tp_traverse*/ NULL, + /*tp_clear*/ NULL, + /*tp_richcompare*/ NULL, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ (getiterfunc)BPy_IDGroup_iter, + /*tp_iternext*/ NULL, + /*tp_methods*/ BPy_IDGroup_methods, + /*tp_members*/ NULL, + /*tp_getset*/ BPy_IDGroup_getseters, + /*tp_base*/ NULL, + /*tp_dict*/ NULL, + /*tp_descr_get*/ NULL, + /*tp_descr_set*/ NULL, + /*tp_dictoffset*/ 0, + /*tp_init*/ NULL, + /*tp_alloc*/ NULL, + /*tp_new*/ NULL, + /*tp_free*/ NULL, + /*tp_is_gc*/ NULL, + /*tp_bases*/ NULL, + /*tp_mro*/ NULL, + /*tp_cache*/ NULL, + /*tp_subclasses*/ NULL, + /*tp_weaklist*/ NULL, + /*tp_del*/ NULL, + /*tp_version_tag*/ 0, + /*tp_finalize*/ NULL, + /*tp_vectorcall*/ NULL, }; /** \} */ @@ -1768,17 +1760,16 @@ static int BPy_IDArray_SetItem(BPy_IDArray *self, int index, PyObject *value) } static PySequenceMethods BPy_IDArray_Seq = { - (lenfunc)BPy_IDArray_Len, /* inquiry sq_length */ - NULL, /* binaryfunc sq_concat */ - NULL, /* intargfunc sq_repeat */ - (ssizeargfunc)BPy_IDArray_GetItem, /* intargfunc sq_item */ - NULL, /* intintargfunc sq_slice */ - (ssizeobjargproc)BPy_IDArray_SetItem, /* intobjargproc sq_ass_item */ - NULL, /* intintobjargproc sq_ass_slice */ - NULL, /* objobjproc sq_contains */ - /* Added in release 2.0 */ - NULL, /* binaryfunc sq_inplace_concat */ - NULL, /* intargfunc sq_inplace_repeat */ + /*sq_length*/ (lenfunc)BPy_IDArray_Len, + /*sq_concat*/ NULL, + /*sq_repeat*/ NULL, + /*sq_item*/ (ssizeargfunc)BPy_IDArray_GetItem, + /*was_sq_slice*/ NULL, /* DEPRECATED. */ + /*sq_ass_item*/ (ssizeobjargproc)BPy_IDArray_SetItem, + /*was_sq_ass_slice*/ NULL, /* DEPRECATED. */ + /*sq_contains*/ NULL, + /*sq_inplace_concat*/ NULL, + /*sq_inplace_repeat*/ NULL, }; /* sequence slice (get): idparr[a:b] */ @@ -1926,9 +1917,9 @@ static int BPy_IDArray_ass_subscript(BPy_IDArray *self, PyObject *item, PyObject } static PyMappingMethods BPy_IDArray_AsMapping = { - (lenfunc)BPy_IDArray_Len, - (binaryfunc)BPy_IDArray_subscript, - (objobjargproc)BPy_IDArray_ass_subscript, + /*mp_len*/ (lenfunc)BPy_IDArray_Len, + /*mp_subscript*/ (binaryfunc)BPy_IDArray_subscript, + /*mp_ass_subscript*/ (objobjargproc)BPy_IDArray_ass_subscript, }; static int itemsize_by_idarray_type(int array_type) @@ -1971,8 +1962,8 @@ static void BPy_IDArray_releasebuffer(BPy_IDArray *UNUSED(self), Py_buffer *view } static PyBufferProcs BPy_IDArray_Buffer = { - (getbufferproc)BPy_IDArray_getbuffer, - (releasebufferproc)BPy_IDArray_releasebuffer, + /*bf_getbuffer*/ (getbufferproc)BPy_IDArray_getbuffer, + /*bf_releasebuffer*/ (releasebufferproc)BPy_IDArray_releasebuffer, }; /** \} */ @@ -1983,83 +1974,55 @@ static PyBufferProcs BPy_IDArray_Buffer = { PyTypeObject BPy_IDArray_Type = { PyVarObject_HEAD_INIT(NULL, 0) - /* For printing, in format "<module>.<name>" */ - "IDPropertyArray", /* char *tp_name; */ - sizeof(BPy_IDArray), /* int tp_basicsize; */ - 0, /* tp_itemsize; For allocation */ - - /* Methods to implement standard operations */ - - NULL, /* destructor tp_dealloc; */ - 0, /* tp_vectorcall_offset */ - NULL, /* getattrfunc tp_getattr; */ - NULL, /* setattrfunc tp_setattr; */ - NULL, /* cmpfunc tp_compare; */ - (reprfunc)BPy_IDArray_repr, /* reprfunc tp_repr; */ - - /* Method suites for standard classes */ - - NULL, /* PyNumberMethods *tp_as_number; */ - &BPy_IDArray_Seq, /* PySequenceMethods *tp_as_sequence; */ - &BPy_IDArray_AsMapping, /* PyMappingMethods *tp_as_mapping; */ - - /* More standard operations (here for binary compatibility) */ - - NULL, /* hashfunc tp_hash; */ - NULL, /* ternaryfunc tp_call; */ - NULL, /* reprfunc tp_str; */ - NULL, /* getattrofunc tp_getattro; */ - NULL, /* setattrofunc tp_setattro; */ - - /* Functions to access object as input/output buffer */ - &BPy_IDArray_Buffer, /* PyBufferProcs *tp_as_buffer; */ - - /*** Flags to define presence of optional/expanded features ***/ - Py_TPFLAGS_DEFAULT, /* long tp_flags; */ - - NULL, /* char *tp_doc; Documentation string */ - /*** Assigned meaning in release 2.0 ***/ - /* call function for all accessible objects */ - NULL, /* traverseproc tp_traverse; */ - - /* delete references to contained objects */ - NULL, /* inquiry tp_clear; */ - - /*** Assigned meaning in release 2.1 ***/ - /*** rich comparisons ***/ - NULL, /* richcmpfunc tp_richcompare; */ - - /*** weak reference enabler ***/ - 0, /* long tp_weaklistoffset; */ - - /*** Added in release 2.2 ***/ - /* Iterators */ - NULL, /* getiterfunc tp_iter; */ - NULL, /* iternextfunc tp_iternext; */ - - /*** Attribute descriptor and subclassing stuff ***/ - BPy_IDArray_methods, /* struct PyMethodDef *tp_methods; */ - NULL, /* struct PyMemberDef *tp_members; */ - BPy_IDArray_getseters, /* struct PyGetSetDef *tp_getset; */ - NULL, /* struct _typeobject *tp_base; */ - NULL, /* PyObject *tp_dict; */ - NULL, /* descrgetfunc tp_descr_get; */ - NULL, /* descrsetfunc tp_descr_set; */ - 0, /* long tp_dictoffset; */ - NULL, /* initproc tp_init; */ - NULL, /* allocfunc tp_alloc; */ - NULL, /* newfunc tp_new; */ - /* Low-level free-memory routine */ - NULL, /* freefunc tp_free; */ - /* For PyObject_IS_GC */ - NULL, /* inquiry tp_is_gc; */ - NULL, /* PyObject *tp_bases; */ - /* method resolution order */ - NULL, /* PyObject *tp_mro; */ - NULL, /* PyObject *tp_cache; */ - NULL, /* PyObject *tp_subclasses; */ - NULL, /* PyObject *tp_weaklist; */ - NULL, + /* For printing, in format `<module>.<name>`. */ + /*tp_name*/ "IDPropertyArray", + /*tp_basicsize*/ sizeof(BPy_IDArray), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ NULL, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ NULL, + /*tp_setattr*/ NULL, + /*tp_as_async*/ NULL, + /*tp_repr*/ (reprfunc)BPy_IDArray_repr, + /*tp_as_number*/ NULL, + /*tp_as_sequence*/ &BPy_IDArray_Seq, + /*tp_as_mapping*/ &BPy_IDArray_AsMapping, + /*tp_hash*/ NULL, + /*tp_call*/ NULL, + /*tp_str*/ NULL, + /*tp_getattro*/ NULL, + /*tp_setattro*/ NULL, + /*tp_as_buffer*/ &BPy_IDArray_Buffer, + /*tp_flags*/ Py_TPFLAGS_DEFAULT, + /*tp_doc*/ NULL, + /*tp_traverse*/ NULL, + /*tp_clear*/ NULL, + /*tp_richcompare*/ NULL, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ NULL, + /*tp_iternext*/ NULL, + /*tp_methods*/ BPy_IDArray_methods, + /*tp_members*/ NULL, + /*tp_getset*/ BPy_IDArray_getseters, + /*tp_base*/ NULL, + /*tp_dict*/ NULL, + /*tp_descr_get*/ NULL, + /*tp_descr_set*/ NULL, + /*tp_dictoffset*/ 0, + /*tp_init*/ NULL, + /*tp_alloc*/ NULL, + /*tp_new*/ NULL, + /*tp_free*/ NULL, + /*tp_is_gc*/ NULL, + /*tp_bases*/ NULL, + /*tp_mro*/ NULL, + /*tp_cache*/ NULL, + /*tp_subclasses*/ NULL, + /*tp_weaklist*/ NULL, + /*tp_del*/ NULL, + /*tp_version_tag*/ 0, + /*tp_finalize*/ NULL, + /*tp_vectorcall*/ NULL, }; /** \} */ diff --git a/source/blender/python/generic/idprop_py_ui_api.c b/source/blender/python/generic/idprop_py_ui_api.c index 890ba997548..4487a885a6c 100644 --- a/source/blender/python/generic/idprop_py_ui_api.c +++ b/source/blender/python/generic/idprop_py_ui_api.c @@ -660,63 +660,55 @@ static Py_hash_t BPy_IDPropertyUIManager_hash(BPy_IDPropertyUIManager *self) PyTypeObject BPy_IDPropertyUIManager_Type = { PyVarObject_HEAD_INIT(NULL, 0) - /* For printing, in format "<module>.<name>" */ - "IDPropertyUIManager", /* char *tp_name; */ - sizeof(BPy_IDPropertyUIManager), /* int tp_basicsize; */ - 0, /* tp_itemsize; For allocation */ - - /* Methods to implement standard operations */ - - NULL, /* destructor tp_dealloc; */ - 0, /* tp_vectorcall_offset */ - NULL, /* getattrfunc tp_getattr; */ - NULL, /* setattrfunc tp_setattr; */ - NULL, /* cmpfunc tp_compare; */ - (reprfunc)BPy_IDPropertyUIManager_repr, /* reprfunc tp_repr; */ - - /* Method suites for standard classes */ - - NULL, /* PyNumberMethods *tp_as_number; */ - NULL, /* PySequenceMethods *tp_as_sequence; */ - NULL, /* PyMappingMethods *tp_as_mapping; */ - - /* More standard operations (here for binary compatibility) */ - - (hashfunc)BPy_IDPropertyUIManager_hash, /* hashfunc tp_hash; */ - NULL, /* ternaryfunc tp_call; */ - NULL, /* reprfunc tp_str; */ - NULL, /* getattrofunc tp_getattro; */ - NULL, /* setattrofunc tp_setattro; */ - - /* Functions to access object as input/output buffer */ - NULL, /* PyBufferProcs *tp_as_buffer; */ - - /*** Flags to define presence of optional/expanded features ***/ - Py_TPFLAGS_DEFAULT, /* long tp_flags; */ - - NULL, /* char *tp_doc; Documentation string */ - /*** Assigned meaning in release 2.0 ***/ - /* call function for all accessible objects */ - NULL, /* traverseproc tp_traverse; */ - - /* delete references to contained objects */ - NULL, /* inquiry tp_clear; */ - - /*** Assigned meaning in release 2.1 ***/ - /*** rich comparisons ***/ - NULL, /* richcmpfunc tp_richcompare; */ - - /*** weak reference enabler ***/ - 0, /* long tp_weaklistoffset; */ - - /*** Added in release 2.2 ***/ - /* Iterators */ - NULL, /* getiterfunc tp_iter; */ - NULL, /* iternextfunc tp_iternext; */ - /*** Attribute descriptor and subclassing stuff ***/ - BPy_IDPropertyUIManager_methods, /* struct PyMethodDef *tp_methods; */ - NULL, /* struct PyMemberDef *tp_members; */ - NULL, /* struct PyGetSetDef *tp_getset; */ + /* For printing, in format `<module>.<name>`. */ + /*tp_name*/ "IDPropertyUIManager", + /*tp_basicsize*/ sizeof(BPy_IDPropertyUIManager), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ NULL, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ NULL, + /*tp_setattr*/ NULL, + /*tp_as_async*/ NULL, + /*tp_repr*/ (reprfunc)BPy_IDPropertyUIManager_repr, + /*tp_as_number*/ NULL, + /*tp_as_sequence*/ NULL, + /*tp_as_mapping*/ NULL, + /*tp_hash*/ (hashfunc)BPy_IDPropertyUIManager_hash, + /*tp_call*/ NULL, + /*tp_str*/ NULL, + /*tp_getattro*/ NULL, + /*tp_setattro*/ NULL, + /*tp_as_buffer*/ NULL, + /*tp_flags*/ Py_TPFLAGS_DEFAULT, + /*tp_doc*/ NULL, + /*tp_traverse*/ NULL, + /*tp_clear*/ NULL, + /*tp_richcompare*/ NULL, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ NULL, + /*tp_iternext*/ NULL, + /*tp_methods*/ BPy_IDPropertyUIManager_methods, + /*tp_members*/ NULL, + /*tp_getset*/ NULL, + /*tp_base*/ NULL, + /*tp_dict*/ NULL, + /*tp_descr_get*/ NULL, + /*tp_descr_set*/ NULL, + /*tp_dictoffset*/ 0, + /*tp_init*/ NULL, + /*tp_alloc*/ NULL, + /*tp_new*/ NULL, + /*tp_free*/ NULL, + /*tp_is_gc*/ NULL, + /*tp_bases*/ NULL, + /*tp_mro*/ NULL, + /*tp_cache*/ NULL, + /*tp_subclasses*/ NULL, + /*tp_weaklist*/ NULL, + /*tp_del*/ NULL, + /*tp_version_tag*/ 0, + /*tp_finalize*/ NULL, + /*tp_vectorcall*/ NULL, }; void IDPropertyUIData_Init_Types() diff --git a/source/blender/python/generic/imbuf_py_api.c b/source/blender/python/generic/imbuf_py_api.c index 14f1958b71d..c6a817fa01c 100644 --- a/source/blender/python/generic/imbuf_py_api.c +++ b/source/blender/python/generic/imbuf_py_api.c @@ -348,63 +348,54 @@ static Py_hash_t py_imbuf_hash(Py_ImBuf *self) PyTypeObject Py_ImBuf_Type = { PyVarObject_HEAD_INIT(NULL, 0) - /* For printing, in format "<module>.<name>" */ - "ImBuf", /* tp_name */ - sizeof(Py_ImBuf), /* int tp_basicsize; */ - 0, /* tp_itemsize; For allocation */ - - /* Methods to implement standard operations */ - - (destructor)py_imbuf_dealloc, /* destructor tp_dealloc; */ - 0, /* tp_vectorcall_offset */ - NULL, /* getattrfunc tp_getattr; */ - NULL, /* setattrfunc tp_setattr; */ - NULL, /* cmpfunc tp_compare; */ - (reprfunc)py_imbuf_repr, /* reprfunc tp_repr; */ - - /* Method suites for standard classes */ - - NULL, /* PyNumberMethods *tp_as_number; */ - NULL, /* PySequenceMethods *tp_as_sequence; */ - NULL, /* PyMappingMethods *tp_as_mapping; */ - - /* More standard operations (here for binary compatibility) */ - - (hashfunc)py_imbuf_hash, /* hashfunc tp_hash; */ - NULL, /* ternaryfunc tp_call; */ - NULL, /* reprfunc tp_str; */ - NULL, /* getattrofunc tp_getattro; */ - NULL, /* setattrofunc tp_setattro; */ - - /* Functions to access object as input/output buffer */ - NULL, /* PyBufferProcs *tp_as_buffer; */ - - /*** Flags to define presence of optional/expanded features ***/ - Py_TPFLAGS_DEFAULT, /* long tp_flags; */ - - NULL, /* char *tp_doc; Documentation string */ - /*** Assigned meaning in release 2.0 ***/ - /* call function for all accessible objects */ - NULL, /* traverseproc tp_traverse; */ - - /* delete references to contained objects */ - NULL, /* inquiry tp_clear; */ - - /*** Assigned meaning in release 2.1 ***/ - /*** rich comparisons ***/ - NULL, /* richcmpfunc tp_richcompare; */ - - /*** weak reference enabler ***/ - 0, /* long tp_weaklistoffset; */ - - /*** Added in release 2.2 ***/ - /* Iterators */ - NULL, /* getiterfunc tp_iter; */ - NULL, /* iternextfunc tp_iternext; */ - /*** Attribute descriptor and subclassing stuff ***/ - Py_ImBuf_methods, /* struct PyMethodDef *tp_methods; */ - NULL, /* struct PyMemberDef *tp_members; */ - Py_ImBuf_getseters, /* struct PyGetSetDef *tp_getset; */ + /*tp_name*/ "ImBuf", + /*tp_basicsize*/ sizeof(Py_ImBuf), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ (destructor)py_imbuf_dealloc, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ NULL, + /*tp_setattr*/ NULL, + /*tp_as_async*/ NULL, + /*tp_repr*/ (reprfunc)py_imbuf_repr, + /*tp_as_number*/ NULL, + /*tp_as_sequence*/ NULL, + /*tp_as_mapping*/ NULL, + /*tp_hash*/ (hashfunc)py_imbuf_hash, + /*tp_call*/ NULL, + /*tp_str*/ NULL, + /*tp_getattro*/ NULL, + /*tp_setattro*/ NULL, + /*tp_as_buffer*/ NULL, + /*tp_flags*/ Py_TPFLAGS_DEFAULT, + /*tp_doc*/ NULL, + /*tp_traverse*/ NULL, + /*tp_clear*/ NULL, + /*tp_richcompare*/ NULL, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ NULL, + /*tp_iternext*/ NULL, + /*tp_methods*/ Py_ImBuf_methods, + /*tp_members*/ NULL, + /*tp_getset*/ Py_ImBuf_getseters, + /*tp_base*/ NULL, + /*tp_dict*/ NULL, + /*tp_descr_get*/ NULL, + /*tp_descr_set*/ NULL, + /*tp_dictoffset*/ 0, + /*tp_init*/ NULL, + /*tp_alloc*/ NULL, + /*tp_new*/ NULL, + /*tp_free*/ NULL, + /*tp_is_gc*/ NULL, + /*tp_bases*/ NULL, + /*tp_mro*/ NULL, + /*tp_cache*/ NULL, + /*tp_subclasses*/ NULL, + /*tp_weaklist*/ NULL, + /*tp_del*/ NULL, + /*tp_version_tag*/ 0, + /*tp_finalize*/ NULL, + /*tp_vectorcall*/ NULL, }; static PyObject *Py_ImBuf_CreatePyObject(ImBuf *ibuf) diff --git a/source/blender/python/gpu/gpu_py_buffer.c b/source/blender/python/gpu/gpu_py_buffer.c index 30a434f8667..3dc141f400d 100644 --- a/source/blender/python/gpu/gpu_py_buffer.c +++ b/source/blender/python/gpu/gpu_py_buffer.c @@ -579,22 +579,22 @@ static PyGetSetDef pygpu_buffer_getseters[] = { }; static PySequenceMethods pygpu_buffer__tp_as_sequence = { - (lenfunc)pygpu_buffer__sq_length, /* sq_length */ - (binaryfunc)NULL, /* sq_concat */ - (ssizeargfunc)NULL, /* sq_repeat */ - (ssizeargfunc)pygpu_buffer__sq_item, /* sq_item */ - (ssizessizeargfunc)NULL, /* sq_slice, deprecated, handled in pygpu_buffer__sq_item */ - (ssizeobjargproc)pygpu_buffer__sq_ass_item, /* sq_ass_item */ - (ssizessizeobjargproc)NULL, /* sq_ass_slice, deprecated handled in pygpu_buffer__sq_ass_item */ - (objobjproc)NULL, /* sq_contains */ - (binaryfunc)NULL, /* sq_inplace_concat */ - (ssizeargfunc)NULL, /* sq_inplace_repeat */ + /*sq_length*/ (lenfunc)pygpu_buffer__sq_length, + /*sq_concat*/ NULL, + /*sq_repeat*/ NULL, + /*sq_item*/ (ssizeargfunc)pygpu_buffer__sq_item, + /*was_sq_slice*/ NULL, /* DEPRECATED. Handled by #pygpu_buffer__sq_item. */ + /*sq_ass_item*/ (ssizeobjargproc)pygpu_buffer__sq_ass_item, + /*was_sq_ass_slice*/ NULL, /* DEPRECATED. Handled by #pygpu_buffer__sq_ass_item. */ + /*sq_contains*/ NULL, + /*sq_inplace_concat*/ NULL, + /*sq_inplace_repeat*/ NULL, }; static PyMappingMethods pygpu_buffer__tp_as_mapping = { - (lenfunc)pygpu_buffer__sq_length, - (binaryfunc)pygpu_buffer__mp_subscript, - (objobjargproc)pygpu_buffer__mp_ass_subscript, + /*mp_len*/ (lenfunc)pygpu_buffer__sq_length, + /*mp_subscript*/ (binaryfunc)pygpu_buffer__mp_subscript, + /*mp_ass_subscript*/ (objobjargproc)pygpu_buffer__mp_ass_subscript, }; #ifdef PYGPU_BUFFER_PROTOCOL @@ -648,8 +648,8 @@ static void pygpu_buffer__bf_releasebuffer(PyObject *UNUSED(exporter), Py_buffer } static PyBufferProcs pygpu_buffer__tp_as_buffer = { - (getbufferproc)pygpu_buffer__bf_getbuffer, - (releasebufferproc)pygpu_buffer__bf_releasebuffer, + /*bf_getbuffer*/ (getbufferproc)pygpu_buffer__bf_getbuffer, + /*bf_releasebuffer*/ (releasebufferproc)pygpu_buffer__bf_releasebuffer, }; #endif diff --git a/source/blender/python/gpu/gpu_py_platform.c b/source/blender/python/gpu/gpu_py_platform.c index 51366d199b0..c6e964405fa 100644 --- a/source/blender/python/gpu/gpu_py_platform.c +++ b/source/blender/python/gpu/gpu_py_platform.c @@ -89,11 +89,13 @@ PyDoc_STRVAR(pygpu_platform_backend_type_get_doc, "\n" " Get actuve GPU backend.\n" "\n" - " :return: Backend type ('OPENGL', 'METAL', 'NONE', 'UNKNOWN').\n" + " :return: Backend type ('OPENGL', 'VULKAN', 'METAL', 'NONE', 'UNKNOWN').\n" " :rtype: str\n"); static PyObject *pygpu_platform_backend_type_get(PyObject *UNUSED(self)) { switch (GPU_backend_get_type()) { + case GPU_BACKEND_VULKAN: + return PyUnicode_FromString("VULKAN"); case GPU_BACKEND_METAL: return PyUnicode_FromString("METAL"); case GPU_BACKEND_NONE: diff --git a/source/blender/python/intern/bpy_app_handlers.c b/source/blender/python/intern/bpy_app_handlers.c index 8c5fb22eab1..3580481941d 100644 --- a/source/blender/python/intern/bpy_app_handlers.c +++ b/source/blender/python/intern/bpy_app_handlers.c @@ -132,7 +132,7 @@ static PyObject *bpy_app_handlers_persistent_new(PyTypeObject *UNUSED(type), return NULL; } -/* dummy type because decorators can't be PyCFunctions */ +/** Dummy type because decorators can't be a #PyCFunction. */ static PyTypeObject BPyPersistent_Type = { #if defined(_MSC_VER) @@ -140,46 +140,54 @@ static PyTypeObject BPyPersistent_Type = { #else PyVarObject_HEAD_INIT(&PyType_Type, 0) #endif - - "persistent", /* tp_name */ - 0, /* tp_basicsize */ - 0, /* tp_itemsize */ - /* methods */ - 0, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - 0, /* tp_repr */ - 0, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - 0, /* tp_hash */ - 0, /* tp_call */ - 0, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - 0, /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - 0, /* tp_iter */ - 0, /* tp_iternext */ - 0, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - 0, /* tp_init */ - 0, /* tp_alloc */ - bpy_app_handlers_persistent_new, /* tp_new */ - 0, /* tp_free */ + /*tp_name*/ "persistent", + /*tp_basicsize*/ 0, + /*tp_itemsize*/ 0, + /*tp_dealloc*/ NULL, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ NULL, + /*tp_setattr*/ NULL, + /*tp_as_async*/ NULL, + /*tp_repr*/ NULL, + /*tp_as_number*/ NULL, + /*tp_as_sequence*/ NULL, + /*tp_as_mapping*/ NULL, + /*tp_hash*/ NULL, + /*tp_call*/ NULL, + /*tp_str*/ NULL, + /*tp_getattro*/ NULL, + /*tp_setattro*/ NULL, + /*tp_as_buffer*/ NULL, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ NULL, + /*tp_traverse*/ NULL, + /*tp_clear*/ NULL, + /*tp_richcompare*/ NULL, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ NULL, + /*tp_iternext*/ NULL, + /*tp_methods*/ NULL, + /*tp_members*/ NULL, + /*tp_getset*/ NULL, + /*tp_base*/ NULL, + /*tp_dict*/ NULL, + /*tp_descr_get*/ NULL, + /*tp_descr_set*/ NULL, + /*tp_dictoffset*/ 0, + /*tp_init*/ NULL, + /*tp_alloc*/ NULL, + /*tp_new*/ bpy_app_handlers_persistent_new, + /*tp_free*/ NULL, + /*tp_is_gc*/ NULL, + /*tp_bases*/ NULL, + /*tp_mro*/ NULL, + /*tp_cache*/ NULL, + /*tp_subclasses*/ NULL, + /*tp_weaklist*/ NULL, + /*tp_del*/ NULL, + /*tp_version_tag*/ 0, + /*tp_finalize*/ NULL, + /*tp_vectorcall*/ NULL, }; static PyObject *py_cb_array[BKE_CB_EVT_TOT] = {NULL}; diff --git a/source/blender/python/intern/bpy_app_translations.c b/source/blender/python/intern/bpy_app_translations.c index 7627d498774..1f5565eb0a7 100644 --- a/source/blender/python/intern/bpy_app_translations.c +++ b/source/blender/python/intern/bpy_app_translations.c @@ -773,84 +773,54 @@ PyDoc_STRVAR(app_translations_doc, "\n"); static PyTypeObject BlenderAppTranslationsType = { PyVarObject_HEAD_INIT(NULL, 0) - /* tp_name */ - "bpy.app._translations_type", - /* tp_basicsize */ - sizeof(BlenderAppTranslations), - 0, /* tp_itemsize */ - /* methods */ - /* No destructor, this is a singleton! */ - NULL, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - NULL, /* getattrfunc tp_getattr; */ - NULL, /* setattrfunc tp_setattr; */ - NULL, - /* tp_compare */ /* DEPRECATED in python 3.0! */ - NULL, /* tp_repr */ - - /* Method suites for standard classes */ - NULL, /* PyNumberMethods *tp_as_number; */ - NULL, /* PySequenceMethods *tp_as_sequence; */ - NULL, /* PyMappingMethods *tp_as_mapping; */ - - /* More standard operations (here for binary compatibility) */ - NULL, /* hashfunc tp_hash; */ - NULL, /* ternaryfunc tp_call; */ - NULL, /* reprfunc tp_str; */ - NULL, /* getattrofunc tp_getattro; */ - NULL, /* setattrofunc tp_setattro; */ - - /* Functions to access object as input/output buffer */ - NULL, /* PyBufferProcs *tp_as_buffer; */ - - /*** Flags to define presence of optional/expanded features ***/ - Py_TPFLAGS_DEFAULT, /* long tp_flags; */ - - app_translations_doc, /* char *tp_doc; Documentation string */ - - /*** Assigned meaning in release 2.0 ***/ - /* call function for all accessible objects */ - NULL, /* traverseproc tp_traverse; */ - - /* delete references to contained objects */ - NULL, /* inquiry tp_clear; */ - - /*** Assigned meaning in release 2.1 ***/ - /*** rich comparisons ***/ - NULL, /* richcmpfunc tp_richcompare; */ - - /*** weak reference enabler ***/ - 0, /* long tp_weaklistoffset */ - - /*** Added in release 2.2 ***/ - /* Iterators */ - NULL, /* getiterfunc tp_iter; */ - NULL, /* iternextfunc tp_iternext; */ - - /*** Attribute descriptor and subclassing stuff ***/ - app_translations_methods, /* struct PyMethodDef *tp_methods; */ - app_translations_members, /* struct PyMemberDef *tp_members; */ - app_translations_getseters, /* struct PyGetSetDef *tp_getset; */ - NULL, /* struct _typeobject *tp_base; */ - NULL, /* PyObject *tp_dict; */ - NULL, /* descrgetfunc tp_descr_get; */ - NULL, /* descrsetfunc tp_descr_set; */ - 0, /* long tp_dictoffset; */ - NULL, /* initproc tp_init; */ - NULL, /* allocfunc tp_alloc; */ - /* newfunc tp_new; */ - (newfunc)app_translations_new, - /* Low-level free-memory routine */ - app_translations_free, /* freefunc tp_free; */ - /* For PyObject_IS_GC */ - NULL, /* inquiry tp_is_gc; */ - NULL, /* PyObject *tp_bases; */ - /* method resolution order */ - NULL, /* PyObject *tp_mro; */ - NULL, /* PyObject *tp_cache; */ - NULL, /* PyObject *tp_subclasses; */ - NULL, /* PyObject *tp_weaklist; */ - NULL, + /*tp_name*/ "bpy.app._translations_type", + /*tp_basicsize*/ sizeof(BlenderAppTranslations), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ NULL, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ NULL, + /*tp_setattr*/ NULL, + /*tp_as_async*/ NULL, + /*tp_repr*/ NULL, + /*tp_as_number*/ NULL, + /*tp_as_sequence*/ NULL, + /*tp_as_mapping*/ NULL, + /*tp_hash*/ NULL, + /*tp_call*/ NULL, + /*tp_str*/ NULL, + /*tp_getattro*/ NULL, + /*tp_setattro*/ NULL, + /*tp_as_buffer*/ NULL, + /*tp_flags*/ Py_TPFLAGS_DEFAULT, + /*tp_doc*/ app_translations_doc, + /*tp_traverse*/ NULL, + /*tp_clear*/ NULL, + /*tp_richcompare*/ NULL, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ NULL, + /*tp_iternext*/ NULL, + /*tp_methods*/ app_translations_methods, + /*tp_members*/ app_translations_members, + /*tp_getset*/ app_translations_getseters, + /*tp_base*/ NULL, + /*tp_dict*/ NULL, + /*tp_descr_get*/ NULL, + /*tp_descr_set*/ NULL, + /*tp_dictoffset*/ 0, + /*tp_init*/ NULL, + /*tp_alloc*/ NULL, + /*tp_new*/ (newfunc)app_translations_new, + /*tp_free*/ app_translations_free, + /*tp_is_gc*/ NULL, + /*tp_bases*/ NULL, + /*tp_mro*/ NULL, + /*tp_cache*/ NULL, + /*tp_subclasses*/ NULL, + /*tp_weaklist*/ NULL, + /*tp_del*/ NULL, + /*tp_version_tag*/ 0, + /*tp_finalize*/ NULL, + /*tp_vectorcall*/ NULL, }; PyObject *BPY_app_translations_struct(void) diff --git a/source/blender/python/intern/bpy_gizmo_wrap.h b/source/blender/python/intern/bpy_gizmo_wrap.h index 6a876747e22..7d5edebed0f 100644 --- a/source/blender/python/intern/bpy_gizmo_wrap.h +++ b/source/blender/python/intern/bpy_gizmo_wrap.h @@ -13,7 +13,7 @@ struct wmGizmoType; extern "C" { #endif -/* exposed to rna/wm api */ +/* Exposed to RNA/WM API. */ void BPY_RNA_gizmo_wrapper(struct wmGizmoType *gzt, void *userdata); void BPY_RNA_gizmogroup_wrapper(struct wmGizmoGroupType *gzgt, void *userdata); diff --git a/source/blender/python/intern/bpy_library_load.c b/source/blender/python/intern/bpy_library_load.c index f29a8d34359..acc6e2cf448 100644 --- a/source/blender/python/intern/bpy_library_load.c +++ b/source/blender/python/intern/bpy_library_load.c @@ -84,82 +84,55 @@ static void bpy_lib_dealloc(BPy_Library *self) } static PyTypeObject bpy_lib_Type = { - PyVarObject_HEAD_INIT(NULL, 0) "bpy_lib", /* tp_name */ - sizeof(BPy_Library), /* tp_basicsize */ - 0, /* tp_itemsize */ - /* methods */ - (destructor)bpy_lib_dealloc, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - NULL, /* getattrfunc tp_getattr; */ - NULL, /* setattrfunc tp_setattr; */ - NULL, - /* tp_compare */ /* DEPRECATED in python 3.0! */ - NULL, /* tp_repr */ - - /* Method suites for standard classes */ - - NULL, /* PyNumberMethods *tp_as_number; */ - NULL, /* PySequenceMethods *tp_as_sequence; */ - NULL, /* PyMappingMethods *tp_as_mapping; */ - - /* More standard operations (here for binary compatibility) */ - - NULL, /* hashfunc tp_hash; */ - NULL, /* ternaryfunc tp_call; */ - NULL, /* reprfunc tp_str; */ - - /* Will only use these if this is a sub-type of a Python class. */ - PyObject_GenericGetAttr, /* getattrofunc tp_getattro; */ - NULL, /* setattrofunc tp_setattro; */ - - /* Functions to access object as input/output buffer */ - NULL, /* PyBufferProcs *tp_as_buffer; */ - - /*** Flags to define presence of optional/expanded features ***/ - Py_TPFLAGS_DEFAULT, /* long tp_flags; */ - - NULL, /* char *tp_doc; Documentation string */ - /*** Assigned meaning in release 2.0 ***/ - /* call function for all accessible objects */ - NULL, /* traverseproc tp_traverse; */ - - /* delete references to contained objects */ - NULL, /* inquiry tp_clear; */ - - /*** Assigned meaning in release 2.1 ***/ - /*** rich comparisons (subclassed) ***/ - NULL, /* richcmpfunc tp_richcompare; */ - - /*** weak reference enabler ***/ - 0, - /*** Added in release 2.2 ***/ - /* Iterators */ - NULL, /* getiterfunc tp_iter; */ - NULL, /* iternextfunc tp_iternext; */ - - /*** Attribute descriptor and subclassing stuff ***/ - bpy_lib_methods, /* struct PyMethodDef *tp_methods; */ - NULL, /* struct PyMemberDef *tp_members; */ - NULL, /* struct PyGetSetDef *tp_getset; */ - NULL, /* struct _typeobject *tp_base; */ - NULL, /* PyObject *tp_dict; */ - NULL, /* descrgetfunc tp_descr_get; */ - NULL, /* descrsetfunc tp_descr_set; */ - offsetof(BPy_Library, dict), /* long tp_dictoffset; */ - NULL, /* initproc tp_init; */ - NULL, /* allocfunc tp_alloc; */ - NULL, /* newfunc tp_new; */ - /* Low-level free-memory routine */ - NULL, /* freefunc tp_free; */ - /* For PyObject_IS_GC */ - NULL, /* inquiry tp_is_gc; */ - NULL, /* PyObject *tp_bases; */ - /* method resolution order */ - NULL, /* PyObject *tp_mro; */ - NULL, /* PyObject *tp_cache; */ - NULL, /* PyObject *tp_subclasses; */ - NULL, /* PyObject *tp_weaklist; */ - NULL, + PyVarObject_HEAD_INIT(NULL, 0) + /*tp_name*/ "bpy_lib", + /*tp_basicsize*/ sizeof(BPy_Library), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ (destructor)bpy_lib_dealloc, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ NULL, + /*tp_setattr*/ NULL, + /*tp_as_async*/ NULL, + /*tp_repr*/ NULL, + /*tp_as_number*/ NULL, + /*tp_as_sequence*/ NULL, + /*tp_as_mapping*/ NULL, + /*tp_hash*/ NULL, + /*tp_call*/ NULL, + /*tp_str*/ NULL, + /*tp_getattro*/ PyObject_GenericGetAttr, + /*tp_setattro*/ NULL, + /*tp_as_buffer*/ NULL, + /*tp_flags*/ Py_TPFLAGS_DEFAULT, + /*tp_doc*/ NULL, + /*tp_traverse*/ NULL, + /*tp_clear*/ NULL, + /*tp_richcompare*/ NULL, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ NULL, + /*tp_iternext*/ NULL, + /*tp_methods*/ bpy_lib_methods, + /*tp_members*/ NULL, + /*tp_getset*/ NULL, + /*tp_base*/ NULL, + /*tp_dict*/ NULL, + /*tp_descr_get*/ NULL, + /*tp_descr_set*/ NULL, + /*tp_dictoffset*/ offsetof(BPy_Library, dict), + /*tp_init*/ NULL, + /*tp_alloc*/ NULL, + /*tp_new*/ NULL, + /*tp_free*/ NULL, + /*tp_is_gc*/ NULL, + /*tp_bases*/ NULL, + /*tp_mro*/ NULL, + /*tp_cache*/ NULL, + /*tp_subclasses*/ NULL, + /*tp_weaklist*/ NULL, + /*tp_del*/ NULL, + /*tp_version_tag*/ 0, + /*tp_finalize*/ NULL, + /*tp_vectorcall*/ NULL, }; PyDoc_STRVAR( diff --git a/source/blender/python/intern/bpy_operator_wrap.h b/source/blender/python/intern/bpy_operator_wrap.h index de3779332da..4b8ceba5f0c 100644 --- a/source/blender/python/intern/bpy_operator_wrap.h +++ b/source/blender/python/intern/bpy_operator_wrap.h @@ -12,10 +12,11 @@ struct wmOperatorType; extern "C" { #endif -/* these are used for operator methods, used by bpy_operator.c */ +/** These are used for operator methods, used by `bpy_operator.c`. */ PyObject *PYOP_wrap_macro_define(PyObject *self, PyObject *args); -/* exposed to rna/wm api */ +/* Exposed to RNA/WM API. */ + /** * Generic function used by all Python defined operators * it's passed as an argument to #WM_operatortype_append_ptr in for operator registration. diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 0eaa5d6b6c7..908c93388a9 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -380,10 +380,10 @@ static short pyrna_rotation_euler_order_get(PointerRNA *ptr, const short order_fallback, PropertyRNA **r_prop_eul_order); -/* bpyrna vector/euler/quat callbacks. */ +/* `bpyrna` vector/euler/quaternion callbacks. */ static uchar mathutils_rna_array_cb_index = -1; /* Index for our callbacks. */ -/* Subtype not used much yet. */ +/* Sub-type not used much yet. */ # define MATHUTILS_CB_SUBTYPE_EUL 0 # define MATHUTILS_CB_SUBTYPE_VEC 1 # define MATHUTILS_CB_SUBTYPE_QUAT 2 @@ -3251,41 +3251,67 @@ static int pyrna_prop_array_ass_subscript(BPy_PropertyArrayRNA *self, /* For slice only. */ static PyMappingMethods pyrna_prop_array_as_mapping = { - (lenfunc)pyrna_prop_array_length, /* mp_length */ - (binaryfunc)pyrna_prop_array_subscript, /* mp_subscript */ - (objobjargproc)pyrna_prop_array_ass_subscript, /* mp_ass_subscript */ + /*mp_len*/ (lenfunc)pyrna_prop_array_length, + /*mp_subscript*/ (binaryfunc)pyrna_prop_array_subscript, + /*mp_ass_subscript*/ (objobjargproc)pyrna_prop_array_ass_subscript, }; static PyMappingMethods pyrna_prop_collection_as_mapping = { - (lenfunc)pyrna_prop_collection_length, /* mp_length */ - (binaryfunc)pyrna_prop_collection_subscript, /* mp_subscript */ - (objobjargproc)pyrna_prop_collection_ass_subscript, /* mp_ass_subscript */ + /*mp_len*/ (lenfunc)pyrna_prop_collection_length, + /*mp_subscript*/ (binaryfunc)pyrna_prop_collection_subscript, + /*mp_ass_subscript*/ (objobjargproc)pyrna_prop_collection_ass_subscript, }; /* Only for fast bool's, large structs, assign nb_bool on init. */ static PyNumberMethods pyrna_prop_array_as_number = { - NULL, /* nb_add */ - NULL, /* nb_subtract */ - NULL, /* nb_multiply */ - NULL, /* nb_remainder */ - NULL, /* nb_divmod */ - NULL, /* nb_power */ - NULL, /* nb_negative */ - NULL, /* nb_positive */ - NULL, /* nb_absolute */ - (inquiry)pyrna_prop_array_bool, /* nb_bool */ + /*nb_add*/ NULL, + /*nb_subtract*/ NULL, + /*nb_multiply*/ NULL, + /*nb_remainder*/ NULL, + /*nb_divmod*/ NULL, + /*nb_power*/ NULL, + /*nb_negative*/ NULL, + /*nb_positive*/ NULL, + /*nb_absolute*/ NULL, + /*nb_bool*/ (inquiry)pyrna_prop_array_bool, }; static PyNumberMethods pyrna_prop_collection_as_number = { - NULL, /* nb_add */ - NULL, /* nb_subtract */ - NULL, /* nb_multiply */ - NULL, /* nb_remainder */ - NULL, /* nb_divmod */ - NULL, /* nb_power */ - NULL, /* nb_negative */ - NULL, /* nb_positive */ - NULL, /* nb_absolute */ - (inquiry)pyrna_prop_collection_bool, /* nb_bool */ + /*nb_add*/ NULL, + /*nb_subtract*/ NULL, + /*nb_multiply*/ NULL, + /*nb_remainder*/ NULL, + /*nb_divmod*/ NULL, + /*nb_power*/ NULL, + /*nb_negative*/ NULL, + /*nb_positive*/ NULL, + /*nb_absolute*/ NULL, + /*nb_bool*/ (inquiry)pyrna_prop_collection_bool, + /*nb_invert*/ NULL, + /*nb_lshift*/ NULL, + /*nb_rshift*/ NULL, + /*nb_and*/ NULL, + /*nb_xor*/ NULL, + /*nb_or*/ NULL, + /*nb_int*/ NULL, + /*nb_reserved*/ NULL, + /*nb_float*/ NULL, + /*nb_inplace_add*/ NULL, + /*nb_inplace_subtract*/ NULL, + /*nb_inplace_multiply*/ NULL, + /*nb_inplace_remainder*/ NULL, + /*nb_inplace_power*/ NULL, + /*nb_inplace_lshift*/ NULL, + /*nb_inplace_rshift*/ NULL, + /*nb_inplace_and*/ NULL, + /*nb_inplace_xor*/ NULL, + /*nb_inplace_or*/ NULL, + /*nb_floor_divide*/ NULL, + /*nb_true_divide*/ NULL, + /*nb_inplace_floor_divide*/ NULL, + /*nb_inplace_true_divide*/ NULL, + /*nb_index*/ NULL, + /*nb_matrix_multiply*/ NULL, + /*nb_inplace_matrix_multiply*/ NULL, }; static int pyrna_prop_array_contains(BPy_PropertyRNA *self, PyObject *value) @@ -3345,46 +3371,46 @@ static int pyrna_struct_contains(BPy_StructRNA *self, PyObject *value) } static PySequenceMethods pyrna_prop_array_as_sequence = { - (lenfunc)pyrna_prop_array_length, - NULL, /* sq_concat */ - NULL, /* sq_repeat */ - (ssizeargfunc)pyrna_prop_array_subscript_int, - /* sq_item */ /* Only set this so PySequence_Check() returns True */ - NULL, /* sq_slice */ - (ssizeobjargproc)prop_subscript_ass_array_int, /* sq_ass_item */ - NULL, /* *was* sq_ass_slice */ - (objobjproc)pyrna_prop_array_contains, /* sq_contains */ - (binaryfunc)NULL, /* sq_inplace_concat */ - (ssizeargfunc)NULL, /* sq_inplace_repeat */ + /*sq_length*/ (lenfunc)pyrna_prop_array_length, + /*sq_concat*/ NULL, + /*sq_repeat*/ NULL, + /* Only set this so `PySequence_Check()` returns True. */ + /*sq_item*/ (ssizeargfunc)pyrna_prop_array_subscript_int, + /*sq_slice*/ NULL, + /*sq_ass_item*/ (ssizeobjargproc)prop_subscript_ass_array_int, + /* was_sq_ass_slice */ NULL, /* DEPRECATED. */ + /*sq_contains*/ (objobjproc)pyrna_prop_array_contains, + /*sq_inplace_concat*/ NULL, + /*sq_inplace_repeat*/ NULL, }; static PySequenceMethods pyrna_prop_collection_as_sequence = { - (lenfunc)pyrna_prop_collection_length, - NULL, /* sq_concat */ - NULL, /* sq_repeat */ - (ssizeargfunc)pyrna_prop_collection_subscript_int, - /* sq_item */ /* Only set this so PySequence_Check() returns True */ - NULL, /* *was* sq_slice */ - (ssizeobjargproc) /* pyrna_prop_collection_ass_subscript_int */ - NULL /* let mapping take this one */, /* sq_ass_item */ - NULL, /* *was* sq_ass_slice */ - (objobjproc)pyrna_prop_collection_contains, /* sq_contains */ - (binaryfunc)NULL, /* sq_inplace_concat */ - (ssizeargfunc)NULL, /* sq_inplace_repeat */ + /*sq_length*/ (lenfunc)pyrna_prop_collection_length, + /*sq_concat*/ NULL, + /*sq_repeat*/ NULL, + /* Only set this so PySequence_Check() returns True */ + /*sq_item*/ (ssizeargfunc)pyrna_prop_collection_subscript_int, + /*was_sq_slice*/ NULL, /* DEPRECATED. */ + /* Let mapping take this one: #pyrna_prop_collection_ass_subscript_int */ + /*sq_ass_item*/ NULL, + /*was_sq_ass_slice*/ NULL, /* DEPRECATED. */ + /*sq_contains*/ (objobjproc)pyrna_prop_collection_contains, + /*sq_inplace_concat*/ NULL, + /*sq_inplace_repeat*/ NULL, }; static PySequenceMethods pyrna_struct_as_sequence = { - NULL, /* Can't set the len otherwise it can evaluate as false */ - NULL, /* sq_concat */ - NULL, /* sq_repeat */ - NULL, - /* sq_item */ /* Only set this so PySequence_Check() returns True */ - NULL, /* *was* sq_slice */ - NULL, /* sq_ass_item */ - NULL, /* *was* sq_ass_slice */ - (objobjproc)pyrna_struct_contains, /* sq_contains */ - (binaryfunc)NULL, /* sq_inplace_concat */ - (ssizeargfunc)NULL, /* sq_inplace_repeat */ + /*sq_length*/ NULL, /* Can't set the len otherwise it can evaluate as false */ + /*sq_concat*/ NULL, + /*sq_repeat*/ NULL, + /* Only set this so `PySequence_Check()` returns True. */ + /*sq_item*/ NULL, + /*was_sq_slice*/ NULL, /* DEPRECATED. */ + /*sq_ass_item */ NULL, + /*was_sq_ass_slice*/ NULL, /* DEPRECATED. */ + /*sq_contains*/ (objobjproc)pyrna_struct_contains, + /*sq_inplace_concat*/ NULL, + /*sq_inplace_repeat*/ NULL, }; static PyObject *pyrna_struct_subscript(BPy_StructRNA *self, PyObject *key) @@ -3457,9 +3483,9 @@ static int pyrna_struct_ass_subscript(BPy_StructRNA *self, PyObject *key, PyObje } static PyMappingMethods pyrna_struct_as_mapping = { - (lenfunc)NULL, /* mp_length */ - (binaryfunc)pyrna_struct_subscript, /* mp_subscript */ - (objobjargproc)pyrna_struct_ass_subscript, /* mp_ass_subscript */ + /*mp_length*/ (lenfunc)NULL, + /*mp_subscript*/ (binaryfunc)pyrna_struct_subscript, + /*mp_ass_subscript*/ (objobjargproc)pyrna_struct_ass_subscript, }; PyDoc_STRVAR(pyrna_struct_keys_doc, @@ -6483,606 +6509,415 @@ static PyObject *pyrna_func_doc_get(BPy_FunctionRNA *self, void *UNUSED(closure) return ret; } -/* Subclasses of pyrna_struct_Type which support idprop definitions use this as a metaclass. */ -/* NOTE: tp_base member is set to &PyType_Type on init. */ +/** + * Sub-classes of #pyrna_struct_Type which support idprop definitions use this as a meta-class. + * \note tp_base member is set to `&PyType_Type` on initialization. + */ PyTypeObject pyrna_struct_meta_idprop_Type = { - PyVarObject_HEAD_INIT(NULL, 0) "bpy_struct_meta_idprop", /* tp_name */ - - /* NOTE: would be PyTypeObject, but sub-types of Type must be PyHeapTypeObject's. */ - sizeof(PyHeapTypeObject), /* tp_basicsize */ - - 0, /* tp_itemsize */ - /* methods */ - NULL, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - NULL, /* getattrfunc tp_getattr; */ - NULL, /* setattrfunc tp_setattr; */ - NULL, - /* tp_compare */ /* deprecated in Python 3.0! */ - NULL, /* tp_repr */ - - /* Method suites for standard classes */ - NULL, /* PyNumberMethods *tp_as_number; */ - NULL, /* PySequenceMethods *tp_as_sequence; */ - NULL, /* PyMappingMethods *tp_as_mapping; */ - - /* More standard operations (here for binary compatibility) */ - NULL, /* hashfunc tp_hash; */ - NULL, /* ternaryfunc tp_call; */ - NULL, /* reprfunc tp_str; */ - NULL /* (getattrofunc) pyrna_struct_meta_idprop_getattro */, /* getattrofunc tp_getattro; */ - (setattrofunc)pyrna_struct_meta_idprop_setattro, /* setattrofunc tp_setattro; */ - - /* Functions to access object as input/output buffer */ - NULL, /* PyBufferProcs *tp_as_buffer; */ - - /*** Flags to define presence of optional/expanded features ***/ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* long tp_flags; */ - - NULL, /* char *tp_doc; Documentation string */ - /*** Assigned meaning in release 2.0 ***/ - /* call function for all accessible objects */ - NULL, /* traverseproc tp_traverse; */ - - /* delete references to contained objects */ - NULL, /* inquiry tp_clear; */ - - /*** Assigned meaning in release 2.1 ***/ - /*** rich comparisons ***/ - NULL, /* richcmpfunc tp_richcompare; */ - - /*** weak reference enabler ***/ - 0, /* long tp_weaklistoffset; */ - - /*** Added in release 2.2 ***/ - /* Iterators */ - NULL, /* getiterfunc tp_iter; */ - NULL, /* iternextfunc tp_iternext; */ - - /*** Attribute descriptor and subclassing stuff ***/ - NULL, /* struct PyMethodDef *tp_methods; */ - NULL, /* struct PyMemberDef *tp_members; */ - NULL, /* struct PyGetSetDef *tp_getset; */ + PyVarObject_HEAD_INIT(NULL, 0) + /*tp_name*/ "bpy_struct_meta_idprop", + /* NOTE: would be `sizeof(PyTypeObject)`, + * but sub-types of Type must be #PyHeapTypeObject's. */ + /*tp_basicsize*/ sizeof(PyHeapTypeObject), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ NULL, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ NULL, + /*tp_setattr*/ NULL, + /*tp_as_async*/ NULL, + /*tp_repr*/ NULL, + /*tp_as_number*/ NULL, + /*tp_as_sequence*/ NULL, + /*tp_as_mapping*/ NULL, + /*tp_hash*/ NULL, + /*tp_call*/ NULL, + /*tp_str*/ NULL, + /*tp_getattro*/ NULL, /* Sub-classed: #pyrna_struct_meta_idprop_getattro. */ + /*tp_setattro*/ (setattrofunc)pyrna_struct_meta_idprop_setattro, + /*tp_as_buffer*/ NULL, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ NULL, + /*tp_traverse*/ NULL, + /*tp_clear*/ NULL, + /*tp_richcompare*/ NULL, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ NULL, + /*tp_iternext*/ NULL, + /*tp_methods*/ NULL, + /*tp_members*/ NULL, + /*tp_getset*/ NULL, #if defined(_MSC_VER) - NULL, /* defer assignment */ + /*tp_base*/ NULL, /* Defer assignment. */ #else - &PyType_Type, /* struct _typeobject *tp_base; */ + /*tp_base*/ &PyType_Type, #endif - NULL, /* PyObject *tp_dict; */ - NULL, /* descrgetfunc tp_descr_get; */ - NULL, /* descrsetfunc tp_descr_set; */ - 0, /* long tp_dictoffset; */ - NULL, /* initproc tp_init; */ - NULL, /* allocfunc tp_alloc; */ - NULL, /* newfunc tp_new; */ - /* Low-level free-memory routine */ - NULL, /* freefunc tp_free; */ - /* For PyObject_IS_GC */ - NULL, /* inquiry tp_is_gc; */ - NULL, /* PyObject *tp_bases; */ - /* method resolution order */ - NULL, /* PyObject *tp_mro; */ - NULL, /* PyObject *tp_cache; */ - NULL, /* PyObject *tp_subclasses; */ - NULL, /* PyObject *tp_weaklist; */ - NULL, + /*tp_dict*/ NULL, + /*tp_descr_get*/ NULL, + /*tp_descr_set*/ NULL, + /*tp_dictoffset*/ 0, + /*tp_init*/ NULL, + /*tp_alloc*/ NULL, + /*tp_new*/ NULL, + /*tp_free*/ NULL, + /*tp_is_gc*/ NULL, + /*tp_bases*/ NULL, + /*tp_mro*/ NULL, + /*tp_cache*/ NULL, + /*tp_subclasses*/ NULL, + /*tp_weaklist*/ NULL, + /*tp_del*/ NULL, + /*tp_version_tag*/ 0, + /*tp_finalize*/ NULL, + /*tp_vectorcall*/ NULL, }; /*-----------------------BPy_StructRNA method def------------------------------*/ PyTypeObject pyrna_struct_Type = { - PyVarObject_HEAD_INIT(NULL, 0) "bpy_struct", /* tp_name */ - sizeof(BPy_StructRNA), /* tp_basicsize */ - 0, /* tp_itemsize */ - /* methods */ - (destructor)pyrna_struct_dealloc, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - NULL, /* getattrfunc tp_getattr; */ - NULL, /* setattrfunc tp_setattr; */ - NULL, - /* tp_compare */ /* DEPRECATED in Python 3.0! */ - (reprfunc)pyrna_struct_repr, /* tp_repr */ - - /* Method suites for standard classes */ - - NULL, /* PyNumberMethods *tp_as_number; */ - &pyrna_struct_as_sequence, /* PySequenceMethods *tp_as_sequence; */ - &pyrna_struct_as_mapping, /* PyMappingMethods *tp_as_mapping; */ - - /* More standard operations (here for binary compatibility) */ - - (hashfunc)pyrna_struct_hash, /* hashfunc tp_hash; */ - NULL, /* ternaryfunc tp_call; */ - (reprfunc)pyrna_struct_str, /* reprfunc tp_str; */ - (getattrofunc)pyrna_struct_getattro, /* getattrofunc tp_getattro; */ - (setattrofunc)pyrna_struct_setattro, /* setattrofunc tp_setattro; */ - - /* Functions to access object as input/output buffer */ - NULL, /* PyBufferProcs *tp_as_buffer; */ - - /*** Flags to define presence of optional/expanded features ***/ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE + PyVarObject_HEAD_INIT(NULL, 0) + /*tp_name*/ "bpy_struct", + /*tp_basicsize*/ sizeof(BPy_StructRNA), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ (destructor)pyrna_struct_dealloc, + /*tp_vectorcall_offset */ 0, + /*tp_getattr*/ NULL, + /*tp_setattr*/ NULL, + /*tp_as_async*/ NULL, + /*tp_repr*/ (reprfunc)pyrna_struct_repr, + /*tp_as_number*/ NULL, + /*tp_as_sequence*/ &pyrna_struct_as_sequence, + /*tp_as_mapping*/ &pyrna_struct_as_mapping, + /*tp_hash*/ (hashfunc)pyrna_struct_hash, + /*tp_call*/ NULL, + /*tp_str*/ (reprfunc)pyrna_struct_str, + /*tp_getattro*/ (getattrofunc)pyrna_struct_getattro, + /*tp_setattro*/ (setattrofunc)pyrna_struct_setattro, + /*tp_as_buffer*/ NULL, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE #ifdef USE_PYRNA_STRUCT_REFERENCE | Py_TPFLAGS_HAVE_GC #endif - , /* long tp_flags; */ - - NULL, /* char *tp_doc; Documentation string */ -/*** Assigned meaning in release 2.0 ***/ -/* call function for all accessible objects */ + , + /*tp_doc*/ NULL, #ifdef USE_PYRNA_STRUCT_REFERENCE - (traverseproc)pyrna_struct_traverse, /* traverseproc tp_traverse; */ - - /* delete references to contained objects */ - (inquiry)pyrna_struct_clear, /* inquiry tp_clear; */ + /*tp_traverse*/ (traverseproc)pyrna_struct_traverse, + /*tp_clear*/ (inquiry)pyrna_struct_clear, #else - NULL, /* traverseproc tp_traverse; */ - - /* delete references to contained objects */ - NULL, /* inquiry tp_clear; */ + /*tp_traverse*/ NULL, + /*tp_clear*/ NULL, #endif /* !USE_PYRNA_STRUCT_REFERENCE */ - - /*** Assigned meaning in release 2.1 ***/ - /*** rich comparisons ***/ - (richcmpfunc)pyrna_struct_richcmp, /* richcmpfunc tp_richcompare; */ - -/*** weak reference enabler ***/ + /*tp_richcompare*/ (richcmpfunc)pyrna_struct_richcmp, #ifdef USE_WEAKREFS - offsetof(BPy_StructRNA, in_weakreflist), /* long tp_weaklistoffset; */ + /*tp_weaklistoffset*/ offsetof(BPy_StructRNA, in_weakreflist), #else 0, #endif - /*** Added in release 2.2 ***/ - /* Iterators */ - NULL, /* getiterfunc tp_iter; */ - NULL, /* iternextfunc tp_iternext; */ - - /*** Attribute descriptor and subclassing stuff ***/ - pyrna_struct_methods, /* struct PyMethodDef *tp_methods; */ - NULL, /* struct PyMemberDef *tp_members; */ - pyrna_struct_getseters, /* struct PyGetSetDef *tp_getset; */ - NULL, /* struct _typeobject *tp_base; */ - NULL, /* PyObject *tp_dict; */ - NULL, /* descrgetfunc tp_descr_get; */ - NULL, /* descrsetfunc tp_descr_set; */ - 0, /* long tp_dictoffset; */ - NULL, /* initproc tp_init; */ - NULL, /* allocfunc tp_alloc; */ - pyrna_struct_new, /* newfunc tp_new; */ - /* Low-level free-memory routine */ - NULL, /* freefunc tp_free; */ - /* For PyObject_IS_GC */ - NULL, /* inquiry tp_is_gc; */ - NULL, /* PyObject *tp_bases; */ - /* method resolution order */ - NULL, /* PyObject *tp_mro; */ - NULL, /* PyObject *tp_cache; */ - NULL, /* PyObject *tp_subclasses; */ - NULL, /* PyObject *tp_weaklist; */ - NULL, + /*tp_iter*/ NULL, + /*tp_iternext*/ NULL, + /*tp_methods*/ pyrna_struct_methods, + /*tp_members*/ NULL, + /*tp_getset*/ pyrna_struct_getseters, + /*tp_base*/ NULL, + /*tp_dict*/ NULL, + /*tp_descr_get*/ NULL, + /*tp_descr_set*/ NULL, + /*tp_dictoffset*/ 0, + /*tp_init*/ NULL, + /*tp_alloc*/ NULL, + /*tp_new*/ pyrna_struct_new, + /*tp_free*/ NULL, + /*tp_is_gc*/ NULL, + /*tp_bases*/ NULL, + /*tp_mro*/ NULL, + /*tp_cache*/ NULL, + /*tp_subclasses*/ NULL, + /*tp_weaklist*/ NULL, + /*tp_del*/ NULL, + /*tp_version_tag*/ 0, + /*tp_finalize*/ NULL, + /*tp_vectorcall*/ NULL, }; /*-----------------------BPy_PropertyRNA method def------------------------------*/ PyTypeObject pyrna_prop_Type = { - PyVarObject_HEAD_INIT(NULL, 0) "bpy_prop", /* tp_name */ - sizeof(BPy_PropertyRNA), /* tp_basicsize */ - 0, /* tp_itemsize */ - /* methods */ - (destructor)pyrna_prop_dealloc, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - NULL, /* getattrfunc tp_getattr; */ - NULL, /* setattrfunc tp_setattr; */ - NULL, - /* tp_compare */ /* DEPRECATED in Python 3.0! */ - (reprfunc)pyrna_prop_repr, /* tp_repr */ - - /* Method suites for standard classes */ - - NULL, /* PyNumberMethods *tp_as_number; */ - NULL, /* PySequenceMethods *tp_as_sequence; */ - NULL, /* PyMappingMethods *tp_as_mapping; */ - - /* More standard operations (here for binary compatibility) */ - - (hashfunc)pyrna_prop_hash, /* hashfunc tp_hash; */ - NULL, /* ternaryfunc tp_call; */ - (reprfunc)pyrna_prop_str, /* reprfunc tp_str; */ - - /* will only use these if this is a subtype of a py class */ - NULL, /* getattrofunc tp_getattro; */ - NULL, /* setattrofunc tp_setattro; */ - - /* Functions to access object as input/output buffer */ - NULL, /* PyBufferProcs *tp_as_buffer; */ - - /*** Flags to define presence of optional/expanded features ***/ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* long tp_flags; */ - - NULL, /* char *tp_doc; Documentation string */ - /*** Assigned meaning in release 2.0 ***/ - /* call function for all accessible objects */ - NULL, /* traverseproc tp_traverse; */ - - /* delete references to contained objects */ - NULL, /* inquiry tp_clear; */ - - /*** Assigned meaning in release 2.1 ***/ - /*** rich comparisons ***/ - (richcmpfunc)pyrna_prop_richcmp, /* richcmpfunc tp_richcompare; */ - -/*** weak reference enabler ***/ + PyVarObject_HEAD_INIT(NULL, 0) + /*tp_name*/ "bpy_prop", + /*tp_basicsize*/ sizeof(BPy_PropertyRNA), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ (destructor)pyrna_prop_dealloc, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ NULL, + /*tp_setattr*/ NULL, + /*tp_as_async*/ NULL, + /*tp_repr*/ (reprfunc)pyrna_prop_repr, + /*tp_as_number*/ NULL, + /*tp_as_sequence*/ NULL, + /*tp_as_mapping*/ NULL, + /*tp_hash*/ (hashfunc)pyrna_prop_hash, + /*tp_call*/ NULL, + /*tp_str*/ (reprfunc)pyrna_prop_str, + /*tp_getattro*/ NULL, + /*tp_setattro*/ NULL, + /*tp_as_buffer*/ NULL, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ NULL, + /*tp_traverse*/ NULL, + /*tp_clear*/ NULL, + /*tp_richcompare*/ (richcmpfunc)pyrna_prop_richcmp, #ifdef USE_WEAKREFS - offsetof(BPy_PropertyRNA, in_weakreflist), /* long tp_weaklistoffset; */ + /*tp_weaklistoffset*/ offsetof(BPy_PropertyRNA, in_weakreflist), #else - 0, + /*tp_weaklistoffset*/ 0, #endif - - /*** Added in release 2.2 ***/ - /* Iterators */ - NULL, /* getiterfunc tp_iter; */ - NULL, /* iternextfunc tp_iternext; */ - - /*** Attribute descriptor and subclassing stuff ***/ - pyrna_prop_methods, /* struct PyMethodDef *tp_methods; */ - NULL, /* struct PyMemberDef *tp_members; */ - pyrna_prop_getseters, /* struct PyGetSetDef *tp_getset; */ - NULL, /* struct _typeobject *tp_base; */ - NULL, /* PyObject *tp_dict; */ - NULL, /* descrgetfunc tp_descr_get; */ - NULL, /* descrsetfunc tp_descr_set; */ - 0, /* long tp_dictoffset; */ - NULL, /* initproc tp_init; */ - NULL, /* allocfunc tp_alloc; */ - pyrna_prop_new, /* newfunc tp_new; */ - /* Low-level free-memory routine */ - NULL, /* freefunc tp_free; */ - /* For PyObject_IS_GC */ - NULL, /* inquiry tp_is_gc; */ - NULL, /* PyObject *tp_bases; */ - /* method resolution order */ - NULL, /* PyObject *tp_mro; */ - NULL, /* PyObject *tp_cache; */ - NULL, /* PyObject *tp_subclasses; */ - NULL, /* PyObject *tp_weaklist; */ - NULL, + /*tp_iter*/ NULL, + /*tp_iternext*/ NULL, + /*tp_methods*/ pyrna_prop_methods, + /*tp_members*/ NULL, + /*tp_getset*/ pyrna_prop_getseters, + /*tp_base*/ NULL, + /*tp_dict*/ NULL, + /*tp_descr_get*/ NULL, + /*tp_descr_set*/ NULL, + /*tp_dictoffset*/ 0, + /*tp_init*/ NULL, + /*tp_alloc*/ NULL, + /*tp_new*/ pyrna_prop_new, + /*tp_free*/ NULL, + /*tp_is_gc*/ NULL, + /*tp_bases*/ NULL, + /*tp_mro*/ NULL, + /*tp_cache*/ NULL, + /*tp_subclasses*/ NULL, + /*tp_weaklist*/ NULL, + /*tp_del*/ NULL, + /*tp_version_tag*/ 0, + /*tp_finalize*/ NULL, + /*tp_vectorcall*/ NULL, }; PyTypeObject pyrna_prop_array_Type = { - PyVarObject_HEAD_INIT(NULL, 0) "bpy_prop_array", /* tp_name */ - sizeof(BPy_PropertyArrayRNA), /* tp_basicsize */ - 0, /* tp_itemsize */ - /* methods */ - (destructor)pyrna_prop_array_dealloc, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - NULL, /* getattrfunc tp_getattr; */ - NULL, /* setattrfunc tp_setattr; */ - NULL, - /* tp_compare */ /* DEPRECATED in Python 3.0! */ - (reprfunc)pyrna_prop_array_repr, /* tp_repr */ - - /* Method suites for standard classes */ - - &pyrna_prop_array_as_number, /* PyNumberMethods *tp_as_number; */ - &pyrna_prop_array_as_sequence, /* PySequenceMethods *tp_as_sequence; */ - &pyrna_prop_array_as_mapping, /* PyMappingMethods *tp_as_mapping; */ - - /* More standard operations (here for binary compatibility) */ - - NULL, /* hashfunc tp_hash; */ - NULL, /* ternaryfunc tp_call; */ - NULL, /* reprfunc tp_str; */ - - /* will only use these if this is a subtype of a py class */ - (getattrofunc)pyrna_prop_array_getattro, /* getattrofunc tp_getattro; */ - NULL, /* setattrofunc tp_setattro; */ - - /* Functions to access object as input/output buffer */ - NULL, /* PyBufferProcs *tp_as_buffer; */ - - /*** Flags to define presence of optional/expanded features ***/ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* long tp_flags; */ - - NULL, /* char *tp_doc; Documentation string */ - /*** Assigned meaning in release 2.0 ***/ - /* call function for all accessible objects */ - NULL, /* traverseproc tp_traverse; */ - - /* delete references to contained objects */ - NULL, /* inquiry tp_clear; */ - - /*** Assigned meaning in release 2.1 ***/ - /*** rich comparisons (subclassed) ***/ - NULL, /* richcmpfunc tp_richcompare; */ - -/*** weak reference enabler ***/ + PyVarObject_HEAD_INIT(NULL, 0) + /*tp_name*/ "bpy_prop_array", + /*tp_basicsize*/ sizeof(BPy_PropertyArrayRNA), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ (destructor)pyrna_prop_array_dealloc, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ NULL, + /*tp_setattr*/ NULL, + /*tp_as_async*/ NULL, + /*tp_repr*/ (reprfunc)pyrna_prop_array_repr, + /*tp_as_number*/ &pyrna_prop_array_as_number, + /*tp_as_sequence*/ &pyrna_prop_array_as_sequence, + /*tp_as_mapping*/ &pyrna_prop_array_as_mapping, + /*tp_hash*/ NULL, + /*tp_call*/ NULL, + /*tp_str*/ NULL, + /*tp_getattro*/ (getattrofunc)pyrna_prop_array_getattro, + /*tp_setattro*/ NULL, + /*tp_as_buffer*/ NULL, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ NULL, + /*tp_traverse*/ NULL, + /*tp_clear*/ NULL, + /*tp_richcompare*/ NULL, #ifdef USE_WEAKREFS - offsetof(BPy_PropertyArrayRNA, in_weakreflist), /* long tp_weaklistoffset; */ + /*tp_weaklistoffset*/ offsetof(BPy_PropertyArrayRNA, in_weakreflist), #else - 0, + /*tp_weaklistoffset*/ 0, #endif - /*** Added in release 2.2 ***/ - /* Iterators */ - (getiterfunc)pyrna_prop_array_iter, /* getiterfunc tp_iter; */ - NULL, /* iternextfunc tp_iternext; */ - - /*** Attribute descriptor and subclassing stuff ***/ - pyrna_prop_array_methods, /* struct PyMethodDef *tp_methods; */ - NULL, /* struct PyMemberDef *tp_members; */ - NULL /*pyrna_prop_getseters*/, /* struct PyGetSetDef *tp_getset; */ - &pyrna_prop_Type, /* struct _typeobject *tp_base; */ - NULL, /* PyObject *tp_dict; */ - NULL, /* descrgetfunc tp_descr_get; */ - NULL, /* descrsetfunc tp_descr_set; */ - 0, /* long tp_dictoffset; */ - NULL, /* initproc tp_init; */ - NULL, /* allocfunc tp_alloc; */ - NULL, /* newfunc tp_new; */ - /* Low-level free-memory routine */ - NULL, /* freefunc tp_free; */ - /* For PyObject_IS_GC */ - NULL, /* inquiry tp_is_gc; */ - NULL, /* PyObject *tp_bases; */ - /* method resolution order */ - NULL, /* PyObject *tp_mro; */ - NULL, /* PyObject *tp_cache; */ - NULL, /* PyObject *tp_subclasses; */ - NULL, /* PyObject *tp_weaklist; */ - NULL, + /*tp_iter*/ (getiterfunc)pyrna_prop_array_iter, + /*tp_iternext*/ NULL, + /*tp_methods*/ pyrna_prop_array_methods, + /*tp_members*/ NULL, + /*tp_getset*/ NULL /* Sub-classed: #pyrna_prop_getseters. */, + /*tp_base*/ &pyrna_prop_Type, + /*tp_dict*/ NULL, + /*tp_descr_get*/ NULL, + /*tp_descr_set*/ NULL, + /*tp_dictoffset*/ 0, + /*tp_init*/ NULL, + /*tp_alloc*/ NULL, + /*tp_new*/ NULL, + /*tp_free*/ NULL, + /*tp_is_gc*/ NULL, + /*tp_bases*/ NULL, + /*tp_mro*/ NULL, + /*tp_cache*/ NULL, + /*tp_subclasses*/ NULL, + /*tp_weaklist*/ NULL, + /*tp_del*/ NULL, + /*tp_version_tag*/ 0, + /*tp_finalize*/ NULL, + /*tp_vectorcall*/ NULL, }; PyTypeObject pyrna_prop_collection_Type = { - PyVarObject_HEAD_INIT(NULL, 0) "bpy_prop_collection", /* tp_name */ - sizeof(BPy_PropertyRNA), /* tp_basicsize */ - 0, /* tp_itemsize */ - /* methods */ - (destructor)pyrna_prop_dealloc, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - NULL, /* getattrfunc tp_getattr; */ - NULL, /* setattrfunc tp_setattr; */ - NULL, - /* tp_compare */ /* DEPRECATED in Python 3.0! */ - NULL, - /* subclassed */ /* tp_repr */ - - /* Method suites for standard classes */ - - &pyrna_prop_collection_as_number, /* PyNumberMethods *tp_as_number; */ - &pyrna_prop_collection_as_sequence, /* PySequenceMethods *tp_as_sequence; */ - &pyrna_prop_collection_as_mapping, /* PyMappingMethods *tp_as_mapping; */ - - /* More standard operations (here for binary compatibility) */ - - NULL, /* hashfunc tp_hash; */ - NULL, /* ternaryfunc tp_call; */ - NULL, /* reprfunc tp_str; */ - - /* will only use these if this is a subtype of a py class */ - (getattrofunc)pyrna_prop_collection_getattro, /* getattrofunc tp_getattro; */ - (setattrofunc)pyrna_prop_collection_setattro, /* setattrofunc tp_setattro; */ - - /* Functions to access object as input/output buffer */ - NULL, /* PyBufferProcs *tp_as_buffer; */ - - /*** Flags to define presence of optional/expanded features ***/ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* long tp_flags; */ - - NULL, /* char *tp_doc; Documentation string */ - /*** Assigned meaning in release 2.0 ***/ - /* call function for all accessible objects */ - NULL, /* traverseproc tp_traverse; */ - - /* delete references to contained objects */ - NULL, /* inquiry tp_clear; */ - - /*** Assigned meaning in release 2.1 ***/ - /*** rich comparisons (subclassed) ***/ - NULL, /* richcmpfunc tp_richcompare; */ - -/*** weak reference enabler ***/ + PyVarObject_HEAD_INIT(NULL, 0) + /*tp_name*/ "bpy_prop_collection", + /*tp_basicsize*/ sizeof(BPy_PropertyRNA), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ (destructor)pyrna_prop_dealloc, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ NULL, + /*tp_setattr*/ NULL, + /*tp_as_async*/ NULL, + /*tp_repr*/ NULL, /* Sub-classed, no need to define. */ + /*tp_as_number*/ &pyrna_prop_collection_as_number, + /*tp_as_sequence*/ &pyrna_prop_collection_as_sequence, + /*tp_as_mapping*/ &pyrna_prop_collection_as_mapping, + /*tp_hash*/ NULL, + /*tp_call*/ NULL, + /*tp_str*/ NULL, + /*tp_getattro*/ (getattrofunc)pyrna_prop_collection_getattro, + /*tp_setattro*/ (setattrofunc)pyrna_prop_collection_setattro, + /*tp_as_buffer*/ NULL, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ NULL, + /*tp_traverse*/ NULL, + /*tp_clear*/ NULL, + /*tp_richcompare*/ NULL, #ifdef USE_WEAKREFS - offsetof(BPy_PropertyRNA, in_weakreflist), /* long tp_weaklistoffset; */ + /*tp_weaklistoffset*/ offsetof(BPy_PropertyRNA, in_weakreflist), #else - 0, + /*tp_weaklistoffset*/ 0, #endif - - /*** Added in release 2.2 ***/ - /* Iterators */ - (getiterfunc)pyrna_prop_collection_iter, /* getiterfunc tp_iter; */ - NULL, /* iternextfunc tp_iternext; */ - - /*** Attribute descriptor and subclassing stuff ***/ - pyrna_prop_collection_methods, /* struct PyMethodDef *tp_methods; */ - NULL, /* struct PyMemberDef *tp_members; */ - NULL /*pyrna_prop_getseters*/, /* struct PyGetSetDef *tp_getset; */ - &pyrna_prop_Type, /* struct _typeobject *tp_base; */ - NULL, /* PyObject *tp_dict; */ - NULL, /* descrgetfunc tp_descr_get; */ - NULL, /* descrsetfunc tp_descr_set; */ - 0, /* long tp_dictoffset; */ - NULL, /* initproc tp_init; */ - NULL, /* allocfunc tp_alloc; */ - NULL, /* newfunc tp_new; */ - /* Low-level free-memory routine */ - NULL, /* freefunc tp_free; */ - /* For PyObject_IS_GC */ - NULL, /* inquiry tp_is_gc; */ - NULL, /* PyObject *tp_bases; */ - /* method resolution order */ - NULL, /* PyObject *tp_mro; */ - NULL, /* PyObject *tp_cache; */ - NULL, /* PyObject *tp_subclasses; */ - NULL, /* PyObject *tp_weaklist; */ - NULL, + /*tp_iter*/ (getiterfunc)pyrna_prop_collection_iter, + /*tp_iternext*/ NULL, + /*tp_methods*/ pyrna_prop_collection_methods, + /*tp_members*/ NULL, + /*tp_getset*/ NULL /*Sub-classed: see #pyrna_prop_getseters. */, + /*tp_base*/ &pyrna_prop_Type, + /*tp_dict*/ NULL, + /*tp_descr_get*/ NULL, + /*tp_descr_set*/ NULL, + /*tp_dictoffset*/ 0, + /*tp_init*/ NULL, + /*tp_alloc*/ NULL, + /*tp_new*/ NULL, + /*tp_free*/ NULL, + /*tp_is_gc*/ NULL, + /*tp_bases*/ NULL, + /*tp_mro*/ NULL, + /*tp_cache*/ NULL, + /*tp_subclasses*/ NULL, + /*tp_weaklist*/ NULL, + /*tp_del*/ NULL, + /*tp_version_tag*/ 0, + /*tp_finalize*/ NULL, + /*tp_vectorcall*/ NULL, }; /* only for add/remove/move methods */ static PyTypeObject pyrna_prop_collection_idprop_Type = { - PyVarObject_HEAD_INIT(NULL, 0) "bpy_prop_collection_idprop", /* tp_name */ - sizeof(BPy_PropertyRNA), /* tp_basicsize */ - 0, /* tp_itemsize */ - /* methods */ - (destructor)pyrna_prop_dealloc, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - NULL, /* getattrfunc tp_getattr; */ - NULL, /* setattrfunc tp_setattr; */ - NULL, - /* tp_compare */ /* DEPRECATED in Python 3.0! */ - NULL, - /* subclassed */ /* tp_repr */ - - /* Method suites for standard classes */ - - NULL, /* PyNumberMethods *tp_as_number; */ - NULL, /* PySequenceMethods *tp_as_sequence; */ - NULL, /* PyMappingMethods *tp_as_mapping; */ - - /* More standard operations (here for binary compatibility) */ - - NULL, /* hashfunc tp_hash; */ - NULL, /* ternaryfunc tp_call; */ - NULL, /* reprfunc tp_str; */ - - /* will only use these if this is a subtype of a py class */ - NULL, /* getattrofunc tp_getattro; */ - NULL, /* setattrofunc tp_setattro; */ - - /* Functions to access object as input/output buffer */ - NULL, /* PyBufferProcs *tp_as_buffer; */ - - /*** Flags to define presence of optional/expanded features ***/ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* long tp_flags; */ - - NULL, /* char *tp_doc; Documentation string */ - /*** Assigned meaning in release 2.0 ***/ - /* call function for all accessible objects */ - NULL, /* traverseproc tp_traverse; */ - - /* delete references to contained objects */ - NULL, /* inquiry tp_clear; */ - - /*** Assigned meaning in release 2.1 ***/ - /*** rich comparisons (subclassed) ***/ - NULL, /* richcmpfunc tp_richcompare; */ - -/*** weak reference enabler ***/ + PyVarObject_HEAD_INIT(NULL, 0) + /*tp_name*/ "bpy_prop_collection_idprop", + /*tp_basicsize*/ sizeof(BPy_PropertyRNA), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ (destructor)pyrna_prop_dealloc, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ NULL, + /*tp_setattr*/ NULL, + /*tp_compare*/ NULL, /* DEPRECATED. */ + /*tp_repr*/ NULL, /* Sub-classed, no need to define. */ + /*tp_as_number*/ NULL, + /*tp_as_sequence*/ NULL, + /*tp_as_mapping*/ NULL, + /*tp_hash*/ NULL, + /*tp_call*/ NULL, + /*tp_str*/ NULL, + /*tp_getattro*/ NULL, + /*tp_setattro*/ NULL, + /*tp_as_buffer*/ NULL, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + /*tp_doc*/ NULL, + /*tp_traverse*/ NULL, + /*tp_clear*/ NULL, + /*tp_richcompare*/ NULL, #ifdef USE_WEAKREFS - offsetof(BPy_PropertyRNA, in_weakreflist), /* long tp_weaklistoffset; */ + /*tp_weaklistoffset*/ offsetof(BPy_PropertyRNA, in_weakreflist), #else - 0, + /*tp_weaklistoffset*/ 0, #endif - - /*** Added in release 2.2 ***/ - /* Iterators */ - NULL, /* getiterfunc tp_iter; */ - NULL, /* iternextfunc tp_iternext; */ - - /*** Attribute descriptor and subclassing stuff ***/ - pyrna_prop_collection_idprop_methods, /* struct PyMethodDef *tp_methods; */ - NULL, /* struct PyMemberDef *tp_members; */ - NULL /*pyrna_prop_getseters*/, /* struct PyGetSetDef *tp_getset; */ - &pyrna_prop_collection_Type, /* struct _typeobject *tp_base; */ - NULL, /* PyObject *tp_dict; */ - NULL, /* descrgetfunc tp_descr_get; */ - NULL, /* descrsetfunc tp_descr_set; */ - 0, /* long tp_dictoffset; */ - NULL, /* initproc tp_init; */ - NULL, /* allocfunc tp_alloc; */ - NULL, /* newfunc tp_new; */ - /* Low-level free-memory routine */ - NULL, /* freefunc tp_free; */ - /* For PyObject_IS_GC */ - NULL, /* inquiry tp_is_gc; */ - NULL, /* PyObject *tp_bases; */ - /* method resolution order */ - NULL, /* PyObject *tp_mro; */ - NULL, /* PyObject *tp_cache; */ - NULL, /* PyObject *tp_subclasses; */ - NULL, /* PyObject *tp_weaklist; */ - NULL, + /*tp_iter*/ NULL, + /*tp_iternext*/ NULL, + /*tp_methods*/ pyrna_prop_collection_idprop_methods, + /*tp_members*/ NULL, + /*tp_getset*/ NULL /* Sub-classed: #pyrna_prop_getseters. */, + /*tp_base*/ &pyrna_prop_collection_Type, + /*tp_dict*/ NULL, + /*tp_descr_get*/ NULL, + /*tp_descr_set*/ NULL, + /*tp_dictoffset*/ 0, + /*tp_init*/ NULL, + /*tp_alloc*/ NULL, + /*tp_new*/ NULL, + /*tp_free*/ NULL, + /*tp_is_gc*/ NULL, + /*tp_bases*/ NULL, + /*tp_mro*/ NULL, + /*tp_cache*/ NULL, + /*tp_subclasses*/ NULL, + /*tp_weaklist*/ NULL, + /*tp_del*/ NULL, + /*tp_version_tag*/ 0, + /*tp_finalize*/ NULL, + /*tp_vectorcall*/ NULL, }; /*-----------------------BPy_PropertyRNA method def------------------------------*/ PyTypeObject pyrna_func_Type = { - PyVarObject_HEAD_INIT(NULL, 0) "bpy_func", /* tp_name */ - sizeof(BPy_FunctionRNA), /* tp_basicsize */ - 0, /* tp_itemsize */ - /* methods */ - NULL, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - NULL, /* getattrfunc tp_getattr; */ - NULL, /* setattrfunc tp_setattr; */ - NULL, - /* tp_compare */ /* DEPRECATED in Python 3.0! */ - (reprfunc)pyrna_func_repr, /* tp_repr */ - - /* Method suites for standard classes */ - - NULL, /* PyNumberMethods *tp_as_number; */ - NULL, /* PySequenceMethods *tp_as_sequence; */ - NULL, /* PyMappingMethods *tp_as_mapping; */ - - /* More standard operations (here for binary compatibility) */ - - NULL, /* hashfunc tp_hash; */ - (ternaryfunc)pyrna_func_call, /* ternaryfunc tp_call; */ - NULL, /* reprfunc tp_str; */ - - /* will only use these if this is a subtype of a py class */ - NULL, /* getattrofunc tp_getattro; */ - NULL, /* setattrofunc tp_setattro; */ - - /* Functions to access object as input/output buffer */ - NULL, /* PyBufferProcs *tp_as_buffer; */ - - /*** Flags to define presence of optional/expanded features ***/ - Py_TPFLAGS_DEFAULT, /* long tp_flags; */ - - NULL, /* char *tp_doc; Documentation string */ - /*** Assigned meaning in release 2.0 ***/ - /* call function for all accessible objects */ - NULL, /* traverseproc tp_traverse; */ - - /* delete references to contained objects */ - NULL, /* inquiry tp_clear; */ - - /*** Assigned meaning in release 2.1 ***/ - /*** rich comparisons ***/ - NULL, /* richcmpfunc tp_richcompare; */ - -/*** weak reference enabler ***/ + PyVarObject_HEAD_INIT(NULL, 0) + /*tp_name*/ "bpy_func", + /*tp_basicsize*/ sizeof(BPy_FunctionRNA), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ NULL, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ NULL, + /*tp_setattr*/ NULL, + /*tp_as_async*/ NULL, + /*tp_repr*/ (reprfunc)pyrna_func_repr, + /*tp_as_number*/ NULL, + /*tp_as_sequence*/ NULL, + /*tp_as_mapping*/ NULL, + /*tp_hash*/ NULL, + /*tp_call*/ (ternaryfunc)pyrna_func_call, + /*tp_str*/ NULL, + /*tp_getattro*/ NULL, + /*tp_setattro*/ NULL, + /*tp_as_buffer*/ NULL, + /*tp_flags*/ Py_TPFLAGS_DEFAULT, + /*tp_doc*/ NULL, + /*tp_traverse*/ NULL, + /*tp_clear*/ NULL, + /*tp_richcompare*/ NULL, #ifdef USE_WEAKREFS - offsetof(BPy_PropertyRNA, in_weakreflist), /* long tp_weaklistoffset; */ + /*tp_weaklistoffset*/ offsetof(BPy_PropertyRNA, in_weakreflist), #else - 0, + /*tp_weaklistoffset*/ 0, #endif - - /*** Added in release 2.2 ***/ - /* Iterators */ - NULL, /* getiterfunc tp_iter; */ - NULL, /* iternextfunc tp_iternext; */ - - /*** Attribute descriptor and subclassing stuff ***/ - NULL, /* struct PyMethodDef *tp_methods; */ - NULL, /* struct PyMemberDef *tp_members; */ - pyrna_func_getseters, /* struct PyGetSetDef *tp_getset; */ - NULL, /* struct _typeobject *tp_base; */ - NULL, /* PyObject *tp_dict; */ - NULL, /* descrgetfunc tp_descr_get; */ - NULL, /* descrsetfunc tp_descr_set; */ - 0, /* long tp_dictoffset; */ - NULL, /* initproc tp_init; */ - NULL, /* allocfunc tp_alloc; */ - NULL, /* newfunc tp_new; */ - /* Low-level free-memory routine */ - NULL, /* freefunc tp_free; */ - /* For PyObject_IS_GC */ - NULL, /* inquiry tp_is_gc; */ - NULL, /* PyObject *tp_bases; */ - /* method resolution order */ - NULL, /* PyObject *tp_mro; */ - NULL, /* PyObject *tp_cache; */ - NULL, /* PyObject *tp_subclasses; */ - NULL, /* PyObject *tp_weaklist; */ - NULL, + /*tp_iter*/ NULL, + /*tp_iternext*/ NULL, + /*tp_methods*/ NULL, + /*tp_members*/ NULL, + /*tp_getset*/ pyrna_func_getseters, + /*tp_base*/ NULL, + /*tp_dict*/ NULL, + /*tp_descr_get*/ NULL, + /*tp_descr_set*/ NULL, + /*tp_dictoffset*/ 0, + /*tp_init*/ NULL, + /*tp_alloc*/ NULL, + /*tp_new*/ NULL, + /*tp_free*/ NULL, + /*tp_is_gc*/ NULL, + /*tp_bases*/ NULL, + /*tp_mro*/ NULL, + /*tp_cache*/ NULL, + /*tp_subclasses*/ NULL, + /*tp_weaklist*/ NULL, + /*tp_del*/ NULL, + /*tp_version_tag*/ 0, + /*tp_finalize*/ NULL, + /*tp_vectorcall*/ NULL, }; #ifdef USE_PYRNA_ITER @@ -7098,87 +6933,59 @@ static void pyrna_prop_collection_iter_dealloc(BPy_PropertyCollectionIterRNA *se static PyObject *pyrna_prop_collection_iter_next(BPy_PropertyCollectionIterRNA *self); static PyTypeObject pyrna_prop_collection_iter_Type = { - PyVarObject_HEAD_INIT(NULL, 0) "bpy_prop_collection_iter", /* tp_name */ - sizeof(BPy_PropertyCollectionIterRNA), /* tp_basicsize */ - 0, /* tp_itemsize */ - /* methods */ - (destructor)pyrna_prop_collection_iter_dealloc, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - NULL, /* getattrfunc tp_getattr; */ - NULL, /* setattrfunc tp_setattr; */ - NULL, - /* tp_compare */ /* DEPRECATED in Python 3.0! */ - NULL, - /* subclassed */ /* tp_repr */ - - /* Method suites for standard classes */ - - NULL, /* PyNumberMethods *tp_as_number; */ - NULL, /* PySequenceMethods *tp_as_sequence; */ - NULL, /* PyMappingMethods *tp_as_mapping; */ - - /* More standard operations (here for binary compatibility) */ - - NULL, /* hashfunc tp_hash; */ - NULL, /* ternaryfunc tp_call; */ - NULL, /* reprfunc tp_str; */ - - /* will only use these if this is a subtype of a py class */ - PyObject_GenericGetAttr, /* getattrofunc tp_getattro; */ - NULL, /* setattrofunc tp_setattro; */ - - /* Functions to access object as input/output buffer */ - NULL, /* PyBufferProcs *tp_as_buffer; */ - - /*** Flags to define presence of optional/expanded features ***/ - Py_TPFLAGS_DEFAULT, /* long tp_flags; */ - - NULL, /* char *tp_doc; Documentation string */ - /*** Assigned meaning in release 2.0 ***/ - /* call function for all accessible objects */ - NULL, /* traverseproc tp_traverse; */ - - /* delete references to contained objects */ - NULL, /* inquiry tp_clear; */ - - /*** Assigned meaning in release 2.1 ***/ - /*** rich comparisons (subclassed) ***/ - NULL, /* richcmpfunc tp_richcompare; */ - -/*** weak reference enabler ***/ + PyVarObject_HEAD_INIT(NULL, 0) + /*tp_name*/ "bpy_prop_collection_iter", + /*tp_basicsize*/ sizeof(BPy_PropertyCollectionIterRNA), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ (destructor)pyrna_prop_collection_iter_dealloc, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ NULL, + /*tp_setattr*/ NULL, + /*tp_as_async*/ NULL, + /*tp_repr*/ NULL, /* No need to define, sub-classed. */ + /*tp_as_number*/ NULL, + /*tp_as_sequence*/ NULL, + /*tp_as_mapping*/ NULL, + /*tp_hash*/ NULL, + /*tp_call*/ NULL, + /*tp_str*/ NULL, + /*tp_getattro*/ PyObject_GenericGetAttr, + /*tp_setattro*/ NULL, + /*tp_as_buffer*/ NULL, + /*tp_flags*/ Py_TPFLAGS_DEFAULT, + /*tp_doc*/ NULL, + /*tp_traverse*/ NULL, + /*tp_clear*/ NULL, + /*tp_richcompare*/ NULL, # ifdef USE_WEAKREFS - offsetof(BPy_PropertyCollectionIterRNA, in_weakreflist), /* long tp_weaklistoffset; */ + /*tp_weaklistoffset*/ offsetof(BPy_PropertyCollectionIterRNA, in_weakreflist), # else - 0, + /*tp_weaklistoffset*/ 0, # endif - /*** Added in release 2.2 ***/ - /* Iterators */ - PyObject_SelfIter, /* getiterfunc tp_iter; */ - (iternextfunc)pyrna_prop_collection_iter_next, /* iternextfunc tp_iternext; */ - - /*** Attribute descriptor and subclassing stuff ***/ - NULL, /* struct PyMethodDef *tp_methods; */ - NULL, /* struct PyMemberDef *tp_members; */ - NULL, /* struct PyGetSetDef *tp_getset; */ - NULL, /* struct _typeobject *tp_base; */ - NULL, /* PyObject *tp_dict; */ - NULL, /* descrgetfunc tp_descr_get; */ - NULL, /* descrsetfunc tp_descr_set; */ - 0, /* long tp_dictoffset; */ - NULL, /* initproc tp_init; */ - NULL, /* allocfunc tp_alloc; */ - NULL, /* newfunc tp_new; */ - /* Low-level free-memory routine */ - NULL, /* freefunc tp_free; */ - /* For PyObject_IS_GC */ - NULL, /* inquiry tp_is_gc; */ - NULL, /* PyObject *tp_bases; */ - /* method resolution order */ - NULL, /* PyObject *tp_mro; */ - NULL, /* PyObject *tp_cache; */ - NULL, /* PyObject *tp_subclasses; */ - NULL, /* PyObject *tp_weaklist; */ - NULL, + /*tp_iter*/ PyObject_SelfIter, + /*tp_iternext*/ (iternextfunc)pyrna_prop_collection_iter_next, + /*tp_methods*/ NULL, + /*tp_members*/ NULL, + /*tp_getset*/ NULL, + /*tp_base*/ NULL, + /*tp_dict*/ NULL, + /*tp_descr_get*/ NULL, + /*tp_descr_set*/ NULL, + /*tp_dictoffset*/ 0, + /*tp_init*/ NULL, + /*tp_alloc*/ NULL, + /*tp_new*/ NULL, + /*tp_free*/ NULL, + /*tp_is_gc*/ NULL, + /*tp_bases*/ NULL, + /*tp_mro*/ NULL, + /*tp_cache*/ NULL, + /*tp_subclasses*/ NULL, + /*tp_weaklist*/ NULL, + /*tp_del*/ NULL, + /*tp_version_tag*/ 0, + /*tp_finalize*/ NULL, + /*tp_vectorcall*/ NULL, }; static PyObject *pyrna_prop_collection_iter_CreatePyObject(PointerRNA *ptr, PropertyRNA *prop) diff --git a/source/blender/python/intern/bpy_rna_data.c b/source/blender/python/intern/bpy_rna_data.c index 3c7ec3bddc3..2dc0b8dc999 100644 --- a/source/blender/python/intern/bpy_rna_data.c +++ b/source/blender/python/intern/bpy_rna_data.c @@ -60,84 +60,56 @@ static void bpy_rna_data_context_dealloc(BPy_DataContext *self) Py_CLEAR(self->data_rna); PyObject_GC_Del(self); } - static PyTypeObject bpy_rna_data_context_Type = { - PyVarObject_HEAD_INIT(NULL, 0) "bpy_rna_data_context", /* tp_name */ - sizeof(BPy_DataContext), /* tp_basicsize */ - 0, /* tp_itemsize */ - /* methods */ - (destructor)bpy_rna_data_context_dealloc, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - NULL, /* getattrfunc tp_getattr; */ - NULL, /* setattrfunc tp_setattr; */ - NULL, - /* tp_compare */ /* DEPRECATED in python 3.0! */ - NULL, /* tp_repr */ - - /* Method suites for standard classes */ - - NULL, /* PyNumberMethods *tp_as_number; */ - NULL, /* PySequenceMethods *tp_as_sequence; */ - NULL, /* PyMappingMethods *tp_as_mapping; */ - - /* More standard operations (here for binary compatibility) */ - - NULL, /* hashfunc tp_hash; */ - NULL, /* ternaryfunc tp_call; */ - NULL, /* reprfunc tp_str; */ - - /* Will only use these if this is a sub-type of a Python class. */ - NULL, /* getattrofunc tp_getattro; */ - NULL, /* setattrofunc tp_setattro; */ - - /* Functions to access object as input/output buffer */ - NULL, /* PyBufferProcs *tp_as_buffer; */ - - /*** Flags to define presence of optional/expanded features ***/ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* long tp_flags; */ - - NULL, /* char *tp_doc; Documentation string */ - /*** Assigned meaning in release 2.0 ***/ - /* call function for all accessible objects */ - (traverseproc)bpy_rna_data_context_traverse, /* traverseproc tp_traverse; */ - - /* delete references to contained objects */ - (inquiry)bpy_rna_data_context_clear, /* inquiry tp_clear; */ - - /*** Assigned meaning in release 2.1 ***/ - /*** rich comparisons (subclassed) ***/ - NULL, /* richcmpfunc tp_richcompare; */ - - /*** weak reference enabler ***/ - 0, - /*** Added in release 2.2 ***/ - /* Iterators */ - NULL, /* getiterfunc tp_iter; */ - NULL, /* iternextfunc tp_iternext; */ - - /*** Attribute descriptor and subclassing stuff ***/ - bpy_rna_data_context_methods, /* struct PyMethodDef *tp_methods; */ - NULL, /* struct PyMemberDef *tp_members; */ - NULL, /* struct PyGetSetDef *tp_getset; */ - NULL, /* struct _typeobject *tp_base; */ - NULL, /* PyObject *tp_dict; */ - NULL, /* descrgetfunc tp_descr_get; */ - NULL, /* descrsetfunc tp_descr_set; */ - 0, /* long tp_dictoffset; */ - NULL, /* initproc tp_init; */ - NULL, /* allocfunc tp_alloc; */ - NULL, /* newfunc tp_new; */ - /* Low-level free-memory routine */ - NULL, /* freefunc tp_free; */ - /* For PyObject_IS_GC */ - NULL, /* inquiry tp_is_gc; */ - NULL, /* PyObject *tp_bases; */ - /* method resolution order */ - NULL, /* PyObject *tp_mro; */ - NULL, /* PyObject *tp_cache; */ - NULL, /* PyObject *tp_subclasses; */ - NULL, /* PyObject *tp_weaklist; */ - NULL, + PyVarObject_HEAD_INIT(NULL, 0) + /*tp_name*/ "bpy_rna_data_context", + /*tp_basicsize*/ sizeof(BPy_DataContext), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ (destructor)bpy_rna_data_context_dealloc, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ NULL, + /*tp_setattr*/ NULL, + /*tp_as_async*/ NULL, + /*tp_repr*/ NULL, + /*tp_as_number*/ NULL, + /*tp_as_sequence*/ NULL, + /*tp_as_mapping*/ NULL, + /*tp_hash*/ NULL, + /*tp_call*/ NULL, + /*tp_str*/ NULL, + /*tp_getattro*/ NULL, + /*tp_setattro*/ NULL, + /*tp_as_buffer*/ NULL, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, + /*tp_doc*/ NULL, + /*tp_traverse*/ (traverseproc)bpy_rna_data_context_traverse, + /*tp_clear*/ (inquiry)bpy_rna_data_context_clear, + /*tp_richcompare*/ NULL, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ NULL, + /*tp_iternext*/ NULL, + /*tp_methods*/ bpy_rna_data_context_methods, + /*tp_members*/ NULL, + /*tp_getset*/ NULL, + /*tp_base*/ NULL, + /*tp_dict*/ NULL, + /*tp_descr_get*/ NULL, + /*tp_descr_set*/ NULL, + /*tp_dictoffset*/ 0, + /*tp_init*/ NULL, + /*tp_alloc*/ NULL, + /*tp_new*/ NULL, + /*tp_free*/ NULL, + /*tp_is_gc*/ NULL, + /*tp_bases*/ NULL, + /*tp_mro*/ NULL, + /*tp_cache*/ NULL, + /*tp_subclasses*/ NULL, + /*tp_weaklist*/ NULL, + /*tp_del*/ NULL, + /*tp_version_tag*/ 0, + /*tp_finalize*/ NULL, + /*tp_vectorcall*/ NULL, }; PyDoc_STRVAR(bpy_rna_data_context_load_doc, diff --git a/source/blender/python/mathutils/mathutils_Color.c b/source/blender/python/mathutils/mathutils_Color.c index 5218ea68f7b..e4f1ea87563 100644 --- a/source/blender/python/mathutils/mathutils_Color.c +++ b/source/blender/python/mathutils/mathutils_Color.c @@ -825,59 +825,61 @@ static PyObject *Color_neg(ColorObject *self) * \{ */ static PySequenceMethods Color_SeqMethods = { - (lenfunc)Color_len, /*sq_length*/ - (binaryfunc)NULL, /*sq_concat*/ - (ssizeargfunc)NULL, /*sq_repeat*/ - (ssizeargfunc)Color_item, /*sq_item*/ - NULL, /*sq_slice(DEPRECATED)*/ - (ssizeobjargproc)Color_ass_item, /*sq_ass_item*/ - NULL, /*sq_ass_slice(DEPRECATED)*/ - (objobjproc)NULL, /*sq_contains*/ - (binaryfunc)NULL, /*sq_inplace_concat*/ - (ssizeargfunc)NULL, /*sq_inplace_repeat*/ + /*sq_length*/ (lenfunc)Color_len, + /*sq_concat*/ NULL, + /*sq_repeat*/ NULL, + /*sq_item*/ (ssizeargfunc)Color_item, + /*was_sq_slice*/ NULL, /* DEPRECATED. */ + /*sq_ass_item*/ (ssizeobjargproc)Color_ass_item, + /*was_sq_ass_slice*/ NULL, /* DEPRECATED. */ + /*sq_contains*/ NULL, + /*sq_inplace_concat*/ NULL, + /*sq_inplace_repeat*/ NULL, }; static PyMappingMethods Color_AsMapping = { - (lenfunc)Color_len, - (binaryfunc)Color_subscript, - (objobjargproc)Color_ass_subscript, + /*mp_len*/ (lenfunc)Color_len, + /*mp_subscript*/ (binaryfunc)Color_subscript, + /*mp_ass_subscript*/ (objobjargproc)Color_ass_subscript, }; static PyNumberMethods Color_NumMethods = { - (binaryfunc)Color_add, /*nb_add*/ - (binaryfunc)Color_sub, /*nb_subtract*/ - (binaryfunc)Color_mul, /*nb_multiply*/ - NULL, /*nb_remainder*/ - NULL, /*nb_divmod*/ - NULL, /*nb_power*/ - (unaryfunc)Color_neg, /*nb_negative*/ - (unaryfunc)Color_copy, /*tp_positive*/ - (unaryfunc)NULL, /*tp_absolute*/ - (inquiry)NULL, /*tp_bool*/ - (unaryfunc)NULL, /*nb_invert*/ - NULL, /*nb_lshift*/ - (binaryfunc)NULL, /*nb_rshift*/ - NULL, /*nb_and*/ - NULL, /*nb_xor*/ - NULL, /*nb_or*/ - NULL, /*nb_int*/ - NULL, /*nb_reserved*/ - NULL, /*nb_float*/ - Color_iadd, /*nb_inplace_add*/ - Color_isub, /*nb_inplace_subtract*/ - Color_imul, /*nb_inplace_multiply*/ - NULL, /*nb_inplace_remainder*/ - NULL, /*nb_inplace_power*/ - NULL, /*nb_inplace_lshift*/ - NULL, /*nb_inplace_rshift*/ - NULL, /*nb_inplace_and*/ - NULL, /*nb_inplace_xor*/ - NULL, /*nb_inplace_or*/ - NULL, /*nb_floor_divide*/ - Color_div, /*nb_true_divide*/ - NULL, /*nb_inplace_floor_divide*/ - Color_idiv, /*nb_inplace_true_divide*/ - NULL, /*nb_index*/ + /*nb_add*/ (binaryfunc)Color_add, + /*nb_subtract*/ (binaryfunc)Color_sub, + /*nb_multiply*/ (binaryfunc)Color_mul, + /*nb_remainder*/ NULL, + /*nb_divmod*/ NULL, + /*nb_power*/ NULL, + /*nb_negative*/ (unaryfunc)Color_neg, + /*tp_positive*/ (unaryfunc)Color_copy, + /*tp_absolute*/ NULL, + /*tp_bool*/ NULL, + /*nb_invert*/ NULL, + /*nb_lshift*/ NULL, + /*nb_rshift*/ NULL, + /*nb_and*/ NULL, + /*nb_xor*/ NULL, + /*nb_or*/ NULL, + /*nb_int*/ NULL, + /*nb_reserved*/ NULL, + /*nb_float*/ NULL, + /*nb_inplace_add*/ Color_iadd, + /*nb_inplace_subtract*/ Color_isub, + /*nb_inplace_multiply*/ Color_imul, + /*nb_inplace_remainder*/ NULL, + /*nb_inplace_power*/ NULL, + /*nb_inplace_lshift*/ NULL, + /*nb_inplace_rshift*/ NULL, + /*nb_inplace_and*/ NULL, + /*nb_inplace_xor*/ NULL, + /*nb_inplace_or*/ NULL, + /*nb_floor_divide*/ NULL, + /*nb_true_divide*/ Color_div, + /*nb_inplace_floor_divide*/ NULL, + /*nb_inplace_true_divide*/ Color_idiv, + /*nb_index*/ NULL, + /*nb_matrix_multiply*/ NULL, + /*nb_inplace_matrix_multiply*/ NULL, }; /** \} */ @@ -1100,6 +1102,10 @@ static struct PyMethodDef Color_methods[] = { /** \name Color Type: Python Object Definition * \{ */ +#ifdef MATH_STANDALONE +# define Color_str NULL +#endif + PyDoc_STRVAR( color_doc, ".. class:: Color(rgb)\n" @@ -1113,57 +1119,61 @@ PyDoc_STRVAR( " :arg rgb: (r, g, b) color values\n" " :type rgb: 3d vector\n"); PyTypeObject color_Type = { - PyVarObject_HEAD_INIT(NULL, 0) "Color", /* tp_name */ - sizeof(ColorObject), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)BaseMathObject_dealloc, /* tp_dealloc */ - (printfunc)NULL, /* tp_print */ - NULL, /* tp_getattr */ - NULL, /* tp_setattr */ - NULL, /* tp_compare */ - (reprfunc)Color_repr, /* tp_repr */ - &Color_NumMethods, /* tp_as_number */ - &Color_SeqMethods, /* tp_as_sequence */ - &Color_AsMapping, /* tp_as_mapping */ - (hashfunc)Color_hash, /* tp_hash */ - NULL, /* tp_call */ -#ifndef MATH_STANDALONE - (reprfunc)Color_str, /* tp_str */ -#else - NULL, /* tp_str */ -#endif - NULL, /* tp_getattro */ - NULL, /* tp_setattro */ - NULL, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC, /* tp_flags */ - color_doc, /* tp_doc */ - (traverseproc)BaseMathObject_traverse, /* tp_traverse */ - (inquiry)BaseMathObject_clear, /* tp_clear */ - (richcmpfunc)Color_richcmpr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - NULL, /* tp_iter */ - NULL, /* tp_iternext */ - Color_methods, /* tp_methods */ - NULL, /* tp_members */ - Color_getseters, /* tp_getset */ - NULL, /* tp_base */ - NULL, /* tp_dict */ - NULL, /* tp_descr_get */ - NULL, /* tp_descr_set */ - 0, /* tp_dictoffset */ - NULL, /* tp_init */ - NULL, /* tp_alloc */ - Color_new, /* tp_new */ - NULL, /* tp_free */ - (inquiry)BaseMathObject_is_gc, /* tp_is_gc */ - NULL, /* tp_bases */ - NULL, /* tp_mro */ - NULL, /* tp_cache */ - NULL, /* tp_subclasses */ - NULL, /* tp_weaklist */ - NULL, /* tp_del */ + PyVarObject_HEAD_INIT(NULL, 0) + /*tp_name*/ "Color", + /*tp_basicsize*/ sizeof(ColorObject), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ (destructor)BaseMathObject_dealloc, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ NULL, + /*tp_setattr*/ NULL, + /*tp_as_async*/ NULL, + /*tp_repr*/ (reprfunc)Color_repr, + /*tp_as_number*/ &Color_NumMethods, + /*tp_as_sequence*/ &Color_SeqMethods, + /*tp_as_mapping*/ &Color_AsMapping, + /*tp_hash*/ (hashfunc)Color_hash, + /*tp_call*/ NULL, + /*tp_str*/ (reprfunc)Color_str, + /*tp_getattro*/ NULL, + /*tp_setattro*/ NULL, + /*tp_as_buffer*/ NULL, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC, + /*tp_doc*/ color_doc, + /*tp_traverse*/ (traverseproc)BaseMathObject_traverse, + /*tp_clear*/ (inquiry)BaseMathObject_clear, + /*tp_richcompare*/ (richcmpfunc)Color_richcmpr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ NULL, + /*tp_iternext*/ NULL, + /*tp_methods*/ Color_methods, + /*tp_members*/ NULL, + /*tp_getset*/ Color_getseters, + /*tp_base*/ NULL, + /*tp_dict*/ NULL, + /*tp_descr_get*/ NULL, + /*tp_descr_set*/ NULL, + /*tp_dictoffset*/ 0, + /*tp_init*/ NULL, + /*tp_alloc*/ NULL, + /*tp_new*/ Color_new, + /*tp_free*/ NULL, + /*tp_is_gc*/ (inquiry)BaseMathObject_is_gc, + /*tp_bases*/ NULL, + /*tp_mro*/ NULL, + /*tp_cache*/ NULL, + /*tp_subclasses*/ NULL, + /*tp_weaklist*/ NULL, + /*tp_del*/ NULL, + /*tp_version_tag*/ 0, + /*tp_finalize*/ NULL, + /*tp_vectorcall*/ NULL, }; +#ifdef MATH_STANDALONE +# define Color_str +#endif + /** \} */ /* -------------------------------------------------------------------- */ diff --git a/source/blender/python/mathutils/mathutils_Euler.c b/source/blender/python/mathutils/mathutils_Euler.c index ddc0f115742..d72ec5bbc77 100644 --- a/source/blender/python/mathutils/mathutils_Euler.c +++ b/source/blender/python/mathutils/mathutils_Euler.c @@ -636,22 +636,22 @@ static int Euler_ass_subscript(EulerObject *self, PyObject *item, PyObject *valu * \{ */ static PySequenceMethods Euler_SeqMethods = { - (lenfunc)Euler_len, /*sq_length*/ - (binaryfunc)NULL, /*sq_concat*/ - (ssizeargfunc)NULL, /*sq_repeat*/ - (ssizeargfunc)Euler_item, /*sq_item*/ - (ssizessizeargfunc)NULL, /*sq_slice(DEPRECATED)*/ - (ssizeobjargproc)Euler_ass_item, /*sq_ass_item*/ - (ssizessizeobjargproc)NULL, /*sq_ass_slice(DEPRECATED)*/ - (objobjproc)NULL, /*sq_contains*/ - (binaryfunc)NULL, /*sq_inplace_concat*/ - (ssizeargfunc)NULL, /*sq_inplace_repeat*/ + /*sq_length*/ (lenfunc)Euler_len, + /*sq_concat*/ NULL, + /*sq_repeat*/ NULL, + /*sq_item*/ (ssizeargfunc)Euler_item, + /*was_sq_slice*/ NULL, /* DEPRECATED. */ + /*sq_ass_item*/ (ssizeobjargproc)Euler_ass_item, + /*was_sq_ass_slice*/ NULL, /* DEPRECATED. */ + /*sq_contains*/ NULL, + /*sq_inplace_concat*/ NULL, + /*sq_inplace_repeat*/ NULL, }; static PyMappingMethods Euler_AsMapping = { - (lenfunc)Euler_len, - (binaryfunc)Euler_subscript, - (objobjargproc)Euler_ass_subscript, + /*mp_len*/ (lenfunc)Euler_len, + /*mp_subscript*/ (binaryfunc)Euler_subscript, + /*mp_ass_subscript*/ (objobjargproc)Euler_ass_subscript, }; /** \} */ @@ -766,6 +766,10 @@ static struct PyMethodDef Euler_methods[] = { /** \name Euler Type: Python Object Definition * \{ */ +#ifdef MATH_STANDALONE +# define Euler_str NULL +#endif + PyDoc_STRVAR( euler_doc, ".. class:: Euler(angles, order='XYZ')\n" @@ -779,57 +783,61 @@ PyDoc_STRVAR( " :arg order: Optional order of the angles, a permutation of ``XYZ``.\n" " :type order: str\n"); PyTypeObject euler_Type = { - PyVarObject_HEAD_INIT(NULL, 0) "Euler", /* tp_name */ - sizeof(EulerObject), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)BaseMathObject_dealloc, /* tp_dealloc */ - (printfunc)NULL, /* tp_print */ - NULL, /* tp_getattr */ - NULL, /* tp_setattr */ - NULL, /* tp_compare */ - (reprfunc)Euler_repr, /* tp_repr */ - NULL, /* tp_as_number */ - &Euler_SeqMethods, /* tp_as_sequence */ - &Euler_AsMapping, /* tp_as_mapping */ - (hashfunc)Euler_hash, /* tp_hash */ - NULL, /* tp_call */ -#ifndef MATH_STANDALONE - (reprfunc)Euler_str, /* tp_str */ -#else - NULL, /* tp_str */ -#endif - NULL, /* tp_getattro */ - NULL, /* tp_setattro */ - NULL, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC, /* tp_flags */ - euler_doc, /* tp_doc */ - (traverseproc)BaseMathObject_traverse, /* tp_traverse */ - (inquiry)BaseMathObject_clear, /* tp_clear */ - (richcmpfunc)Euler_richcmpr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - NULL, /* tp_iter */ - NULL, /* tp_iternext */ - Euler_methods, /* tp_methods */ - NULL, /* tp_members */ - Euler_getseters, /* tp_getset */ - NULL, /* tp_base */ - NULL, /* tp_dict */ - NULL, /* tp_descr_get */ - NULL, /* tp_descr_set */ - 0, /* tp_dictoffset */ - NULL, /* tp_init */ - NULL, /* tp_alloc */ - Euler_new, /* tp_new */ - NULL, /* tp_free */ - (inquiry)BaseMathObject_is_gc, /* tp_is_gc */ - NULL, /* tp_bases */ - NULL, /* tp_mro */ - NULL, /* tp_cache */ - NULL, /* tp_subclasses */ - NULL, /* tp_weaklist */ - NULL, /* tp_del */ + PyVarObject_HEAD_INIT(NULL, 0) + /*tp_name*/ "Euler", + /*tp_basicsize*/ sizeof(EulerObject), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ (destructor)BaseMathObject_dealloc, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ NULL, + /*tp_setattr*/ NULL, + /*tp_as_async*/ NULL, + /*tp_repr*/ (reprfunc)Euler_repr, + /*tp_as_number*/ NULL, + /*tp_as_sequence*/ &Euler_SeqMethods, + /*tp_as_mapping*/ &Euler_AsMapping, + /*tp_hash*/ (hashfunc)Euler_hash, + /*tp_call*/ NULL, + /*tp_str*/ (reprfunc)Euler_str, + /*tp_getattro*/ NULL, + /*tp_setattro*/ NULL, + /*tp_as_buffer*/ NULL, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC, + /*tp_doc*/ euler_doc, + /*tp_traverse*/ (traverseproc)BaseMathObject_traverse, + /*tp_clear*/ (inquiry)BaseMathObject_clear, + /*tp_richcompare*/ (richcmpfunc)Euler_richcmpr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ NULL, + /*tp_iternext*/ NULL, + /*tp_methods*/ Euler_methods, + /*tp_members*/ NULL, + /*tp_getset*/ Euler_getseters, + /*tp_base*/ NULL, + /*tp_dict*/ NULL, + /*tp_descr_get*/ NULL, + /*tp_descr_set*/ NULL, + /*tp_dictoffset*/ 0, + /*tp_init*/ NULL, + /*tp_alloc*/ NULL, + /*tp_new*/ Euler_new, + /*tp_free*/ NULL, + /*tp_is_gc*/ (inquiry)BaseMathObject_is_gc, + /*tp_bases*/ NULL, + /*tp_mro*/ NULL, + /*tp_cache*/ NULL, + /*tp_subclasses*/ NULL, + /*tp_weaklist*/ NULL, + /*tp_del*/ NULL, + /*tp_version_tag*/ 0, + /*tp_finalize*/ NULL, + /*tp_vectorcall*/ NULL, }; +#ifdef MATH_STANDALONE +# undef Euler_str +#endif + /** \} */ /* -------------------------------------------------------------------- */ diff --git a/source/blender/python/mathutils/mathutils_Matrix.c b/source/blender/python/mathutils/mathutils_Matrix.c index a44f42bc337..858b01b2a84 100644 --- a/source/blender/python/mathutils/mathutils_Matrix.c +++ b/source/blender/python/mathutils/mathutils_Matrix.c @@ -2964,61 +2964,61 @@ static PyObject *Matrix_imatmul(PyObject *m1, PyObject *m2) * \{ */ static PySequenceMethods Matrix_SeqMethods = { - (lenfunc)Matrix_len, /*sq_length*/ - (binaryfunc)NULL, /*sq_concat*/ - (ssizeargfunc)NULL, /*sq_repeat*/ - (ssizeargfunc)Matrix_item_row, /*sq_item*/ - (ssizessizeargfunc)NULL, /*sq_slice(DEPRECATED)*/ - (ssizeobjargproc)Matrix_ass_item_row, /*sq_ass_item*/ - (ssizessizeobjargproc)NULL, /*sq_ass_slice(DEPRECATED)*/ - (objobjproc)NULL, /*sq_contains*/ - (binaryfunc)NULL, /*sq_inplace_concat*/ - (ssizeargfunc)NULL, /*sq_inplace_repeat*/ + /*sq_length*/ (lenfunc)Matrix_len, + /*sq_concat*/ NULL, + /*sq_repeat*/ NULL, + /*sq_item*/ (ssizeargfunc)Matrix_item_row, + /*was_sq_slice*/ NULL, /* DEPRECATED. */ + /*sq_ass_item*/ (ssizeobjargproc)Matrix_ass_item_row, + /*was_sq_ass_slice*/ NULL, /* DEPRECATED. */ + /*sq_contains*/ NULL, + /*sq_inplace_concat*/ NULL, + /*sq_inplace_repeat*/ NULL, }; static PyMappingMethods Matrix_AsMapping = { - (lenfunc)Matrix_len, - (binaryfunc)Matrix_subscript, - (objobjargproc)Matrix_ass_subscript, + /*mp_len*/ (lenfunc)Matrix_len, + /*mp_subscript*/ (binaryfunc)Matrix_subscript, + /*mp_ass_subscript*/ (objobjargproc)Matrix_ass_subscript, }; static PyNumberMethods Matrix_NumMethods = { - (binaryfunc)Matrix_add, /*nb_add*/ - (binaryfunc)Matrix_sub, /*nb_subtract*/ - (binaryfunc)Matrix_mul, /*nb_multiply*/ - NULL, /*nb_remainder*/ - NULL, /*nb_divmod*/ - NULL, /*nb_power*/ - (unaryfunc)0, /*nb_negative*/ - (unaryfunc)0, /*tp_positive*/ - (unaryfunc)0, /*tp_absolute*/ - (inquiry)0, /*tp_bool*/ - (unaryfunc)Matrix_inverted_noargs, /*nb_invert*/ - NULL, /*nb_lshift*/ - (binaryfunc)0, /*nb_rshift*/ - NULL, /*nb_and*/ - NULL, /*nb_xor*/ - NULL, /*nb_or*/ - NULL, /*nb_int*/ - NULL, /*nb_reserved*/ - NULL, /*nb_float*/ - NULL, /*nb_inplace_add*/ - NULL, /*nb_inplace_subtract*/ - (binaryfunc)Matrix_imul, /*nb_inplace_multiply*/ - NULL, /*nb_inplace_remainder*/ - NULL, /*nb_inplace_power*/ - NULL, /*nb_inplace_lshift*/ - NULL, /*nb_inplace_rshift*/ - NULL, /*nb_inplace_and*/ - NULL, /*nb_inplace_xor*/ - NULL, /*nb_inplace_or*/ - NULL, /*nb_floor_divide*/ - NULL, /*nb_true_divide*/ - NULL, /*nb_inplace_floor_divide*/ - NULL, /*nb_inplace_true_divide*/ - NULL, /*nb_index*/ - (binaryfunc)Matrix_matmul, /*nb_matrix_multiply*/ - (binaryfunc)Matrix_imatmul, /*nb_inplace_matrix_multiply*/ + /*nb_add*/ (binaryfunc)Matrix_add, + /*nb_subtract*/ (binaryfunc)Matrix_sub, + /*nb_multiply*/ (binaryfunc)Matrix_mul, + /*nb_remainder*/ NULL, + /*nb_divmod*/ NULL, + /*nb_power*/ NULL, + /*nb_negative*/ NULL, + /*tp_positive*/ NULL, + /*tp_absolute*/ NULL, + /*tp_bool*/ NULL, + /*nb_invert*/ (unaryfunc)Matrix_inverted_noargs, + /*nb_lshift*/ NULL, + /*nb_rshift*/ NULL, + /*nb_and*/ NULL, + /*nb_xor*/ NULL, + /*nb_or*/ NULL, + /*nb_int*/ NULL, + /*nb_reserved*/ NULL, + /*nb_float*/ NULL, + /*nb_inplace_add*/ NULL, + /*nb_inplace_subtract*/ NULL, + /*nb_inplace_multiply*/ (binaryfunc)Matrix_imul, + /*nb_inplace_remainder*/ NULL, + /*nb_inplace_power*/ NULL, + /*nb_inplace_lshift*/ NULL, + /*nb_inplace_rshift*/ NULL, + /*nb_inplace_and*/ NULL, + /*nb_inplace_xor*/ NULL, + /*nb_inplace_or*/ NULL, + /*nb_floor_divide*/ NULL, + /*nb_true_divide*/ NULL, + /*nb_inplace_floor_divide*/ NULL, + /*nb_inplace_true_divide*/ NULL, + /*nb_index*/ NULL, + /*nb_matrix_multiply*/ (binaryfunc)Matrix_matmul, + /*nb_inplace_matrix_multiply*/ (binaryfunc)Matrix_imatmul, }; /** \} */ @@ -3314,6 +3314,10 @@ static struct PyMethodDef Matrix_methods[] = { /** \name Matrix Type: Python Object Definition * \{ */ +#ifdef MATH_STANDALONE +# define Matrix_str NULL +#endif + PyDoc_STRVAR( matrix_doc, ".. class:: Matrix([rows])\n" @@ -3324,57 +3328,61 @@ PyDoc_STRVAR( " :arg rows: Sequence of rows. When omitted, a 4x4 identity matrix is constructed.\n" " :type rows: 2d number sequence\n"); PyTypeObject matrix_Type = { - PyVarObject_HEAD_INIT(NULL, 0) "Matrix", /*tp_name*/ - sizeof(MatrixObject), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - (destructor)BaseMathObject_dealloc, /*tp_dealloc*/ - (printfunc)NULL, /*tp_print*/ - NULL, /*tp_getattr*/ - NULL, /*tp_setattr*/ - NULL, /*tp_compare*/ - (reprfunc)Matrix_repr, /*tp_repr*/ - &Matrix_NumMethods, /*tp_as_number*/ - &Matrix_SeqMethods, /*tp_as_sequence*/ - &Matrix_AsMapping, /*tp_as_mapping*/ - (hashfunc)Matrix_hash, /*tp_hash*/ - NULL, /*tp_call*/ -#ifndef MATH_STANDALONE - (reprfunc)Matrix_str, /*tp_str*/ -#else - NULL, /*tp_str*/ -#endif - NULL, /*tp_getattro*/ - NULL, /*tp_setattro*/ - NULL, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - matrix_doc, /*tp_doc*/ - (traverseproc)BaseMathObject_traverse, /* tp_traverse */ - (inquiry)BaseMathObject_clear, /*tp_clear*/ - (richcmpfunc)Matrix_richcmpr, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - NULL, /*tp_iter*/ - NULL, /*tp_iternext*/ - Matrix_methods, /*tp_methods*/ - NULL, /*tp_members*/ - Matrix_getseters, /*tp_getset*/ - NULL, /*tp_base*/ - NULL, /*tp_dict*/ - NULL, /*tp_descr_get*/ - NULL, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ - NULL, /*tp_init*/ - NULL, /*tp_alloc*/ - Matrix_new, /*tp_new*/ - NULL, /*tp_free*/ - (inquiry)BaseMathObject_is_gc, /*tp_is_gc*/ - NULL, /*tp_bases*/ - NULL, /*tp_mro*/ - NULL, /*tp_cache*/ - NULL, /*tp_subclasses*/ - NULL, /*tp_weaklist*/ - NULL, /*tp_del*/ + PyVarObject_HEAD_INIT(NULL, 0) + /*tp_name*/ "Matrix", + /*tp_basicsize*/ sizeof(MatrixObject), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ (destructor)BaseMathObject_dealloc, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ NULL, + /*tp_setattr*/ NULL, + /*tp_as_async*/ NULL, + /*tp_repr*/ (reprfunc)Matrix_repr, + /*tp_as_number*/ &Matrix_NumMethods, + /*tp_as_sequence*/ &Matrix_SeqMethods, + /*tp_as_mapping*/ &Matrix_AsMapping, + /*tp_hash*/ (hashfunc)Matrix_hash, + /*tp_call*/ NULL, + /*tp_str*/ (reprfunc)Matrix_str, + /*tp_getattro*/ NULL, + /*tp_setattro*/ NULL, + /*tp_as_buffer*/ NULL, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC, + /*tp_doc*/ matrix_doc, + /*tp_traverse*/ (traverseproc)BaseMathObject_traverse, + /*tp_clear*/ (inquiry)BaseMathObject_clear, + /*tp_richcompare*/ (richcmpfunc)Matrix_richcmpr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ NULL, + /*tp_iternext*/ NULL, + /*tp_methods*/ Matrix_methods, + /*tp_members*/ NULL, + /*tp_getset*/ Matrix_getseters, + /*tp_base*/ NULL, + /*tp_dict*/ NULL, + /*tp_descr_get*/ NULL, + /*tp_descr_set*/ NULL, + /*tp_dictoffset*/ 0, + /*tp_init*/ NULL, + /*tp_alloc*/ NULL, + /*tp_new*/ Matrix_new, + /*tp_free*/ NULL, + /*tp_is_gc*/ (inquiry)BaseMathObject_is_gc, + /*tp_bases*/ NULL, + /*tp_mro*/ NULL, + /*tp_cache*/ NULL, + /*tp_subclasses*/ NULL, + /*tp_weaklist*/ NULL, + /*tp_del*/ NULL, + /*tp_version_tag*/ 0, + /*tp_finalize*/ NULL, + /*tp_vectorcall*/ NULL, }; +#ifdef MATH_STANDALONE +# undef Matrix_str +#endif + /** \} */ /* -------------------------------------------------------------------- */ @@ -3752,9 +3760,9 @@ static PyObject *MatrixAccess_iter(MatrixAccessObject *self) } static PyMappingMethods MatrixAccess_AsMapping = { - (lenfunc)MatrixAccess_len, - (binaryfunc)MatrixAccess_subscript, - (objobjargproc)MatrixAccess_ass_subscript, + /*mp_len*/ (lenfunc)MatrixAccess_len, + /*mp_subscript*/ (binaryfunc)MatrixAccess_subscript, + /*mp_ass_subscript*/ (objobjargproc)MatrixAccess_ass_subscript, }; /** \} */ @@ -3764,31 +3772,55 @@ static PyMappingMethods MatrixAccess_AsMapping = { * \{ */ PyTypeObject matrix_access_Type = { - PyVarObject_HEAD_INIT(NULL, 0) "MatrixAccess", /*tp_name*/ - sizeof(MatrixAccessObject), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - (destructor)MatrixAccess_dealloc, /*tp_dealloc*/ - (printfunc)NULL, /*tp_print*/ - NULL, /*tp_getattr*/ - NULL, /*tp_setattr*/ - NULL, /*tp_compare*/ - NULL, /*tp_repr*/ - NULL, /*tp_as_number*/ - NULL /* &MatrixAccess_SeqMethods */ /* TODO */, /*tp_as_sequence*/ - &MatrixAccess_AsMapping, /*tp_as_mapping*/ - NULL, /*tp_hash*/ - NULL, /*tp_call*/ - NULL, /*tp_str*/ - NULL, /*tp_getattro*/ - NULL, /*tp_setattro*/ - NULL, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - NULL, /*tp_doc*/ - (traverseproc)MatrixAccess_traverse, /*tp_traverse*/ - (inquiry)MatrixAccess_clear, /*tp_clear*/ - NULL /* (richcmpfunc)MatrixAccess_richcmpr */ /* TODO*/, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - (getiterfunc)MatrixAccess_iter, /* getiterfunc tp_iter; */ + PyVarObject_HEAD_INIT(NULL, 0) + /*tp_name*/ "MatrixAccess", + /*tp_basicsize*/ sizeof(MatrixAccessObject), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ (destructor)MatrixAccess_dealloc, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ NULL, + /*tp_setattr*/ NULL, + /*tp_as_async*/ NULL, + /*tp_repr*/ NULL, + /*tp_as_number*/ NULL, + /*tp_as_sequence*/ NULL /* &MatrixAccess_SeqMethods */ /* TODO */, + /*tp_as_mapping*/ &MatrixAccess_AsMapping, + /*tp_hash*/ NULL, + /*tp_call*/ NULL, + /*tp_str*/ NULL, + /*tp_getattro*/ NULL, + /*tp_setattro*/ NULL, + /*tp_as_buffer*/ NULL, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, + /*tp_doc*/ NULL, + /*tp_traverse*/ (traverseproc)MatrixAccess_traverse, + /*tp_clear*/ (inquiry)MatrixAccess_clear, + /*tp_richcompare*/ NULL /* MatrixAccess_richcmpr */ /* TODO*/, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ (getiterfunc)MatrixAccess_iter, + /*tp_iternext*/ NULL, + /*tp_methods*/ NULL, + /*tp_members*/ NULL, + /*tp_getset*/ NULL, + /*tp_base*/ NULL, + /*tp_dict*/ NULL, + /*tp_descr_get*/ NULL, + /*tp_descr_set*/ NULL, + /*tp_dictoffset*/ 0, + /*tp_init*/ NULL, + /*tp_alloc*/ NULL, + /*tp_new*/ NULL, + /*tp_free*/ NULL, + /*tp_is_gc*/ NULL, + /*tp_bases*/ NULL, + /*tp_mro*/ NULL, + /*tp_cache*/ NULL, + /*tp_subclasses*/ NULL, + /*tp_weaklist*/ NULL, + /*tp_del*/ NULL, + /*tp_version_tag*/ 0, + /*tp_finalize*/ NULL, + /*tp_vectorcall*/ NULL, }; /** \} */ diff --git a/source/blender/python/mathutils/mathutils_Quaternion.c b/source/blender/python/mathutils/mathutils_Quaternion.c index 976c1da1916..4c64746b764 100644 --- a/source/blender/python/mathutils/mathutils_Quaternion.c +++ b/source/blender/python/mathutils/mathutils_Quaternion.c @@ -1342,61 +1342,61 @@ static PyObject *Quaternion_neg(QuaternionObject *self) * \{ */ static PySequenceMethods Quaternion_SeqMethods = { - (lenfunc)Quaternion_len, /*sq_length*/ - (binaryfunc)NULL, /*sq_concat*/ - (ssizeargfunc)NULL, /*sq_repeat*/ - (ssizeargfunc)Quaternion_item, /*sq_item*/ - (ssizessizeargfunc)NULL, /*sq_slice(deprecated)*/ - (ssizeobjargproc)Quaternion_ass_item, /*sq_ass_item*/ - (ssizessizeobjargproc)NULL, /*sq_ass_slice(deprecated)*/ - (objobjproc)NULL, /*sq_contains*/ - (binaryfunc)NULL, /*sq_inplace_concat*/ - (ssizeargfunc)NULL, /*sq_inplace_repeat*/ + /*sq_length*/ (lenfunc)Quaternion_len, + /*sq_concat*/ NULL, + /*sq_repeat*/ NULL, + /*sq_item*/ (ssizeargfunc)Quaternion_item, + /*was_sq_slice*/ NULL, /* DEPRECATED. */ + /*sq_ass_item*/ (ssizeobjargproc)Quaternion_ass_item, + /*was_sq_ass_slice*/ NULL, /* DEPRECATED. */ + /*sq_contains*/ NULL, + /*sq_inplace_concat*/ NULL, + /*sq_inplace_repeat*/ NULL, }; static PyMappingMethods Quaternion_AsMapping = { - (lenfunc)Quaternion_len, - (binaryfunc)Quaternion_subscript, - (objobjargproc)Quaternion_ass_subscript, + /*mp_len*/ (lenfunc)Quaternion_len, + /*mp_subscript*/ (binaryfunc)Quaternion_subscript, + /*mp_ass_subscript*/ (objobjargproc)Quaternion_ass_subscript, }; static PyNumberMethods Quaternion_NumMethods = { - (binaryfunc)Quaternion_add, /*nb_add*/ - (binaryfunc)Quaternion_sub, /*nb_subtract*/ - (binaryfunc)Quaternion_mul, /*nb_multiply*/ - NULL, /*nb_remainder*/ - NULL, /*nb_divmod*/ - NULL, /*nb_power*/ - (unaryfunc)Quaternion_neg, /*nb_negative*/ - (unaryfunc)Quaternion_copy, /*tp_positive*/ - (unaryfunc)0, /*tp_absolute*/ - (inquiry)0, /*tp_bool*/ - (unaryfunc)0, /*nb_invert*/ - NULL, /*nb_lshift*/ - (binaryfunc)0, /*nb_rshift*/ - NULL, /*nb_and*/ - NULL, /*nb_xor*/ - NULL, /*nb_or*/ - NULL, /*nb_int*/ - NULL, /*nb_reserved*/ - NULL, /*nb_float*/ - NULL, /*nb_inplace_add*/ - NULL, /*nb_inplace_subtract*/ - (binaryfunc)Quaternion_imul, /*nb_inplace_multiply*/ - NULL, /*nb_inplace_remainder*/ - NULL, /*nb_inplace_power*/ - NULL, /*nb_inplace_lshift*/ - NULL, /*nb_inplace_rshift*/ - NULL, /*nb_inplace_and*/ - NULL, /*nb_inplace_xor*/ - NULL, /*nb_inplace_or*/ - NULL, /*nb_floor_divide*/ - NULL, /*nb_true_divide*/ - NULL, /*nb_inplace_floor_divide*/ - NULL, /*nb_inplace_true_divide*/ - NULL, /*nb_index*/ - (binaryfunc)Quaternion_matmul, /*nb_matrix_multiply*/ - (binaryfunc)Quaternion_imatmul, /*nb_inplace_matrix_multiply*/ + /*nb_add*/ (binaryfunc)Quaternion_add, + /*nb_subtract*/ (binaryfunc)Quaternion_sub, + /*nb_multiply*/ (binaryfunc)Quaternion_mul, + /*nb_remainder*/ NULL, + /*nb_divmod*/ NULL, + /*nb_power*/ NULL, + /*nb_negative*/ (unaryfunc)Quaternion_neg, + /*tp_positive*/ (unaryfunc)Quaternion_copy, + /*tp_absolute*/ NULL, + /*tp_bool*/ NULL, + /*nb_invert*/ NULL, + /*nb_lshift*/ NULL, + /*nb_rshift*/ NULL, + /*nb_and*/ NULL, + /*nb_xor*/ NULL, + /*nb_or*/ NULL, + /*nb_int*/ NULL, + /*nb_reserved*/ NULL, + /*nb_float*/ NULL, + /*nb_inplace_add*/ NULL, + /*nb_inplace_subtract*/ NULL, + /*nb_inplace_multiply*/ (binaryfunc)Quaternion_imul, + /*nb_inplace_remainder*/ NULL, + /*nb_inplace_power*/ NULL, + /*nb_inplace_lshift*/ NULL, + /*nb_inplace_rshift*/ NULL, + /*nb_inplace_and*/ NULL, + /*nb_inplace_xor*/ NULL, + /*nb_inplace_or*/ NULL, + /*nb_floor_divide*/ NULL, + /*nb_true_divide*/ NULL, + /*nb_inplace_floor_divide*/ NULL, + /*nb_inplace_true_divide*/ NULL, + /*nb_index*/ NULL, + /*nb_matrix_multiply*/ (binaryfunc)Quaternion_matmul, + /*nb_inplace_matrix_multiply*/ (binaryfunc)Quaternion_imatmul, }; /** \} */ @@ -1657,6 +1657,10 @@ static struct PyMethodDef Quaternion_methods[] = { /** \name Quaternion Type: Python Object Definition * \{ */ +#ifdef MATH_STANDALONE +# define Quaternion_str NULL +#endif + PyDoc_STRVAR(quaternion_doc, ".. class:: Quaternion([seq, [angle]])\n" "\n" @@ -1682,57 +1686,61 @@ PyDoc_STRVAR(quaternion_doc, "\n" " .. seealso:: :meth:`to_axis_angle`\n"); PyTypeObject quaternion_Type = { - PyVarObject_HEAD_INIT(NULL, 0) "Quaternion", /* tp_name */ - sizeof(QuaternionObject), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)BaseMathObject_dealloc, /* tp_dealloc */ - (printfunc)NULL, /* tp_print */ - NULL, /* tp_getattr */ - NULL, /* tp_setattr */ - NULL, /* tp_compare */ - (reprfunc)Quaternion_repr, /* tp_repr */ - &Quaternion_NumMethods, /* tp_as_number */ - &Quaternion_SeqMethods, /* tp_as_sequence */ - &Quaternion_AsMapping, /* tp_as_mapping */ - (hashfunc)Quaternion_hash, /* tp_hash */ - NULL, /* tp_call */ -#ifndef MATH_STANDALONE - (reprfunc)Quaternion_str, /* tp_str */ -#else - NULL, /* tp_str */ -#endif - NULL, /* tp_getattro */ - NULL, /* tp_setattro */ - NULL, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC, /* tp_flags */ - quaternion_doc, /* tp_doc */ - (traverseproc)BaseMathObject_traverse, /* tp_traverse */ - (inquiry)BaseMathObject_clear, /* tp_clear */ - (richcmpfunc)Quaternion_richcmpr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - NULL, /* tp_iter */ - NULL, /* tp_iternext */ - Quaternion_methods, /* tp_methods */ - NULL, /* tp_members */ - Quaternion_getseters, /* tp_getset */ - NULL, /* tp_base */ - NULL, /* tp_dict */ - NULL, /* tp_descr_get */ - NULL, /* tp_descr_set */ - 0, /* tp_dictoffset */ - NULL, /* tp_init */ - NULL, /* tp_alloc */ - Quaternion_new, /* tp_new */ - NULL, /* tp_free */ - (inquiry)BaseMathObject_is_gc, /* tp_is_gc */ - NULL, /* tp_bases */ - NULL, /* tp_mro */ - NULL, /* tp_cache */ - NULL, /* tp_subclasses */ - NULL, /* tp_weaklist */ - NULL, /* tp_del */ + PyVarObject_HEAD_INIT(NULL, 0) + /*tp_name*/ "Quaternion", + /*tp_basicsize*/ sizeof(QuaternionObject), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ (destructor)BaseMathObject_dealloc, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ NULL, + /*tp_setattr*/ NULL, + /*tp_as_async*/ NULL, + /*tp_repr*/ (reprfunc)Quaternion_repr, + /*tp_as_number*/ &Quaternion_NumMethods, + /*tp_as_sequence*/ &Quaternion_SeqMethods, + /*tp_as_mapping*/ &Quaternion_AsMapping, + /*tp_hash*/ (hashfunc)Quaternion_hash, + /*tp_call*/ NULL, + /*tp_str*/ (reprfunc)Quaternion_str, + /*tp_getattro*/ NULL, + /*tp_setattro*/ NULL, + /*tp_as_buffer*/ NULL, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC, + /*tp_doc*/ quaternion_doc, + /*tp_traverse*/ (traverseproc)BaseMathObject_traverse, + /*tp_clear*/ (inquiry)BaseMathObject_clear, + /*tp_richcompare*/ (richcmpfunc)Quaternion_richcmpr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ NULL, + /*tp_iternext*/ NULL, + /*tp_methods*/ Quaternion_methods, + /*tp_members*/ NULL, + /*tp_getset*/ Quaternion_getseters, + /*tp_base*/ NULL, + /*tp_dict*/ NULL, + /*tp_descr_get*/ NULL, + /*tp_descr_set*/ NULL, + /*tp_dictoffset*/ 0, + /*tp_init*/ NULL, + /*tp_alloc*/ NULL, + /*tp_new*/ Quaternion_new, + /*tp_free*/ NULL, + /*tp_is_gc*/ (inquiry)BaseMathObject_is_gc, + /*tp_bases*/ NULL, + /*tp_mro*/ NULL, + /*tp_cache*/ NULL, + /*tp_subclasses*/ NULL, + /*tp_weaklist*/ NULL, + /*tp_del*/ NULL, + /*tp_version_tag*/ 0, + /*tp_finalize*/ NULL, + /*tp_vectorcall*/ NULL, }; +#ifdef MATH_STANDALONE +# undef Quaternion_str +#endif + /** \} */ /* -------------------------------------------------------------------- */ diff --git a/source/blender/python/mathutils/mathutils_Vector.c b/source/blender/python/mathutils/mathutils_Vector.c index 290be771c90..0f534e76e73 100644 --- a/source/blender/python/mathutils/mathutils_Vector.c +++ b/source/blender/python/mathutils/mathutils_Vector.c @@ -2387,61 +2387,61 @@ static PyObject *Vector_neg(VectorObject *self) * \{ */ static PySequenceMethods Vector_SeqMethods = { - (lenfunc)Vector_len, /*sq_length*/ - (binaryfunc)NULL, /*sq_concat*/ - (ssizeargfunc)NULL, /*sq_repeat*/ - (ssizeargfunc)Vector_item, /*sq_item*/ - NULL, /*sq_slice(DEPRECATED)*/ - (ssizeobjargproc)Vector_ass_item, /*sq_ass_item*/ - NULL, /*sq_ass_slice(DEPRECATED)*/ - (objobjproc)NULL, /*sq_contains*/ - (binaryfunc)NULL, /*sq_inplace_concat */ - (ssizeargfunc)NULL, /*sq_inplace_repeat */ + /*sq_length*/ (lenfunc)Vector_len, + /*sq_concat*/ NULL, + /*sq_repeat*/ NULL, + /*sq_item*/ (ssizeargfunc)Vector_item, + /*was_sq_slice*/ NULL, /* DEPRECATED. */ + /*sq_ass_item*/ (ssizeobjargproc)Vector_ass_item, + /*was_sq_ass_slice*/ NULL, /* DEPRECATED. */ + /*sq_contains*/ NULL, + /*sq_inplace_concat */ NULL, + /*sq_inplace_repeat */ NULL, }; static PyMappingMethods Vector_AsMapping = { - (lenfunc)Vector_len, - (binaryfunc)Vector_subscript, - (objobjargproc)Vector_ass_subscript, + /*mp_len*/ (lenfunc)Vector_len, + /*mp_subscript*/ (binaryfunc)Vector_subscript, + /*mp_ass_subscript*/ (objobjargproc)Vector_ass_subscript, }; static PyNumberMethods Vector_NumMethods = { - (binaryfunc)Vector_add, /*nb_add*/ - (binaryfunc)Vector_sub, /*nb_subtract*/ - (binaryfunc)Vector_mul, /*nb_multiply*/ - NULL, /*nb_remainder*/ - NULL, /*nb_divmod*/ - NULL, /*nb_power*/ - (unaryfunc)Vector_neg, /*nb_negative*/ - (unaryfunc)Vector_copy, /*tp_positive*/ - (unaryfunc)NULL, /*tp_absolute*/ - (inquiry)NULL, /*tp_bool*/ - (unaryfunc)NULL, /*nb_invert*/ - NULL, /*nb_lshift*/ - (binaryfunc)NULL, /*nb_rshift*/ - NULL, /*nb_and*/ - NULL, /*nb_xor*/ - NULL, /*nb_or*/ - NULL, /*nb_int*/ - NULL, /*nb_reserved*/ - NULL, /*nb_float*/ - Vector_iadd, /*nb_inplace_add*/ - Vector_isub, /*nb_inplace_subtract*/ - Vector_imul, /*nb_inplace_multiply*/ - NULL, /*nb_inplace_remainder*/ - NULL, /*nb_inplace_power*/ - NULL, /*nb_inplace_lshift*/ - NULL, /*nb_inplace_rshift*/ - NULL, /*nb_inplace_and*/ - NULL, /*nb_inplace_xor*/ - NULL, /*nb_inplace_or*/ - NULL, /*nb_floor_divide*/ - Vector_div, /*nb_true_divide*/ - NULL, /*nb_inplace_floor_divide*/ - Vector_idiv, /*nb_inplace_true_divide*/ - NULL, /*nb_index*/ - (binaryfunc)Vector_matmul, /*nb_matrix_multiply*/ - (binaryfunc)Vector_imatmul, /*nb_inplace_matrix_multiply*/ + /*nb_add*/ (binaryfunc)Vector_add, + /*nb_subtract*/ (binaryfunc)Vector_sub, + /*nb_multiply*/ (binaryfunc)Vector_mul, + /*nb_remainder*/ NULL, + /*nb_divmod*/ NULL, + /*nb_power*/ NULL, + /*nb_negative*/ (unaryfunc)Vector_neg, + /*tp_positive*/ (unaryfunc)Vector_copy, + /*tp_absolute*/ NULL, + /*tp_bool*/ NULL, + /*nb_invert*/ NULL, + /*nb_lshift*/ NULL, + /*nb_rshift*/ NULL, + /*nb_and*/ NULL, + /*nb_xor*/ NULL, + /*nb_or*/ NULL, + /*nb_int*/ NULL, + /*nb_reserved*/ NULL, + /*nb_float*/ NULL, + /*nb_inplace_add*/ Vector_iadd, + /*nb_inplace_subtract*/ Vector_isub, + /*nb_inplace_multiply*/ Vector_imul, + /*nb_inplace_remainder*/ NULL, + /*nb_inplace_power*/ NULL, + /*nb_inplace_lshift*/ NULL, + /*nb_inplace_rshift*/ NULL, + /*nb_inplace_and*/ NULL, + /*nb_inplace_xor*/ NULL, + /*nb_inplace_or*/ NULL, + /*nb_floor_divide*/ NULL, + /*nb_true_divide*/ Vector_div, + /*nb_inplace_floor_divide*/ NULL, + /*nb_inplace_true_divide*/ Vector_idiv, + /*nb_index*/ NULL, + /*nb_matrix_multiply*/ (binaryfunc)Vector_matmul, + /*nb_inplace_matrix_multiply*/ (binaryfunc)Vector_imatmul, }; /** \} */ @@ -3183,6 +3183,10 @@ static struct PyMethodDef Vector_methods[] = { * both get sent to Vector_mul and it needs to sort out the order * \{ */ +#ifdef MATH_STANDALONE +# define Vector_str NULL +#endif + PyDoc_STRVAR(vector_doc, ".. class:: Vector(seq)\n" "\n" @@ -3192,88 +3196,59 @@ PyDoc_STRVAR(vector_doc, " :type seq: sequence of numbers\n"); PyTypeObject vector_Type = { PyVarObject_HEAD_INIT(NULL, 0) - /* For printing, in format "<module>.<name>" */ - "Vector", /* char *tp_name; */ - sizeof(VectorObject), /* int tp_basicsize; */ - 0, /* tp_itemsize; For allocation */ - - /* Methods to implement standard operations */ - - (destructor)BaseMathObject_dealloc, /* destructor tp_dealloc; */ - 0, /* tp_vectorcall_offset */ - NULL, /* getattrfunc tp_getattr; */ - NULL, /* setattrfunc tp_setattr; */ - NULL, /* cmpfunc tp_compare; */ - (reprfunc)Vector_repr, /* reprfunc tp_repr; */ - - /* Method suites for standard classes */ - - &Vector_NumMethods, /* PyNumberMethods *tp_as_number; */ - &Vector_SeqMethods, /* PySequenceMethods *tp_as_sequence; */ - &Vector_AsMapping, /* PyMappingMethods *tp_as_mapping; */ - - /* More standard operations (here for binary compatibility) */ + /*tp_name*/ "Vector", + /*tp_basicsize*/ sizeof(VectorObject), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ (destructor)BaseMathObject_dealloc, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ NULL, + /*tp_setattr*/ NULL, + /*tp_as_async*/ NULL, + /*tp_repr*/ (reprfunc)Vector_repr, + /*tp_as_number*/ &Vector_NumMethods, + /*tp_as_sequence*/ &Vector_SeqMethods, + /*tp_as_mapping*/ &Vector_AsMapping, + /*tp_hash*/ (hashfunc)Vector_hash, + /*tp_call*/ NULL, + /*tp_str*/ (reprfunc)Vector_str, + /*tp_getattro*/ NULL, + /*tp_setattro*/ NULL, + /*tp_as_buffer*/ NULL, + /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC, + /*tp_doc*/ vector_doc, + /*tp_traverse*/ (traverseproc)BaseMathObject_traverse, + /*tp_clear*/ (inquiry)BaseMathObject_clear, + /*tp_richcompare*/ (richcmpfunc)Vector_richcmpr, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ NULL, + /*tp_iternext*/ NULL, + /*tp_methods*/ Vector_methods, + /*tp_members*/ NULL, + /*tp_getset*/ Vector_getseters, + /*tp_base*/ NULL, + /*tp_dict*/ NULL, + /*tp_descr_get*/ NULL, + /*tp_descr_set*/ NULL, + /*tp_dictoffset*/ 0, + /*tp_init*/ NULL, + /*tp_alloc*/ NULL, + /*tp_new*/ Vector_new, + /*tp_free*/ NULL, + /*tp_is_gc*/ (inquiry)BaseMathObject_is_gc, + /*tp_bases*/ NULL, + /*tp_mro*/ NULL, + /*tp_cache*/ NULL, + /*tp_subclasses*/ NULL, + /*tp_weaklist*/ NULL, + /*tp_del*/ NULL, + /*tp_version_tag*/ 0, + /*tp_finalize*/ NULL, + /*tp_vectorcall*/ NULL, +}; - (hashfunc)Vector_hash, /* hashfunc tp_hash; */ - NULL, /* ternaryfunc tp_call; */ -#ifndef MATH_STANDALONE - (reprfunc)Vector_str, /* reprfunc tp_str; */ -#else - NULL, /* reprfunc tp_str; */ +#ifdef MATH_STANDALONE +# undef Vector_str NULL #endif - NULL, /* getattrofunc tp_getattro; */ - NULL, /* setattrofunc tp_setattro; */ - - /* Functions to access object as input/output buffer */ - NULL, /* PyBufferProcs *tp_as_buffer; */ - - /*** Flags to define presence of optional/expanded features ***/ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC, - vector_doc, /* char *tp_doc; Documentation string */ - /*** Assigned meaning in release 2.0 ***/ - - /* call function for all accessible objects */ - (traverseproc)BaseMathObject_traverse, /* tp_traverse */ - - /* delete references to contained objects */ - (inquiry)BaseMathObject_clear, /* tp_clear */ - - /*** Assigned meaning in release 2.1 ***/ - /*** rich comparisons ***/ - (richcmpfunc)Vector_richcmpr, /* richcmpfunc tp_richcompare; */ - - /*** weak reference enabler ***/ - 0, /* long tp_weaklistoffset; */ - - /*** Added in release 2.2 ***/ - /* Iterators */ - NULL, /* getiterfunc tp_iter; */ - NULL, /* iternextfunc tp_iternext; */ - - /*** Attribute descriptor and subclassing stuff ***/ - Vector_methods, /* struct PyMethodDef *tp_methods; */ - NULL, /* struct PyMemberDef *tp_members; */ - Vector_getseters, /* struct PyGetSetDef *tp_getset; */ - NULL, /* struct _typeobject *tp_base; */ - NULL, /* PyObject *tp_dict; */ - NULL, /* descrgetfunc tp_descr_get; */ - NULL, /* descrsetfunc tp_descr_set; */ - 0, /* long tp_dictoffset; */ - NULL, /* initproc tp_init; */ - NULL, /* allocfunc tp_alloc; */ - Vector_new, /* newfunc tp_new; */ - /* Low-level free-memory routine */ - NULL, /* freefunc tp_free; */ - /* For PyObject_IS_GC */ - (inquiry)BaseMathObject_is_gc, /* inquiry tp_is_gc; */ - NULL, /* PyObject *tp_bases; */ - /* method resolution order */ - NULL, /* PyObject *tp_mro; */ - NULL, /* PyObject *tp_cache; */ - NULL, /* PyObject *tp_subclasses; */ - NULL, /* PyObject *tp_weaklist; */ - NULL, -}; /** \} */ diff --git a/source/blender/python/mathutils/mathutils_bvhtree.c b/source/blender/python/mathutils/mathutils_bvhtree.c index 4bdb1adcdde..11f8d57397e 100644 --- a/source/blender/python/mathutils/mathutils_bvhtree.c +++ b/source/blender/python/mathutils/mathutils_bvhtree.c @@ -1235,52 +1235,55 @@ static PyMethodDef py_bvhtree_methods[] = { }; PyTypeObject PyBVHTree_Type = { - PyVarObject_HEAD_INIT(NULL, 0) "BVHTree", /* tp_name */ - sizeof(PyBVHTree), /* tp_basicsize */ - 0, /* tp_itemsize */ - /* methods */ - (destructor)py_bvhtree__tp_dealloc, /* tp_dealloc */ - (printfunc)NULL, /* tp_print */ - NULL, /* tp_getattr */ - NULL, /* tp_setattr */ - NULL, /* tp_compare */ - NULL, /* tp_repr */ - NULL, /* tp_as_number */ - NULL, /* tp_as_sequence */ - NULL, /* tp_as_mapping */ - NULL, /* tp_hash */ - NULL, /* tp_call */ - NULL, /* tp_str */ - NULL, /* tp_getattro */ - NULL, /* tp_setattro */ - NULL, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ - NULL, /* Documentation string */ - NULL, /* tp_traverse */ - NULL, /* tp_clear */ - NULL, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - NULL, /* tp_iter */ - NULL, /* tp_iternext */ - py_bvhtree_methods, /* tp_methods */ - NULL, /* tp_members */ - NULL, /* tp_getset */ - NULL, /* tp_base */ - NULL, /* tp_dict */ - NULL, /* tp_descr_get */ - NULL, /* tp_descr_set */ - 0, /* tp_dictoffset */ - NULL, /* tp_init */ - (allocfunc)PyType_GenericAlloc, /* tp_alloc */ - (newfunc)PyType_GenericNew, /* tp_new */ - (freefunc)0, /* tp_free */ - NULL, /* tp_is_gc */ - NULL, /* tp_bases */ - NULL, /* tp_mro */ - NULL, /* tp_cache */ - NULL, /* tp_subclasses */ - NULL, /* tp_weaklist */ - (destructor)NULL, /* tp_del */ + PyVarObject_HEAD_INIT(NULL, 0) + /*tp_name*/ "BVHTree", + /*tp_basicsize*/ sizeof(PyBVHTree), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ (destructor)py_bvhtree__tp_dealloc, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ NULL, + /*tp_setattr*/ NULL, + /*tp_as_async*/ NULL, + /*tp_repr*/ NULL, + /*tp_as_number*/ NULL, + /*tp_as_sequence*/ NULL, + /*tp_as_mapping*/ NULL, + /*tp_hash*/ NULL, + /*tp_call*/ NULL, + /*tp_str*/ NULL, + /*tp_getattro*/ NULL, + /*tp_setattro*/ NULL, + /*tp_as_buffer*/ NULL, + /*tp_flags*/ Py_TPFLAGS_DEFAULT, + /*tp_doc*/ NULL, + /*tp_traverse*/ NULL, + /*tp_clear*/ NULL, + /*tp_richcompare*/ NULL, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ NULL, + /*tp_iternext*/ NULL, + /*tp_methods*/ py_bvhtree_methods, + /*tp_members*/ NULL, + /*tp_getset*/ NULL, + /*tp_base*/ NULL, + /*tp_dict*/ NULL, + /*tp_descr_get*/ NULL, + /*tp_descr_set*/ NULL, + /*tp_dictoffset*/ 0, + /*tp_init*/ NULL, + /*tp_alloc*/ (allocfunc)PyType_GenericAlloc, + /*tp_new*/ (newfunc)PyType_GenericNew, + /*tp_free*/ (freefunc)0, + /*tp_is_gc*/ NULL, + /*tp_bases*/ NULL, + /*tp_mro*/ NULL, + /*tp_cache*/ NULL, + /*tp_subclasses*/ NULL, + /*tp_weaklist*/ NULL, + /*tp_del*/ (destructor)NULL, + /*tp_version_tag*/ 0, + /*tp_finalize*/ NULL, + /*tp_vectorcall*/ NULL, }; /* -------------------------------------------------------------------- */ diff --git a/source/blender/python/mathutils/mathutils_kdtree.c b/source/blender/python/mathutils/mathutils_kdtree.c index f5a27c6f90f..02d9482b575 100644 --- a/source/blender/python/mathutils/mathutils_kdtree.c +++ b/source/blender/python/mathutils/mathutils_kdtree.c @@ -372,53 +372,57 @@ PyDoc_STRVAR(py_KDtree_doc, "\n" " :class:`KDTree.balance` must have been called before using any of the ``find`` " "methods.\n"); + PyTypeObject PyKDTree_Type = { - PyVarObject_HEAD_INIT(NULL, 0) "KDTree", /* tp_name */ - sizeof(PyKDTree), /* tp_basicsize */ - 0, /* tp_itemsize */ - /* methods */ - (destructor)PyKDTree__tp_dealloc, /* tp_dealloc */ - (printfunc)NULL, /* tp_print */ - NULL, /* tp_getattr */ - NULL, /* tp_setattr */ - NULL, /* tp_compare */ - NULL, /* tp_repr */ - NULL, /* tp_as_number */ - NULL, /* tp_as_sequence */ - NULL, /* tp_as_mapping */ - NULL, /* tp_hash */ - NULL, /* tp_call */ - NULL, /* tp_str */ - NULL, /* tp_getattro */ - NULL, /* tp_setattro */ - NULL, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ - py_KDtree_doc, /* Documentation string */ - NULL, /* tp_traverse */ - NULL, /* tp_clear */ - NULL, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - NULL, /* tp_iter */ - NULL, /* tp_iternext */ - (struct PyMethodDef *)PyKDTree_methods, /* tp_methods */ - NULL, /* tp_members */ - NULL, /* tp_getset */ - NULL, /* tp_base */ - NULL, /* tp_dict */ - NULL, /* tp_descr_get */ - NULL, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)PyKDTree__tp_init, /* tp_init */ - (allocfunc)PyType_GenericAlloc, /* tp_alloc */ - (newfunc)PyType_GenericNew, /* tp_new */ - (freefunc)0, /* tp_free */ - NULL, /* tp_is_gc */ - NULL, /* tp_bases */ - NULL, /* tp_mro */ - NULL, /* tp_cache */ - NULL, /* tp_subclasses */ - NULL, /* tp_weaklist */ - (destructor)NULL, /* tp_del */ + PyVarObject_HEAD_INIT(NULL, 0) + /*tp_name*/ "KDTree", + /*tp_basicsize*/ sizeof(PyKDTree), + /*tp_itemsize*/ 0, + /*tp_dealloc*/ (destructor)PyKDTree__tp_dealloc, + /*tp_vectorcall_offset*/ 0, + /*tp_getattr*/ NULL, + /*tp_setattr*/ NULL, + /*tp_as_async*/ NULL, + /*tp_repr*/ NULL, + /*tp_as_number*/ NULL, + /*tp_as_sequence*/ NULL, + /*tp_as_mapping*/ NULL, + /*tp_hash*/ NULL, + /*tp_call*/ NULL, + /*tp_str*/ NULL, + /*tp_getattro*/ NULL, + /*tp_setattro*/ NULL, + /*tp_as_buffer*/ NULL, + /*tp_flags*/ Py_TPFLAGS_DEFAULT, + /*Documentation string*/ py_KDtree_doc, + /*tp_traverse*/ NULL, + /*tp_clear*/ NULL, + /*tp_richcompare*/ NULL, + /*tp_weaklistoffset*/ 0, + /*tp_iter*/ NULL, + /*tp_iternext*/ NULL, + /*tp_methods*/ (struct PyMethodDef *)PyKDTree_methods, + /*tp_members*/ NULL, + /*tp_getset*/ NULL, + /*tp_base*/ NULL, + /*tp_dict*/ NULL, + /*tp_descr_get*/ NULL, + /*tp_descr_set*/ NULL, + /*tp_dictoffset*/ 0, + /*tp_init*/ (initproc)PyKDTree__tp_init, + /*tp_alloc*/ (allocfunc)PyType_GenericAlloc, + /*tp_new*/ (newfunc)PyType_GenericNew, + /*tp_free*/ (freefunc)0, + /*tp_is_gc*/ NULL, + /*tp_bases*/ NULL, + /*tp_mro*/ NULL, + /*tp_cache*/ NULL, + /*tp_subclasses*/ NULL, + /*tp_weaklist*/ NULL, + /*tp_del*/ (destructor)NULL, + /*tp_version_tag*/ 0, + /*tp_finalize*/ NULL, + /*tp_vectorcall*/ NULL, }; PyDoc_STRVAR(py_kdtree_doc, "Generic 3-dimensional kd-tree to perform spatial searches."); diff --git a/source/blender/python/mathutils/mathutils_noise.c b/source/blender/python/mathutils/mathutils_noise.c index 3a3297f27f7..3c564142160 100644 --- a/source/blender/python/mathutils/mathutils_noise.c +++ b/source/blender/python/mathutils/mathutils_noise.c @@ -40,7 +40,7 @@ * * Any feedback is very welcome. * http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html - * email: m-mat @ math.sci.hiroshima-u.ac.jp (remove space). */ + * email: `m-mat @ math.sci.hiroshima-u.ac.jp` (remove space). */ /* Period parameters */ #define N 624 @@ -120,7 +120,7 @@ static void setRndSeed(int seed) } } -/* float number in range [0, 1) using the mersenne twister rng */ +/* Float number in range [0, 1) using the mersenne twister random number generator. */ static float frand(void) { ulong y; |