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:
parent
4834634766
commit
f7d8102b35
|
@ -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,
|
||||||
|
|
Loading…
Reference in New Issue