Rev 11393: Move [in, out] parameters to r->inout. in
file:///home/jelmer/bzr.samba/pidl-fixes/
Jelmer Vernooij
jelmer at samba.org
Thu Feb 8 11:30:25 GMT 2007
At file:///home/jelmer/bzr.samba/pidl-fixes/
------------------------------------------------------------
revno: 11393
revision-id: jelmer at samba.org-20070208113014-hn0t8z5s0y1jfryz
parent: jelmer at samba.org-20070208112519-x9ru04sml0g8wq4x
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: pidl-fixes
timestamp: Thu 2007-02-08 12:30:14 +0100
message:
Move [in,out] parameters to r->inout.
modified:
source/pidl/lib/Parse/Pidl/Samba4/Header.pm svn-v2:12463 at 0c0555d6-39d7-0310-84fc-f1cc0bd64818-branches%2fSAMBA_4_0-source%2fpidl%2flib%2fParse%2fPidl%2fSamba4%2fHeader.pm
source/pidl/tests/header.pl header.pl-20070208094205-onb80lvoyh5ciw5r-1
=== modified file 'source/pidl/lib/Parse/Pidl/Samba4/Header.pm'
--- a/source/pidl/lib/Parse/Pidl/Samba4/Header.pm 2007-02-08 11:25:19 +0000
+++ b/source/pidl/lib/Parse/Pidl/Samba4/Header.pm 2007-02-08 11:30:14 +0000
@@ -287,23 +287,19 @@
$tab_depth++;
my $needed = 0;
- if (HeaderFunctionInOut_needed($fn, "in") or
- HeaderFunctionInOut_needed($fn, "inout")) {
+ if (HeaderFunctionInOut_needed($fn, "in")) {
pidl tabs()."struct {\n";
$tab_depth++;
HeaderFunctionInOut($fn, "in");
- HeaderFunctionInOut($fn, "inout");
$tab_depth--;
pidl tabs()."} in;\n\n";
$needed++;
}
- if (HeaderFunctionInOut_needed($fn, "out") or
- HeaderFunctionInOut_needed($fn, "inout")) {
+ if (HeaderFunctionInOut_needed($fn, "out")) {
pidl tabs()."struct {\n";
$tab_depth++;
HeaderFunctionInOut($fn, "out");
- HeaderFunctionInOut($fn, "inout");
if ($fn->{RETURN_TYPE} ne "void") {
pidl tabs().mapType($fn->{RETURN_TYPE}) . " result;\n";
}
@@ -312,6 +308,15 @@
$needed++;
}
+ if (HeaderFunctionInOut_needed($fn, "inout")) {
+ pidl tabs()."struct {\n";
+ $tab_depth++;
+ HeaderFunctionInOut($fn, "inout");
+ $tab_depth--;
+ pidl tabs()."} inout;\n\n";
+ $needed++;
+ }
+
if (!$needed) {
# sigh - some compilers don't like empty structures
pidl tabs()."int _dummy_element;\n";
=== modified file 'source/pidl/tests/header.pl'
--- a/source/pidl/tests/header.pl 2007-02-08 11:25:19 +0000
+++ b/source/pidl/tests/header.pl 2007-02-08 11:30:14 +0000
@@ -32,5 +32,5 @@
like(parse_idl("interface x { void foo ([out] uint32 x); };"),
qr/struct foo.*{.*struct\s+{\s+uint32_t x;\s+} out;.*};/sm, "fn out arg works");
like(parse_idl("interface x { void foo ([in,out] uint32 x); };"),
- qr/struct foo.*{.*struct\s+{\s+uint32_t x;\s+} in;\s+struct\s+{\s+uint32_t x;\s+} out;.*};/sm, "fn in,out arg works");
-like(parse_idl("interface x { void foo (uint32 x); };"), qr/struct foo.*{.*struct\s+{\s+uint32_t x;\s+} in;\s+struct\s+{\s+uint32_t x;\s+} out;.*};/sm, "fn with no props implies in,out");
+ qr/struct foo.*{.*struct\s+{\s+uint32_t x;\s+} inout;.*};/sm, "fn in,out arg works");
+like(parse_idl("interface x { void foo (uint32 x); };"), qr/struct foo.*{.*struct\s+{\s+uint32_t x;\s+} inout;\s+};/sm, "fn with no props implies in,out");
More information about the samba-cvs
mailing list