summaryrefslogtreecommitdiff
path: root/source4/build
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2005-05-27 18:36:23 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:17:07 -0500
commit8017286589abfeb9642bf2aea53dccfcb4956143 (patch)
tree628fa6753964d1afad666a29c3815a4fe370c8ee /source4/build
parent55781cdce67bdba9c6f37024ae1c76c74a8881de (diff)
downloadsamba-8017286589abfeb9642bf2aea53dccfcb4956143.tar.gz
samba-8017286589abfeb9642bf2aea53dccfcb4956143.tar.bz2
samba-8017286589abfeb9642bf2aea53dccfcb4956143.zip
r7037: Add enough pointers in the header file as well
Fix a couple of warnings. (This used to be commit fcaa9d495c13af5065dd32f8ed65d4260b3a5539)
Diffstat (limited to 'source4/build')
-rw-r--r--source4/build/pidl/ndr_header.pm22
1 files changed, 13 insertions, 9 deletions
diff --git a/source4/build/pidl/ndr_header.pm b/source4/build/pidl/ndr_header.pm
index 05c2f1f55c..05265bbf5b 100644
--- a/source4/build/pidl/ndr_header.pm
+++ b/source4/build/pidl/ndr_header.pm
@@ -60,20 +60,24 @@ sub HeaderElement($)
pidl tabs();
HeaderType($element, $element->{TYPE}, "");
pidl " ";
- my $pointers = 0;
+ my $prefix = "";
+ my $postfix = "";
foreach my $l (@{$element->{LEVELS}})
{
if (($l->{TYPE} eq "POINTER")) {
next if ($element->{TYPE} eq "string");
- pidl "*";
- $pointers+=1;
- } elsif ($l->{TYPE} eq "ARRAY") {
- if (!$pointers and !$l->{IS_FIXED}) { pidl "*"; }
- pidl "$element->{NAME}";
- if ($l->{IS_FIXED}) { pidl "[$l->{SIZE_IS}]"; }
- last; #FIXME
+ $prefix .= "*";
+ } elsif (($l->{TYPE} eq "ARRAY")) {
+ my $pl = Ndr::GetPrevLevel($element, $l);
+ next if ($pl and $pl->{TYPE} eq "POINTER");
+
+ if ($l->{IS_FIXED}) {
+ $postfix .= "[$l->{SIZE_IS}]";
+ } else {
+ $prefix .= "*";
+ }
} elsif ($l->{TYPE} eq "DATA") {
- pidl "$element->{NAME}";
+ pidl "$prefix$element->{NAME}$postfix";
}
}