diff options
-rw-r--r-- | source/blender/makesrna/intern/makesrna.c | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_access.c | 10 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_define.c | 22 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_internal.h | 1 |
4 files changed, 11 insertions, 24 deletions
diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index 5237c97ef71..c158facca7c 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -2292,7 +2292,7 @@ static void rna_def_function_funcs(FILE *f, StructDefRNA *dsrna, FunctionDefRNA } if (dparm->next) - fprintf(f, "\t_data += %d;\n", rna_parameter_size_alloc(dparm->prop)); + fprintf(f, "\t_data += %d;\n", rna_parameter_size(dparm->prop)); } if (dfunc->call) { diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index 7e2d8e8eb62..f3e561cde0a 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -5378,7 +5378,7 @@ ParameterList *RNA_parameter_list_create(ParameterList *parms, PointerRNA *UNUSE /* allocate data */ for (parm = func->cont.properties.first; parm; parm = parm->next) { - alloc_size += rna_parameter_size_alloc(parm); + alloc_size += rna_parameter_size(parm); if (parm->flag & PROP_OUTPUT) parms->ret_count++; @@ -5440,7 +5440,7 @@ ParameterList *RNA_parameter_list_create(ParameterList *parms, PointerRNA *UNUSE } } - data = ((char *)data) + rna_parameter_size_alloc(parm); + data = ((char *)data) + rna_parameter_size(parm); } return parms; @@ -5462,7 +5462,7 @@ void RNA_parameter_list_free(ParameterList *parms) MEM_freeN(data_alloc->array); } - tot += rna_parameter_size_alloc(parm); + tot += rna_parameter_size(parm); } MEM_freeN(parms->data); @@ -5497,7 +5497,7 @@ void RNA_parameter_list_begin(ParameterList *parms, ParameterIterator *iter) iter->offset = 0; if (iter->valid) { - iter->size = rna_parameter_size_alloc(iter->parm); + iter->size = rna_parameter_size(iter->parm); iter->data = (((char *)iter->parms->data)); /* +iter->offset, always 0 */ } } @@ -5509,7 +5509,7 @@ void RNA_parameter_list_next(ParameterIterator *iter) iter->valid = iter->parm != NULL; if (iter->valid) { - iter->size = rna_parameter_size_alloc(iter->parm); + iter->size = rna_parameter_size(iter->parm); iter->data = (((char *)iter->parms->data) + iter->offset); } } diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c index 969e715bebf..723f158bb50 100644 --- a/source/blender/makesrna/intern/rna_define.c +++ b/source/blender/makesrna/intern/rna_define.c @@ -3039,13 +3039,13 @@ void RNA_def_function_ui_description(FunctionRNA *func, const char *description) int rna_parameter_size(PropertyRNA *parm) { PropertyType ptype = parm->type; - int len = parm->totarraylength; /* only supports fixed length at the moment */ + int len = parm->totarraylength; - if (len > 0) { - /* XXX in other parts is mentioned that strings can be dynamic as well */ - if (parm->flag & PROP_DYNAMIC) - return sizeof(void *); + /* XXX in other parts is mentioned that strings can be dynamic as well */ + if (parm->flag & PROP_DYNAMIC) + return sizeof(ParameterDynAlloc); + if (len > 0) { switch (ptype) { case PROP_BOOLEAN: case PROP_INT: @@ -3106,18 +3106,6 @@ int rna_parameter_size(PropertyRNA *parm) return sizeof(void *); } -/* this function returns the size of the memory allocated for the parameter, - * useful for instance for memory alignment or for storing additional information */ -int rna_parameter_size_alloc(PropertyRNA *parm) -{ - int size = rna_parameter_size(parm); - - if (parm->flag & PROP_DYNAMIC) - size += sizeof(((ParameterDynAlloc *)NULL)->array_tot); - - return size; -} - /* Dynamic Enums */ void RNA_enum_item_add(EnumPropertyItem **items, int *totitem, const EnumPropertyItem *item) diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h index d1cfb01abfb..72985f7b6e6 100644 --- a/source/blender/makesrna/intern/rna_internal.h +++ b/source/blender/makesrna/intern/rna_internal.h @@ -402,7 +402,6 @@ PointerRNA rna_pointer_inherit_refine(struct PointerRNA *ptr, struct StructRNA * /* Functions */ int rna_parameter_size(struct PropertyRNA *parm); -int rna_parameter_size_alloc(struct PropertyRNA *parm); struct Mesh *rna_Main_meshes_new_from_object( struct Main *bmain, struct ReportList *reports, struct Scene *sce, |