r5660: Reduce number of generated "{}"'s
authorJelmer Vernooij <jelmer@samba.org>
Sat, 5 Mar 2005 16:50:02 +0000 (16:50 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:10:56 +0000 (13:10 -0500)
No longer complain about pointers to arrays - we support those.

source/build/pidl/ndr.pm
source/build/pidl/validator.pm

index c460c92c95a037cf929ab1f41571c913ceed876e..8a654f71655b666d6c9e6fe31d49f89c0609395e 100644 (file)
@@ -1820,15 +1820,18 @@ sub ParseFunctionElementPull($$)
                        pidl "NDR_CHECK(ndr_pull_unique_ptr(ndr, &_ptr_$e->{NAME}));";
                        pidl "r->$inout.$e->{NAME} = NULL;";
                        pidl "if (_ptr_$e->{NAME}) {";
+                       indent;
                } elsif ($inout eq "out" && util::has_property($e, "ref")) {
                        pidl "if (r->$inout.$e->{NAME}) {";
-               } else {
-                       pidl "{";
+                       indent;
                }
-               indent;
+
                ParseArrayPull($e, "ndr", "r->$inout.", "NDR_SCALARS|NDR_BUFFERS");
-               deindent;
-               pidl "}";
+
+               if (need_wire_pointer($e) or ($inout eq "out" and util::has_property($e, "ref"))) {
+                       deindent;
+                       pidl "}";
+               }
        } else {
                if ($inout eq "out" && util::has_property($e, "ref")) {
                        pidl "if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {";
index cf7df0dcb24abd9d2c5e373142cd46d5de9f0f03..37f2e26e413aee2b0e582cbfc09ac499c6bd5a84 100644 (file)
@@ -40,9 +40,6 @@ sub el_name($)
 sub ValidElement($)
 {
        my $e = shift;
-       if ($e->{POINTERS} && $e->{ARRAY_LEN}) {
-               fatal(el_name($e) . " : pidl cannot handle pointers to arrays. Use a substructure instead\n");
-       }
        
        if (util::has_property($e, "ptr")) {
                fatal(el_name($e) . " : pidl does not support full NDR pointers yet\n");