diff options
author | Jan Engelhardt <jengelh@medozas.de> | 2010-11-06 01:00:24 +0100 |
---|---|---|
committer | Jan Engelhardt <jengelh@medozas.de> | 2010-11-09 20:28:24 +0100 |
commit | 81092cde12affb71cfa0c02b9510ae1e3d492b80 (patch) | |
tree | 20de994cbcaa20c2544891e6f413d5f2dd41f676 /src/libnfnetlink.c | |
parent | ac19c1954c3d8505c1612b219f71d7c86cc7fb13 (diff) |
src: remove redundant casts
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Diffstat (limited to 'src/libnfnetlink.c')
-rw-r--r-- | src/libnfnetlink.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/src/libnfnetlink.c b/src/libnfnetlink.c index b048d2b..6e7afc6 100644 --- a/src/libnfnetlink.c +++ b/src/libnfnetlink.c @@ -445,8 +445,7 @@ void nfnl_fill_hdr(struct nfnl_subsys_handle *ssh, assert(ssh); assert(nlh); - struct nfgenmsg *nfg = (struct nfgenmsg *) - ((void *)nlh + sizeof(*nlh)); + struct nfgenmsg *nfg = (void *)nlh + sizeof(*nlh); nlh->nlmsg_len = NLMSG_LENGTH(len+sizeof(*nfg)); nlh->nlmsg_type = (ssh->subsys_id<<8)|msg_type; @@ -478,14 +477,14 @@ nfnl_parse_hdr(const struct nfnl_handle *nfnlh, if (nlh->nlmsg_len == NLMSG_LENGTH(sizeof(struct nfgenmsg))) { if (genmsg) - *genmsg = (struct nfgenmsg *)((void *)nlh+sizeof(nlh)); + *genmsg = (void *)nlh + sizeof(nlh); return NULL; } if (genmsg) - *genmsg = (struct nfgenmsg *)((void *)nlh + sizeof(nlh)); + *genmsg = (void *)nlh + sizeof(nlh); - return ((void *)nlh + NLMSG_LENGTH(sizeof(struct nfgenmsg))); + return (void *)nlh + NLMSG_LENGTH(sizeof(struct nfgenmsg)); } /** @@ -575,10 +574,10 @@ int nfnl_listen(struct nfnl_handle *nfnlh, int quit=0; struct msghdr msg = { - (void *)&nladdr, sizeof(nladdr), - &iov, 1, - NULL, 0, - 0 + .msg_name = &nladdr, + .msg_namelen = sizeof(nladdr), + .msg_iov = &iov, + .msg_iovlen = 1, }; memset(&nladdr, 0, sizeof(nladdr)); @@ -682,13 +681,13 @@ int nfnl_talk(struct nfnl_handle *nfnlh, struct nlmsghdr *n, pid_t peer, unsigned int seq; int status; struct iovec iov = { - (void *)n, n->nlmsg_len + n, n->nlmsg_len }; struct msghdr msg = { - (void *)&nladdr, sizeof(nladdr), - &iov, 1, - NULL, 0, - 0 + .msg_name = &nladdr, + .msg_namelen = sizeof(nladdr), + .msg_iov = &iov, + .msg_iovlen = 1, }; memset(&nladdr, 0, sizeof(nladdr)); |