diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-10-18 07:07:26 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-10-18 08:04:07 +0300 |
commit | ab7ebf2b10f67b002447fb0e2cb352c2c178e128 (patch) | |
tree | 8ca38116cf22d8a5e8c6b788f93a84ba1963cb4c /source/blender/makesrna/intern/rna_object.c | |
parent | 92611dada67fcc151c894462749031be1de27191 (diff) |
Cleanup: Use const for RNA EnumPropertyItem args
Practically all access to enum data is read-only.
Diffstat (limited to 'source/blender/makesrna/intern/rna_object.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_object.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index 1f018a6ddfc..e179d78898f 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -60,7 +60,7 @@ #include "WM_api.h" #include "WM_types.h" -EnumPropertyItem rna_enum_object_mode_items[] = { +const EnumPropertyItem rna_enum_object_mode_items[] = { {OB_MODE_OBJECT, "OBJECT", ICON_OBJECT_DATAMODE, "Object Mode", ""}, {OB_MODE_EDIT, "EDIT", ICON_EDITMODE_HLT, "Edit Mode", ""}, {OB_MODE_POSE, "POSE", ICON_POSE_HLT, "Pose Mode", ""}, @@ -73,7 +73,7 @@ EnumPropertyItem rna_enum_object_mode_items[] = { {0, NULL, 0, NULL, NULL} }; -EnumPropertyItem rna_enum_object_empty_drawtype_items[] = { +const EnumPropertyItem rna_enum_object_empty_drawtype_items[] = { {OB_PLAINAXES, "PLAIN_AXES", 0, "Plain Axes", ""}, {OB_ARROWS, "ARROWS", 0, "Arrows", ""}, {OB_SINGLE_ARROW, "SINGLE_ARROW", 0, "Single Arrow", ""}, @@ -86,7 +86,7 @@ EnumPropertyItem rna_enum_object_empty_drawtype_items[] = { }; -static EnumPropertyItem parent_type_items[] = { +static const EnumPropertyItem parent_type_items[] = { {PAROBJECT, "OBJECT", 0, "Object", "The object is parented to an object"}, {PARSKEL, "ARMATURE", 0, "Armature", ""}, {PARSKEL, "LATTICE", 0, "Lattice", "The object is parented to a lattice"}, /* PARSKEL reuse will give issues */ @@ -97,7 +97,7 @@ static EnumPropertyItem parent_type_items[] = { }; #ifndef RNA_RUNTIME -static EnumPropertyItem dupli_items[] = { +static const EnumPropertyItem dupli_items[] = { {0, "NONE", 0, "None", ""}, {OB_DUPLIFRAMES, "FRAMES", 0, "Frames", "Make copy of object for every frame"}, {OB_DUPLIVERTS, "VERTS", 0, "Verts", "Duplicate child objects on all vertices"}, @@ -107,7 +107,7 @@ static EnumPropertyItem dupli_items[] = { }; #endif -static EnumPropertyItem collision_bounds_items[] = { +static const EnumPropertyItem collision_bounds_items[] = { {OB_BOUND_BOX, "BOX", ICON_MESH_CUBE, "Box", ""}, {OB_BOUND_SPHERE, "SPHERE", ICON_MESH_UVSPHERE, "Sphere", ""}, {OB_BOUND_CYLINDER, "CYLINDER", ICON_MESH_CYLINDER, "Cylinder", ""}, @@ -119,7 +119,7 @@ static EnumPropertyItem collision_bounds_items[] = { {0, NULL, 0, NULL, NULL} }; -EnumPropertyItem rna_enum_metaelem_type_items[] = { +const EnumPropertyItem rna_enum_metaelem_type_items[] = { {MB_BALL, "BALL", ICON_META_BALL, "Ball", ""}, {MB_TUBE, "CAPSULE", ICON_META_CAPSULE, "Capsule", ""}, {MB_PLANE, "PLANE", ICON_META_PLANE, "Plane", ""}, @@ -133,7 +133,7 @@ EnumPropertyItem rna_enum_metaelem_type_items[] = { #define OBTYPE_CU_SURF {OB_SURF, "SURFACE", 0, "Surface", ""} #define OBTYPE_CU_FONT {OB_FONT, "FONT", 0, "Font", ""} -EnumPropertyItem rna_enum_object_type_items[] = { +const EnumPropertyItem rna_enum_object_type_items[] = { {OB_MESH, "MESH", 0, "Mesh", ""}, OBTYPE_CU_CURVE, OBTYPE_CU_SURF, @@ -150,14 +150,14 @@ EnumPropertyItem rna_enum_object_type_items[] = { {0, NULL, 0, NULL, NULL} }; -EnumPropertyItem rna_enum_object_type_curve_items[] = { +const EnumPropertyItem rna_enum_object_type_curve_items[] = { OBTYPE_CU_CURVE, OBTYPE_CU_SURF, OBTYPE_CU_FONT, {0, NULL, 0, NULL, NULL} }; -EnumPropertyItem rna_enum_object_axis_items[] = { +const EnumPropertyItem rna_enum_object_axis_items[] = { {OB_POSX, "POS_X", 0, "+X", ""}, {OB_POSY, "POS_Y", 0, "+Y", ""}, {OB_POSZ, "POS_Z", 0, "+Z", ""}, @@ -445,7 +445,7 @@ static void rna_Object_parent_type_set(PointerRNA *ptr, int value) ED_object_parent(ob, ob->parent, value, ob->parsubstr); } -static EnumPropertyItem *rna_Object_parent_type_itemf(bContext *UNUSED(C), PointerRNA *ptr, +static const EnumPropertyItem *rna_Object_parent_type_itemf(bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), bool *r_free) { Object *ob = (Object *)ptr->data; @@ -486,7 +486,7 @@ static void rna_Object_empty_draw_type_set(PointerRNA *ptr, int value) BKE_object_empty_draw_type_set(ob, value); } -static EnumPropertyItem *rna_Object_collision_bounds_itemf(bContext *UNUSED(C), PointerRNA *ptr, +static const EnumPropertyItem *rna_Object_collision_bounds_itemf(bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), bool *r_free) { Object *ob = (Object *)ptr->data; @@ -1524,7 +1524,7 @@ static void rna_def_vertex_group(BlenderRNA *brna) FunctionRNA *func; PropertyRNA *parm; - static EnumPropertyItem assign_mode_items[] = { + static const EnumPropertyItem assign_mode_items[] = { {WEIGHT_REPLACE, "REPLACE", 0, "Replace", "Replace"}, {WEIGHT_ADD, "ADD", 0, "Add", "Add"}, {WEIGHT_SUBTRACT, "SUBTRACT", 0, "Subtract", "Subtract"}, @@ -1586,7 +1586,7 @@ static void rna_def_material_slot(BlenderRNA *brna) StructRNA *srna; PropertyRNA *prop; - static EnumPropertyItem link_items[] = { + static const EnumPropertyItem link_items[] = { {1, "OBJECT", 0, "Object", ""}, {0, "DATA", 0, "Data", ""}, {0, NULL, 0, NULL, NULL} @@ -1627,7 +1627,7 @@ static void rna_def_object_game_settings(BlenderRNA *brna) StructRNA *srna; PropertyRNA *prop; - static EnumPropertyItem body_type_items[] = { + static const EnumPropertyItem body_type_items[] = { {OB_BODY_TYPE_NO_COLLISION, "NO_COLLISION", 0, "No Collision", "Disable collision for this object"}, {OB_BODY_TYPE_STATIC, "STATIC", 0, "Static", "Stationary object"}, {OB_BODY_TYPE_DYNAMIC, "DYNAMIC", 0, "Dynamic", "Linear physics"}, @@ -2162,14 +2162,14 @@ static void rna_def_object(BlenderRNA *brna) StructRNA *srna; PropertyRNA *prop; - static EnumPropertyItem up_items[] = { + static const EnumPropertyItem up_items[] = { {OB_POSX, "X", 0, "X", ""}, {OB_POSY, "Y", 0, "Y", ""}, {OB_POSZ, "Z", 0, "Z", ""}, {0, NULL, 0, NULL, NULL} }; - static EnumPropertyItem drawtype_items[] = { + static const EnumPropertyItem drawtype_items[] = { {OB_BOUNDBOX, "BOUNDS", 0, "Bounds", "Draw the bounds of the object"}, {OB_WIRE, "WIRE", 0, "Wire", "Draw the object as a wireframe"}, {OB_SOLID, "SOLID", 0, "Solid", "Draw the object as a solid (if solid drawing is enabled in the viewport)"}, @@ -2178,7 +2178,7 @@ static void rna_def_object(BlenderRNA *brna) {0, NULL, 0, NULL, NULL} }; - static EnumPropertyItem boundtype_items[] = { + static const EnumPropertyItem boundtype_items[] = { {OB_BOUND_BOX, "BOX", 0, "Box", "Draw bounds as box"}, {OB_BOUND_SPHERE, "SPHERE", 0, "Sphere", "Draw bounds as sphere"}, {OB_BOUND_CYLINDER, "CYLINDER", 0, "Cylinder", "Draw bounds as cylinder"}, @@ -2190,7 +2190,7 @@ static void rna_def_object(BlenderRNA *brna) /* XXX: this RNA enum define is currently duplicated for objects, * since there is some text here which is not applicable */ - static EnumPropertyItem prop_rotmode_items[] = { + static const EnumPropertyItem prop_rotmode_items[] = { {ROT_MODE_QUAT, "QUATERNION", 0, "Quaternion (WXYZ)", "No Gimbal Lock"}, {ROT_MODE_XYZ, "XYZ", 0, "XYZ Euler", "XYZ Rotation Order - prone to Gimbal Lock (default)"}, {ROT_MODE_XZY, "XZY", 0, "XZY Euler", "XZY Rotation Order - prone to Gimbal Lock"}, |