diff options
Diffstat (limited to 'source4/lib')
-rw-r--r-- | source4/lib/events/events_liboop.c | 14 | ||||
-rw-r--r-- | source4/lib/events/events_standard.c | 12 | ||||
-rw-r--r-- | source4/lib/ldb/ldb_ldap/ldb_ldap.c | 3 | ||||
-rw-r--r-- | source4/lib/ldb/ldb_sqlite3/ldb_sqlite3.c | 7 | ||||
-rw-r--r-- | source4/lib/ldb/ldb_tdb/ldb_tdb_wrap.c | 3 | ||||
-rw-r--r-- | source4/lib/ldb/modules/paged_results.c | 4 | ||||
-rw-r--r-- | source4/lib/ldb/modules/skel.c | 3 | ||||
-rw-r--r-- | source4/lib/messaging/messaging.c | 6 | ||||
-rw-r--r-- | source4/lib/registry/reg_backend_ldb.c | 6 | ||||
-rw-r--r-- | source4/lib/socket/socket.c | 3 | ||||
-rw-r--r-- | source4/lib/stream/packet.c | 4 | ||||
-rw-r--r-- | source4/lib/tls/tls.c | 3 | ||||
-rw-r--r-- | source4/lib/util/unix_privs.c | 3 |
13 files changed, 24 insertions, 47 deletions
diff --git a/source4/lib/events/events_liboop.c b/source4/lib/events/events_liboop.c index c81449e65e..53238662f0 100644 --- a/source4/lib/events/events_liboop.c +++ b/source4/lib/events/events_liboop.c @@ -35,9 +35,8 @@ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */ -static int oop_event_context_destructor(void *ptr) +static int oop_event_context_destructor(struct event_context *ev) { - struct event_context *ev = talloc_get_type(ptr, struct event_context); oop_source_sys *oop_sys = ev->additional_data; oop_sys_delete(oop_sys); @@ -91,9 +90,8 @@ static void *oop_event_fd_handler(oop_source *oop, int fd, oop_event oop_type, v /* destroy an fd_event */ -static int oop_event_fd_destructor(void *ptr) +static int oop_event_fd_destructor(struct fd_event *fde) { - struct fd_event *fde = talloc_get_type(ptr, struct fd_event); struct event_context *ev = fde->event_ctx; oop_source_sys *oop_sys = ev->additional_data; oop_source *oop = oop_sys_source(oop_sys); @@ -174,8 +172,9 @@ static void oop_event_set_fd_flags(struct fd_event *fde, uint16_t flags) fde->flags = flags; } -static int oop_event_timed_destructor(void *ptr); -static int oop_event_timed_deny_destructor(void *ptr) +static int oop_event_timed_destructor(struct timed_event *te); + +static int oop_event_timed_deny_destructor(struct timed_event *te) { return -1; } @@ -197,9 +196,8 @@ static void *oop_event_timed_handler(oop_source *oop, struct timeval t, void *pt /* destroy a timed event */ -static int oop_event_timed_destructor(void *ptr) +static int oop_event_timed_destructor(struct timed_event *te) { - struct timed_event *te = talloc_get_type(ptr, struct timed_event); struct event_context *ev = te->event_ctx; oop_source_sys *oop_sys = ev->additional_data; oop_source *oop = oop_sys_source(oop_sys); diff --git a/source4/lib/events/events_standard.c b/source4/lib/events/events_standard.c index ff11afe5d5..5d59f1b885 100644 --- a/source4/lib/events/events_standard.c +++ b/source4/lib/events/events_standard.c @@ -93,10 +93,8 @@ static uint32_t epoll_map_flags(uint16_t flags) /* free the epoll fd */ -static int epoll_ctx_destructor(void *ptr) +static int epoll_ctx_destructor(struct std_event_context *std_ev) { - struct std_event_context *std_ev = talloc_get_type(ptr, - struct std_event_context); close(std_ev->epoll_fd); std_ev->epoll_fd = -1; return 0; @@ -336,9 +334,8 @@ static void calc_maxfd(struct std_event_context *std_ev) /* destroy an fd_event */ -static int std_event_fd_destructor(void *ptr) +static int std_event_fd_destructor(struct fd_event *fde) { - struct fd_event *fde = talloc_get_type(ptr, struct fd_event); struct event_context *ev = fde->event_ctx; struct std_event_context *std_ev = talloc_get_type(ev->additional_data, struct std_event_context); @@ -420,16 +417,15 @@ static void std_event_set_fd_flags(struct fd_event *fde, uint16_t flags) /* destroy a timed event */ -static int std_event_timed_destructor(void *ptr) +static int std_event_timed_destructor(struct timed_event *te) { - struct timed_event *te = talloc_get_type(ptr, struct timed_event); struct std_event_context *std_ev = talloc_get_type(te->event_ctx->additional_data, struct std_event_context); DLIST_REMOVE(std_ev->timed_events, te); return 0; } -static int std_event_timed_deny_destructor(void *ptr) +static int std_event_timed_deny_destructor(struct timed_event *te) { return -1; } 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); diff --git a/source4/lib/messaging/messaging.c b/source4/lib/messaging/messaging.c index bf06d68a33..6bd331c247 100644 --- a/source4/lib/messaging/messaging.c +++ b/source4/lib/messaging/messaging.c @@ -434,9 +434,8 @@ NTSTATUS messaging_send_ptr(struct messaging_context *msg, uint32_t server, /* destroy the messaging context */ -static int messaging_destructor(void *ptr) +static int messaging_destructor(struct messaging_context *msg) { - struct messaging_context *msg = ptr; unlink(msg->path); while (msg->names && msg->names[0]) { irpc_remove_name(msg, msg->names[0]); @@ -720,9 +719,8 @@ failed: /* destroy a irpc request */ -static int irpc_destructor(void *ptr) +static int irpc_destructor(struct irpc_request *irpc) { - struct irpc_request *irpc = talloc_get_type(ptr, struct irpc_request); idr_remove(irpc->msg_ctx->idr, irpc->callid); return 0; } diff --git a/source4/lib/registry/reg_backend_ldb.c b/source4/lib/registry/reg_backend_ldb.c index ec185cd65b..a8c054cc16 100644 --- a/source4/lib/registry/reg_backend_ldb.c +++ b/source4/lib/registry/reg_backend_ldb.c @@ -32,9 +32,8 @@ struct ldb_key_data int subkey_count, value_count; }; -static int ldb_free_hive (void *_hive) +static int ldb_free_hive (struct registry_hive *hive) { - struct registry_hive *hive = _hive; talloc_free(hive->backend_data); hive->backend_data = NULL; return 0; @@ -96,9 +95,8 @@ static struct ldb_message *reg_ldb_pack_value(struct ldb_context *ctx, TALLOC_CT } -static int reg_close_ldb_key (void *data) +static int reg_close_ldb_key(struct registry_key *key) { - struct registry_key *key = data; struct ldb_key_data *kd = talloc_get_type(key->backend_data, struct ldb_key_data); /* struct ldb_context *c = key->hive->backend_data; */ diff --git a/source4/lib/socket/socket.c b/source4/lib/socket/socket.c index b7d4431c94..e1f8bb4d86 100644 --- a/source4/lib/socket/socket.c +++ b/source4/lib/socket/socket.c @@ -28,9 +28,8 @@ /* auto-close sockets on free */ -static int socket_destructor(void *ptr) +static int socket_destructor(struct socket_context *sock) { - struct socket_context *sock = ptr; if (sock->ops->fn_close) { sock->ops->fn_close(sock); } diff --git a/source4/lib/stream/packet.c b/source4/lib/stream/packet.c index 1da7f5706b..e06f4985ef 100644 --- a/source4/lib/stream/packet.c +++ b/source4/lib/stream/packet.c @@ -60,10 +60,8 @@ struct packet_context { a destructor used when we are processing packets to prevent freeing of this context while it is being used */ -static int packet_destructor(void *p) +static int packet_destructor(struct packet_context *pc) { - struct packet_context *pc = talloc_get_type(p, struct packet_context); - if (pc->busy) { pc->destructor_called = True; /* now we refuse the talloc_free() request. The free will diff --git a/source4/lib/tls/tls.c b/source4/lib/tls/tls.c index 2872669948..936c18c0c6 100644 --- a/source4/lib/tls/tls.c +++ b/source4/lib/tls/tls.c @@ -175,9 +175,8 @@ static ssize_t tls_push(gnutls_transport_ptr ptr, const void *buf, size_t size) /* destroy a tls session */ -static int tls_destructor(void *ptr) +static int tls_destructor(struct tls_context *tls) { - struct tls_context *tls = talloc_get_type(ptr, struct tls_context); int ret; ret = gnutls_bye(tls->session, GNUTLS_SHUT_WR); if (ret < 0) { diff --git a/source4/lib/util/unix_privs.c b/source4/lib/util/unix_privs.c index c94cf619a3..bf3e61ba2d 100644 --- a/source4/lib/util/unix_privs.c +++ b/source4/lib/util/unix_privs.c @@ -49,9 +49,8 @@ struct saved_state { uid_t uid; }; -static int privileges_destructor(void *ptr) +static int privileges_destructor(struct saved_state *s) { - struct saved_state *s = ptr; if (geteuid() != s->uid && seteuid(s->uid) != 0) { smb_panic("Failed to restore privileges"); |