[SCM] Samba Shared Repository - branch master updated

Michael Adam obnox at samba.org
Wed Nov 7 09:19:02 MST 2012


The branch, master has been updated
       via  d236709 Remove two unused variables
       via  647a0fb lib/util: Simplify bitmap.c a bit
       via  7f4d55d lib/util: Make "struct bitmap" abstract
      from  da284b3 heimdal_build: Fix finding of system heimdal.

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


- Log -----------------------------------------------------------------
commit d236709d15ba577def07f049c975069eb39ba1e3
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Nov 7 15:33:10 2012 +0100

    Remove two unused variables
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>
    
    Autobuild-User(master): Michael Adam <obnox at samba.org>
    Autobuild-Date(master): Wed Nov  7 17:18:06 CET 2012 on sn-devel-104

commit 647a0fb098bada862b49a51e3a31be847207c59a
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Oct 30 23:15:09 2012 +0100

    lib/util: Simplify bitmap.c a bit
    
    This avoids the double-talloc for bitmaps
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit 7f4d55d1b8bda4f0d7a8bdbfe82c9a623dfe5843
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Oct 30 22:43:21 2012 +0100

    lib/util: Make "struct bitmap" abstract
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

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

Summary of changes:
 lib/util/bitmap.c     |   16 ++++++++++------
 lib/util/bitmap.h     |    5 +----
 source3/smbd/pysmbd.c |    1 -
 3 files changed, 11 insertions(+), 11 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/util/bitmap.c b/lib/util/bitmap.c
index 7defd77..77de55a 100644
--- a/lib/util/bitmap.c
+++ b/lib/util/bitmap.c
@@ -20,6 +20,11 @@
 #include "includes.h"
 #include "lib/util/bitmap.h"
 
+struct bitmap {
+	unsigned int n;
+	uint32_t b[1];		/* We allocate more */
+};
+
 /* these functions provide a simple way to allocate integers from a
    pool without repetition */
 
@@ -30,16 +35,15 @@ struct bitmap *bitmap_talloc(TALLOC_CTX *mem_ctx, int n)
 {
 	struct bitmap *bm;
 
-	bm = talloc(mem_ctx, struct bitmap);
+	bm = (struct bitmap *)talloc_zero_size(
+		mem_ctx,
+		offsetof(struct bitmap, b) + sizeof(uint32_t)*((n+31)/32));
 
 	if (!bm) return NULL;
 
+	talloc_set_name_const(bm, "struct bitmap");
+
 	bm->n = n;
-	bm->b = talloc_zero_array(bm, uint32_t, (n+31)/32);
-	if (!bm->b) {
-		TALLOC_FREE(bm);
-		return NULL;
-	}
 	return bm;
 }
 
diff --git a/lib/util/bitmap.h b/lib/util/bitmap.h
index cf7aa1b..6d75929 100644
--- a/lib/util/bitmap.h
+++ b/lib/util/bitmap.h
@@ -19,10 +19,7 @@
 
 /* The following definitions come from lib/bitmap.c  */
 
-struct bitmap {
-	uint32_t *b;
-	unsigned int n;
-};
+struct bitmap;
 
 struct bitmap *bitmap_talloc(TALLOC_CTX *mem_ctx, int n);
 int bitmap_copy(struct bitmap * const dst, const struct bitmap * const src);
diff --git a/source3/smbd/pysmbd.c b/source3/smbd/pysmbd.c
index 5e8691a..ed3e23a 100644
--- a/source3/smbd/pysmbd.c
+++ b/source3/smbd/pysmbd.c
@@ -370,7 +370,6 @@ static PyObject *py_smbd_unlink(PyObject *self, PyObject *args)
 	int ret;
 	struct smb_filename *smb_fname = NULL;
 	char *fname;
-	int uid, gid;
 	TALLOC_CTX *frame;
 	mode_t saved_umask;
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list