From eca6982a951b7f7051d6386a58cf35caedc84f3b Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Wed, 16 Jun 2004 05:03:50 +0000 Subject: r1164: Whoops - remove debugging printfs and Data::Dumper reference. Give unions their own subtree as well as structures. (This used to be commit d3183d781ed62de756840c85742ae4f887c45251) --- source4/build/pidl/eparser.pm | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'source4/build') diff --git a/source4/build/pidl/eparser.pm b/source4/build/pidl/eparser.pm index 79158340a4..7db875af32 100644 --- a/source4/build/pidl/eparser.pm +++ b/source4/build/pidl/eparser.pm @@ -478,11 +478,11 @@ sub ParseStructPull($) start_flags($struct); - pidl "\tif (!(ndr_flags & NDR_SCALARS)) goto buffers;\n"; - pidl "\titem = proto_tree_add_text(tree, ndr->tvb, ndr->offset, 0, \"$struct->{PARENT}{NAME}\");\n"; pidl "\tsubtree = proto_item_add_subtree(item, ett_$struct->{PARENT}{NAME});\n"; + pidl "\tif (!(ndr_flags & NDR_SCALARS)) goto buffers;\n"; + pidl "\tndr_pull_struct_start(ndr);\n"; if (defined $conform_e) { @@ -518,6 +518,9 @@ sub ParseUnionPull($) start_flags($e); + pidl "\titem = proto_tree_add_text(tree, ndr->tvb, ndr->offset, 0, \"$e->{PARENT}{NAME}\");\n"; + pidl "\tsubtree = proto_item_add_subtree(item, ett_$e->{PARENT}{NAME});\n"; + pidl "\tif (!(ndr_flags & NDR_SCALARS)) goto buffers;\n"; pidl "\tndr_pull_struct_start(ndr);\n"; @@ -637,6 +640,7 @@ sub ParseTypedefPull($) } if ($e->{DATA}->{TYPE} eq "UNION") { + pidl "static gint ett_$e->{NAME} = -1;\n\n"; pidl $static . "void ndr_pull_$e->{NAME}(struct e_ndr_pull *ndr, proto_tree *tree, int ndr_flags, int level)"; pidl "\n{\n"; pidl "\tproto_item *item = NULL;\n"; @@ -860,8 +864,6 @@ sub NeededTypedef($) if ($t->{DATA}->{TYPE} eq "STRUCT") { - print "ett_$t->{NAME}\n"; - $needed{"ett_$t->{NAME}"} = 1; for my $e (@{$t->{DATA}->{ELEMENTS}}) { @@ -880,6 +882,9 @@ sub NeededTypedef($) } } if ($t->{DATA}->{TYPE} eq "UNION") { + + $needed{"ett_$t->{NAME}"} = 1; + for my $e (@{$t->{DATA}->{DATA}}) { $e->{PARENT} = $t->{DATA}; if ($e->{TYPE} eq "UNION_ELEMENT") { @@ -1048,9 +1053,6 @@ sub Parse($$) pidl "\t};\n\n"; - use Data::Dumper; - print Dumper(%needed); - pidl "\tstatic gint *ett[] = {\n"; pidl "\t\t&ett_dcerpc_$module,\n"; foreach my $x (keys(%needed)) { -- cgit