diff options
author | Stefan Metzmacher <metze@samba.org> | 2007-08-17 07:46:34 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 15:02:04 -0500 |
commit | 9785c25519c412670ee6fc7e39828e6744e66e14 (patch) | |
tree | a03fb88178f8fbf72237dbfa5c78bbbab0b90ae5 /source4/pidl/lib | |
parent | f9bca9e9acc3188f9c8449b2505c0c723dd516af (diff) | |
download | samba-9785c25519c412670ee6fc7e39828e6744e66e14.tar.gz samba-9785c25519c412670ee6fc7e39828e6744e66e14.tar.bz2 samba-9785c25519c412670ee6fc7e39828e6744e66e14.zip |
r24506: pass $fn down one more layer
metze
(This used to be commit 8cc3fd09ffce6f389d979ec0a49d2ecefda70dd1)
Diffstat (limited to 'source4/pidl/lib')
-rw-r--r-- | source4/pidl/lib/Parse/Pidl/Samba4/Header.pm | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/Header.pm b/source4/pidl/lib/Parse/Pidl/Samba4/Header.pm index 3c0a7bc24e..e10f647635 100644 --- a/source4/pidl/lib/Parse/Pidl/Samba4/Header.pm +++ b/source4/pidl/lib/Parse/Pidl/Samba4/Header.pm @@ -254,8 +254,10 @@ sub HeaderFunctionInOut($$) { my($fn,$prop) = @_; - foreach (@{$fn->{ELEMENTS}}) { - HeaderElement($_) if (ElementDirection($_) eq $prop); + return unless defined($fn->{ELEMENTS}); + + foreach my $e (@{$fn->{ELEMENTS}}) { + HeaderElement($e->{ORIGINAL}) if (ElementDirection($e) eq $prop); } } @@ -265,10 +267,12 @@ sub HeaderFunctionInOut_needed($$) { my($fn,$prop) = @_; - return 1 if ($prop eq "out" && $fn->{RETURN_TYPE} ne "void"); + return 1 if ($prop eq "out" && defined($fn->{RETURN_TYPE})); + + return undef unless defined($fn->{ELEMENTS}); - foreach (@{$fn->{ELEMENTS}}) { - return 1 if (ElementDirection($_) eq $prop); + foreach my $e (@{$fn->{ELEMENTS}}) { + return 1 if (ElementDirection($e) eq $prop); } return undef; @@ -290,23 +294,23 @@ sub HeaderFunction($) $tab_depth++; my $needed = 0; - if (HeaderFunctionInOut_needed($fn->{ORIGINAL}, "in") or - HeaderFunctionInOut_needed($fn->{ORIGINAL}, "inout")) { + if (HeaderFunctionInOut_needed($fn, "in") or + HeaderFunctionInOut_needed($fn, "inout")) { pidl tabs()."struct {\n"; $tab_depth++; - HeaderFunctionInOut($fn->{ORIGINAL}, "in"); - HeaderFunctionInOut($fn->{ORIGINAL}, "inout"); + HeaderFunctionInOut($fn, "in"); + HeaderFunctionInOut($fn, "inout"); $tab_depth--; pidl tabs()."} in;\n\n"; $needed++; } - if (HeaderFunctionInOut_needed($fn->{ORIGINAL}, "out") or - HeaderFunctionInOut_needed($fn->{ORIGINAL}, "inout")) { + if (HeaderFunctionInOut_needed($fn, "out") or + HeaderFunctionInOut_needed($fn, "inout")) { pidl tabs()."struct {\n"; $tab_depth++; - HeaderFunctionInOut($fn->{ORIGINAL}, "out"); - HeaderFunctionInOut($fn->{ORIGINAL}, "inout"); + HeaderFunctionInOut($fn, "out"); + HeaderFunctionInOut($fn, "inout"); if (defined($fn->{RETURN_TYPE})) { pidl tabs().mapTypeName($fn->{RETURN_TYPE}) . " result;\n"; } |