summaryrefslogtreecommitdiff
path: root/source4/pidl/lib
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2006-09-15 14:32:30 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:18:45 -0500
commit3e7cff6c0002d09489cbb186dcab57b72a0c1ed2 (patch)
tree7071c8c24cfdad2dd677bb8bd42c8cf38299f44e /source4/pidl/lib
parent45e566b7cc180d9a873284c07539233a856a694f (diff)
downloadsamba-3e7cff6c0002d09489cbb186dcab57b72a0c1ed2.tar.gz
samba-3e7cff6c0002d09489cbb186dcab57b72a0c1ed2.tar.bz2
samba-3e7cff6c0002d09489cbb186dcab57b72a0c1ed2.zip
r18554: Fix warnings about [out] arguments.
(This used to be commit caac6cf817b09c864554e992f89437f6205b948b)
Diffstat (limited to 'source4/pidl/lib')
-rw-r--r--source4/pidl/lib/Parse/Pidl/NDR.pm14
1 files changed, 9 insertions, 5 deletions
diff --git a/source4/pidl/lib/Parse/Pidl/NDR.pm b/source4/pidl/lib/Parse/Pidl/NDR.pm
index f274836fe7..114de797b8 100644
--- a/source4/pidl/lib/Parse/Pidl/NDR.pm
+++ b/source4/pidl/lib/Parse/Pidl/NDR.pm
@@ -109,6 +109,15 @@ sub GetElementLevelTable($)
@bracket_array = @{$e->{ARRAY_LEN}};
}
+ if (has_property($e, "out")) {
+ my $needptrs = 1;
+
+ if (has_property($e, "string")) { $needptrs++; }
+ if ($#bracket_array >= 0) { $needptrs = 0; }
+
+ nonfatal($e, "[out] argument `$e->{NAME}' not a pointer") if ($needptrs > $e->{POINTERS});
+ }
+
# Parse the [][][][] style array stuff
for my $i (0 .. $#bracket_array) {
my $d = $bracket_array[$#bracket_array - $i];
@@ -543,11 +552,6 @@ sub ParseFunction($$$)
push (@{$e->{DIRECTION}}, "in") if (has_property($x, "in"));
push (@{$e->{DIRECTION}}, "out") if (has_property($x, "out"));
- nonfatal($x, "`$e->{NAME}' is [out] argument but not a pointer or array")
- if ($e->{LEVELS}[0]->{TYPE} ne "POINTER" and
- $e->{LEVELS}[0]->{TYPE} ne "ARRAY" and
- grep(/out/, @{$e->{DIRECTION}}));
-
push (@elements, $e);
}