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_brush.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_brush.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_brush.c | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c index 294af1a4b83..78614bebceb 100644 --- a/source/blender/makesrna/intern/rna_brush.c +++ b/source/blender/makesrna/intern/rna_brush.c @@ -43,13 +43,13 @@ #include "WM_types.h" -static EnumPropertyItem prop_direction_items[] = { +static const EnumPropertyItem prop_direction_items[] = { {0, "ADD", 0, "Add", "Add effect of brush"}, {BRUSH_DIR_IN, "SUBTRACT", 0, "Subtract", "Subtract effect of brush"}, {0, NULL, 0, NULL, NULL} }; -static EnumPropertyItem sculpt_stroke_method_items[] = { +static const EnumPropertyItem sculpt_stroke_method_items[] = { {0, "DOTS", 0, "Dots", "Apply paint on each mouse move step"}, {BRUSH_DRAG_DOT, "DRAG_DOT", 0, "Drag Dot", "Allows a single dot to be carefully positioned"}, {BRUSH_SPACE, "SPACE", 0, "Space", "Limit brush application to the distance specified by spacing"}, @@ -62,7 +62,7 @@ static EnumPropertyItem sculpt_stroke_method_items[] = { }; -EnumPropertyItem rna_enum_brush_sculpt_tool_items[] = { +const EnumPropertyItem rna_enum_brush_sculpt_tool_items[] = { {SCULPT_TOOL_BLOB, "BLOB", ICON_BRUSH_BLOB, "Blob", ""}, {SCULPT_TOOL_CLAY, "CLAY", ICON_BRUSH_CLAY, "Clay", ""}, {SCULPT_TOOL_CLAY_STRIPS, "CLAY_STRIPS", ICON_BRUSH_CLAY_STRIPS, "Clay Strips", ""}, @@ -86,7 +86,7 @@ EnumPropertyItem rna_enum_brush_sculpt_tool_items[] = { }; -EnumPropertyItem rna_enum_brush_vertex_tool_items[] = { +const EnumPropertyItem rna_enum_brush_vertex_tool_items[] = { {PAINT_BLEND_MIX, "MIX", ICON_BRUSH_MIX, "Mix", "Use mix blending mode while painting"}, {PAINT_BLEND_ADD, "ADD", ICON_BRUSH_ADD, "Add", "Use add blending mode while painting"}, {PAINT_BLEND_SUB, "SUB", ICON_BRUSH_SUBTRACT, "Subtract", "Use subtract blending mode while painting"}, @@ -112,7 +112,7 @@ EnumPropertyItem rna_enum_brush_vertex_tool_items[] = { {0, NULL, 0, NULL, NULL} }; -EnumPropertyItem rna_enum_brush_image_tool_items[] = { +const EnumPropertyItem rna_enum_brush_image_tool_items[] = { {PAINT_TOOL_DRAW, "DRAW", ICON_BRUSH_TEXDRAW, "Draw", ""}, {PAINT_TOOL_SOFTEN, "SOFTEN", ICON_BRUSH_SOFTEN, "Soften", ""}, {PAINT_TOOL_SMEAR, "SMEAR", ICON_BRUSH_SMEAR, "Smear", ""}, @@ -477,48 +477,48 @@ static void rna_Brush_set_unprojected_radius(PointerRNA *ptr, float value) brush->unprojected_radius = value; } -static EnumPropertyItem *rna_Brush_direction_itemf(bContext *C, PointerRNA *ptr, +static const EnumPropertyItem *rna_Brush_direction_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *UNUSED(prop), bool *UNUSED(r_free)) { ePaintMode mode = BKE_paintmode_get_active_from_context(C); - static EnumPropertyItem prop_default_items[] = { + static const EnumPropertyItem prop_default_items[] = { {0, NULL, 0, NULL, NULL} }; /* sculpt mode */ - static EnumPropertyItem prop_flatten_contrast_items[] = { + static const EnumPropertyItem prop_flatten_contrast_items[] = { {0, "FLATTEN", 0, "Flatten", "Add effect of brush"}, {BRUSH_DIR_IN, "CONTRAST", 0, "Contrast", "Subtract effect of brush"}, {0, NULL, 0, NULL, NULL} }; - static EnumPropertyItem prop_fill_deepen_items[] = { + static const EnumPropertyItem prop_fill_deepen_items[] = { {0, "FILL", 0, "Fill", "Add effect of brush"}, {BRUSH_DIR_IN, "DEEPEN", 0, "Deepen", "Subtract effect of brush"}, {0, NULL, 0, NULL, NULL} }; - static EnumPropertyItem prop_scrape_peaks_items[] = { + static const EnumPropertyItem prop_scrape_peaks_items[] = { {0, "SCRAPE", 0, "Scrape", "Add effect of brush"}, {BRUSH_DIR_IN, "PEAKS", 0, "Peaks", "Subtract effect of brush"}, {0, NULL, 0, NULL, NULL} }; - static EnumPropertyItem prop_pinch_magnify_items[] = { + static const EnumPropertyItem prop_pinch_magnify_items[] = { {0, "PINCH", 0, "Pinch", "Add effect of brush"}, {BRUSH_DIR_IN, "MAGNIFY", 0, "Magnify", "Subtract effect of brush"}, {0, NULL, 0, NULL, NULL} }; - static EnumPropertyItem prop_inflate_deflate_items[] = { + static const EnumPropertyItem prop_inflate_deflate_items[] = { {0, "INFLATE", 0, "Inflate", "Add effect of brush"}, {BRUSH_DIR_IN, "DEFLATE", 0, "Deflate", "Subtract effect of brush"}, {0, NULL, 0, NULL, NULL} }; /* texture paint mode */ - static EnumPropertyItem prop_soften_sharpen_items[] = { + static const EnumPropertyItem prop_soften_sharpen_items[] = { {0, "SOFTEN", 0, "Soften", "Blur effect of brush"}, {BRUSH_DIR_IN, "SHARPEN", 0, "Sharpen", "Sharpen effect of brush"}, {0, NULL, 0, NULL, NULL} @@ -583,12 +583,12 @@ static EnumPropertyItem *rna_Brush_direction_itemf(bContext *C, PointerRNA *ptr, } } -static EnumPropertyItem *rna_Brush_stroke_itemf(bContext *C, PointerRNA *UNUSED(ptr), +static const EnumPropertyItem *rna_Brush_stroke_itemf(bContext *C, PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), bool *UNUSED(r_free)) { ePaintMode mode = BKE_paintmode_get_active_from_context(C); - static EnumPropertyItem brush_stroke_method_items[] = { + static const EnumPropertyItem brush_stroke_method_items[] = { {0, "DOTS", 0, "Dots", "Apply paint on each mouse move step"}, {BRUSH_SPACE, "SPACE", 0, "Space", "Limit brush application to the distance specified by spacing"}, {BRUSH_AIRBRUSH, "AIRBRUSH", 0, "Airbrush", "Keep applying paint effect while holding mouse (spray)"}, @@ -614,7 +614,7 @@ static void rna_def_brush_texture_slot(BlenderRNA *brna) StructRNA *srna; PropertyRNA *prop; - static EnumPropertyItem prop_map_mode_items[] = { + static const EnumPropertyItem prop_map_mode_items[] = { {MTEX_MAP_MODE_VIEW, "VIEW_PLANE", 0, "View Plane", ""}, {MTEX_MAP_MODE_AREA, "AREA_PLANE", 0, "Area Plane", ""}, {MTEX_MAP_MODE_TILED, "TILED", 0, "Tiled", ""}, @@ -624,7 +624,7 @@ static void rna_def_brush_texture_slot(BlenderRNA *brna) {0, NULL, 0, NULL, NULL} }; - static EnumPropertyItem prop_tex_paint_map_mode_items[] = { + static const EnumPropertyItem prop_tex_paint_map_mode_items[] = { {MTEX_MAP_MODE_VIEW, "VIEW_PLANE", 0, "View Plane", ""}, {MTEX_MAP_MODE_TILED, "TILED", 0, "Tiled", ""}, {MTEX_MAP_MODE_3D, "3D", 0, "3D", ""}, @@ -633,7 +633,7 @@ static void rna_def_brush_texture_slot(BlenderRNA *brna) {0, NULL, 0, NULL, NULL} }; - static EnumPropertyItem prop_mask_paint_map_mode_items[] = { + static const EnumPropertyItem prop_mask_paint_map_mode_items[] = { {MTEX_MAP_MODE_VIEW, "VIEW_PLANE", 0, "View Plane", ""}, {MTEX_MAP_MODE_TILED, "TILED", 0, "Tiled", ""}, {MTEX_MAP_MODE_RANDOM, "RANDOM", 0, "Random", ""}, @@ -799,7 +799,7 @@ static void rna_def_brush(BlenderRNA *brna) StructRNA *srna; PropertyRNA *prop; - static EnumPropertyItem prop_blend_items[] = { + static const EnumPropertyItem prop_blend_items[] = { {IMB_BLEND_MIX, "MIX", 0, "Mix", "Use mix blending mode while painting"}, {IMB_BLEND_ADD, "ADD", 0, "Add", "Use add blending mode while painting"}, {IMB_BLEND_SUB, "SUB", 0, "Subtract", "Use subtract blending mode while painting"}, @@ -827,7 +827,7 @@ static void rna_def_brush(BlenderRNA *brna) {0, NULL, 0, NULL, NULL} }; - static EnumPropertyItem brush_sculpt_plane_items[] = { + static const EnumPropertyItem brush_sculpt_plane_items[] = { {SCULPT_DISP_DIR_AREA, "AREA", 0, "Area Plane", ""}, {SCULPT_DISP_DIR_VIEW, "VIEW", 0, "View Plane", ""}, {SCULPT_DISP_DIR_X, "X", 0, "X Plane", ""}, @@ -836,32 +836,32 @@ static void rna_def_brush(BlenderRNA *brna) {0, NULL, 0, NULL, NULL} }; - static EnumPropertyItem brush_mask_tool_items[] = { + static const EnumPropertyItem brush_mask_tool_items[] = { {BRUSH_MASK_DRAW, "DRAW", 0, "Draw", ""}, {BRUSH_MASK_SMOOTH, "SMOOTH", 0, "Smooth", ""}, {0, NULL, 0, NULL, NULL} }; - static EnumPropertyItem brush_blur_mode_items[] = { + static const EnumPropertyItem brush_blur_mode_items[] = { {KERNEL_BOX, "BOX", 0, "Box", ""}, {KERNEL_GAUSSIAN, "GAUSSIAN", 0, "Gaussian", ""}, {0, NULL, 0, NULL, NULL} }; - static EnumPropertyItem brush_gradient_items[] = { + static const EnumPropertyItem brush_gradient_items[] = { {BRUSH_GRADIENT_PRESSURE, "PRESSURE", 0, "Pressure", ""}, {BRUSH_GRADIENT_SPACING_REPEAT, "SPACING_REPEAT", 0, "Repeat", ""}, {BRUSH_GRADIENT_SPACING_CLAMP, "SPACING_CLAMP", 0, "Clamp", ""}, {0, NULL, 0, NULL, NULL} }; - static EnumPropertyItem brush_gradient_fill_items[] = { + static const EnumPropertyItem brush_gradient_fill_items[] = { {BRUSH_GRADIENT_LINEAR, "LINEAR", 0, "Linear", ""}, {BRUSH_GRADIENT_RADIAL, "RADIAL", 0, "Radial", ""}, {0, NULL, 0, NULL, NULL} }; - static EnumPropertyItem brush_mask_pressure_items[] = { + static const EnumPropertyItem brush_mask_pressure_items[] = { {0, "NONE", 0, "Off", ""}, {BRUSH_MASK_PRESSURE_RAMP, "RAMP", ICON_STYLUS_PRESSURE, "Ramp", ""}, {BRUSH_MASK_PRESSURE_CUTOFF, "CUTOFF", ICON_STYLUS_PRESSURE, "Cutoff", ""}, |