diff options
author | Andrew Bartlett <abartlet@samba.org> | 2009-03-08 16:16:11 +1100 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2009-03-08 16:16:11 +1100 |
commit | 6ac77d19b5a25a53459a58e4828fa9eac0bf11f4 (patch) | |
tree | bb504eecdcb94d6c82b522f5de0fd13de130fb41 /pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm | |
parent | bb6a2c8076e5e9eabad4ee7f09f6df979616fd13 (diff) | |
parent | 46bcb10b5abb21758cf234764b64220ede1b7ab5 (diff) | |
download | samba-6ac77d19b5a25a53459a58e4828fa9eac0bf11f4.tar.gz samba-6ac77d19b5a25a53459a58e4828fa9eac0bf11f4.tar.bz2 samba-6ac77d19b5a25a53459a58e4828fa9eac0bf11f4.zip |
Merge branch 'master' of ssh://git.samba.org/data/git/samba into wspp-schema
Diffstat (limited to 'pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm')
-rw-r--r-- | pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm b/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm index 34aebc7f0f..7ce9708e14 100644 --- a/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm +++ b/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm @@ -1256,7 +1256,7 @@ sub ParseStructPush($$$$) EnvSubstituteValue($env, $struct); - $self->DeclareArrayVariables($_) foreach (@{$struct->{ELEMENTS}}); + $self->DeclareArrayVariablesNoZero($_, $env) foreach (@{$struct->{ELEMENTS}}); $self->start_flags($struct, $ndr); @@ -1481,6 +1481,24 @@ sub DeclareArrayVariables($$) } } +sub DeclareArrayVariablesNoZero($$$) +{ + my ($self,$e,$env) = @_; + + foreach my $l (@{$e->{LEVELS}}) { + next if has_fast_array($e,$l); + next if is_charset_array($e,$l); + if ($l->{TYPE} eq "ARRAY") { + my $length = ParseExpr($l->{LENGTH_IS}, $env, $e->{ORIGINAL}); + if ($length eq "0") { + warning($e->{ORIGINAL}, "pointless array cntr: 'cntr_$e->{NAME}_$l->{LEVEL_INDEX}': length=$length"); + } else { + $self->pidl("uint32_t cntr_$e->{NAME}_$l->{LEVEL_INDEX};"); + } + } + } +} + sub DeclareMemCtxVariables($$) { my ($self,$e) = @_; |