Cleanup: use C++ compatible struct declarations for Python API

Also add m_base & ob_base comments.
This commit is contained in:
Campbell Barton
2023-07-16 17:43:31 +10:00
parent ee5501750c
commit d594954bf2
207 changed files with 1116 additions and 388 deletions

View File

@@ -335,13 +335,55 @@ PyDoc_STRVAR(pygpu_vertbuf__tp_doc,
" :arg len: Amount of vertices that will fit into this buffer.\n"
" :type len: int\n");
PyTypeObject BPyGPUVertBuf_Type = {
PyVarObject_HEAD_INIT(NULL, 0).tp_name = "GPUVertBuf",
.tp_basicsize = sizeof(BPyGPUVertBuf),
.tp_dealloc = (destructor)pygpu_vertbuf__tp_dealloc,
.tp_flags = Py_TPFLAGS_DEFAULT,
.tp_doc = pygpu_vertbuf__tp_doc,
.tp_methods = pygpu_vertbuf__tp_methods,
.tp_new = pygpu_vertbuf__tp_new,
/*ob_base*/ PyVarObject_HEAD_INIT(NULL, 0)
/*tp_name*/ "GPUVertBuf",
/*tp_basicsize*/ sizeof(BPyGPUVertBuf),
/*tp_itemsize*/ 0,
/*tp_dealloc*/ (destructor)pygpu_vertbuf__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*/ pygpu_vertbuf__tp_doc,
/*tp_traverse*/ NULL,
/*tp_clear*/ NULL,
/*tp_richcompare*/ NULL,
/*tp_weaklistoffset*/ 0,
/*tp_iter*/ NULL,
/*tp_iternext*/ NULL,
/*tp_methods*/ pygpu_vertbuf__tp_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*/ pygpu_vertbuf__tp_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,
};
/** \} */