diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-11-28 19:20:30 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-11-28 19:20:30 +0300 |
commit | 51f996836c1bd6484905b224c46f497c7faf66a2 (patch) | |
tree | 689941e392e3a141589943d5db6bfb55b5c3b142 /source | |
parent | 2ae7593700a2442cba40e0085301e68a075e0cab (diff) |
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.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/makesrna/intern/makesrna.c | 10 |
1 files changed, 7 insertions, 3 deletions
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, ")"); |