The branch, master has been updated
       via  08b180e40e5179cc02d4aa1867d5063f47b85790 (commit)
       via  74293f117b08ffefdad78828ad9cfa8f8f6049e0 (commit)
       via  e2469e37488fe46257f1f4f4f8b0ebe11c08da47 (commit)
      from  09ac816b36e45fd537af2f7fe7c57a11f5c744f5 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 08b180e40e5179cc02d4aa1867d5063f47b85790
Merge: 74293f117b08ffefdad78828ad9cfa8f8f6049e0 
09ac816b36e45fd537af2f7fe7c57a11f5c744f5
Author: Jelmer Vernooij <jel...@samba.org>
Date:   Sun Mar 1 17:13:10 2009 +0100

    Merge branch 'master' of ssh://git.samba.org/data/git/samba into talloc-next

commit 74293f117b08ffefdad78828ad9cfa8f8f6049e0
Author: Jelmer Vernooij <jel...@samba.org>
Date:   Sun Mar 1 17:09:45 2009 +0100

    Rerun pidl.

commit e2469e37488fe46257f1f4f4f8b0ebe11c08da47
Author: Jelmer Vernooij <jel...@samba.org>
Date:   Sun Mar 1 17:09:07 2009 +0100

    Don't generate array iterators when the length of the array is always 0.
    (bug #6140)

-----------------------------------------------------------------------

Summary of changes:
 librpc/gen_ndr/ndr_drsblobs.c            |    6 ------
 pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm |   10 ++++++++--
 2 files changed, 8 insertions(+), 8 deletions(-)


Changeset truncated at 500 lines:

diff --git a/librpc/gen_ndr/ndr_drsblobs.c b/librpc/gen_ndr/ndr_drsblobs.c
index 72e182d..ee7c993 100644
--- a/librpc/gen_ndr/ndr_drsblobs.c
+++ b/librpc/gen_ndr/ndr_drsblobs.c
@@ -1870,9 +1870,6 @@ static enum ndr_err_code 
ndr_push_package_PrimaryKerberosCtr4(struct ndr_push *n
                for (cntr_keys_0 = 0; cntr_keys_0 < r->num_keys; cntr_keys_0++) 
{
                        NDR_CHECK(ndr_push_package_PrimaryKerberosKey4(ndr, 
NDR_SCALARS, &r->keys[cntr_keys_0]));
                }
-               for (cntr_service_keys_0 = 0; cntr_service_keys_0 < 0; 
cntr_service_keys_0++) {
-                       NDR_CHECK(ndr_push_package_PrimaryKerberosKey4(ndr, 
NDR_SCALARS, &r->service_keys[cntr_service_keys_0]));
-               }
                for (cntr_old_keys_0 = 0; cntr_old_keys_0 < r->num_old_keys; 
cntr_old_keys_0++) {
                        NDR_CHECK(ndr_push_package_PrimaryKerberosKey4(ndr, 
NDR_SCALARS, &r->old_keys[cntr_old_keys_0]));
                }
@@ -1885,9 +1882,6 @@ static enum ndr_err_code 
ndr_push_package_PrimaryKerberosCtr4(struct ndr_push *n
                for (cntr_keys_0 = 0; cntr_keys_0 < r->num_keys; cntr_keys_0++) 
{
                        NDR_CHECK(ndr_push_package_PrimaryKerberosKey4(ndr, 
NDR_BUFFERS, &r->keys[cntr_keys_0]));
                }
-               for (cntr_service_keys_0 = 0; cntr_service_keys_0 < 0; 
cntr_service_keys_0++) {
-                       NDR_CHECK(ndr_push_package_PrimaryKerberosKey4(ndr, 
NDR_BUFFERS, &r->service_keys[cntr_service_keys_0]));
-               }
                for (cntr_old_keys_0 = 0; cntr_old_keys_0 < r->num_old_keys; 
cntr_old_keys_0++) {
                        NDR_CHECK(ndr_push_package_PrimaryKerberosKey4(ndr, 
NDR_BUFFERS, &r->old_keys[cntr_old_keys_0]));
                }
diff --git a/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm 
b/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
index 0e4a7e2..34aebc7 100644
--- a/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
+++ b/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
@@ -586,9 +586,15 @@ sub ParseElementPushLevel
                my $length = ParseExpr($l->{LENGTH_IS}, $env, $e->{ORIGINAL});
                my $counter = "cntr_$e->{NAME}_$l->{LEVEL_INDEX}";
 
+               my $array_pointless = ($length eq "0");
+
+               if ($array_pointless) {
+                       warning($e->{ORIGINAL}, "pointless array `$e->{NAME}' 
will always have size 0");
+               }
+
                $var_name = get_array_element($var_name, $counter);
 
-               if (($primitives and not $l->{IS_DEFERRED}) or ($deferred and 
$l->{IS_DEFERRED})) {
+               if ((($primitives and not $l->{IS_DEFERRED}) or ($deferred and 
$l->{IS_DEFERRED})) and not $array_pointless) {
                        $self->pidl("for ($counter = 0; $counter < $length; 
$counter++) {");
                        $self->indent;
                        $self->ParseElementPushLevel($e, GetNextLevel($e, $l), 
$ndr, $var_name, $env, 1, 0);
@@ -596,7 +602,7 @@ sub ParseElementPushLevel
                        $self->pidl("}");
                }
 
-               if ($deferred and ContainsDeferred($e, $l)) {
+               if ($deferred and ContainsDeferred($e, $l) and not 
$array_pointless) {
                        $self->pidl("for ($counter = 0; $counter < $length; 
$counter++) {");
                        $self->indent;
                        $self->ParseElementPushLevel($e, GetNextLevel($e, $l), 
$ndr, $var_name, $env, 0, 1);


-- 
Samba Shared Repository

Reply via email to