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:
parent
4b4cee8916
commit
8761cc9bfc
|
@ -162,7 +162,8 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define IPBUF(hl) ((FAR void *)(IOB_DATA(dev->d_iob) + (hl)))
|
#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 IPv4BUF ((FAR struct ipv4_hdr_s *)IPBUF(0))
|
||||||
#define IPv6BUF ((FAR struct ipv6_hdr_s *)IPBUF(0))
|
#define IPv6BUF ((FAR struct ipv6_hdr_s *)IPBUF(0))
|
||||||
|
|
|
@ -107,7 +107,7 @@ static int inet_ipv4_pton(FAR const char *src, FAR void *dest)
|
||||||
|
|
||||||
memset(dest, 0, sizeof(struct in_addr));
|
memset(dest, 0, sizeof(struct in_addr));
|
||||||
|
|
||||||
ip = (uint8_t *)dest;
|
ip = (FAR uint8_t *)dest;
|
||||||
srcoffset = 0;
|
srcoffset = 0;
|
||||||
numoffset = 0;
|
numoffset = 0;
|
||||||
ndots = 0;
|
ndots = 0;
|
||||||
|
@ -297,7 +297,8 @@ static int inet_ipv6_pton(FAR const char *src, FAR void *dest)
|
||||||
|
|
||||||
if (nrsep > 0)
|
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 */
|
/* Return 1 if the conversion succeeds */
|
||||||
|
|
Loading…
Reference in New Issue