From 3e7cff6c0002d09489cbb186dcab57b72a0c1ed2 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 15 Sep 2006 14:32:30 +0000 Subject: r18554: Fix warnings about [out] arguments. (This used to be commit caac6cf817b09c864554e992f89437f6205b948b) --- source4/pidl/lib/Parse/Pidl/NDR.pm | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'source4/pidl') 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); } -- cgit