From: Dave Barach Date: Mon, 27 Feb 2017 14:25:39 +0000 (-0500) Subject: Fix warning in generated code X-Git-Tag: v17.04-rc1~158 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F38%2F5538%2F2;p=vpp.git Fix warning in generated code Change-Id: Ie56fca84a8a0ed77ee480e8078e6e9b3f4cef105 Signed-off-by: Dave Barach --- diff --git a/src/tools/vppapigen/node.c b/src/tools/vppapigen/node.c index 260c6f2ef7b..54fef8f1e59 100644 --- a/src/tools/vppapigen/node.c +++ b/src/tools/vppapigen/node.c @@ -753,8 +753,14 @@ void node_complex_generate (node_t *this, enum passid which, FILE *fp) fprintf(fp, "vl_print(handle, \"%s%s ----- \\n\");\n", union_prefix, member_name); indent_me(fp); - fprintf(fp, "%s_print(&a->%s%s, handle);\n", - CDATA0, union_prefix, member_name); + + if (deeper->type == NODE_VECTOR) + fprintf(fp, "%s_print(a->%s%s, handle);\n", + CDATA0, union_prefix, member_name); + else + fprintf(fp, "%s_print(&a->%s%s, handle);\n", + CDATA0, union_prefix, member_name); + indent_me(fp); fprintf(fp, "vl_print(handle, \"%s%s ----- END \\n\");\n", union_prefix, member_name); @@ -772,8 +778,12 @@ void node_complex_generate (node_t *this, enum passid which, FILE *fp) } indent_me(fp); - fprintf(fp, "%s_endian(&a->%s%s);\n", - CDATA0, union_prefix, member_name); + if (deeper->type == NODE_VECTOR) + fprintf(fp, "%s_endian(a->%s%s);\n", + CDATA0, union_prefix, member_name); + else + fprintf(fp, "%s_endian(&a->%s%s);\n", + CDATA0, union_prefix, member_name); break; case PYTHON_PASS: fprintf(fp, "('%s',", CDATA0);