summaryrefslogtreecommitdiff
path: root/source4/build/pidl
diff options
context:
space:
mode:
Diffstat (limited to 'source4/build/pidl')
-rw-r--r--source4/build/pidl/Parse/Pidl/NDR.pm5
-rw-r--r--source4/build/pidl/Parse/Pidl/Samba/NDR/Parser.pm15
2 files changed, 11 insertions, 9 deletions
diff --git a/source4/build/pidl/Parse/Pidl/NDR.pm b/source4/build/pidl/Parse/Pidl/NDR.pm
index 0c2b00539d..33d7839a3a 100644
--- a/source4/build/pidl/Parse/Pidl/NDR.pm
+++ b/source4/build/pidl/Parse/Pidl/NDR.pm
@@ -9,7 +9,7 @@ package Parse::Pidl::NDR;
require Exporter;
@ISA = qw(Exporter);
-@EXPORT = qw(GetPrevLevel GetNextLevel);
+@EXPORT = qw(GetPrevLevel GetNextLevel ContainsDeferred);
use strict;
use Parse::Pidl::Typelist qw(hasType getType);
@@ -195,7 +195,6 @@ sub GetElementLevelTable($)
nonfatal($e, "string() attribute on non-array element");
}
-
push (@$order, {
TYPE => "DATA",
DATA_TYPE => $e->{TYPE},
@@ -216,13 +215,13 @@ sub can_contain_deferred
{
my $e = shift;
- return 1 if ($e->{POINTERS});
return 0 if (Parse::Pidl::Typelist::is_scalar($e->{TYPE}));
return 1 unless (hasType($e->{TYPE})); # assume the worst
my $type = getType($e->{TYPE});
foreach my $x (@{$type->{DATA}->{ELEMENTS}}) {
+ return 1 if ($x->{POINTERS});
return 1 if (can_contain_deferred ($x));
}
diff --git a/source4/build/pidl/Parse/Pidl/Samba/NDR/Parser.pm b/source4/build/pidl/Parse/Pidl/Samba/NDR/Parser.pm
index c04182ee14..c720ad6925 100644
--- a/source4/build/pidl/Parse/Pidl/Samba/NDR/Parser.pm
+++ b/source4/build/pidl/Parse/Pidl/Samba/NDR/Parser.pm
@@ -10,7 +10,7 @@ package Parse::Pidl::Samba::NDR::Parser;
use strict;
use Parse::Pidl::Typelist qw(hasType getType);
use Parse::Pidl::Util qw(has_property ParseExpr);
-use Parse::Pidl::NDR qw(GetPrevLevel GetNextLevel);
+use Parse::Pidl::NDR qw(GetPrevLevel GetNextLevel ContainsDeferred);
# list of known types
my %typefamily;
@@ -55,7 +55,10 @@ sub has_fast_array($$)
return 0 unless ($nl->{TYPE} eq "DATA");
return 0 unless (hasType($nl->{DATA_TYPE}));
- return Parse::Pidl::Typelist::is_scalar($nl->{DATA_TYPE});
+ my $t = getType($nl->{DATA_TYPE});
+
+ # Only uint8 and string have fast array functions at the moment
+ return ($t->{NAME} eq "uint8") or ($t->{NAME} eq "string");
}
sub get_pointer_to($)
@@ -567,7 +570,7 @@ sub ParseElementPushLevel
pidl "}";
}
- if ($deferred and Parse::Pidl::NDR::ContainsDeferred($e, $l)) {
+ if ($deferred and ContainsDeferred($e, $l)) {
pidl "for ($counter = 0; $counter < $length; $counter++) {";
indent;
ParseElementPushLevel($e, GetNextLevel($e, $l), $ndr, $var_name, $env, 0, 1);
@@ -590,7 +593,7 @@ sub ParseElementPush($$$$$$)
$var_name = append_prefix($e, $var_name);
- return unless $primitives or ($deferred and Parse::Pidl::NDR::ContainsDeferred($e, $e->{LEVELS}[0]));
+ return unless $primitives or ($deferred and ContainsDeferred($e, $e->{LEVELS}[0]));
start_flags($e);
@@ -881,7 +884,7 @@ sub ParseElementPullLevel
}
}
- if ($deferred and Parse::Pidl::NDR::ContainsDeferred($e, $l)) {
+ if ($deferred and ContainsDeferred($e, $l)) {
pidl "for ($counter = 0; $counter < $length; $counter++) {";
indent;
ParseElementPullLevel($e,GetNextLevel($e,$l), $ndr, $var_name, $env, 0, 1);
@@ -903,7 +906,7 @@ sub ParseElementPull($$$$$$)
$var_name = append_prefix($e, $var_name);
- return unless $primitives or ($deferred and Parse::Pidl::NDR::ContainsDeferred($e, $e->{LEVELS}[0]));
+ return unless $primitives or ($deferred and ContainsDeferred($e, $e->{LEVELS}[0]));
start_flags($e);