libs: fix visual studio Compiler Error C2036

D:\code\nuttx\libs\libc\net\lib_inetpton.c(300,52): error C2036: "void *" : unknown size

Reference:
https://learn.microsoft.com/en-us/cpp/error-messages/compiler-errors-1/compiler-error-c2036?view=msvc-170

Signed-off-by: chao an <anchao@xiaomi.com>
This commit is contained in:
chao an 2023-02-08 13:58:23 +08:00 committed by Xiang Xiao
parent 4b4cee8916
commit 8761cc9bfc
2 changed files with 5 additions and 3 deletions

View File

@ -162,7 +162,8 @@
*/
#define IPBUF(hl) ((FAR void *)(IOB_DATA(dev->d_iob) + (hl)))
#define NETLLBUF (IPBUF(0) - NET_LL_HDRLEN(dev))
#define NETLLBUF ((FAR void *) \
((FAR uint8_t *)IPBUF(0) - NET_LL_HDRLEN(dev)))
#define IPv4BUF ((FAR struct ipv4_hdr_s *)IPBUF(0))
#define IPv6BUF ((FAR struct ipv6_hdr_s *)IPBUF(0))

View File

@ -107,7 +107,7 @@ static int inet_ipv4_pton(FAR const char *src, FAR void *dest)
memset(dest, 0, sizeof(struct in_addr));
ip = (uint8_t *)dest;
ip = (FAR uint8_t *)dest;
srcoffset = 0;
numoffset = 0;
ndots = 0;
@ -297,7 +297,8 @@ static int inet_ipv6_pton(FAR const char *src, FAR void *dest)
if (nrsep > 0)
{
memcpy(dest + (16 - (nrsep << 1)), &rip[0], nrsep << 1);
memcpy((FAR uint8_t *)dest +
(16 - (nrsep << 1)), &rip[0], nrsep << 1);
}
/* Return 1 if the conversion succeeds */