From f7d8102b3550a1fe79ffbcd4c0113819723b10a9 Mon Sep 17 00:00:00 2001 From: aeneid Date: Sun, 12 Jul 2015 22:10:57 +0300 Subject: [PATCH] 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. --- src/idl_gen_general.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/idl_gen_general.cpp b/src/idl_gen_general.cpp index 9a2132338..9bb411edf 100644 --- a/src/idl_gen_general.cpp +++ b/src/idl_gen_general.cpp @@ -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,