diff --git a/bin/dnssec/dnssec-signzone.c b/bin/dnssec/dnssec-signzone.c index 1c735a2024..4abbf56847 100644 --- a/bin/dnssec/dnssec-signzone.c +++ b/bin/dnssec/dnssec-signzone.c @@ -16,7 +16,7 @@ * IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: dnssec-signzone.c,v 1.177 2004/03/10 02:19:51 marka Exp $ */ +/* $Id: dnssec-signzone.c,v 1.178 2004/04/15 01:58:22 marka Exp $ */ #include @@ -1113,7 +1113,7 @@ assignwork(isc_task_t *task, isc_task_t *worker) { sevent->node = node; sevent->fname = fname; - isc_task_send(worker, (isc_event_t **) (void*) &sevent); + isc_task_send(worker, ISC_EVENT_PTR(&sevent)); assigned++; } @@ -1169,7 +1169,7 @@ sign(isc_task_t *task, isc_event_t *event) { fatal("failed to allocate event\n"); wevent->node = node; wevent->fname = fname; - isc_task_send(master, (isc_event_t **) (void*) &wevent); + isc_task_send(master, ISC_EVENT_PTR(&wevent)); } /* diff --git a/bin/named/query.c b/bin/named/query.c index c37e728d81..1ba7622df2 100644 --- a/bin/named/query.c +++ b/bin/named/query.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: query.c,v 1.257 2004/03/10 02:19:52 marka Exp $ */ +/* $Id: query.c,v 1.258 2004/04/15 01:58:23 marka Exp $ */ #include @@ -3276,7 +3276,7 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype) dns_db_detach(&zdb); } if (event != NULL) - isc_event_free((isc_event_t **) (void*)&event); + isc_event_free(ISC_EVENT_PTR(&event)); /* * AA bit. diff --git a/bin/named/update.c b/bin/named/update.c index fe4a5982de..9268fcd52e 100644 --- a/bin/named/update.c +++ b/bin/named/update.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: update.c,v 1.109 2004/03/05 04:57:49 marka Exp $ */ +/* $Id: update.c,v 1.110 2004/04/15 01:58:23 marka Exp $ */ #include @@ -1965,11 +1965,11 @@ send_update_event(ns_client_t *client, dns_zone_t *zone) { event->ev_arg = evclient; dns_zone_gettask(zone, &zonetask); - isc_task_send(zonetask, (isc_event_t **) (void *)&event); + isc_task_send(zonetask, ISC_EVENT_PTR(&event)); failure: if (event != NULL) - isc_event_free((isc_event_t **) (void *)&event); + isc_event_free(ISC_EVENT_PTR(&event)); return (result); } @@ -2723,7 +2723,7 @@ forward_callback(void *arg, isc_result_t result, dns_message_t *answer) { uev->ev_action = forward_done; uev->answer = answer; } - isc_task_send(client->task, (isc_event_t **) (void *)&uev); + isc_task_send(client->task, ISC_EVENT_PTR(&uev)); } static void @@ -2777,10 +2777,10 @@ send_forward_event(ns_client_t *client, dns_zone_t *zone) { event->ev_arg = evclient; dns_zone_gettask(zone, &zonetask); - isc_task_send(zonetask, (isc_event_t **) (void *)&event); + isc_task_send(zonetask, ISC_EVENT_PTR(&event)); failure: if (event != NULL) - isc_event_free((isc_event_t **) (void *)&event); + isc_event_free(ISC_EVENT_PTR(&event)); return (result); } diff --git a/lib/dns/dispatch.c b/lib/dns/dispatch.c index dcf95e1727..a5edb9762b 100644 --- a/lib/dns/dispatch.c +++ b/lib/dns/dispatch.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: dispatch.c,v 1.116 2004/03/05 05:09:19 marka Exp $ */ +/* $Id: dispatch.c,v 1.117 2004/04/15 01:58:24 marka Exp $ */ #include @@ -672,7 +672,7 @@ udp_recv(isc_task_t *task, isc_event_t *ev_in) { rev, rev->buffer.base, rev->buffer.length, resp->task); resp->item_out = ISC_TRUE; - isc_task_send(resp->task, (isc_event_t **) (void *)&rev); + isc_task_send(resp->task, ISC_EVENT_PTR(&rev)); } /* @@ -856,7 +856,7 @@ tcp_recv(isc_task_t *task, isc_event_t *ev_in) { rev, rev->buffer.base, rev->buffer.length, resp->task); resp->item_out = ISC_TRUE; - isc_task_send(resp->task, (isc_event_t **) (void *)&rev); + isc_task_send(resp->task, ISC_EVENT_PTR(&rev)); } /* @@ -2078,7 +2078,7 @@ do_cancel(dns_dispatch_t *disp, dns_dispentry_t *resp) { "cancel: failsafe event %p -> task %p", ev, resp->task); resp->item_out = ISC_TRUE; - isc_task_send(resp->task, (isc_event_t **) (void *)&ev); + isc_task_send(resp->task, ISC_EVENT_PTR(&ev)); } isc_socket_t * @@ -2174,7 +2174,7 @@ dns_dispatch_importrecv(dns_dispatch_t *disp, isc_event_t *event) { buf = allocate_udp_buffer(disp); if (buf == NULL) { - isc_event_free((isc_event_t **) (void *)&newsevent); + isc_event_free(ISC_EVENT_PTR(&newsevent)); return; } memcpy(buf, sevent->region.base, sevent->n); @@ -2187,7 +2187,7 @@ dns_dispatch_importrecv(dns_dispatch_t *disp, isc_event_t *event) { newsevent->pktinfo = sevent->pktinfo; newsevent->attributes = sevent->attributes; - isc_task_send(disp->task, (isc_event_t **) (void*)&newsevent); + isc_task_send(disp->task, ISC_EVENT_PTR(&newsevent)); } #if 0 diff --git a/lib/dns/lookup.c b/lib/dns/lookup.c index 07b89a26f6..3a994b3896 100644 --- a/lib/dns/lookup.c +++ b/lib/dns/lookup.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: lookup.c,v 1.14 2004/03/05 05:09:21 marka Exp $ */ +/* $Id: lookup.c,v 1.15 2004/04/15 01:58:24 marka Exp $ */ #include @@ -316,7 +316,7 @@ lookup_find(dns_lookup_t *lookup, dns_fetchevent_t *event) { dns_db_detachnode(event->db, &event->node); if (event->db != NULL) dns_db_detach(&event->db); - isc_event_free((isc_event_t **) (void *)&event); + isc_event_free(ISC_EVENT_PTR(&event)); } /* diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c index b71feb6598..acfc12b399 100644 --- a/lib/dns/resolver.c +++ b/lib/dns/resolver.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: resolver.c,v 1.284 2004/03/16 05:52:19 marka Exp $ */ +/* $Id: resolver.c,v 1.285 2004/04/15 01:58:24 marka Exp $ */ #include @@ -721,7 +721,7 @@ fctx_sendevents(fetchctx_t *fctx, isc_result_t result) { fctx->type == dns_rdatatype_any || fctx->type == dns_rdatatype_rrsig); - isc_task_sendanddetach(&task, (isc_event_t **) (void *)&event); + isc_task_sendanddetach(&task, ISC_EVENT_PTR(&event)); } } @@ -6024,7 +6024,7 @@ dns_resolver_cancelfetch(dns_fetch_t *fetch) { etask = event->ev_sender; event->ev_sender = fctx; event->result = ISC_R_CANCELED; - isc_task_sendanddetach(&etask, (isc_event_t **) (void *)&event); + isc_task_sendanddetach(&etask, ISC_EVENT_PTR(&event)); } /* * The fctx continues running even if no fetches remain; diff --git a/lib/dns/validator.c b/lib/dns/validator.c index fbcec39c5e..6896b0c7dc 100644 --- a/lib/dns/validator.c +++ b/lib/dns/validator.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: validator.c,v 1.119 2004/03/10 02:19:56 marka Exp $ */ +/* $Id: validator.c,v 1.120 2004/04/15 01:58:24 marka Exp $ */ #include @@ -2384,7 +2384,7 @@ dns_validator_create(dns_view_t *view, dns_name_t *name, dns_rdatatype_t type, ISC_LINK_INIT(val, link); val->magic = VALIDATOR_MAGIC; - isc_task_send(task, (isc_event_t **) (void *)&event); + isc_task_send(task, ISC_EVENT_PTR(&event)); *validatorp = val; diff --git a/lib/isc/include/isc/event.h b/lib/isc/include/isc/event.h index 1c5d5e51a7..90e078c951 100644 --- a/lib/isc/include/isc/event.h +++ b/lib/isc/include/isc/event.h @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: event.h,v 1.27 2004/03/05 05:10:56 marka Exp $ */ +/* $Id: event.h,v 1.28 2004/04/15 01:58:25 marka Exp $ */ #ifndef ISC_EVENT_H #define ISC_EVENT_H 1 @@ -82,6 +82,8 @@ struct isc_event { #define ISC_EVENTTYPE_FIRSTEVENT 0x00000000 #define ISC_EVENTTYPE_LASTEVENT 0xffffffff +#define ISC_EVENT_PTR(p) ((isc_event_t **)(void *)(p)) + ISC_LANG_BEGINDECLS isc_event_t * diff --git a/lib/isc/unix/socket.c b/lib/isc/unix/socket.c index 5d7e15969d..3b1396cf13 100644 --- a/lib/isc/unix/socket.c +++ b/lib/isc/unix/socket.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: socket.c,v 1.237 2004/03/18 02:58:07 marka Exp $ */ +/* $Id: socket.c,v 1.238 2004/04/15 01:58:25 marka Exp $ */ #include @@ -1958,7 +1958,7 @@ internal_accept(isc_task_t *me, isc_event_t *ev) { task = dev->ev_sender; dev->ev_sender = sock; - isc_task_sendanddetach(&task, (isc_event_t **) (void *)&dev); + isc_task_sendanddetach(&task, ISC_EVENT_PTR(&dev)); return; soft_error: @@ -2997,7 +2997,7 @@ isc_socket_accept(isc_socket_t *sock, ret = allocate_socket(manager, sock->type, &nsock); if (ret != ISC_R_SUCCESS) { - isc_event_free((isc_event_t **) (void *)&dev); + isc_event_free(ISC_EVENT_PTR(&dev)); UNLOCK(&sock->lock); return (ret); } @@ -3097,12 +3097,12 @@ isc_socket_connect(isc_socket_t *sock, isc_sockaddr_t *addr, UNEXPECTED_ERROR(__FILE__, __LINE__, "%d/%s", errno, strbuf); UNLOCK(&sock->lock); - isc_event_free((isc_event_t **) (void *)&dev); + isc_event_free(ISC_EVENT_PTR(&dev)); return (ISC_R_UNEXPECTED); err_exit: sock->connected = 0; - isc_task_send(task, (isc_event_t **) (void *)&dev); + isc_task_send(task, ISC_EVENT_PTR(&dev)); UNLOCK(&sock->lock); return (ISC_R_SUCCESS); @@ -3115,7 +3115,7 @@ isc_socket_connect(isc_socket_t *sock, isc_sockaddr_t *addr, sock->connected = 1; sock->bound = 1; dev->result = ISC_R_SUCCESS; - isc_task_send(task, (isc_event_t **) (void *)&dev); + isc_task_send(task, ISC_EVENT_PTR(&dev)); UNLOCK(&sock->lock); return (ISC_R_SUCCESS); @@ -3253,7 +3253,7 @@ internal_connect(isc_task_t *me, isc_event_t *ev) { task = dev->ev_sender; dev->ev_sender = sock; - isc_task_sendanddetach(&task, (isc_event_t **) (void *)&dev); + isc_task_sendanddetach(&task, ISC_EVENT_PTR(&dev)); } isc_result_t @@ -3401,7 +3401,7 @@ isc_socket_cancel(isc_socket_t *sock, isc_task_t *task, unsigned int how) { dev->result = ISC_R_CANCELED; dev->ev_sender = sock; isc_task_sendanddetach(¤t_task, - (isc_event_t **) (void *)&dev); + ISC_EVENT_PTR(&dev)); } dev = next; @@ -3428,7 +3428,7 @@ isc_socket_cancel(isc_socket_t *sock, isc_task_t *task, unsigned int how) { dev->result = ISC_R_CANCELED; dev->ev_sender = sock; isc_task_sendanddetach(¤t_task, - (isc_event_t **) (void *)&dev); + ISC_EVENT_PTR(&dev)); } }