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

@@ -186,12 +186,55 @@ PyDoc_STRVAR(pygpu_IndexBuf__tp_doc,
" Optionally the sequence can support the buffer protocol.\n"
" :type seq: 1D or 2D sequence\n");
PyTypeObject BPyGPUIndexBuf_Type = {
PyVarObject_HEAD_INIT(NULL, 0).tp_name = "GPUIndexBuf",
.tp_basicsize = sizeof(BPyGPUIndexBuf),
.tp_dealloc = (destructor)pygpu_IndexBuf__tp_dealloc,
.tp_flags = Py_TPFLAGS_DEFAULT,
.tp_doc = pygpu_IndexBuf__tp_doc,
.tp_new = pygpu_IndexBuf__tp_new,
/*ob_base*/ PyVarObject_HEAD_INIT(NULL, 0)
/*tp_name*/ "GPUIndexBuf",
/*tp_basicsize*/ sizeof(BPyGPUIndexBuf),
/*tp_itemsize*/ 0,
/*tp_dealloc*/ (destructor)pygpu_IndexBuf__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_IndexBuf__tp_doc,
/*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*/ pygpu_IndexBuf__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,
};
/** \} */