svn commit: samba r15367 - in
branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba4: .
jelmer at samba.org
jelmer at samba.org
Sun Apr 30 23:12:00 GMT 2006
Author: jelmer
Date: 2006-04-30 23:11:59 +0000 (Sun, 30 Apr 2006)
New Revision: 15367
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=15367
Log:
Fix unused function warnings in generated EJS code.
Modified:
branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba4/EJS.pm
Changeset:
Modified: branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba4/EJS.pm
===================================================================
--- branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba4/EJS.pm 2006-04-30 21:21:04 UTC (rev 15366)
+++ branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba4/EJS.pm 2006-04-30 23:11:59 UTC (rev 15367)
@@ -422,15 +422,13 @@
# on the non-array elements
foreach my $e (@{$d->{ELEMENTS}}) {
next unless (grep(/in/, @{$e->{DIRECTION}}));
- next if (has_property($e, "length_is") ||
- has_property($e, "size_is"));
+ next if (has_property($e, "length_is") || has_property($e, "size_is"));
EjsPullElementTop($e, $env);
}
foreach my $e (@{$d->{ELEMENTS}}) {
next unless (grep(/in/, @{$e->{DIRECTION}}));
- next unless (has_property($e, "length_is") ||
- has_property($e, "size_is"));
+ next unless (has_property($e, "length_is") || has_property($e, "size_is"));
EjsPullElementTop($e, $env);
}
@@ -760,7 +758,7 @@
foreach my $d (@{$interface->{FUNCTIONS}}) {
next if not defined($d->{OPNUM});
- next if Parse::Pidl::Util::has_property($d, "noejs");
+ next if has_property($d, "noejs");
EjsPullFunction($d);
EjsPushFunction($d);
@@ -846,14 +844,17 @@
sub NeededFunction($$)
{
my ($fn,$needed) = @_;
+
$needed->{"pull_$fn->{NAME}"} = 1;
$needed->{"push_$fn->{NAME}"} = 1;
- foreach my $e (@{$fn->{ELEMENTS}}) {
- if (grep (/in/, @{$e->{DIRECTION}})) {
- $needed->{"pull_$e->{TYPE}"} = 1;
+
+ foreach (@{$fn->{ELEMENTS}}) {
+ next if (has_property($_, "subcontext")); #FIXME: Support subcontexts
+ if (grep(/in/, @{$_->{DIRECTION}})) {
+ $needed->{"pull_$_->{TYPE}"} = 1;
}
- if (grep (/out/, @{$e->{DIRECTION}})) {
- $needed->{"push_$e->{TYPE}"} = 1;
+ if (grep(/out/, @{$_->{DIRECTION}})) {
+ $needed->{"push_$_->{TYPE}"} = 1;
}
}
}
@@ -861,20 +862,22 @@
sub NeededTypedef($$)
{
my ($t,$needed) = @_;
- if (Parse::Pidl::Util::has_property($t, "public")) {
- $needed->{"pull_$t->{NAME}"} = not Parse::Pidl::Util::has_property($t, "noejs");
- $needed->{"push_$t->{NAME}"} = not Parse::Pidl::Util::has_property($t, "noejs");
+
+ if (has_property($t, "public")) {
+ $needed->{"pull_$t->{NAME}"} = not has_property($t, "noejs");
+ $needed->{"push_$t->{NAME}"} = not has_property($t, "noejs");
}
- if ($t->{DATA}->{TYPE} ne "STRUCT" &&
- $t->{DATA}->{TYPE} ne "UNION") {
- return;
- }
- for my $e (@{$t->{DATA}->{ELEMENTS}}) {
- if ($needed->{"pull_$t->{NAME}"}) {
- $needed->{"pull_$e->{TYPE}"} = 1;
+
+ return if (($t->{DATA}->{TYPE} ne "STRUCT") and
+ ($t->{DATA}->{TYPE} ne "UNION"));
+
+ foreach (@{$t->{DATA}->{ELEMENTS}}) {
+ next if (has_property($_, "subcontext")); #FIXME: Support subcontexts
+ unless (defined($needed->{"pull_$_->{TYPE}"})) {
+ $needed->{"pull_$_->{TYPE}"} = $needed->{"pull_$t->{NAME}"};
}
- if ($needed->{"push_$t->{NAME}"}) {
- $needed->{"push_$e->{TYPE}"} = 1;
+ unless (defined($needed->{"push_$_->{TYPE}"})) {
+ $needed->{"push_$_->{TYPE}"} = $needed->{"push_$t->{NAME}"};
}
}
}
@@ -884,12 +887,9 @@
sub NeededInterface($$)
{
my ($interface,$needed) = @_;
- foreach my $d (@{$interface->{FUNCTIONS}}) {
- NeededFunction($d, $needed);
- }
- foreach my $d (reverse @{$interface->{TYPES}}) {
- NeededTypedef($d, $needed);
- }
+
+ NeededFunction($_, $needed) foreach (@{$interface->{FUNCTIONS}});
+ NeededTypedef($_, $needed) foreach (reverse @{$interface->{TYPES}});
}
1;
More information about the samba-cvs
mailing list