[Bf-blender-cvs] [4eb9322edae] master: Cleanup: PyMethodDef formatting

Campbell Barton noreply at git.blender.org
Tue Nov 8 02:18:05 CET 2022


Commit: 4eb9322edae4ded7caba1b12379a0194225d87cd
Author: Campbell Barton
Date:   Tue Nov 8 11:13:58 2022 +1100
Branches: master
https://developer.blender.org/rB4eb9322edae4ded7caba1b12379a0194225d87cd

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] e555ede626dade2c9b6449ec7dcdda22b2585fd4

===================================================================

M	source/blender/freestyle/intern/python/BPy_ContextFunctions.cpp
M	source/blender/freestyle/intern/python/BPy_Freestyle.cpp
M	source/blender/freestyle/intern/python/BPy_IntegrationType.cpp
M	source/blender/python/bmesh/bmesh_py_api.c
M	source/blender/python/bmesh/bmesh_py_geometry.c
M	source/blender/python/bmesh/bmesh_py_ops.c
M	source/blender/python/bmesh/bmesh_py_types.c
M	source/blender/python/bmesh/bmesh_py_utils.c
M	source/blender/python/generic/bgl.c
M	source/blender/python/generic/bl_math_py_api.c
M	source/blender/python/generic/blf_py_api.c
M	source/blender/python/generic/idprop_py_api.c
M	source/blender/python/generic/imbuf_py_api.c
M	source/blender/python/gpu/gpu_py_api.c
M	source/blender/python/gpu/gpu_py_capabilities.c
M	source/blender/python/gpu/gpu_py_matrix.c
M	source/blender/python/gpu/gpu_py_platform.c
M	source/blender/python/gpu/gpu_py_select.c
M	source/blender/python/gpu/gpu_py_shader.c
M	source/blender/python/gpu/gpu_py_state.c
M	source/blender/python/gpu/gpu_py_texture.c
M	source/blender/python/gpu/gpu_py_types.c
M	source/blender/python/intern/bpy_app_icons.c
M	source/blender/python/intern/bpy_app_timers.c
M	source/blender/python/intern/bpy_interface.c
M	source/blender/python/intern/bpy_msgbus.c
M	source/blender/python/intern/bpy_operator.c
M	source/blender/python/intern/bpy_path.c
M	source/blender/python/intern/bpy_props.c
M	source/blender/python/intern/bpy_rna.c
M	source/blender/python/intern/bpy_utils_previews.c
M	source/blender/python/intern/bpy_utils_units.c
M	source/blender/python/mathutils/mathutils.c
M	source/blender/python/mathutils/mathutils_bvhtree.c
M	source/blender/python/mathutils/mathutils_geometry.c
M	source/blender/python/mathutils/mathutils_interpolate.c
M	source/blender/python/mathutils/mathutils_kdtree.c
M	source/blender/python/mathutils/mathutils_noise.c

===================================================================

diff --git a/source/blender/freestyle/intern/python/BPy_ContextFunctions.cpp b/source/blender/freestyle/intern/python/BPy_ContextFunctions.cpp
index d79c2f4d9b0..a4b83b840f3 100644
--- a/source/blender/freestyle/intern/python/BPy_ContextFunctions.cpp
+++ b/source/blender/freestyle/intern/python/BPy_ContextFunctions.cpp
@@ -280,10 +280,14 @@ static PyMethodDef module_functions[] = {
 
 static PyModuleDef module_definition = {
     PyModuleDef_HEAD_INIT,
-    "Freestyle.ContextFunctions",
-    module_docstring,
-    -1,
-    module_functions,
+    /*m_name*/ "Freestyle.ContextFunctions",
+    /*m_doc*/ module_docstring,
+    /*m_size*/ -1,
+    /*m_methods*/ module_functions,
+    /*m_slots*/ NULL,
+    /*m_traverse*/ NULL,
+    /*m_clear*/ NULL,
+    /*m_free*/ NULL,
 };
 
 //------------------- MODULE INITIALIZATION --------------------------------
diff --git a/source/blender/freestyle/intern/python/BPy_Freestyle.cpp b/source/blender/freestyle/intern/python/BPy_Freestyle.cpp
index 237f1802026..f99e66c822d 100644
--- a/source/blender/freestyle/intern/python/BPy_Freestyle.cpp
+++ b/source/blender/freestyle/intern/python/BPy_Freestyle.cpp
@@ -509,10 +509,14 @@ static PyMethodDef module_functions[] = {
 
 static PyModuleDef module_definition = {
     PyModuleDef_HEAD_INIT,
-    "_freestyle",
-    module_docstring,
-    -1,
-    module_functions,
+    /*m_name*/ "_freestyle",
+    /*m_doc*/ module_docstring,
+    /*m_size*/ -1,
+    /*m_methods*/ module_functions,
+    /*m_slots*/ NULL,
+    /*m_traverse*/ NULL,
+    /*m_clear*/ NULL,
+    /*m_free*/ NULL,
 };
 
 //-------------------MODULE INITIALIZATION--------------------------------
diff --git a/source/blender/freestyle/intern/python/BPy_IntegrationType.cpp b/source/blender/freestyle/intern/python/BPy_IntegrationType.cpp
index dfebfd3ff73..c862b226271 100644
--- a/source/blender/freestyle/intern/python/BPy_IntegrationType.cpp
+++ b/source/blender/freestyle/intern/python/BPy_IntegrationType.cpp
@@ -112,10 +112,14 @@ static PyMethodDef module_functions[] = {
 
 static PyModuleDef module_definition = {
     PyModuleDef_HEAD_INIT,
-    "Freestyle.Integrator",
-    module_docstring,
-    -1,
-    module_functions,
+    /*m_name*/ "Freestyle.Integrator",
+    /*m_doc*/ module_docstring,
+    /*m_size*/ -1,
+    /*m_methods*/ module_functions,
+    /*m_slots*/ NULL,
+    /*m_traverse*/ NULL,
+    /*m_clear*/ NULL,
+    /*m_free*/ NULL,
 };
 
 /*-----------------------BPy_IntegrationType type definition ------------------------------*/
diff --git a/source/blender/python/bmesh/bmesh_py_api.c b/source/blender/python/bmesh/bmesh_py_api.c
index 2e6d1698da9..cc413ad7924 100644
--- a/source/blender/python/bmesh/bmesh_py_api.c
+++ b/source/blender/python/bmesh/bmesh_py_api.c
@@ -156,14 +156,14 @@ PyDoc_STRVAR(BPy_BM_doc,
              ".. include:: include__bmesh.rst\n");
 static struct PyModuleDef BPy_BM_module_def = {
     PyModuleDef_HEAD_INIT,
-    "bmesh",        /* m_name */
-    BPy_BM_doc,     /* m_doc */
-    0,              /* m_size */
-    BPy_BM_methods, /* m_methods */
-    NULL,           /* m_slots */
-    NULL,           /* m_traverse */
-    NULL,           /* m_clear */
-    NULL,           /* m_free */
+    /*m_name*/ "bmesh",
+    /*m_doc*/ BPy_BM_doc,
+    /*m_size*/ 0,
+    /*m_methods*/ BPy_BM_methods,
+    /*m_slots*/ NULL,
+    /*m_traverse*/ NULL,
+    /*m_clear*/ NULL,
+    /*m_free*/ NULL,
 };
 
 PyObject *BPyInit_bmesh(void)
diff --git a/source/blender/python/bmesh/bmesh_py_geometry.c b/source/blender/python/bmesh/bmesh_py_geometry.c
index f2af8599807..aed197bc353 100644
--- a/source/blender/python/bmesh/bmesh_py_geometry.c
+++ b/source/blender/python/bmesh/bmesh_py_geometry.c
@@ -62,14 +62,14 @@ PyDoc_STRVAR(BPy_BM_utils_doc,
              "This module provides access to bmesh geometry evaluation functions.");
 static struct PyModuleDef BPy_BM_geometry_module_def = {
     PyModuleDef_HEAD_INIT,
-    "bmesh.geometry",        /* m_name */
-    BPy_BM_utils_doc,        /* m_doc */
-    0,                       /* m_size */
-    BPy_BM_geometry_methods, /* m_methods */
-    NULL,                    /* m_slots */
-    NULL,                    /* m_traverse */
-    NULL,                    /* m_clear */
-    NULL,                    /* m_free */
+    /*m_name*/ "bmesh.geometry",
+    /*m_doc*/ BPy_BM_utils_doc,
+    /*m_size*/ 0,
+    /*m_methods*/ BPy_BM_geometry_methods,
+    /*m_slots*/ NULL,
+    /*m_traverse*/ NULL,
+    /*m_clear*/ NULL,
+    /*m_free*/ NULL,
 };
 
 PyObject *BPyInit_bmesh_geometry(void)
diff --git a/source/blender/python/bmesh/bmesh_py_ops.c b/source/blender/python/bmesh/bmesh_py_ops.c
index 35f87172d78..e5ca170599f 100644
--- a/source/blender/python/bmesh/bmesh_py_ops.c
+++ b/source/blender/python/bmesh/bmesh_py_ops.c
@@ -235,14 +235,14 @@ static struct PyMethodDef BPy_BM_ops_methods[] = {
 PyDoc_STRVAR(BPy_BM_ops_doc, "Access to BMesh operators");
 static struct PyModuleDef BPy_BM_ops_module_def = {
     PyModuleDef_HEAD_INIT,
-    "bmesh.ops",        /* m_name */
-    BPy_BM_ops_doc,     /* m_doc */
-    0,                  /* m_size */
-    BPy_BM_ops_methods, /* m_methods */
-    NULL,               /* m_slots */
-    NULL,               /* m_traverse */
-    NULL,               /* m_clear */
-    NULL,               /* m_free */
+    /*m_name*/ "bmesh.ops",
+    /*m_doc*/ BPy_BM_ops_doc,
+    /*m_size*/ 0,
+    /*m_methods*/ BPy_BM_ops_methods,
+    /*m_slots*/ NULL,
+    /*m_traverse*/ NULL,
+    /*m_clear*/ NULL,
+    /*m_free*/ NULL,
 };
 
 PyObject *BPyInit_bmesh_ops(void)
diff --git a/source/blender/python/bmesh/bmesh_py_types.c b/source/blender/python/bmesh/bmesh_py_types.c
index cf20e1349ee..fab23d06ab3 100644
--- a/source/blender/python/bmesh/bmesh_py_types.c
+++ b/source/blender/python/bmesh/bmesh_py_types.c
@@ -3735,14 +3735,14 @@ void BPy_BM_init_types(void)
 
 static struct PyModuleDef BPy_BM_types_module_def = {
     PyModuleDef_HEAD_INIT,
-    "bmesh.types", /* m_name */
-    NULL,          /* m_doc */
-    0,             /* m_size */
-    NULL,          /* m_methods */
-    NULL,          /* m_slots */
-    NULL,          /* m_traverse */
-    NULL,          /* m_clear */
-    NULL,          /* m_free */
+    /*m_name*/ "bmesh.types",
+    /*m_doc*/ NULL,
+    /*m_size*/ 0,
+    /*m_methods*/ NULL,
+    /*m_slots*/ NULL,
+    /*m_traverse*/ NULL,
+    /*m_clear*/ NULL,
+    /*m_free*/ NULL,
 };
 
 PyObject *BPyInit_bmesh_types(void)
diff --git a/source/blender/python/bmesh/bmesh_py_utils.c b/source/blender/python/bmesh/bmesh_py_utils.c
index 6630eb4924e..5eca6f854f6 100644
--- a/source/blender/python/bmesh/bmesh_py_utils.c
+++ b/source/blender/python/bmesh/bmesh_py_utils.c
@@ -818,14 +818,14 @@ static struct PyMethodDef BPy_BM_utils_methods[] = {
 PyDoc_STRVAR(BPy_BM_utils_doc, "This module provides access to blenders bmesh data structures.");
 static struct PyModuleDef BPy_BM_utils_module_def = {
     PyModuleDef_HEAD_INIT,
-    "bmesh.utils",        /* m_name */
-    BPy_BM_utils_doc,     /* m_doc */
-    0,                    /* m_size */
-    BPy_BM_utils_methods, /* m_methods */
-    NULL,                 /* m_slots */
-    NULL,                 /* m_traverse */
-    NULL,                 /* m_clear */
-    NULL,                 /* m_free */
+    /*m_name*/ "bmesh.utils",
+    /*m_doc*/ BPy_BM_utils_doc,
+    /*m_size*/ 0,
+    /*m_methods*/ BPy_BM_utils_methods,
+    /*m_slots*/ NULL,
+    /*m_traverse*/ NULL,
+    /*m_clear*/ NULL,
+    /*m_free*/ NULL,
 };
 
 PyObject *BPyInit_bmesh_utils(void)
diff --git a/source/blender/python/generic/bgl.c b/source/blender/python/generic/bgl.c
index a03e0ab31eb..9c4212ebad4 100644
--- a/source/blender/python/generic/bgl.c
+++ b/source/blender/python/generic/bgl.c
@@ -1376,14 +1376,14 @@ BGL_Wrap(TexImage3DMultisample,
 
 static struct PyModuleDef BGL_module_def = {
     PyModuleDef_HEAD_INIT,
-    "bgl", /* m_name */
-    NULL,  /* m_doc */
-    0,     /* m_size */
-    NULL,  /* m_methods */
-    NULL,  /* m_slots */
-    NULL,  /* m_traverse */
-    NULL,  /* m_clear */
-    NULL,  /* m_free */
+    /*m_name*/ "bgl",
+    /*m_doc*/ NULL,
+    /*m_size*/ 0,
+    /*m_methods*/ NULL,
+    /*m_slots*/ NULL,
+    /*m_traverse*/ NULL,
+    /*m_clear*/ NULL,
+    /*m_free*/ NULL,
 };
 
 static void py_module_dict_add_int(PyObject *dict, const char *name, int value)
diff --git a/source/blender/python/generic/bl_math_py_api.c b/source/blender/python/generic/bl_math_py_api.c
index 19958a99df9..47a1687d20b 100644
--- a/source/blender/python/generic/bl_math_py_api.c
+++ b/source/blender/python/generic/bl_math_py_api.c
@@ -129,14 +129,14 @@ static PyMethodDef M_bl_math_methods[] = {
 
 static struct PyModuleDef M_bl_math_module_def = {
     PyModuleDef_HEAD_INIT,
-    "bl_math",         /* m_name */
-    M_bl_math_doc,     /* m_doc */
-    0,                 /* m_size */
-    M_bl_math_methods, /* m_methods */
-    NULL,              /* m_slots */
-    NULL,              /* m_traverse */
-    NULL,              /* m_clear */
-    NULL,              /* m_free */
+    /*m_name*/ "bl_math",
+    /*m_doc*/ M_bl_math_doc,
+    /*m_size*/ 0,
+    /*m_methods*/ M_bl_math_methods,
+    /*m_slots*/ NULL,
+    /*m_traverse*/ NULL,
+    /*m_clear*/ NULL,
+    /*m_free*/ NULL,
 };
 
 PyMODINIT_FUNC BPyInit_bl_math(void)
diff --git a/source/blender/python/generic/blf_py_api.c b/source/blender/python/generic/blf_py_api.c
index 979a581463e..2b7c5ed7e55 100644
--- a/source/blender/python/generic/blf_py_api.c
+++ b/source/blender/python/generic/blf_py_api.c
@@ -466,14 +466,14 @@ static PyMethodDef BLF_methods[] = {
 PyDoc_STRVAR(BLF_doc, "This module provides access to Blender's text drawing functions.");
 static struct PyModuleDef BLF_module_def = {
     PyModuleDef_HEAD_INIT,
-    "blf",       /* m_name */
-    BLF_doc,     /* m_doc */
-    0,           /* m_size */
-    BLF_methods, /* m_methods */
-    NULL,        /* m_slots */
-    NULL,        /* m_traverse */
-    NULL,        /* m_clear */
-    NULL,        /* m_free */
+    /*m_name*/ "blf",
+    /*m_doc*/ BLF_doc,
+    /*m_size*/ 0,
+    /*m_methods*/ BLF_methods,
+    /*m_slots*/ NULL,
+    /*m_traverse*/ NULL,
+    /*m_clear*/ NULL,
+    /*m_free*/ NULL,
 };
 
 

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list