diff options
author | rodrigc <rodrigc@FreeBSD.org> | 2006-12-16 06:03:43 +0000 |
---|---|---|
committer | rodrigc <rodrigc@FreeBSD.org> | 2006-12-16 06:03:43 +0000 |
commit | 0ce5d91ed156f4cb86fc35607ac3a2a948c18eda (patch) | |
tree | 30ac95db20c46469265584b1dac506d31fcb9a5b /lib/libc | |
parent | fd764f04247f7e3d8cde039e223356e4bbe14a6c (diff) | |
download | FreeBSD-src-0ce5d91ed156f4cb86fc35607ac3a2a948c18eda.zip FreeBSD-src-0ce5d91ed156f4cb86fc35607ac3a2a948c18eda.tar.gz |
Consistently use a socklen_t type where required, and eliminate
GCC warning "dereferencing type-punned pointer will
break strict-aliasing rules".
Reviewed by: rrs
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/net/sctp_sys_calls.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/libc/net/sctp_sys_calls.c b/lib/libc/net/sctp_sys_calls.c index fb103ad..72f794d 100644 --- a/lib/libc/net/sctp_sys_calls.c +++ b/lib/libc/net/sctp_sys_calls.c @@ -288,7 +288,7 @@ sctp_getpaddrs(int sd, sctp_assoc_t id, struct sockaddr **raddrs) struct sockaddr *re; sctp_assoc_t asoc; caddr_t lim; - size_t siz; + socklen_t siz; int cnt; if (raddrs == NULL) { @@ -298,7 +298,7 @@ sctp_getpaddrs(int sd, sctp_assoc_t id, struct sockaddr **raddrs) asoc = id; siz = sizeof(sctp_assoc_t); if (getsockopt(sd, IPPROTO_SCTP, SCTP_GET_REMOTE_ADDR_SIZE, - &asoc, (socklen_t *) & siz) != 0) { + &asoc, &siz) != 0) { errno = ENOMEM; return (-1); } @@ -350,7 +350,7 @@ sctp_getladdrs(int sd, sctp_assoc_t id, struct sockaddr **raddrs) caddr_t lim; struct sockaddr *sa; int size_of_addresses; - size_t siz; + socklen_t siz; int cnt; if (raddrs == NULL) { @@ -360,7 +360,7 @@ sctp_getladdrs(int sd, sctp_assoc_t id, struct sockaddr **raddrs) size_of_addresses = 0; siz = sizeof(int); if (getsockopt(sd, IPPROTO_SCTP, SCTP_GET_LOCAL_ADDR_SIZE, - &size_of_addresses, (socklen_t *) & siz) != 0) { + &size_of_addresses, &siz) != 0) { errno = ENOMEM; return (-1); } @@ -518,7 +518,7 @@ sctp_assoc_t sctp_getassocid(int sd, struct sockaddr *sa) { struct sctp_paddrparams sp; - size_t siz; + socklen_t siz; /* First get the assoc id */ siz = sizeof(struct sctp_paddrparams); @@ -526,7 +526,7 @@ sctp_getassocid(int sd, struct sockaddr *sa) memcpy((caddr_t)&sp.spp_address, sa, sa->sa_len); errno = 0; if (getsockopt(sd, IPPROTO_SCTP, - SCTP_PEER_ADDR_PARAMS, &sp, (socklen_t *) & siz) != 0) { + SCTP_PEER_ADDR_PARAMS, &sp, &siz) != 0) { return ((sctp_assoc_t) 0); } /* We depend on the fact that 0 can never be returned */ |