diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2009-03-20 01:30:36 +0100 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2009-03-20 01:30:36 +0100 |
commit | 5fe2b28f45289dc5578cdd536600f0d30a14d820 (patch) | |
tree | 4bdf36d0d4d8bdddcb3d618b4b01839370ed57c3 /pidl | |
parent | ec9aeeab00584f4d3dfe9afb83dc1a77b8463b81 (diff) | |
parent | 3a4638db0351368d3b148bf547546f28fa0b1479 (diff) | |
download | samba-5fe2b28f45289dc5578cdd536600f0d30a14d820.tar.gz samba-5fe2b28f45289dc5578cdd536600f0d30a14d820.tar.bz2 samba-5fe2b28f45289dc5578cdd536600f0d30a14d820.zip |
Merge branch 'master' of git://git.samba.org/samba into minschema
Diffstat (limited to 'pidl')
-rw-r--r-- | pidl/README | 5 | ||||
-rw-r--r-- | pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm | 20 | ||||
-rw-r--r-- | pidl/lib/Parse/Pidl/Samba4/TDR.pm | 2 |
3 files changed, 23 insertions, 4 deletions
diff --git a/pidl/README b/pidl/README index 8f31e408d5..c6b7e11792 100644 --- a/pidl/README +++ b/pidl/README @@ -3,8 +3,9 @@ Introduction: This directory contains the source code of the pidl (Perl IDL) compiler for Samba 4. -The main sources for pidl are available by Subversion on -svn://svnanon.samba.org/samba/branches/SAMBA_4_0/source/pidl +The main sources for pidl are available using Git as part of +the combined Samba 3 / Samba 4 tree. Use: +git clone git://git.samba.org/samba.git Pidl works by building a parse tree from a .pidl file (a simple dump of it's internal parse tree) or a .idl file 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) = @_; diff --git a/pidl/lib/Parse/Pidl/Samba4/TDR.pm b/pidl/lib/Parse/Pidl/Samba4/TDR.pm index 568dff5adf..a6b74a0ba4 100644 --- a/pidl/lib/Parse/Pidl/Samba4/TDR.pm +++ b/pidl/lib/Parse/Pidl/Samba4/TDR.pm @@ -271,7 +271,7 @@ sub Parser($$$$) $self->pidl(""); $self->pidl_hdr("/* autogenerated by pidl */"); $self->pidl_hdr("#include \"$baseheader\""); - $self->pidl_hdr(choose_header("tdr/tdr.h", "tdr.h")); + $self->pidl_hdr(choose_header("lib/tdr/tdr.h", "tdr.h")); $self->pidl_hdr(""); foreach (@$idl) { $self->ParserInterface($_) if ($_->{TYPE} eq "INTERFACE"); } |