Author: jelmer Date: 2006-09-15 14:32:30 +0000 (Fri, 15 Sep 2006) New Revision: 18554
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=18554 Log: Fix warnings about [out] arguments. Modified: branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/NDR.pm Changeset: Modified: branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/NDR.pm =================================================================== --- branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/NDR.pm 2006-09-15 14:30:23 UTC (rev 18553) +++ branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/NDR.pm 2006-09-15 14:32:30 UTC (rev 18554) @@ -109,6 +109,15 @@ @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 @@ 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); }