From 03b2371387dcae9f801cabbc1819b1d7e3350829 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 14 Aug 2019 23:29:46 +1000 Subject: Cleanup: move trailing comments to avoid wrapping code Some statements were split across multiple lines because of their trailing comments. In most cases it's clearer to put the comments above. --- source/blender/makesrna/intern/rna_access.c | 4 ++-- source/blender/makesrna/intern/rna_curve.c | 4 ++-- source/blender/makesrna/intern/rna_define.c | 6 ++++-- source/blender/makesrna/intern/rna_rna.c | 6 ++++-- source/blender/makesrna/intern/rna_ui_api.c | 3 ++- source/blender/makesrna/intern/rna_wm.c | 6 ++++-- source/blender/makesrna/intern/rna_wm_gizmo.c | 7 ++++--- 7 files changed, 22 insertions(+), 14 deletions(-) (limited to 'source/blender/makesrna/intern') diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index 3e4cb96a8e8..330d45c2fa5 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -6477,8 +6477,8 @@ char *RNA_string_get_alloc(PointerRNA *ptr, const char *name, char *fixedbuf, in PropertyRNA *prop = RNA_struct_find_property(ptr, name); if (prop) { - return RNA_property_string_get_alloc( - ptr, prop, fixedbuf, fixedlen, NULL); /* TODO, pass length */ + /* TODO, pass length */ + return RNA_property_string_get_alloc(ptr, prop, fixedbuf, fixedlen, NULL); } else { printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name); diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c index 310a335ba4c..644d0b712a2 100644 --- a/source/blender/makesrna/intern/rna_curve.c +++ b/source/blender/makesrna/intern/rna_curve.c @@ -1215,8 +1215,8 @@ static void rna_def_font(BlenderRNA *UNUSED(brna), StructRNA *srna) RNA_def_property_ui_text(prop, "Body Text", "Content of this text object"); RNA_def_property_string_funcs( prop, "rna_Curve_body_get", "rna_Curve_body_length", "rna_Curve_body_set"); - RNA_def_property_string_maxlength(prop, - 8192); /* note that originally str did not have a limit! */ + /* note that originally str did not have a limit! */ + RNA_def_property_string_maxlength(prop, 8192); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); prop = RNA_def_property(srna, "body_format", PROP_COLLECTION, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c index 2cb7c62b028..03ab9da2eff 100644 --- a/source/blender/makesrna/intern/rna_define.c +++ b/source/blender/makesrna/intern/rna_define.c @@ -724,8 +724,10 @@ void RNA_struct_free_extension(StructRNA *srna, ExtensionRNA *ext) #ifdef RNA_RUNTIME ext->free(ext->data); /* decref's the PyObject that the srna owns */ RNA_struct_blender_type_set(srna, NULL); /* this gets accessed again - XXX fixme */ - RNA_struct_py_type_set( - srna, NULL); /* NULL the srna's value so RNA_struct_free wont complain of a leak */ + + /* NULL the srna's value so RNA_struct_free wont complain of a leak */ + RNA_struct_py_type_set(srna, NULL); + #else (void)srna; (void)ext; diff --git a/source/blender/makesrna/intern/rna_rna.c b/source/blender/makesrna/intern/rna_rna.c index f17e9ce28fe..631ad72e146 100644 --- a/source/blender/makesrna/intern/rna_rna.c +++ b/source/blender/makesrna/intern/rna_rna.c @@ -2824,8 +2824,10 @@ static void rna_def_number_property(StructRNA *srna, PropertyType type) prop = RNA_def_property(srna, "default_array", type, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); - RNA_def_property_array( - prop, RNA_MAX_ARRAY_DIMENSION); /* no fixed default length, important its not 0 though */ + + /* no fixed default length, important its not 0 though. */ + RNA_def_property_array(prop, RNA_MAX_ARRAY_DIMENSION); + RNA_def_property_flag(prop, PROP_DYNAMIC); RNA_def_property_dynamic_array_funcs( prop, "rna_NumberProperty_default_array_get_length"); /* same for all types */ diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c index d50f97e88ca..c8b039bd2d6 100644 --- a/source/blender/makesrna/intern/rna_ui_api.c +++ b/source/blender/makesrna/intern/rna_ui_api.c @@ -796,6 +796,7 @@ void RNA_api_ui_layout(StructRNA *srna) RNA_def_boolean(func, "emboss", true, "", "Draw the button itself, not just the icon/text"); RNA_def_int(func, "index", + /* RNA_NO_INDEX == -1 */ -1, -2, INT_MAX, @@ -803,7 +804,7 @@ void RNA_api_ui_layout(StructRNA *srna) "The index of this button, when set a single member of an array can be accessed, " "when set to -1 all array members are used", -2, - INT_MAX); /* RNA_NO_INDEX == -1 */ + INT_MAX); parm = RNA_def_property(func, "icon_value", PROP_INT, PROP_UNSIGNED); RNA_def_property_ui_text(parm, "Icon Value", "Override automatic icon of the item"); RNA_def_boolean(func, "invert_checkbox", false, "", "Draw checkbox value inverted"); diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c index 1edda29a556..123ec9634c9 100644 --- a/source/blender/makesrna/intern/rna_wm.c +++ b/source/blender/makesrna/intern/rna_wm.c @@ -1514,8 +1514,10 @@ static StructRNA *rna_Operator_register(Main *bmain, /* create a new operator type */ dummyot.ext.srna = RNA_def_struct_ptr(&BLENDER_RNA, dummyot.idname, &RNA_Operator); - RNA_def_struct_flag(dummyot.ext.srna, - STRUCT_NO_IDPROPERTIES); /* operator properties are registered separately */ + + /* Operator properties are registered separately. */ + RNA_def_struct_flag(dummyot.ext.srna, STRUCT_NO_IDPROPERTIES); + RNA_def_struct_property_tags(dummyot.ext.srna, rna_enum_operator_property_tags); RNA_def_struct_translation_context(dummyot.ext.srna, dummyot.translation_context); dummyot.ext.data = data; diff --git a/source/blender/makesrna/intern/rna_wm_gizmo.c b/source/blender/makesrna/intern/rna_wm_gizmo.c index 38b6ac9ac52..534e3042768 100644 --- a/source/blender/makesrna/intern/rna_wm_gizmo.c +++ b/source/blender/makesrna/intern/rna_wm_gizmo.c @@ -870,9 +870,10 @@ static StructRNA *rna_GizmoGroup_register(Main *bmain, /* create a new gizmogroup type */ dummywgt.ext.srna = RNA_def_struct_ptr(&BLENDER_RNA, dummywgt.idname, &RNA_GizmoGroup); - RNA_def_struct_flag( - dummywgt.ext.srna, - STRUCT_NO_IDPROPERTIES); /* gizmogroup properties are registered separately */ + + /* Gizmo group properties are registered separately. */ + RNA_def_struct_flag(dummywgt.ext.srna, STRUCT_NO_IDPROPERTIES); + dummywgt.ext.data = data; dummywgt.ext.call = call; dummywgt.ext.free = free; -- cgit v1.2.3