From b94fcbd306bbf758d26fb40c7c0a1b00ba6fe38d Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 10 Oct 2005 11:47:23 +0000 Subject: r10868: make flag(NDR_PAHEX) possible to use and show the union level in hex metze (This used to be commit 7efb92adc057ad8a993eb9de66c3806608747104) --- source4/pidl/lib/Parse/Pidl/Samba/NDR/Parser.pm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'source4/pidl') diff --git a/source4/pidl/lib/Parse/Pidl/Samba/NDR/Parser.pm b/source4/pidl/lib/Parse/Pidl/Samba/NDR/Parser.pm index da60a02059..2ccbc057fc 100644 --- a/source4/pidl/lib/Parse/Pidl/Samba/NDR/Parser.pm +++ b/source4/pidl/lib/Parse/Pidl/Samba/NDR/Parser.pm @@ -1624,15 +1624,17 @@ sub ParseUnionPrint($$) my ($e,$name) = @_; my $have_default = 0; - pidl "int level = ndr_print_get_switch_value(ndr, r);"; - + pidl "int level;"; foreach my $el (@{$e->{ELEMENTS}}) { DeclareArrayVariables($el); } - pidl "ndr_print_union(ndr, name, level, \"$name\");"; start_flags($e); + pidl "level = ndr_print_get_switch_value(ndr, r);"; + + pidl "ndr_print_union(ndr, name, level, \"$name\");"; + pidl "switch (level) {"; indent; foreach my $el (@{$e->{ELEMENTS}}) { -- cgit