From 51f996836c1bd6484905b224c46f497c7faf66a2 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Sat, 28 Nov 2015 21:20:30 +0500 Subject: C++ RNA: Pass structures by reference C++ structures might be rather big and passing them by value is not really optimal. There should be no functional changes apart from better memory access pattern when synchronizing huge scenes to Cycles. --- source/blender/makesrna/intern/makesrna.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'source') diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index 887124fc486..ce977daf30a 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -1900,9 +1900,13 @@ static void rna_def_struct_function_prototype_cpp(FILE *f, StructRNA *UNUSED(srn if (!(flag & PROP_DYNAMIC) && dp->prop->arraydimension) fprintf(f, "%s %s[%u]", rna_parameter_type_cpp_name(dp->prop), rna_safe_id(dp->prop->identifier), dp->prop->totarraylength); - else - fprintf(f, "%s %s%s", rna_parameter_type_cpp_name(dp->prop), - ptrstr, rna_safe_id(dp->prop->identifier)); + else { + fprintf(f, "%s%s%s%s", + rna_parameter_type_cpp_name(dp->prop), + (dp->prop->type == PROP_POINTER && ptrstr[0] == '\0') ? "& " : " ", + ptrstr, + rna_safe_id(dp->prop->identifier)); + } } fprintf(f, ")"); -- cgit v1.2.3