From 646668bc51d42273a3665bd80bd044287e73bf2a Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 7 May 2009 23:07:55 +0200 Subject: Fix some type-punned warnings --- source3/winbindd/winbindd.c | 11 +++++++---- source3/winbindd/winbindd_cm.c | 7 +++++-- source3/winbindd/winbindd_wins.c | 2 +- 3 files changed, 13 insertions(+), 7 deletions(-) (limited to 'source3') diff --git a/source3/winbindd/winbindd.c b/source3/winbindd/winbindd.c index 1cd16b20ba..bcfe52891a 100644 --- a/source3/winbindd/winbindd.c +++ b/source3/winbindd/winbindd.c @@ -741,14 +741,16 @@ static void request_len_recv(void *private_data, bool success) return; } - if (*(uint32 *)(&state->request) != sizeof(state->request)) { + if (*(uint32 *)(void *)(&state->request) != sizeof(state->request)) { DEBUG(0,("request_len_recv: Invalid request size received: %d (expected %u)\n", - *(uint32_t *)(&state->request), (uint32_t)sizeof(state->request))); + *(uint32_t *)(void *)(&state->request), + (uint32_t)sizeof(state->request))); state->finished = True; return; } - setup_async_read(&state->fd_event, (uint32 *)(&state->request)+1, + setup_async_read(&state->fd_event, + (uint32 *)(void *)(&state->request)+1, sizeof(state->request) - sizeof(uint32), request_main_recv, state); } @@ -821,7 +823,8 @@ static void new_connection(int listen_sock, bool privileged) len = sizeof(sunaddr); do { - sock = accept(listen_sock, (struct sockaddr *)&sunaddr, &len); + sock = accept(listen_sock, (struct sockaddr *)(void *)&sunaddr, + &len); } while (sock == -1 && errno == EINTR); if (sock == -1) diff --git a/source3/winbindd/winbindd_cm.c b/source3/winbindd/winbindd_cm.c index b59a391029..396a30377f 100644 --- a/source3/winbindd/winbindd_cm.c +++ b/source3/winbindd/winbindd_cm.c @@ -769,7 +769,8 @@ static NTSTATUS cm_prepare_connection(const struct winbindd_domain *domain, struct sockaddr peeraddr; socklen_t peeraddr_len; - struct sockaddr_in *peeraddr_in = (struct sockaddr_in *)&peeraddr; + struct sockaddr_in *peeraddr_in = + (struct sockaddr_in *)(void *)&peeraddr; DEBUG(10,("cm_prepare_connection: connecting to DC %s for domain %s\n", controller, domain->name )); @@ -1040,7 +1041,9 @@ static bool add_one_dc_unique(TALLOC_CTX *mem_ctx, const char *domain_name, /* Make sure there's no duplicates in the list */ for (i=0; i<*num; i++) - if (sockaddr_equal((struct sockaddr *)&(*dcs)[i].ss, (struct sockaddr *)pss)) + if (sockaddr_equal( + (struct sockaddr *)(void *)&(*dcs)[i].ss, + (struct sockaddr *)(void *)pss)) return False; *dcs = TALLOC_REALLOC_ARRAY(mem_ctx, *dcs, struct dc_name_ip, (*num)+1); diff --git a/source3/winbindd/winbindd_wins.c b/source3/winbindd/winbindd_wins.c index f9ba13ffda..82bf199f3c 100644 --- a/source3/winbindd/winbindd_wins.c +++ b/source3/winbindd/winbindd_wins.c @@ -59,7 +59,7 @@ static int wins_lookup_open_socket_in(void) /* now we've got a socket - we need to bind it */ - if (bind(res, (struct sockaddr * ) &sock,sizeof(sock)) < 0) { + if (bind(res, (struct sockaddr *)(void *)&sock, sizeof(sock)) < 0) { close(res); return(-1); } -- cgit