[Bf-blender-cvs] [ab7ebf2b10f] master: Cleanup: Use const for RNA EnumPropertyItem args

Campbell Barton noreply at git.blender.org
Wed Oct 18 07:01:34 CEST 2017


Commit: ab7ebf2b10f67b002447fb0e2cb352c2c178e128
Author: Campbell Barton
Date:   Wed Oct 18 15:07:26 2017 +1100
Branches: master
https://developer.blender.org/rBab7ebf2b10f67b002447fb0e2cb352c2c178e128

Cleanup: Use const for RNA EnumPropertyItem args

Practically all access to enum data is read-only.

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

M	source/blender/editors/animation/anim_channels_edit.c
M	source/blender/editors/animation/drivers.c
M	source/blender/editors/animation/keyframes_general.c
M	source/blender/editors/animation/keyingsets.c
M	source/blender/editors/armature/armature_add.c
M	source/blender/editors/armature/armature_edit.c
M	source/blender/editors/armature/armature_naming.c
M	source/blender/editors/armature/armature_relations.c
M	source/blender/editors/armature/armature_select.c
M	source/blender/editors/armature/pose_edit.c
M	source/blender/editors/armature/pose_group.c
M	source/blender/editors/armature/pose_lib.c
M	source/blender/editors/armature/pose_select.c
M	source/blender/editors/armature/pose_slide.c
M	source/blender/editors/curve/editcurve.c
M	source/blender/editors/curve/editcurve_select.c
M	source/blender/editors/curve/editfont.c
M	source/blender/editors/gpencil/gpencil_convert.c
M	source/blender/editors/gpencil/gpencil_data.c
M	source/blender/editors/gpencil/gpencil_edit.c
M	source/blender/editors/gpencil/gpencil_intern.h
M	source/blender/editors/gpencil/gpencil_paint.c
M	source/blender/editors/gpencil/gpencil_select.c
M	source/blender/editors/gpencil/gpencil_utils.c
M	source/blender/editors/include/ED_keyframing.h
M	source/blender/editors/include/ED_object.h
M	source/blender/editors/interface/interface.c
M	source/blender/editors/interface/interface_eyedropper.c
M	source/blender/editors/interface/interface_icons.c
M	source/blender/editors/interface/interface_layout.c
M	source/blender/editors/interface/interface_templates.c
M	source/blender/editors/io/io_collada.c
M	source/blender/editors/mask/mask_ops.c
M	source/blender/editors/mesh/editmesh_bevel.c
M	source/blender/editors/mesh/editmesh_intersect.c
M	source/blender/editors/mesh/editmesh_knife.c
M	source/blender/editors/mesh/editmesh_select.c
M	source/blender/editors/mesh/editmesh_tools.c
M	source/blender/editors/metaball/mball_edit.c
M	source/blender/editors/object/object_add.c
M	source/blender/editors/object/object_constraint.c
M	source/blender/editors/object/object_data_transfer.c
M	source/blender/editors/object/object_edit.c
M	source/blender/editors/object/object_group.c
M	source/blender/editors/object/object_hook.c
M	source/blender/editors/object/object_lattice.c
M	source/blender/editors/object/object_modifier.c
M	source/blender/editors/object/object_relations.c
M	source/blender/editors/object/object_select.c
M	source/blender/editors/object/object_shapekey.c
M	source/blender/editors/object/object_transform.c
M	source/blender/editors/object/object_vgroup.c
M	source/blender/editors/physics/dynamicpaint_ops.c
M	source/blender/editors/physics/particle_edit.c
M	source/blender/editors/physics/particle_object.c
M	source/blender/editors/physics/rigidbody_object.c
M	source/blender/editors/render/render_internal.c
M	source/blender/editors/render/render_shading.c
M	source/blender/editors/screen/screen_ops.c
M	source/blender/editors/sculpt_paint/paint_hide.c
M	source/blender/editors/sculpt_paint/paint_image_proj.c
M	source/blender/editors/sculpt_paint/paint_mask.c
M	source/blender/editors/sculpt_paint/paint_ops.c
M	source/blender/editors/sculpt_paint/paint_utils.c
M	source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c
M	source/blender/editors/sculpt_paint/sculpt_uv.c
M	source/blender/editors/sound/sound_ops.c
M	source/blender/editors/space_action/action_edit.c
M	source/blender/editors/space_action/action_select.c
M	source/blender/editors/space_clip/clip_graph_ops.c
M	source/blender/editors/space_clip/tracking_ops.c
M	source/blender/editors/space_clip/tracking_ops_detect.c
M	source/blender/editors/space_clip/tracking_ops_orient.c
M	source/blender/editors/space_clip/tracking_select.c
M	source/blender/editors/space_console/console_ops.c
M	source/blender/editors/space_file/file_ops.c
M	source/blender/editors/space_graph/graph_edit.c
M	source/blender/editors/space_graph/graph_select.c
M	source/blender/editors/space_image/image_ops.c
M	source/blender/editors/space_logic/logic_ops.c
M	source/blender/editors/space_nla/nla_edit.c
M	source/blender/editors/space_nla/nla_select.c
M	source/blender/editors/space_node/node_add.c
M	source/blender/editors/space_node/node_edit.c
M	source/blender/editors/space_node/node_group.c
M	source/blender/editors/space_node/node_select.c
M	source/blender/editors/space_outliner/outliner_edit.c
M	source/blender/editors/space_outliner/outliner_tools.c
M	source/blender/editors/space_sequencer/sequencer_edit.c
M	source/blender/editors/space_sequencer/sequencer_modifier.c
M	source/blender/editors/space_sequencer/sequencer_select.c
M	source/blender/editors/space_text/text_ops.c
M	source/blender/editors/space_view3d/view3d_edit.c
M	source/blender/editors/space_view3d/view3d_fly.c
M	source/blender/editors/space_view3d/view3d_header.c
M	source/blender/editors/space_view3d/view3d_select.c
M	source/blender/editors/space_view3d/view3d_walk.c
M	source/blender/editors/transform/transform.c
M	source/blender/editors/transform/transform_ops.c
M	source/blender/editors/util/undo.c
M	source/blender/editors/uvedit/uvedit_ops.c
M	source/blender/editors/uvedit/uvedit_smart_stitch.c
M	source/blender/editors/uvedit/uvedit_unwrap_ops.c
M	source/blender/makesdna/DNA_windowmanager_types.h
M	source/blender/makesrna/RNA_access.h
M	source/blender/makesrna/RNA_define.h
M	source/blender/makesrna/RNA_enum_types.h
M	source/blender/makesrna/RNA_types.h
M	source/blender/makesrna/intern/makesrna.c
M	source/blender/makesrna/intern/rna_ID.c
M	source/blender/makesrna/intern/rna_access.c
M	source/blender/makesrna/intern/rna_actuator.c
M	source/blender/makesrna/intern/rna_animation.c
M	source/blender/makesrna/intern/rna_animviz.c
M	source/blender/makesrna/intern/rna_armature.c
M	source/blender/makesrna/intern/rna_boid.c
M	source/blender/makesrna/intern/rna_brush.c
M	source/blender/makesrna/intern/rna_camera.c
M	source/blender/makesrna/intern/rna_cloth.c
M	source/blender/makesrna/intern/rna_color.c
M	source/blender/makesrna/intern/rna_constraint.c
M	source/blender/makesrna/intern/rna_context.c
M	source/blender/makesrna/intern/rna_controller.c
M	source/blender/makesrna/intern/rna_curve.c
M	source/blender/makesrna/intern/rna_define.c
M	source/blender/makesrna/intern/rna_dynamicpaint.c
M	source/blender/makesrna/intern/rna_fcurve.c
M	source/blender/makesrna/intern/rna_fluidsim.c
M	source/blender/makesrna/intern/rna_gpencil.c
M	source/blender/makesrna/intern/rna_image.c
M	source/blender/makesrna/intern/rna_internal_types.h
M	source/blender/makesrna/intern/rna_key.c
M	source/blender/makesrna/intern/rna_lamp.c
M	source/blender/makesrna/intern/rna_linestyle.c
M	source/blender/makesrna/intern/rna_main_api.c
M	source/blender/makesrna/intern/rna_mask.c
M	source/blender/makesrna/intern/rna_material.c
M	source/blender/makesrna/intern/rna_mesh.c
M	source/blender/makesrna/intern/rna_meta.c
M	source/blender/makesrna/intern/rna_modifier.c
M	source/blender/makesrna/intern/rna_movieclip.c
M	source/blender/makesrna/intern/rna_nla.c
M	source/blender/makesrna/intern/rna_nodetree.c
M	source/blender/makesrna/intern/rna_object.c
M	source/blender/makesrna/intern/rna_object_api.c
M	source/blender/makesrna/intern/rna_object_force.c
M	source/blender/makesrna/intern/rna_packedfile.c
M	source/blender/makesrna/intern/rna_particle.c
M	source/blender/makesrna/intern/rna_pose.c
M	source/blender/makesrna/intern/rna_property.c
M	source/blender/makesrna/intern/rna_render.c
M	source/blender/makesrna/intern/rna_rigidbody.c
M	source/blender/makesrna/intern/rna_rna.c
M	source/blender/makesrna/intern/rna_scene.c
M	source/blender/makesrna/intern/rna_scene_api.c
M	source/blender/makesrna/intern/rna_screen.c
M	source/blender/makesrna/intern/rna_sculpt_paint.c
M	source/blender/makesrna/intern/rna_sensor.c
M	source/blender/makesrna/intern/rna_sequencer.c
M	source/blender/makesrna/intern/rna_sequencer_api.c
M	source/blender/makesrna/intern/rna_smoke.c
M	source/blender/makesrna/intern/rna_space.c
M	source/blender/makesrna/intern/rna_texture.c
M	source/blender/makesrna/intern/rna_tracking.c
M	source/blender/makesrna/intern/rna_ui.c
M	source/blender/makesrna/intern/rna_ui_api.c
M	source/blender/makesrna/intern/rna_userdef.c
M	source/blender/makesrna/intern/rna_wm.c
M	source/blender/makesrna/intern/rna_wm_api.c
M	source/blender/makesrna/intern/rna_world.c
M	source/blender/python/intern/bpy_props.c
M	source/blender/python/intern/bpy_rna.c
M	source/blender/python/intern/bpy_rna.h
M	source/blender/python/intern/bpy_rna_callback.c
M	source/blender/python/intern/bpy_util.c
M	source/blender/python/intern/bpy_util.h
M	source/blender/windowmanager/WM_keymap.h
M	source/blender/windowmanager/intern/wm_keymap.c
M	source/blender/windowmanager/intern/wm_operator_props.c
M	source/blender/windowmanager/intern/wm_operators.c
M	source/blenderplayer/bad_level_call_stubs/stubs.c

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

diff --git a/source/blender/editors/animation/anim_channels_edit.c b/source/blender/editors/animation/anim_channels_edit.c
index fc0c39e6295..75a6af3819c 100644
--- a/source/blender/editors/animation/anim_channels_edit.c
+++ b/source/blender/editors/animation/anim_channels_edit.c
@@ -680,7 +680,7 @@ typedef enum eRearrangeAnimChan_Mode {
 } eRearrangeAnimChan_Mode;
 
 /* defines for rearranging channels */
-static EnumPropertyItem prop_animchannel_rearrange_types[] = {
+static const EnumPropertyItem prop_animchannel_rearrange_types[] = {
 	{REARRANGE_ANIMCHAN_TOP, "TOP", 0, "To Top", ""},
 	{REARRANGE_ANIMCHAN_UP, "UP", 0, "Up", ""},
 	{REARRANGE_ANIMCHAN_DOWN, "DOWN", 0, "Down", ""},
@@ -1743,7 +1743,7 @@ static void ANIM_OT_channels_delete(wmOperatorType *ot)
 /* ********************** Set Flags Operator *********************** */
 
 /* defines for setting animation-channel flags */
-static EnumPropertyItem prop_animchannel_setflag_types[] = {
+static const EnumPropertyItem prop_animchannel_setflag_types[] = {
 	{ACHANNEL_SETFLAG_TOGGLE, "TOGGLE", 0, "Toggle", ""},
 	{ACHANNEL_SETFLAG_CLEAR, "DISABLE", 0, "Disable", ""},
 	{ACHANNEL_SETFLAG_ADD, "ENABLE", 0, "Enable", ""},
@@ -1753,7 +1753,7 @@ static EnumPropertyItem prop_animchannel_setflag_types[] = {
 
 /* defines for set animation-channel settings */
 // TODO: could add some more types, but those are really quite dependent on the mode...
-static EnumPropertyItem prop_animchannel_settings_types[] = {
+static const EnumPropertyItem prop_animchannel_settings_types[] = {
 	{ACHANNEL_SETTING_PROTECT, "PROTECT", 0, "Protect", ""},
 	{ACHANNEL_SETTING_MUTE, "MUTE", 0, "Mute", ""},
 	{0, NULL, 0, NULL, NULL}
diff --git a/source/blender/editors/animation/drivers.c b/source/blender/editors/animation/drivers.c
index 0d329898c41..958c2f2c8d1 100644
--- a/source/blender/editors/animation/drivers.c
+++ b/source/blender/editors/animation/drivers.c
@@ -765,7 +765,7 @@ EnumPropertyItem prop_driver_create_mapping_types[] = {
 };
 
 /* Filtering callback for driver mapping types enum */
-static EnumPropertyItem *driver_mapping_type_itemsf(bContext *C, PointerRNA *UNUSED(owner_ptr), PropertyRNA *UNUSED(owner_prop), bool *r_free)
+static const EnumPropertyItem *driver_mapping_type_itemsf(bContext *C, PointerRNA *UNUSED(owner_ptr), PropertyRNA *UNUSED(owner_prop), bool *r_free)
 {
 	EnumPropertyItem *input = prop_driver_create_mapping_types;
 	EnumPropertyItem *item = NULL;
diff --git a/source/blender/editors/animation/keyframes_general.c b/source/blender/editors/animation/keyframes_general.c
index 071c5fab9d7..97f53561bfe 100644
--- a/source/blender/editors/animation/keyframes_general.c
+++ b/source/blender/editors/animation/keyframes_general.c
@@ -885,14 +885,14 @@ static void paste_animedit_keys_fcurve(FCurve *fcu, tAnimCopybufItem *aci, float
 
 /* ------------------- */
 
-EnumPropertyItem rna_enum_keyframe_paste_offset_items[] = {
+const EnumPropertyItem rna_enum_keyframe_paste_offset_items[] = {
 	{KEYFRAME_PASTE_OFFSET_CFRA_START, "START", 0, "Frame Start", "Paste keys starting at current frame"},
 	{KEYFRAME_PASTE_OFFSET_CFRA_END, "END", 0, "Frame End", "Paste keys ending at current frame"},
 	{KEYFRAME_PASTE_OFFSET_CFRA_RELATIVE, "RELATIVE", 0, "Frame Relative", "Paste keys relative to the current frame when copying"},
 	{KEYFRAME_PASTE_OFFSET_NONE, "NONE", 0, "No Offset", "Paste keys from original time"},
 	{0, NULL, 0, NULL, NULL}};
 
-EnumPropertyItem rna_enum_keyframe_paste_merge_items[] = {
+const EnumPropertyItem rna_enum_keyframe_paste_merge_items[] = {
 	{KEYFRAME_PASTE_MERGE_MIX, "MIX", 0, "Mix", "Overlay existing with new keys"},
 	{KEYFRAME_PASTE_MERGE_OVER, "OVER_ALL", 0, "Overwrite All", "Replace all keys"},
 	{KEYFRAME_PASTE_MERGE_OVER_RANGE, "OVER_RANGE", 0, "Overwrite Range", "Overwrite keys in pasted range"},
diff --git a/source/blender/editors/animation/keyingsets.c b/source/blender/editors/animation/keyingsets.c
index 0a27fe14de7..ad08caba799 100644
--- a/source/blender/editors/animation/keyingsets.c
+++ b/source/blender/editors/animation/keyingsets.c
@@ -726,7 +726,7 @@ KeyingSet *ANIM_get_keyingset_for_autokeying(Scene *scene, const char *tranformK
 /* Menu of All Keying Sets ----------------------------- */
 
 /* Dynamically populate an enum of Keying Sets */
-EnumPropertyItem *ANIM_keying_sets_enum_itemf(bContext *C, PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), bool *r_free)
+const EnumPropertyItem *ANIM_keying_sets_enum_itemf(bContext *C, PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), bool *r_free)
 {
 	Scene *scene = CTX_data_scene(C);
 	KeyingSet *ks;
diff --git a/source/blender/editors/armature/armature_add.c b/source/blender/editors/armature/armature_add.c
index bbc81f522fa..cff161d9d93 100644
--- a/source/blender/editors/armature/armature_add.c
+++ b/source/blender/editors/armature/armature_add.c
@@ -778,7 +778,7 @@ static int armature_symmetrize_exec(bContext *C, wmOperator *op)
 void ARMATURE_OT_symmetrize(wmOperatorType *ot)
 {
 	/* subset of 'rna_enum_symmetrize_direction_items' */
-	static EnumPropertyItem arm_symmetrize_direction_items[] = {
+	static const EnumPropertyItem arm_symmetrize_direction_items[] = {
 		{-1, "NEGATIVE_X", 0, "-X to +X", ""},
 		{+1, "POSITIVE_X", 0, "+X to -X", ""},
 		{0, NULL, 0, NULL, NULL}
diff --git a/source/blender/editors/armature/armature_edit.c b/source/blender/editors/armature/armature_edit.c
index 51b76563c72..ab9a3e068d0 100644
--- a/source/blender/editors/armature/armature_edit.c
+++ b/source/blender/editors/armature/armature_edit.c
@@ -265,7 +265,7 @@ typedef enum eCalcRollTypes {
 	CALC_ROLL_CURSOR,
 } eCalcRollTypes;
 
-static EnumPropertyItem prop_calc_roll_types[] = {
+static const EnumPropertyItem prop_calc_roll_types[] = {
 	{0, "", 0, N_("Positive"), ""},
 	{CALC_ROLL_TAN_POS_X, "POS_X", 0, "Local +X Tangent", ""},
 	{CALC_ROLL_TAN_POS_Z, "POS_Z", 0, "Local +Z Tangent", ""},
@@ -967,7 +967,7 @@ static int armature_merge_exec(bContext *C, wmOperator *op)
 
 void ARMATURE_OT_merge(wmOperatorType *ot)
 {
-	static EnumPropertyItem merge_types[] = {
+	static const EnumPropertyItem merge_types[] = {
 		{1, "WITHIN_CHAIN", 0, "Within Chains", ""},
 		{0, NULL, 0, NULL, NULL}
 	};
diff --git a/source/blender/editors/armature/armature_naming.c b/source/blender/editors/armature/armature_naming.c
index db4b642fe91..2d7a83f20c1 100644
--- a/source/blender/editors/armature/armature_naming.c
+++ b/source/blender/editors/armature/armature_naming.c
@@ -435,7 +435,7 @@ static int armature_autoside_names_exec(bContext *C, wmOperator *op)
 
 void ARMATURE_OT_autoside_names(wmOperatorType *ot)
 {
-	static EnumPropertyItem axis_items[] = {
+	static const EnumPropertyItem axis_items[] = {
 		{0, "XAXIS", 0, "X-Axis", "Left/Right"},
 		{1, "YAXIS", 0, "Y-Axis", "Front/Back"},
 		{2, "ZAXIS", 0, "Z-Axis", "Top/Bottom"},
diff --git a/source/blender/editors/armature/armature_relations.c b/source/blender/editors/armature/armature_relations.c
index 417d7c8ba3b..685f8227a47 100644
--- a/source/blender/editors/armature/armature_relations.c
+++ b/source/blender/editors/armature/armature_relations.c
@@ -735,7 +735,7 @@ static void bone_connect_to_new_parent(ListBase *edbo, EditBone *selbone, EditBo
 }
 
 
-static EnumPropertyItem prop_editarm_make_parent_types[] = {
+static const EnumPropertyItem prop_editarm_make_parent_types[] = {
 	{ARM_PAR_CONNECT, "CONNECTED", 0, "Connected", ""},
 	{ARM_PAR_OFFSET, "OFFSET", 0, "Keep Offset", ""},
 	{0, NULL, 0, NULL, NULL}
@@ -856,7 +856,7 @@ void ARMATURE_OT_parent_set(wmOperatorType *ot)
 
 
 
-static EnumPropertyItem prop_editarm_clear_parent_types[] = {
+static const EnumPropertyItem prop_editarm_clear_parent_types[] = {
 	{1, "CLEAR", 0, "Clear Parent", ""},
 	{2, "DISCONNECT", 0, "Disconnect Bone", ""},
 	{0, NULL, 0, NULL, NULL}
diff --git a/source/blender/editors/armature/armature_select.c b/source/blender/editors/armature/armature_select.c
index ed44214591c..93185971492 100644
--- a/source/blender/editors/armature/armature_select.c
+++ b/source/blender/editors/armature/armature_select.c
@@ -803,7 +803,7 @@ enum {
 	SIMEDBONE_LAYER,
 };
 
-static EnumPropertyItem prop_similar_types[] = {
+static const EnumPropertyItem prop_similar_types[] = {
 	{SIMEDBONE_CHILDREN, "CHILDREN", 0, "Children", ""},
 	{SIMEDBONE_CHILDREN_IMMEDIATE, "CHILDREN_IMMEDIATE", 0, "Immediate children", ""},
 	{SIMEDBONE_SIBLINGS, "SIBLINGS", 0, "Siblings", ""},
@@ -1116,7 +1116,7 @@ static int armature_select_hierarchy_exec(bContext *C, wmOperator *op)
 
 void ARMATURE_OT_select_hierarchy(wmOperatorType *ot)
 {
-	static EnumPropertyItem direction_items[] = {
+	static const EnumPropertyItem direction_items[] = {
 		{BONE_SELECT_PARENT, "PARENT", 0, "Select Parent", ""},
 		{BONE_SELECT_CHILD, "CHILD", 0, "Select Child", ""},
 		{0, NULL, 0, NULL, NULL}
diff --git a/source/blender/editors/armature/pose_edit.c b/source/blender/editors/armature/pose_edit.c
index 86b7271bfff..e14069dfb12 100644
--- a/source/blender/editors/armature/pose_edit.c
+++ b/source/blender/editors/armature/pose_edit.c
@@ -670,7 +670,7 @@ static int pose_autoside_names_exec(bContext *C, wmOperator *op)
 
 void POSE_OT_autoside_names(wmOperatorType *ot)
 {
-	static EnumPropertyItem axis_items[] = {
+	static const EnumPropertyItem axis_items[] = {
 		{0, "XAXIS", 0, "X-Axis", "Left/Right"},
 		{1, "YAXIS", 0, "Y-Axis", "Front/Back"},
 		{2, "ZAXIS", 0, "Z-Axis", "Top/Bottom"},
diff --git a/source/blender/editors/armature/pose_group.c b/source/blender/editors/armature/pose_group.c
index c492772b282..c9b1d8613a9 100644
--- a/source/blender/editors/armature/pose_group.c
+++ b/source/blender/editors/armature/pose_group.c
@@ -328,7 +328,7 @@ static int group_move_exec(bContext *C, wmOperator *op)
 
 void POSE_OT_group_move(wmOperatorType *ot)
 {
-	static EnumPropertyItem group_slot_move[] = {
+	static const EnumPropertyItem group_slot_move[] = {
 		{-1, "UP", 0, "Up", ""},
 		{1, "DOWN", 0, "Down", ""},
 		{0, NULL, 0, NULL, NULL}
diff --git a/source/blender/editors/armature/pose_lib.c b/source/blender/editors/armature/pose_lib.c
index 25f1b282f14..13feec2c523 100644
--- a/source/blender/editors/armature/pose_lib.c
+++ b/source/blender/editors/armature/pos

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list