From a5a86f39212fb16c8310d8eca67ccecc4c6f7dd7 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 14 Nov 2018 09:04:24 +1100 Subject: Cleanup: python doc-strings Indentation & trailing space. --- source/blender/python/bmesh/bmesh_py_api.c | 2 +- source/blender/python/bmesh/bmesh_py_types.c | 4 ++-- .../blender/python/intern/bpy_app_translations.c | 28 +++++++++++----------- source/blender/python/intern/bpy_rna.c | 4 ++-- .../python/mathutils/mathutils_Quaternion.c | 12 +++++----- .../blender/python/mathutils/mathutils_geometry.c | 2 +- 6 files changed, 26 insertions(+), 26 deletions(-) (limited to 'source') diff --git a/source/blender/python/bmesh/bmesh_py_api.c b/source/blender/python/bmesh/bmesh_py_api.c index d7324eabb6c..5819d7ce2bb 100644 --- a/source/blender/python/bmesh/bmesh_py_api.c +++ b/source/blender/python/bmesh/bmesh_py_api.c @@ -115,7 +115,7 @@ static PyObject *bpy_bm_from_edit_mesh(PyObject *UNUSED(self), PyObject *value) PyDoc_STRVAR(bpy_bm_update_edit_mesh_doc, ".. method:: update_edit_mesh(mesh, tessface=True, destructive=True)\n" "\n" -" Update the mesh after changes to the BMesh in editmode, \n" +" Update the mesh after changes to the BMesh in editmode,\n" " optionally recalculating n-gon tessellation.\n" "\n" " :arg mesh: The editmode mesh.\n" diff --git a/source/blender/python/bmesh/bmesh_py_types.c b/source/blender/python/bmesh/bmesh_py_types.c index a53248314df..9cd8eeb0aab 100644 --- a/source/blender/python/bmesh/bmesh_py_types.c +++ b/source/blender/python/bmesh/bmesh_py_types.c @@ -3272,10 +3272,10 @@ PyDoc_STRVAR(bpy_bmloop_doc, "This is normally accessed from :class:`BMFace.loops` where each face loop represents a corner of the face.\n" ); PyDoc_STRVAR(bpy_bmelemseq_doc, -"General sequence type used for accessing any sequence of \n" +"General sequence type used for accessing any sequence of\n" ":class:`BMVert`, :class:`BMEdge`, :class:`BMFace`, :class:`BMLoop`.\n" "\n" -"When accessed via :class:`BMesh.verts`, :class:`BMesh.edges`, :class:`BMesh.faces` \n" +"When accessed via :class:`BMesh.verts`, :class:`BMesh.edges`, :class:`BMesh.faces`\n" "there are also functions to create/remomove items.\n" ); PyDoc_STRVAR(bpy_bmiter_doc, diff --git a/source/blender/python/intern/bpy_app_translations.c b/source/blender/python/intern/bpy_app_translations.c index ffc54969d8c..2a5efc15b87 100644 --- a/source/blender/python/intern/bpy_app_translations.c +++ b/source/blender/python/intern/bpy_app_translations.c @@ -289,12 +289,12 @@ PyDoc_STRVAR(app_translations_py_messages_register_doc, " Registers an addon's UI translations.\n" "\n" " .. note::\n" -" Does nothing when Blender is built without internationalization support.\n" +" Does nothing when Blender is built without internationalization support.\n" "\n" " :arg module_name: The name identifying the addon.\n" " :type module_name: string\n" " :arg translations_dict: A dictionary built like that:\n" -" ``{locale: {msg_key: msg_translation, ...}, ...}``\n" +" ``{locale: {msg_key: msg_translation, ...}, ...}``\n" " :type translations_dict: dict\n" "\n" ); @@ -337,7 +337,7 @@ PyDoc_STRVAR(app_translations_py_messages_unregister_doc, " Unregisters an addon's UI translations.\n" "\n" " .. note::\n" -" Does nothing when Blender is built without internationalization support.\n" +" Does nothing when Blender is built without internationalization support.\n" "\n" " :arg module_name: The name identifying the addon.\n" " :type module_name: string\n" @@ -425,8 +425,8 @@ PyDoc_STRVAR(app_translations_contexts_doc, "A named tuple containing all pre-defined translation contexts.\n" "\n" ".. warning::\n" -" Never use a (new) context starting with \"" BLT_I18NCONTEXT_DEFAULT_BPYRNA "\", it would be internally \n" -" assimilated as the default one!\n" +" Never use a (new) context starting with \"" BLT_I18NCONTEXT_DEFAULT_BPYRNA "\", it would be internally\n" +" assimilated as the default one!\n" ); PyDoc_STRVAR(app_translations_contexts_C_to_py_doc, @@ -522,16 +522,16 @@ PyDoc_STRVAR(app_translations_pgettext_doc, " Try to translate the given msgid (with optional msgctxt).\n" "\n" " .. note::\n" -" The ``(msgid, msgctxt)`` parameters order has been switched compared to gettext function, to allow\n" -" single-parameter calls (context then defaults to BLT_I18NCONTEXT_DEFAULT).\n" +" The ``(msgid, msgctxt)`` parameters order has been switched compared to gettext function, to allow\n" +" single-parameter calls (context then defaults to BLT_I18NCONTEXT_DEFAULT).\n" "\n" " .. note::\n" -" You should really rarely need to use this function in regular addon code, as all translation should be\n" -" handled by Blender internal code. The only exception are string containing formatting (like \"File: %r\"),\n" -" but you should rather use :func:`pgettext_iface`/:func:`pgettext_tip` in those cases!\n" +" You should really rarely need to use this function in regular addon code, as all translation should be\n" +" handled by Blender internal code. The only exception are string containing formatting (like \"File: %r\"),\n" +" but you should rather use :func:`pgettext_iface`/:func:`pgettext_tip` in those cases!\n" "\n" " .. note::\n" -" Does nothing when Blender is built without internationalization support (hence always returns ``msgid``).\n" +" Does nothing when Blender is built without internationalization support (hence always returns ``msgid``).\n" "\n" " :arg msgid: The string to translate.\n" " :type msgid: string\n" @@ -551,7 +551,7 @@ PyDoc_STRVAR(app_translations_pgettext_iface_doc, " Try to translate the given msgid (with optional msgctxt), if labels' translation is enabled.\n" "\n" " .. note::\n" -" See :func:`pgettext` notes.\n" +" See :func:`pgettext` notes.\n" "\n" " :arg msgid: The string to translate.\n" " :type msgid: string\n" @@ -571,7 +571,7 @@ PyDoc_STRVAR(app_translations_pgettext_tip_doc, " Try to translate the given msgid (with optional msgctxt), if tooltips' translation is enabled.\n" "\n" " .. note::\n" -" See :func:`pgettext` notes.\n" +" See :func:`pgettext` notes.\n" "\n" " :arg msgid: The string to translate.\n" " :type msgid: string\n" @@ -591,7 +591,7 @@ PyDoc_STRVAR(app_translations_pgettext_data_doc, " Try to translate the given msgid (with optional msgctxt), if new data name's translation is enabled.\n" "\n" " .. note::\n" -" See :func:`pgettext` notes.\n" +" See :func:`pgettext` notes.\n" "\n" " :arg msgid: The string to translate.\n" " :type msgid: string\n" diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index b542f32f844..9837017b8b1 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -90,7 +90,7 @@ static PyObject *pyrna_prop_collection_values(BPy_PropertyRNA *self); #define BPY_DOC_ID_PROP_TYPE_NOTE \ " .. note::\n" \ "\n" \ -" Only :class:`bpy.types.ID`, :class:`bpy.types.Bone` and \n" \ +" Only :class:`bpy.types.ID`, :class:`bpy.types.Bone` and\n" \ " :class:`bpy.types.PoseBone` classes support custom properties.\n" @@ -7309,7 +7309,7 @@ static int deferred_register_prop(StructRNA *srna, PyObject *key, PyObject *item RNA_struct_idprops_contains_datablock(type_srna)) { PyErr_Format(PyExc_ValueError, - "bpy_struct \"%.200s\" doesn't support datablock properties \n", + "bpy_struct \"%.200s\" doesn't support datablock properties\n", RNA_struct_identifier(srna)); return -1; } diff --git a/source/blender/python/mathutils/mathutils_Quaternion.c b/source/blender/python/mathutils/mathutils_Quaternion.c index bf603502ec2..645fa96c22e 100644 --- a/source/blender/python/mathutils/mathutils_Quaternion.c +++ b/source/blender/python/mathutils/mathutils_Quaternion.c @@ -1260,17 +1260,17 @@ PyDoc_STRVAR(quaternion_doc, " The constructor takes arguments in various forms:\n" "\n" " (), *no args*\n" -" Create an identity quaternion\n" +" Create an identity quaternion\n" " (*wxyz*)\n" -" Create a quaternion from a ``(w, x, y, z)`` vector.\n" +" Create a quaternion from a ``(w, x, y, z)`` vector.\n" " (*exponential_map*)\n" -" Create a quaternion from a 3d exponential map vector.\n" +" Create a quaternion from a 3d exponential map vector.\n" "\n" -" .. seealso:: :meth:`to_exponential_map`\n" +" .. seealso:: :meth:`to_exponential_map`\n" " (*axis, angle*)\n" -" Create a quaternion representing a rotation of *angle* radians over *axis*.\n" +" Create a quaternion representing a rotation of *angle* radians over *axis*.\n" "\n" -" .. seealso:: :meth:`to_axis_angle`\n" +" .. seealso:: :meth:`to_axis_angle`\n" ); PyTypeObject quaternion_Type = { PyVarObject_HEAD_INIT(NULL, 0) diff --git a/source/blender/python/mathutils/mathutils_geometry.c b/source/blender/python/mathutils/mathutils_geometry.c index c759653c5cf..371733ea147 100644 --- a/source/blender/python/mathutils/mathutils_geometry.c +++ b/source/blender/python/mathutils/mathutils_geometry.c @@ -860,7 +860,7 @@ static PyObject *M_Geometry_intersect_point_tri_2d(PyObject *UNUSED(self), PyObj PyDoc_STRVAR(M_Geometry_intersect_point_quad_2d_doc, ".. function:: intersect_point_quad_2d(pt, quad_p1, quad_p2, quad_p3, quad_p4)\n" "\n" -" Takes 5 vectors (using only the x and y coordinates): one is the point and the next 4 define the quad, \n" +" Takes 5 vectors (using only the x and y coordinates): one is the point and the next 4 define the quad,\n" " only the x and y are used from the vectors. Returns 1 if the point is within the quad, otherwise 0.\n" " Works only with convex quads without singular edges.\n" "\n" -- cgit v1.2.3 From c1d29ea7835c0f2ebd20531dfe3996c6bbce6b58 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 14 Nov 2018 09:47:23 +1100 Subject: WM: enforce descriptions being NULL or defined Without this bugs slip through that don't null check the descriptions since many were set to empty strings. --- source/blender/editors/interface/interface_layout.c | 4 +++- source/blender/editors/interface/view2d_ops.c | 1 - source/blender/editors/mask/mask_shapekey.c | 2 -- source/blender/editors/mesh/editmesh_tools.c | 1 - source/blender/editors/object/object_relations.c | 2 -- source/blender/editors/space_file/file_ops.c | 1 - source/blender/editors/space_outliner/outliner_edit.c | 1 - source/blender/editors/space_outliner/outliner_tools.c | 8 -------- source/blender/editors/space_sequencer/sequencer_edit.c | 5 ----- source/blender/editors/space_text/text_ops.c | 2 -- source/blender/editors/space_view3d/view3d_view.c | 1 - source/blender/makesrna/intern/rna_ui.c | 5 +++-- source/blender/makesrna/intern/rna_wm.c | 4 ++-- source/blender/windowmanager/intern/wm_menu_type.c | 1 + source/blender/windowmanager/intern/wm_operator_type.c | 2 ++ 15 files changed, 11 insertions(+), 29 deletions(-) (limited to 'source') diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index 4c252ae55bb..922b5779c9f 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -1979,7 +1979,9 @@ void uiItemM(uiLayout *layout, const char *menuname, const char *name, int icon) if (layout->root->type == UI_LAYOUT_MENU && !icon) icon = ICON_BLANK1; - ui_item_menu(layout, name, icon, ui_item_menutype_func, mt, NULL, TIP_(mt->description), false); + ui_item_menu( + layout, name, icon, ui_item_menutype_func, mt, NULL, + mt->description ? TIP_(mt->description) : "", false); } /* label item */ diff --git a/source/blender/editors/interface/view2d_ops.c b/source/blender/editors/interface/view2d_ops.c index b9ea5d96057..119c0a46f1f 100644 --- a/source/blender/editors/interface/view2d_ops.c +++ b/source/blender/editors/interface/view2d_ops.c @@ -1545,7 +1545,6 @@ static void VIEW2D_OT_smoothview(wmOperatorType *ot) { /* identifiers */ ot->name = "Smooth View 2D"; - ot->description = ""; ot->idname = "VIEW2D_OT_smoothview"; /* api callbacks */ diff --git a/source/blender/editors/mask/mask_shapekey.c b/source/blender/editors/mask/mask_shapekey.c index 99ffc9cd7d2..5df0b80ad2a 100644 --- a/source/blender/editors/mask/mask_shapekey.c +++ b/source/blender/editors/mask/mask_shapekey.c @@ -88,7 +88,6 @@ void MASK_OT_shape_key_insert(wmOperatorType *ot) { /* identifiers */ ot->name = "Insert Shape Key"; - ot->description = ""; ot->idname = "MASK_OT_shape_key_insert"; /* api callbacks */ @@ -137,7 +136,6 @@ void MASK_OT_shape_key_clear(wmOperatorType *ot) { /* identifiers */ ot->name = "Clear Shape Key"; - ot->description = ""; ot->idname = "MASK_OT_shape_key_clear"; /* api callbacks */ diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index 7b687f7f045..b9cfac386be 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -247,7 +247,6 @@ void MESH_OT_subdivide_edgering(wmOperatorType *ot) { /* identifiers */ ot->name = "Subdivide Edge-Ring"; - ot->description = ""; ot->idname = "MESH_OT_subdivide_edgering"; /* api callbacks */ diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index 34f64023441..151df5993ed 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -2501,7 +2501,6 @@ void OBJECT_OT_drop_named_material(wmOperatorType *ot) { /* identifiers */ ot->name = "Drop Named Material on Object"; - ot->description = ""; ot->idname = "OBJECT_OT_drop_named_material"; /* api callbacks */ @@ -2558,7 +2557,6 @@ void OBJECT_OT_unlink_data(wmOperatorType *ot) /* identifiers */ ot->name = "Unlink"; ot->idname = "OBJECT_OT_unlink_data"; - ot->description = ""; /* api callbacks */ ot->exec = object_unlink_data_exec; diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index c9de18d9ca8..429b643a807 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -1714,7 +1714,6 @@ static int filepath_drop_exec(bContext *C, wmOperator *op) void FILE_OT_filepath_drop(wmOperatorType *ot) { ot->name = "File Selector Drop"; - ot->description = ""; ot->idname = "FILE_OT_filepath_drop"; ot->exec = filepath_drop_exec; diff --git a/source/blender/editors/space_outliner/outliner_edit.c b/source/blender/editors/space_outliner/outliner_edit.c index 3708b653ec4..c1bb8467ff1 100644 --- a/source/blender/editors/space_outliner/outliner_edit.c +++ b/source/blender/editors/space_outliner/outliner_edit.c @@ -509,7 +509,6 @@ void OUTLINER_OT_id_remap(wmOperatorType *ot) /* identifiers */ ot->name = "Outliner ID data Remap"; ot->idname = "OUTLINER_OT_id_remap"; - ot->description = ""; /* callbacks */ ot->invoke = outliner_id_remap_invoke; diff --git a/source/blender/editors/space_outliner/outliner_tools.c b/source/blender/editors/space_outliner/outliner_tools.c index 2707e130598..9c21241cf7b 100644 --- a/source/blender/editors/space_outliner/outliner_tools.c +++ b/source/blender/editors/space_outliner/outliner_tools.c @@ -1025,7 +1025,6 @@ void OUTLINER_OT_object_operation(wmOperatorType *ot) /* identifiers */ ot->name = "Outliner Object Operation"; ot->idname = "OUTLINER_OT_object_operation"; - ot->description = ""; /* callbacks */ ot->invoke = WM_menu_invoke; @@ -1128,7 +1127,6 @@ void OUTLINER_OT_group_operation(wmOperatorType *ot) /* identifiers */ ot->name = "Outliner Group Operation"; ot->idname = "OUTLINER_OT_group_operation"; - ot->description = ""; /* callbacks */ ot->invoke = WM_menu_invoke; @@ -1323,7 +1321,6 @@ void OUTLINER_OT_id_operation(wmOperatorType *ot) /* identifiers */ ot->name = "Outliner ID data Operation"; ot->idname = "OUTLINER_OT_id_operation"; - ot->description = ""; /* callbacks */ ot->invoke = WM_menu_invoke; @@ -1418,7 +1415,6 @@ void OUTLINER_OT_lib_operation(wmOperatorType *ot) /* identifiers */ ot->name = "Outliner Library Operation"; ot->idname = "OUTLINER_OT_lib_operation"; - ot->description = ""; /* callbacks */ ot->invoke = WM_menu_invoke; @@ -1642,7 +1638,6 @@ void OUTLINER_OT_animdata_operation(wmOperatorType *ot) /* identifiers */ ot->name = "Outliner Animation Data Operation"; ot->idname = "OUTLINER_OT_animdata_operation"; - ot->description = ""; /* callbacks */ ot->invoke = WM_menu_invoke; @@ -1688,7 +1683,6 @@ void OUTLINER_OT_constraint_operation(wmOperatorType *ot) /* identifiers */ ot->name = "Outliner Constraint Operation"; ot->idname = "OUTLINER_OT_constraint_operation"; - ot->description = ""; /* callbacks */ ot->invoke = WM_menu_invoke; @@ -1734,7 +1728,6 @@ void OUTLINER_OT_modifier_operation(wmOperatorType *ot) /* identifiers */ ot->name = "Outliner Modifier Operation"; ot->idname = "OUTLINER_OT_modifier_operation"; - ot->description = ""; /* callbacks */ ot->invoke = WM_menu_invoke; @@ -1832,7 +1825,6 @@ void OUTLINER_OT_data_operation(wmOperatorType *ot) /* identifiers */ ot->name = "Outliner Data Operation"; ot->idname = "OUTLINER_OT_data_operation"; - ot->description = ""; /* callbacks */ ot->invoke = WM_menu_invoke; diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index c2a1079c349..04cb5c7a37c 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -3288,7 +3288,6 @@ void SEQUENCER_OT_copy(wmOperatorType *ot) /* identifiers */ ot->name = "Copy"; ot->idname = "SEQUENCER_OT_copy"; - ot->description = ""; /* api callbacks */ ot->exec = sequencer_copy_exec; @@ -3353,7 +3352,6 @@ void SEQUENCER_OT_paste(wmOperatorType *ot) /* identifiers */ ot->name = "Paste"; ot->idname = "SEQUENCER_OT_paste"; - ot->description = ""; /* api callbacks */ ot->exec = sequencer_paste_exec; @@ -3683,7 +3681,6 @@ void SEQUENCER_OT_change_effect_input(struct wmOperatorType *ot) /* identifiers */ ot->name = "Change Effect Input"; ot->idname = "SEQUENCER_OT_change_effect_input"; - ot->description = ""; /* api callbacks */ ot->exec = sequencer_change_effect_input_exec; @@ -3743,7 +3740,6 @@ void SEQUENCER_OT_change_effect_type(struct wmOperatorType *ot) /* identifiers */ ot->name = "Change Effect Type"; ot->idname = "SEQUENCER_OT_change_effect_type"; - ot->description = ""; /* api callbacks */ ot->exec = sequencer_change_effect_type_exec; @@ -3878,7 +3874,6 @@ void SEQUENCER_OT_change_path(struct wmOperatorType *ot) /* identifiers */ ot->name = "Change Data/Files"; ot->idname = "SEQUENCER_OT_change_path"; - ot->description = ""; /* api callbacks */ ot->exec = sequencer_change_path_exec; diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c index 30137f70a76..c483aa180db 100644 --- a/source/blender/editors/space_text/text_ops.c +++ b/source/blender/editors/space_text/text_ops.c @@ -2305,7 +2305,6 @@ void TEXT_OT_scroll(wmOperatorType *ot) * scroll_bar. Both do basically the same thing (aside * from keymaps).*/ ot->idname = "TEXT_OT_scroll"; - ot->description = ""; /* api callbacks */ ot->exec = text_scroll_exec; @@ -2397,7 +2396,6 @@ void TEXT_OT_scroll_bar(wmOperatorType *ot) * scroll. Both do basically the same thing (aside * from keymaps).*/ ot->idname = "TEXT_OT_scroll_bar"; - ot->description = ""; /* api callbacks */ ot->invoke = text_scroll_bar_invoke; diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index a812950254f..92f226f72de 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -414,7 +414,6 @@ void VIEW3D_OT_smoothview(wmOperatorType *ot) { /* identifiers */ ot->name = "Smooth View"; - ot->description = ""; ot->idname = "VIEW3D_OT_smoothview"; /* api callbacks */ diff --git a/source/blender/makesrna/intern/rna_ui.c b/source/blender/makesrna/intern/rna_ui.c index 782d39bcb7e..c6dc0c1b124 100644 --- a/source/blender/makesrna/intern/rna_ui.c +++ b/source/blender/makesrna/intern/rna_ui.c @@ -759,8 +759,9 @@ static StructRNA *rna_Menu_register( memcpy(buf, _menu_descr, description_size); mt->description = buf; } - else - mt->description = ""; + else { + mt->description = NULL; + } mt->ext.srna = RNA_def_struct_ptr(&BLENDER_RNA, mt->idname, &RNA_Menu); RNA_def_struct_translation_context(mt->ext.srna, mt->translation_context); diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c index d0d01b9e43e..9b2cc850169 100644 --- a/source/blender/makesrna/intern/rna_wm.c +++ b/source/blender/makesrna/intern/rna_wm.c @@ -1187,7 +1187,7 @@ static StructRNA *rna_Operator_register( dummyot.idname = strings_table[0]; /* allocated string stored here */ dummyot.name = strings_table[1]; - dummyot.description = strings_table[2]; + dummyot.description = *strings_table[2] ? strings_table[2] : NULL; dummyot.translation_context = strings_table[3]; dummyot.undo_group = strings_table[4]; BLI_assert(ARRAY_SIZE(strings) == 5); @@ -1328,7 +1328,7 @@ static StructRNA *rna_MacroOperator_register( dummyot.idname = strings_table[0]; /* allocated string stored here */ dummyot.name = strings_table[1]; - dummyot.description = strings_table[2]; + dummyot.description = *strings_table[2] ? strings_table[2] : NULL; dummyot.translation_context = strings_table[3]; dummyot.undo_group = strings_table[4]; BLI_assert(ARRAY_SIZE(strings) == 5); diff --git a/source/blender/windowmanager/intern/wm_menu_type.c b/source/blender/windowmanager/intern/wm_menu_type.c index 58e85716bf1..4e71001990d 100644 --- a/source/blender/windowmanager/intern/wm_menu_type.c +++ b/source/blender/windowmanager/intern/wm_menu_type.c @@ -60,6 +60,7 @@ MenuType *WM_menutype_find(const char *idname, bool quiet) bool WM_menutype_add(MenuType *mt) { + BLI_assert((mt->description == NULL) || (mt->description[0])); BLI_ghash_insert(menutypes_hash, mt->idname, mt); return true; } diff --git a/source/blender/windowmanager/intern/wm_operator_type.c b/source/blender/windowmanager/intern/wm_operator_type.c index 25ca84f3d57..e9287d83a9a 100644 --- a/source/blender/windowmanager/intern/wm_operator_type.c +++ b/source/blender/windowmanager/intern/wm_operator_type.c @@ -116,6 +116,7 @@ void WM_operatortype_append(void (*opfunc)(wmOperatorType *)) if (ot->name == NULL) { CLOG_ERROR(WM_LOG_OPERATORS, "Operator '%s' has no name property", ot->idname); } + BLI_assert((ot->description == NULL) || (ot->description[0])); /* XXX All ops should have a description but for now allow them not to. */ RNA_def_struct_ui_text(ot->srna, ot->name, ot->description ? ot->description : UNDOCUMENTED_OPERATOR_TIP); @@ -134,6 +135,7 @@ void WM_operatortype_append_ptr(void (*opfunc)(wmOperatorType *, void *), void * RNA_def_struct_translation_context(ot->srna, BLT_I18NCONTEXT_OPERATOR_DEFAULT); ot->translation_context = BLT_I18NCONTEXT_OPERATOR_DEFAULT; opfunc(ot, userdata); + BLI_assert((ot->description == NULL) || (ot->description[0])); RNA_def_struct_ui_text(ot->srna, ot->name, ot->description ? ot->description : UNDOCUMENTED_OPERATOR_TIP); RNA_def_struct_identifier(&BLENDER_RNA, ot->srna, ot->idname); -- cgit v1.2.3