summaryrefslogtreecommitdiff
path: root/pidl
diff options
context:
space:
mode:
Diffstat (limited to 'pidl')
-rw-r--r--pidl/README5
-rw-r--r--pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm20
-rw-r--r--pidl/lib/Parse/Pidl/Samba4/TDR.pm2
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"); }