svn commit: samba r24524 - in
branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba3: .
metze at samba.org
metze at samba.org
Fri Aug 17 13:53:13 GMT 2007
Author: metze
Date: 2007-08-17 13:53:12 +0000 (Fri, 17 Aug 2007)
New Revision: 24524
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=24524
Log:
make use of ElementStars()
metze
Modified:
branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm
Changeset:
Modified: branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm
===================================================================
--- branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm 2007-08-17 13:47:03 UTC (rev 24523)
+++ branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm 2007-08-17 13:53:12 UTC (rev 24524)
@@ -11,7 +11,7 @@
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 DeclLevel($$)
{
- sub DeclLevel($$);
my ($e, $l) = @_;
+ my $res = "";
- my $ret = "";
-
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);
- return $ret;
+ $res .= " ".$stars unless ($stars eq "");
+
+ return $res;
}
sub AllocOutVar($$$$)
More information about the samba-cvs
mailing list