Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2017-10-18 07:07:26 +0300
committerCampbell Barton <ideasman42@gmail.com>2017-10-18 08:04:07 +0300
commitab7ebf2b10f67b002447fb0e2cb352c2c178e128 (patch)
tree8ca38116cf22d8a5e8c6b788f93a84ba1963cb4c /source/blender/makesrna/intern/rna_define.c
parent92611dada67fcc151c894462749031be1de27191 (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_define.c')
-rw-r--r--source/blender/makesrna/intern/rna_define.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c
index 118dd0b15de..fd511655c5f 100644
--- a/source/blender/makesrna/intern/rna_define.c
+++ b/source/blender/makesrna/intern/rna_define.c
@@ -3284,17 +3284,17 @@ void RNA_enum_item_add(EnumPropertyItem **items, int *totitem, const EnumPropert
void RNA_enum_item_add_separator(EnumPropertyItem **items, int *totitem)
{
- static EnumPropertyItem sepr = {0, "", 0, NULL, NULL};
+ static const EnumPropertyItem sepr = {0, "", 0, NULL, NULL};
RNA_enum_item_add(items, totitem, &sepr);
}
-void RNA_enum_items_add(EnumPropertyItem **items, int *totitem, EnumPropertyItem *item)
+void RNA_enum_items_add(EnumPropertyItem **items, int *totitem, const EnumPropertyItem *item)
{
for (; item->identifier; item++)
RNA_enum_item_add(items, totitem, item);
}
-void RNA_enum_items_add_value(EnumPropertyItem **items, int *totitem, EnumPropertyItem *item, int value)
+void RNA_enum_items_add_value(EnumPropertyItem **items, int *totitem, const EnumPropertyItem *item, int value)
{
for (; item->identifier; item++) {
if (item->value == value) {
@@ -3308,7 +3308,7 @@ void RNA_enum_items_add_value(EnumPropertyItem **items, int *totitem, EnumProper
void RNA_enum_item_end(EnumPropertyItem **items, int *totitem)
{
- static EnumPropertyItem empty = {0, NULL, 0, NULL, NULL};
+ static const EnumPropertyItem empty = {0, NULL, 0, NULL, NULL};
RNA_enum_item_add(items, totitem, &empty);
}
@@ -3425,12 +3425,12 @@ void RNA_def_property_duplicate_pointers(StructOrFunctionRNA *cont_, PropertyRNA
eprop->item = earray;
for (a = 0; a < eprop->totitem; a++) {
- if (eprop->item[a].identifier)
- eprop->item[a].identifier = BLI_strdup(eprop->item[a].identifier);
- if (eprop->item[a].name)
- eprop->item[a].name = BLI_strdup(eprop->item[a].name);
- if (eprop->item[a].description)
- eprop->item[a].description = BLI_strdup(eprop->item[a].description);
+ if (earray[a].identifier)
+ earray[a].identifier = BLI_strdup(earray[a].identifier);
+ if (earray[a].name)
+ earray[a].name = BLI_strdup(earray[a].name);
+ if (earray[a].description)
+ earray[a].description = BLI_strdup(earray[a].description);
}
}
break;