Cleanup: PyMethodDef formatting

Missed these changes in [0].

Also replace designated initializers in some C code, as it's not used
often and would need to be removed when converting to C++.

[0] e555ede626
This commit is contained in:
2022-11-08 11:13:58 +11:00
parent 3e71220efc
commit 4eb9322eda
38 changed files with 326 additions and 256 deletions

View File

@@ -32,8 +32,14 @@ PyDoc_STRVAR(pygpu_doc,
"Some higher level functions can be found in the `gpu_extras` module.");
static struct PyModuleDef pygpu_module_def = {
PyModuleDef_HEAD_INIT,
.m_name = "gpu",
.m_doc = pygpu_doc,
/*m_name*/ "gpu",
/*m_doc*/ pygpu_doc,
/*m_size*/ 0,
/*m_methods*/ NULL,
/*m_slots*/ NULL,
/*m_traverse*/ NULL,
/*m_clear*/ NULL,
/*m_free*/ NULL,
};
PyObject *BPyInit_gpu(void)

View File

@@ -301,9 +301,14 @@ static struct PyMethodDef pygpu_capabilities__tp_methods[] = {
PyDoc_STRVAR(pygpu_capabilities__tp_doc, "This module provides access to the GPU capabilities.");
static PyModuleDef pygpu_capabilities_module_def = {
PyModuleDef_HEAD_INIT,
.m_name = "gpu.capabilities",
.m_doc = pygpu_capabilities__tp_doc,
.m_methods = pygpu_capabilities__tp_methods,
/*m_name*/ "gpu.capabilities",
/*m_doc*/ pygpu_capabilities__tp_doc,
/*m_size*/ 0,
/*m_methods*/ pygpu_capabilities__tp_methods,
/*m_slots*/ NULL,
/*m_traverse*/ NULL,
/*m_clear*/ NULL,
/*m_free*/ NULL,
};
PyObject *bpygpu_capabilities_init(void)

View File

@@ -528,9 +528,14 @@ static struct PyMethodDef pygpu_matrix__tp_methods[] = {
PyDoc_STRVAR(pygpu_matrix__tp_doc, "This module provides access to the matrix stack.");
static PyModuleDef pygpu_matrix_module_def = {
PyModuleDef_HEAD_INIT,
.m_name = "gpu.matrix",
.m_doc = pygpu_matrix__tp_doc,
.m_methods = pygpu_matrix__tp_methods,
/*m_name*/ "gpu.matrix",
/*m_doc*/ pygpu_matrix__tp_doc,
/*m_size*/ 0,
/*m_methods*/ pygpu_matrix__tp_methods,
/*m_slots*/ NULL,
/*m_traverse*/ NULL,
/*m_clear*/ NULL,
/*m_free*/ NULL,
};
PyObject *bpygpu_matrix_init(void)

View File

@@ -141,9 +141,14 @@ static struct PyMethodDef pygpu_platform__tp_methods[] = {
PyDoc_STRVAR(pygpu_platform__tp_doc, "This module provides access to GPU Platform definitions.");
static PyModuleDef pygpu_platform_module_def = {
PyModuleDef_HEAD_INIT,
.m_name = "gpu.platform",
.m_doc = pygpu_platform__tp_doc,
.m_methods = pygpu_platform__tp_methods,
/*m_name*/ "gpu.platform",
/*m_doc*/ pygpu_platform__tp_doc,
/*m_size*/ 0,
/*m_methods*/ pygpu_platform__tp_methods,
/*m_slots*/ NULL,
/*m_traverse*/ NULL,
/*m_clear*/ NULL,
/*m_free*/ NULL,
};
PyObject *bpygpu_platform_init(void)

View File

@@ -58,9 +58,14 @@ static struct PyMethodDef pygpu_select__tp_methods[] = {
PyDoc_STRVAR(pygpu_select__tp_doc, "This module provides access to selection.");
static PyModuleDef pygpu_select_module_def = {
PyModuleDef_HEAD_INIT,
.m_name = "gpu.select",
.m_doc = pygpu_select__tp_doc,
.m_methods = pygpu_select__tp_methods,
/*m_name*/ "gpu.select",
/*m_doc*/ pygpu_select__tp_doc,
/*m_size*/ 0,
/*m_methods*/ pygpu_select__tp_methods,
/*m_slots*/ NULL,
/*m_traverse*/ NULL,
/*m_clear*/ NULL,
/*m_free*/ NULL,
};
PyObject *bpygpu_select_init(void)

View File

@@ -923,9 +923,14 @@ PyDoc_STRVAR(pygpu_shader_module__tp_doc,
"\n" PYDOC_BUILTIN_SHADER_DESCRIPTION);
static PyModuleDef pygpu_shader_module_def = {
PyModuleDef_HEAD_INIT,
.m_name = "gpu.shader",
.m_doc = pygpu_shader_module__tp_doc,
.m_methods = pygpu_shader_module__tp_methods,
/*m_name*/ "gpu.shader",
/*m_doc*/ pygpu_shader_module__tp_doc,
/*m_size*/ 0,
/*m_methods*/ pygpu_shader_module__tp_methods,
/*m_slots*/ NULL,
/*m_traverse*/ NULL,
/*m_clear*/ NULL,
/*m_free*/ NULL,
};
/** \} */

View File

@@ -431,9 +431,14 @@ static struct PyMethodDef pygpu_state__tp_methods[] = {
PyDoc_STRVAR(pygpu_state__tp_doc, "This module provides access to the gpu state.");
static PyModuleDef pygpu_state_module_def = {
PyModuleDef_HEAD_INIT,
.m_name = "gpu.state",
.m_doc = pygpu_state__tp_doc,
.m_methods = pygpu_state__tp_methods,
/*m_name*/ "gpu.state",
/*m_doc*/ pygpu_state__tp_doc,
/*m_size*/ 0,
/*m_methods*/ pygpu_state__tp_methods,
/*m_slots*/ NULL,
/*m_traverse*/ NULL,
/*m_clear*/ NULL,
/*m_free*/ NULL,
};
PyObject *bpygpu_state_init(void)

View File

@@ -565,9 +565,14 @@ static struct PyMethodDef pygpu_texture__m_methods[] = {
PyDoc_STRVAR(pygpu_texture__m_doc, "This module provides utils for textures.");
static PyModuleDef pygpu_texture_module_def = {
PyModuleDef_HEAD_INIT,
.m_name = "gpu.texture",
.m_doc = pygpu_texture__m_doc,
.m_methods = pygpu_texture__m_methods,
/*m_name*/ "gpu.texture",
/*m_doc*/ pygpu_texture__m_doc,
/*m_size*/ 0,
/*m_methods*/ pygpu_texture__m_methods,
/*m_slots*/ NULL,
/*m_traverse*/ NULL,
/*m_clear*/ NULL,
/*m_free*/ NULL,
};
/** \} */

View File

@@ -19,7 +19,14 @@
static struct PyModuleDef pygpu_types_module_def = {
PyModuleDef_HEAD_INIT,
.m_name = "gpu.types",
/*m_name*/ "gpu.types",
/*m_doc*/ NULL,
/*m_size*/ 0,
/*m_methods*/ NULL,
/*m_slots*/ NULL,
/*m_traverse*/ NULL,
/*m_clear*/ NULL,
/*m_free*/ NULL,
};
PyObject *bpygpu_types_init(void)