summaryrefslogtreecommitdiff
path: root/package/libnl-tiny/src/include/netlink/attr.h
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2011-01-26 11:33:38 +0000
committerFelix Fietkau <nbd@openwrt.org>2011-01-26 11:33:38 +0000
commit9a37eaeacf30cceefd56aa53d80a6b7f3fe26503 (patch)
treea4cb5fe66248e8ae017d313bba75a876c93e1c26 /package/libnl-tiny/src/include/netlink/attr.h
parent516dcae1c7643d736e71d240790370cb140a8383 (diff)
downloadmtk-20170518-9a37eaeacf30cceefd56aa53d80a6b7f3fe26503.zip
mtk-20170518-9a37eaeacf30cceefd56aa53d80a6b7f3fe26503.tar.gz
mtk-20170518-9a37eaeacf30cceefd56aa53d80a6b7f3fe26503.tar.bz2
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> SVN-Revision: 25101
Diffstat (limited to 'package/libnl-tiny/src/include/netlink/attr.h')
-rw-r--r--package/libnl-tiny/src/include/netlink/attr.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/package/libnl-tiny/src/include/netlink/attr.h b/package/libnl-tiny/src/include/netlink/attr.h
index 7076d67..3b56a82 100644
--- a/package/libnl-tiny/src/include/netlink/attr.h
+++ b/package/libnl-tiny/src/include/netlink/attr.h
@@ -508,7 +508,7 @@ static inline int nla_nest_end(struct nl_msg *msg, struct nlattr *start)
static inline int nla_parse_nested(struct nlattr *tb[], int maxtype, struct nlattr *nla,
struct nla_policy *policy)
{
- return nla_parse(tb, maxtype, nla_data(nla), nla_len(nla), policy);
+ return nla_parse(tb, maxtype, (struct nlattr *)nla_data(nla), nla_len(nla), policy);
}
/**
@@ -563,8 +563,8 @@ static inline int nla_strcmp(const struct nlattr *nla, const char *str)
*/
static inline size_t nla_strlcpy(char *dst, const struct nlattr *nla, size_t dstsize)
{
- size_t srclen = nla_len(nla);
- char *src = nla_data(nla);
+ size_t srclen = (size_t)nla_len(nla);
+ char *src = (char*)nla_data(nla);
if (srclen > 0 && src[srclen - 1] == '\0')
srclen--;
@@ -713,7 +713,7 @@ static inline size_t nla_strlcpy(char *dst, const struct nlattr *nla, size_t dst
* @arg rem initialized to len, holds bytes currently remaining in stream
*/
#define nla_for_each_nested(pos, nla, rem) \
- for (pos = nla_data(nla), rem = nla_len(nla); \
+ for (pos = (struct nlattr *)nla_data(nla), rem = nla_len(nla); \
nla_ok(pos, rem); \
pos = nla_next(pos, &(rem)))