diff options
author | Robert Drehmel <robert@FreeBSD.org> | 2002-08-02 11:57:59 +0000 |
---|---|---|
committer | Robert Drehmel <robert@FreeBSD.org> | 2002-08-02 11:57:59 +0000 |
commit | 6dbe8d53a5aa97a948b49c4f9d0f145a02936109 (patch) | |
tree | 5140b30371899b06fd6edc43bdb159ae68000f8c /usr.bin/sockstat/sockstat.c | |
parent | 052c7c89c2d0e6d18aee7cc9751a7fe21e3f9fe2 (diff) | |
download | src-6dbe8d53a5aa97a948b49c4f9d0f145a02936109.tar.gz src-6dbe8d53a5aa97a948b49c4f9d0f145a02936109.zip |
Use a cast to `void *' before casting to a pointer to a structure
to stop GCC emitting warnings about increased alignment requirements
which broke the build for sparc64.
Approved by: des
Notes
Notes:
svn path=/head/; revision=101220
Diffstat (limited to 'usr.bin/sockstat/sockstat.c')
-rw-r--r-- | usr.bin/sockstat/sockstat.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/usr.bin/sockstat/sockstat.c b/usr.bin/sockstat/sockstat.c index b8692a85a24a..63b9058f8910 100644 --- a/usr.bin/sockstat/sockstat.c +++ b/usr.bin/sockstat/sockstat.c @@ -223,7 +223,8 @@ gather_inet(int proto) bufsize *= 2; } xig = (struct xinpgen *)buf; - exig = (struct xinpgen *)((char *)buf + len - sizeof *exig); + exig = (struct xinpgen *)(void *) + ((char *)buf + len - sizeof *exig); if (xig->xig_len != sizeof *xig || exig->xig_len != sizeof *exig) errx(1, "struct xinpgen size mismatch"); @@ -233,7 +234,7 @@ gather_inet(int proto) warnx("warning: data may be inconsistent"); for (;;) { - xig = (struct xinpgen *)((char *)xig + xig->xig_len); + xig = (struct xinpgen *)(void *)((char *)xig + xig->xig_len); if (xig >= exig) break; switch (proto) { @@ -339,7 +340,8 @@ gather_unix(int proto) bufsize *= 2; } xug = (struct xunpgen *)buf; - exug = (struct xunpgen *)((char *)buf + len - sizeof *exug); + exug = (struct xunpgen *)(void *) + ((char *)buf + len - sizeof *exug); if (xug->xug_len != sizeof *xug || exug->xug_len != sizeof *exug) { warnx("struct xinpgen size mismatch"); @@ -351,7 +353,7 @@ gather_unix(int proto) warnx("warning: data may be inconsistent"); for (;;) { - xug = (struct xunpgen *)((char *)xug + xug->xug_len); + xug = (struct xunpgen *)(void *)((char *)xug + xug->xug_len); if (xug >= exug) break; xup = (struct xunpcb *)xug; @@ -370,7 +372,8 @@ gather_unix(int proto) sock->family = AF_UNIX; sock->protoname = protoname; if (xup->xu_unp.unp_addr != NULL) - sock->laddr = *(struct sockaddr_storage *)&xup->xu_addr; + sock->laddr = + *(struct sockaddr_storage *)(void *)&xup->xu_addr; else if (xup->xu_unp.unp_conn != NULL) *(void **)&sock->faddr = xup->xu_unp.unp_conn; hash = (int)((uintptr_t)sock->socket % HASHSIZE); |