diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-08-11 19:49:27 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-08-11 19:49:27 +0400 |
commit | 33686720f2313944d895e543c0fa306eaa9fe9c4 (patch) | |
tree | 012a833769a806dc0fa381b81ab496c228c56037 /source/blender/makesrna/intern/rna_define.c | |
parent | 48ae40ccdf5475506700b7b50e5e677ecf301479 (diff) |
Fix RNA parameter passing issue with dynamic arrays, was computing the wrong
size in some cases.
Diffstat (limited to 'source/blender/makesrna/intern/rna_define.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_define.c | 22 |
1 files changed, 5 insertions, 17 deletions
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) |