summaryrefslogtreecommitdiff
path: root/source4/lib/ldb
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2006-05-24 07:34:11 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:08:32 -0500
commit971d30bb201f5c3faff5f575d26882eb79f7955a (patch)
treeaad4df492eb9c8bf1e105c8bac65dc315b27a1cd /source4/lib/ldb
parentcdc64c448df49676c96f87d106af8de0c467651f (diff)
downloadsamba-971d30bb201f5c3faff5f575d26882eb79f7955a.tar.gz
samba-971d30bb201f5c3faff5f575d26882eb79f7955a.tar.bz2
samba-971d30bb201f5c3faff5f575d26882eb79f7955a.zip
r15854: more talloc_set_destructor() typesafe fixes
(This used to be commit 61c6100617589ac6df4f527877241464cacbf8b3)
Diffstat (limited to 'source4/lib/ldb')
-rw-r--r--source4/lib/ldb/ldb_ldap/ldb_ldap.c3
-rw-r--r--source4/lib/ldb/ldb_sqlite3/ldb_sqlite3.c7
-rw-r--r--source4/lib/ldb/ldb_tdb/ldb_tdb_wrap.c3
-rw-r--r--source4/lib/ldb/modules/paged_results.c4
-rw-r--r--source4/lib/ldb/modules/skel.c3
5 files changed, 6 insertions, 14 deletions
diff --git a/source4/lib/ldb/ldb_ldap/ldb_ldap.c b/source4/lib/ldb/ldb_ldap/ldb_ldap.c
index 8bfff117da..bbfb1de104 100644
--- a/source4/lib/ldb/ldb_ldap/ldb_ldap.c
+++ b/source4/lib/ldb/ldb_ldap/ldb_ldap.c
@@ -1042,9 +1042,8 @@ static const struct ldb_module_ops lldb_ops = {
};
-static int lldb_destructor(void *p)
+static int lldb_destructor(struct lldb_private *lldb)
{
- struct lldb_private *lldb = p;
ldap_unbind(lldb->ldap);
return 0;
}
diff --git a/source4/lib/ldb/ldb_sqlite3/ldb_sqlite3.c b/source4/lib/ldb/ldb_sqlite3/ldb_sqlite3.c
index bcb830c38d..06b76e812d 100644
--- a/source4/lib/ldb/ldb_sqlite3/ldb_sqlite3.c
+++ b/source4/lib/ldb/ldb_sqlite3/ldb_sqlite3.c
@@ -1963,11 +1963,8 @@ failed:
return -1;
}
-static int
-destructor(void *p)
-{
- struct lsqlite3_private *lsqlite3 = p;
-
+static int destructor(struct lsqlite3_private *lsqlite3)
+{
if (lsqlite3->sqlite) {
sqlite3_close(lsqlite3->sqlite);
}
diff --git a/source4/lib/ldb/ldb_tdb/ldb_tdb_wrap.c b/source4/lib/ldb/ldb_tdb/ldb_tdb_wrap.c
index d4fc67c2d4..fdce36b24c 100644
--- a/source4/lib/ldb/ldb_tdb/ldb_tdb_wrap.c
+++ b/source4/lib/ldb/ldb_tdb/ldb_tdb_wrap.c
@@ -43,9 +43,8 @@ struct ltdb_wrap {
static struct ltdb_wrap *tdb_list;
/* destroy the last connection to a tdb */
-static int ltdb_wrap_destructor(void *ctx)
+static int ltdb_wrap_destructor(struct ltdb_wrap *w)
{
- struct ltdb_wrap *w = talloc_get_type(ctx, struct ltdb_wrap);
tdb_close(w->tdb);
if (w->next) {
w->next->prev = w->prev;
diff --git a/source4/lib/ldb/modules/paged_results.c b/source4/lib/ldb/modules/paged_results.c
index 5ce062868e..1b002716a5 100644
--- a/source4/lib/ldb/modules/paged_results.c
+++ b/source4/lib/ldb/modules/paged_results.c
@@ -71,10 +71,8 @@ struct private_data {
};
-int store_destructor(void *data)
+int store_destructor(struct results_store *store)
{
- struct results_store *store = talloc_get_type(data, struct results_store);
-
if (store->prev) {
store->prev->next = store->next;
}
diff --git a/source4/lib/ldb/modules/skel.c b/source4/lib/ldb/modules/skel.c
index 0089433b37..2f3c2e8b57 100644
--- a/source4/lib/ldb/modules/skel.c
+++ b/source4/lib/ldb/modules/skel.c
@@ -87,9 +87,8 @@ static int skel_del_trans(struct ldb_module *module)
return ldb_next_del_trans(module);
}
-static int skel_destructor(void *module_ctx)
+static int skel_destructor(struct ldb_module *ctx)
{
- struct ldb_module *ctx = talloc_get_type(module_ctx, struct ldb_module);
struct private_data *data = talloc_get_type(ctx->private_data, struct private_data);
/* put your clean-up functions here */
if (data->some_private_data) talloc_free(data->some_private_data);