summaryrefslogtreecommitdiff
path: root/source4/pidl/lib/Parse/Pidl/Samba4/NDR
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2008-02-01 09:54:25 +0100
committerStefan Metzmacher <metze@samba.org>2008-02-01 21:50:22 +0100
commita0c83e990f6dfda809600a0160e383f89bfe2f6c (patch)
treeb0979b7de47442f0d923818e985c99b836695b16 /source4/pidl/lib/Parse/Pidl/Samba4/NDR
parentc94ee074998a623dd9e47ca35b73ba2a83fbfeca (diff)
downloadsamba-a0c83e990f6dfda809600a0160e383f89bfe2f6c.tar.gz
samba-a0c83e990f6dfda809600a0160e383f89bfe2f6c.tar.bz2
samba-a0c83e990f6dfda809600a0160e383f89bfe2f6c.zip
CHECKED... TODO:MSG pidl/Samba4::NDR::Parser: fix ...
metze (This used to be commit 29c104944bcad30c6a2a3fa70d527bf0ee8969de)
Diffstat (limited to 'source4/pidl/lib/Parse/Pidl/Samba4/NDR')
-rw-r--r--source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm17
1 files changed, 14 insertions, 3 deletions
diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
index 81e8a21625..281018d4cc 100644
--- a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
+++ b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
@@ -42,19 +42,21 @@ sub append_prefix($$)
{
my ($e, $var_name) = @_;
my $pointers = 0;
+ my $arrays = 0;
foreach my $l (@{$e->{LEVELS}}) {
if ($l->{TYPE} eq "POINTER") {
$pointers++;
} elsif ($l->{TYPE} eq "ARRAY") {
+ $arrays++;
if (($pointers == 0) and
(not $l->{IS_FIXED}) and
(not $l->{IS_INLINE})) {
- return get_value_of($var_name);
+ return get_value_of($var_name);
}
} elsif ($l->{TYPE} eq "DATA") {
if (Parse::Pidl::Typelist::scalar_is_reference($l->{DATA_TYPE})) {
- return get_value_of($var_name) unless ($pointers);
+ return get_value_of($var_name) unless ($pointers or $arrays);
}
}
}
@@ -684,8 +686,17 @@ sub need_pointer_to($$$)
return 1 if $scalar_only;
}
+ my $arrays = 0;
+
+ foreach my $tl (@{$e->{LEVELS}}) {
+ last if $l == $tl;
+ if ($tl->{TYPE} eq "ARRAY") {
+ $arrays++;
+ }
+ }
+
if (Parse::Pidl::Typelist::scalar_is_reference($t)) {
- return 1;
+ return 1 unless $arrays;
}
return 0;