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);
}
/**
*/
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--;
* @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)))
int i, err;
for (i = 0; i <= NL_CB_TYPE_MAX; i++) {
- err = nl_cb_set(cb, i, kind, func, arg);
+ err = nl_cb_set(cb,(enum nl_cb_type)i, kind, func, arg);
if (err < 0)
return err;
}
*/
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));
}
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;
if (tmp == NULL)
return -NLE_NOMEM;
- n->nm_nlh = tmp;
+ n->nm_nlh = (struct nlmsghdr*)tmp;
n->nm_size = newlen;
return 0;