diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2004-10-12 10:32:54 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:59:49 -0500 |
commit | 2e8b3926c69ee1d98a8958a8548ec2007ff2a3fb (patch) | |
tree | 62260b54161fe22ffcecf5b2181669bed2c2b50a | |
parent | 94c18cd1a3399a621f6191e16e925e18bf641707 (diff) | |
download | samba-2e8b3926c69ee1d98a8958a8548ec2007ff2a3fb.tar.gz samba-2e8b3926c69ee1d98a8958a8548ec2007ff2a3fb.tar.bz2 samba-2e8b3926c69ee1d98a8958a8548ec2007ff2a3fb.zip |
r2933: Only pull a union once when it occurs in a subcontext
(This used to be commit 309623447eef9ae554e2f25713c2123ab578cc6e)
-rw-r--r-- | source4/build/pidl/parser.pm | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/source4/build/pidl/parser.pm b/source4/build/pidl/parser.pm index 621b12aa62..edecc24284 100644 --- a/source4/build/pidl/parser.pm +++ b/source4/build/pidl/parser.pm @@ -454,7 +454,9 @@ sub ParseElementPullSwitch($$$$) my $sub_size = util::has_property($e, "subcontext"); if (defined $sub_size) { - pidl "\tNDR_CHECK(ndr_pull_subcontext_union_fn(ndr, $sub_size, $switch_var, $cprefix$var_prefix$e->{NAME}, (ndr_pull_union_fn_t) ndr_pull_$e->{TYPE}));\n"; + pidl "\tif (($ndr_flags) & NDR_SCALARS) {\n"; + pidl "\t\tNDR_CHECK(ndr_pull_subcontext_union_fn(ndr, $sub_size, $switch_var, $cprefix$var_prefix$e->{NAME}, (ndr_pull_union_fn_t) ndr_pull_$e->{TYPE}));\n"; + pidl "\t}\n"; } else { pidl "\tNDR_CHECK(ndr_pull_$e->{TYPE}(ndr, $ndr_flags, $switch_var, $cprefix$var_prefix$e->{NAME}));\n"; } @@ -484,7 +486,9 @@ sub ParseElementPushSwitch($$$$) my $sub_size = util::has_property($e, "subcontext"); if (defined $sub_size) { - pidl "\tNDR_CHECK(ndr_push_subcontext_union_fn(ndr, $sub_size, $switch_var, $cprefix$var_prefix$e->{NAME}, (ndr_push_union_fn_t) ndr_push_$e->{TYPE}));\n"; + pidl "\tif(($ndr_flags) & NDR_SCALARS) {\n"; + pidl "\t\tNDR_CHECK(ndr_push_subcontext_union_fn(ndr, $sub_size, $switch_var, $cprefix$var_prefix$e->{NAME}, (ndr_push_union_fn_t) ndr_push_$e->{TYPE}));\n"; + pidl "\t}\n"; } else { pidl "\tNDR_CHECK(ndr_push_$e->{TYPE}(ndr, $ndr_flags, $switch_var, $cprefix$var_prefix$e->{NAME}));\n"; } |