diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2010-12-30 02:02:05 +0100 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2010-12-30 02:02:05 +0100 |
commit | dbbd8a22742a9f67c75c10411908835703d34728 (patch) | |
tree | 6c1639e5d3e61cf606c163d694a4bf53af1fdcfc | |
parent | 091286e666a9d34818a875152ac7659b38656f06 (diff) | |
download | libmnl-dbbd8a22742a9f67c75c10411908835703d34728.tar.gz libmnl-dbbd8a22742a9f67c75c10411908835703d34728.zip |
header: fix invalid use of type void * in arithmetic of mnl_for_each_nest(...)
This patch fixes the following warnings:
netlink.c:121: warning: pointer of type ‘void *’ used in arithmetic
netlink.c:121: warning: pointer of type ‘void *’ used in subtraction
We cannot use type void * for pointer arithmetic operations.
This was introduced in 478dc5f4ab8d0a639d1bafe3bd53ff3309727836
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r-- | include/libmnl/libmnl.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/libmnl/libmnl.h b/include/libmnl/libmnl.h index 0ca9e4d..1e170a9 100644 --- a/include/libmnl/libmnl.h +++ b/include/libmnl/libmnl.h @@ -148,12 +148,12 @@ extern struct nlattr *mnl_attr_next(const struct nlattr *attr); #define mnl_attr_for_each(attr, nlh, offset) \ for ((attr) = mnl_nlmsg_get_payload_offset((nlh), (offset)); \ - mnl_attr_ok((attr), mnl_nlmsg_get_payload_tail(nlh) - (void *)(attr)); \ + mnl_attr_ok((attr), (char *)mnl_nlmsg_get_payload_tail(nlh) - (char *)(attr)); \ (attr) = mnl_attr_next(attr)) #define mnl_attr_for_each_nested(attr, nest) \ for ((attr) = mnl_attr_get_payload(nest); \ - mnl_attr_ok((attr), mnl_attr_get_payload(nest) + mnl_attr_get_payload_len(nest) - (void *)(attr)); \ + mnl_attr_ok((attr), (char *)mnl_attr_get_payload(nest) + mnl_attr_get_payload_len(nest) - (char *)(attr)); \ (attr) = mnl_attr_next(attr)) /* TLV callback-based attribute parsers */ |