Skip to content

Commit

Permalink
Passed field name as prefix for nested structs
Browse files Browse the repository at this point in the history
This pull request should fix google#232.
Pass field name instead of struct name as nameprefix for nested structures. Continuously concatenate nameprefix arguments to support deeper nested structures.
  • Loading branch information
aeneid committed Jul 12, 2015
1 parent 4834634 commit f7d8102
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/idl_gen_general.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ static void GenStructArgs(const LanguageParameters &lang,
// don't clash, and to make it obvious these arguments are constructing
// a nested struct, prefix the name with the struct name.
GenStructArgs(lang, *field.value.type.struct_def, code_ptr,
(field.value.type.struct_def->name + "_").c_str());
(nameprefix + (field.name + "_")).c_str());
} else {
code += ", ";
code += GenTypeForUser(lang,
Expand Down

0 comments on commit f7d8102

Please sign in to comment.