diff options
author | Stefan Metzmacher <metze@samba.org> | 2007-08-17 13:53:12 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 15:02:10 -0500 |
commit | 75564a9d0ece0c050923339b09457bc3dd1a5f5d (patch) | |
tree | 6f2741d4ad7f4631dd8ef2cf7225c7932382c058 /source4/pidl/lib/Parse/Pidl/Samba3 | |
parent | b379e50351c7cd7069ab75115a39749d6eba60ac (diff) | |
download | samba-75564a9d0ece0c050923339b09457bc3dd1a5f5d.tar.gz samba-75564a9d0ece0c050923339b09457bc3dd1a5f5d.tar.bz2 samba-75564a9d0ece0c050923339b09457bc3dd1a5f5d.zip |
r24524: make use of ElementStars()
metze
(This used to be commit 701aa31d14cde412c1fecef694d851882be8d17f)
Diffstat (limited to 'source4/pidl/lib/Parse/Pidl/Samba3')
-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($$$$) |