Passed field name as prefix for nested structs

This pull request should fix #232.
Pass field name instead of struct name as nameprefix for nested structures. Continuously concatenate nameprefix arguments to support deeper nested structures.
This commit is contained in:
aeneid 2015-07-12 22:10:57 +03:00
parent 4834634766
commit f7d8102b35
1 changed files with 1 additions and 1 deletions

View File

@ -450,7 +450,7 @@ static void GenStructArgs(const LanguageParameters &lang,
// don't clash, and to make it obvious these arguments are constructing // don't clash, and to make it obvious these arguments are constructing
// a nested struct, prefix the name with the struct name. // a nested struct, prefix the name with the struct name.
GenStructArgs(lang, *field.value.type.struct_def, code_ptr, GenStructArgs(lang, *field.value.type.struct_def, code_ptr,
(field.value.type.struct_def->name + "_").c_str()); (nameprefix + (field.name + "_")).c_str());
} else { } else {
code += ", "; code += ", ";
code += GenTypeForUser(lang, code += GenTypeForUser(lang,