From 59cbaa1ce8ef816f486d0763dc7be5ab299fa4c8 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sat, 8 May 2010 09:44:09 +0200 Subject: [PATCH] TODO: pidl:NDR/Parser: for ndr64 the union alignment comes before the switch_type metze --- pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm b/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm index 4c23dfa..955ed17 100644 --- a/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm +++ b/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm @@ -1664,14 +1664,14 @@ sub ParseUnionPushPrimitives($$$$) $self->pidl("int level = ndr_push_get_switch_value($ndr, $varname);"); - if (defined($e->{SWITCH_TYPE})) { - $self->pidl("NDR_CHECK(ndr_push_$e->{SWITCH_TYPE}($ndr, NDR_SCALARS, level));"); - } - if (defined($e->{ALIGN})) { $self->pidl("NDR_CHECK(ndr_push_union_align($ndr, $e->{ALIGN}));"); } + if (defined($e->{SWITCH_TYPE})) { + $self->pidl("NDR_CHECK(ndr_push_$e->{SWITCH_TYPE}($ndr, NDR_SCALARS, level));"); + } + $self->pidl("switch (level) {"); $self->indent; foreach my $el (@{$e->{ELEMENTS}}) { @@ -1809,6 +1809,10 @@ sub ParseUnionPullPrimitives($$$$$) my ($self,$e,$ndr,$varname,$switch_type) = @_; my $have_default = 0; + if (defined($e->{ALIGN})) { + $self->pidl("NDR_CHECK(ndr_pull_union_align($ndr, $e->{ALIGN}));"); + } + if (defined($switch_type)) { $self->pidl("NDR_CHECK(ndr_pull_$switch_type($ndr, NDR_SCALARS, &_level));"); $self->pidl("if (_level != level) {"); @@ -1816,10 +1820,6 @@ sub ParseUnionPullPrimitives($$$$$) $self->pidl("}"); } - if (defined($e->{ALIGN})) { - $self->pidl("NDR_CHECK(ndr_pull_union_align($ndr, $e->{ALIGN}));"); - } - $self->pidl("switch (level) {"); $self->indent; foreach my $el (@{$e->{ELEMENTS}}) { -- 1.6.3.3