r7037: Add enough pointers in the header file as well
authorJelmer Vernooij <jelmer@samba.org>
Fri, 27 May 2005 18:36:23 +0000 (18:36 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:17:07 +0000 (13:17 -0500)
Fix a couple of warnings.
(This used to be commit fcaa9d495c13af5065dd32f8ed65d4260b3a5539)

source4/build/pidl/ndr_header.pm
source4/librpc/idl/orpc.idl

index 05c2f1f55c3d0660ae7cb2adb0b9d04588556c81..05265bbf5bd12b91433b223ec62b788fdaaf371a 100644 (file)
@@ -60,20 +60,24 @@ sub HeaderElement($)
     pidl tabs();
     HeaderType($element, $element->{TYPE}, "");
     pidl " ";
-    my $pointers = 0;
+       my $prefix = "";
+       my $postfix = "";
        foreach my $l (@{$element->{LEVELS}}) 
        {
                if (($l->{TYPE} eq "POINTER")) {
                        next if ($element->{TYPE} eq "string");
-                   pidl "*";
-                   $pointers+=1;
-           } elsif ($l->{TYPE} eq "ARRAY") {
-               if (!$pointers and !$l->{IS_FIXED}) { pidl "*"; }
-               pidl "$element->{NAME}";
-               if ($l->{IS_FIXED}) { pidl "[$l->{SIZE_IS}]"; }
-               last; #FIXME
+                       $prefix .= "*";
+           } elsif (($l->{TYPE} eq "ARRAY")) {
+                       my $pl = Ndr::GetPrevLevel($element, $l);
+                       next if ($pl and $pl->{TYPE} eq "POINTER");
+
+                       if ($l->{IS_FIXED}) { 
+                               $postfix .= "[$l->{SIZE_IS}]"; 
+                       } else {
+                               $prefix .= "*";
+                       }
            } elsif ($l->{TYPE} eq "DATA") {
-               pidl "$element->{NAME}";
+               pidl "$prefix$element->{NAME}$postfix";
                }
        }
        
index 4b80c5bfe63f737dd5ae64a2d11bacf90d60855e..1934a3cbed7f4076b36a0832ed44365830940ba2 100644 (file)
@@ -59,7 +59,7 @@ interface ObjectRpcBaseTypes
        {       
                GUID id; /* Extension identifier. */
                uint32 size; /* Extension size. */
-               [size_is((size+7)&~7)] uint8 data[]; /* Extension data. */
+               [size_is(((size+7)&~7))] uint8 data[]; /* Extension data. */
        }       ORPC_EXTENT;
 
 
@@ -68,7 +68,7 @@ interface ObjectRpcBaseTypes
        {
                uint32 size; /* Num extents. */
                uint32 reserved; /* Must be zero. */
-               [size_is((size+1)&~1,), unique] ORPC_EXTENT **extent; /* extents */
+               [size_is(((size+1)&~1))] ORPC_EXTENT **extent; /* extents */
        } ORPC_EXTENT_ARRAY;