diff options
author | Felix Fietkau <nbd@openwrt.org> | 2011-01-26 11:33:38 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2011-01-26 11:33:38 +0000 |
commit | eaa763410fbd4815eab137444af24a05d72aec58 (patch) | |
tree | e5945fac7a7dec1709375bd4897ba4dafd2de923 /package/libnl-tiny/src/include/netlink/msg.h | |
parent | 9303cd12100a79bc6aac9cb24938bfbf945016dd (diff) | |
download | upstream-eaa763410fbd4815eab137444af24a05d72aec58.tar.gz upstream-eaa763410fbd4815eab137444af24a05d72aec58.tar.bz2 upstream-eaa763410fbd4815eab137444af24a05d72aec58.zip |
libnl-tiny: Fix for c++ compatibility
g++ compiler issued some errors like "invalid conversion from void* to *struct nl_attr"
when compiling cpp file which calls libnl-tiny functions. (it's OK with gcc)
Also see https://dev.openwrt.org/ticket/7854
Patch from: kentarou matsuyama <matsuyama@thinktube.com>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@25101 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/libnl-tiny/src/include/netlink/msg.h')
-rw-r--r-- | package/libnl-tiny/src/include/netlink/msg.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/package/libnl-tiny/src/include/netlink/msg.h b/package/libnl-tiny/src/include/netlink/msg.h index aedcb08296..b3e2b0b2b9 100644 --- a/package/libnl-tiny/src/include/netlink/msg.h +++ b/package/libnl-tiny/src/include/netlink/msg.h @@ -144,7 +144,7 @@ static inline int nlmsg_len(const struct nlmsghdr *nlh) */ static inline struct nlattr *nlmsg_attrdata(const struct nlmsghdr *nlh, int hdrlen) { - unsigned char *data = nlmsg_data(nlh); + unsigned char *data = (unsigned char*)nlmsg_data(nlh); return (struct nlattr *) (data + NLMSG_ALIGN(hdrlen)); } @@ -160,7 +160,7 @@ static inline int nlmsg_attrlen(const struct nlmsghdr *nlh, int hdrlen) static inline int nlmsg_valid_hdr(const struct nlmsghdr *nlh, int hdrlen) { - if (nlh->nlmsg_len < nlmsg_msg_size(hdrlen)) + if (nlh->nlmsg_len < (uint)nlmsg_msg_size(hdrlen)) return 0; return 1; @@ -263,7 +263,7 @@ static inline int nlmsg_expand(struct nl_msg *n, size_t newlen) if (tmp == NULL) return -NLE_NOMEM; - n->nm_nlh = tmp; + n->nm_nlh = (struct nlmsghdr*)tmp; n->nm_size = newlen; return 0; |