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>2020-03-04 15:51:32 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-03-04 15:51:32 +0300
commite7f1de5e110a925cfa11bb7824c4fe2695e274ba (patch)
tree6df6a9514071f5debc14886d4b1a17c26be2d05f /source/blender/makesrna/intern/rna_define.c
parentf4463cd865a228088a7c303c74a5a53b061dc260 (diff)
Cleanup: use MEM_recallocN_id utility function
Diffstat (limited to 'source/blender/makesrna/intern/rna_define.c')
-rw-r--r--source/blender/makesrna/intern/rna_define.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c
index aed2c94b493..55c97672958 100644
--- a/source/blender/makesrna/intern/rna_define.c
+++ b/source/blender/makesrna/intern/rna_define.c
@@ -4334,18 +4334,14 @@ int rna_parameter_size(PropertyRNA *parm)
void RNA_enum_item_add(EnumPropertyItem **items, int *totitem, const EnumPropertyItem *item)
{
- EnumPropertyItem *newitems;
int tot = *totitem;
if (tot == 0) {
- *items = MEM_callocN(sizeof(EnumPropertyItem) * 8, "RNA_enum_items_add");
+ *items = MEM_callocN(sizeof(EnumPropertyItem) * 8, __func__);
}
else if (tot >= 8 && (tot & (tot - 1)) == 0) {
/* power of two > 8 */
- newitems = MEM_callocN(sizeof(EnumPropertyItem) * tot * 2, "RNA_enum_items_add");
- memcpy(newitems, *items, sizeof(EnumPropertyItem) * tot);
- MEM_freeN(*items);
- *items = newitems;
+ *items = MEM_recallocN_id(*items, sizeof(EnumPropertyItem) * tot * 2, __func__);
}
(*items)[tot] = *item;