diff options
Diffstat (limited to 'source4/pidl')
-rw-r--r-- | source4/pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm | 32 |
1 files changed, 8 insertions, 24 deletions
diff --git a/source4/pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm b/source4/pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm index a8e7c347b3..071163c300 100644 --- a/source4/pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm +++ b/source4/pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm @@ -11,7 +11,7 @@ use Parse::Pidl qw(warning fatal); use Parse::Pidl::Typelist qw(mapTypeName scalar_is_reference); use Parse::Pidl::Util qw(ParseExpr has_property is_constant); use Parse::Pidl::NDR qw(GetNextLevel); -use Parse::Pidl::Samba4 qw(DeclLong); +use Parse::Pidl::Samba4 qw(ElementStars DeclLong); use Parse::Pidl::Samba4::NDR::Parser qw(GenerateFunctionOutEnv); use vars qw($VERSION); @@ -28,36 +28,20 @@ sub fn_declare($) { my ($n) = @_; pidl $n; pidl_hdr "$n;"; } sub DeclLevel($$) { - sub DeclLevel($$); my ($e, $l) = @_; - - my $ret = ""; + my $res = ""; if (has_property($e, "charset")) { - $ret.="const char"; + $res .= "const char"; } else { - $ret.=mapTypeName($e->{TYPE}); + $res .= mapTypeName($e->{TYPE}); } - my $numstar = $e->{ORIGINAL}->{POINTERS}; - if ($numstar >= 1) { - $numstar-- if scalar_is_reference($e->{TYPE}); - } - foreach (@{$e->{ORIGINAL}->{ARRAY_LEN}}) - { - next if is_constant($_) and - not has_property($e, "charset"); - $numstar++; - } - $numstar -= $l; - die ("Too few pointers") if $numstar < 0; - if ($numstar > 0) - { - $ret.=" "; - $ret.="*" foreach (1..$numstar); - } + my $stars = ElementStars($e, $l); + + $res .= " ".$stars unless ($stars eq ""); - return $ret; + return $res; } sub AllocOutVar($$$$) |