net/procfs: fix visual studio Compiler Error C2057
D:\archer\code\nuttx\net\procfs\net_tcp.c(63,15): error C2057: expected constant expression Compiler error C2057: The context requires a constant expression, an expression whose value is known at compile time. Reference: https://learn.microsoft.com/en-us/cpp/error-messages/compiler-errors-1/compiler-error-c2057?view=msvc-170 Signed-off-by: chao an <anchao@xiaomi.com>
This commit is contained in:
parent
5580de0685
commit
4a8cd8ca0c
@ -60,8 +60,8 @@ static ssize_t netprocfs_tcpstats(FAR struct netprocfs_file_s *priv,
|
|||||||
int addrlen = (domain == PF_INET) ?
|
int addrlen = (domain == PF_INET) ?
|
||||||
INET_ADDRSTRLEN : INET6_ADDRSTRLEN;
|
INET_ADDRSTRLEN : INET6_ADDRSTRLEN;
|
||||||
FAR struct tcp_conn_s *conn = NULL;
|
FAR struct tcp_conn_s *conn = NULL;
|
||||||
char remote[addrlen + 1];
|
char remote[INET6_ADDRSTRLEN + 1];
|
||||||
char local[addrlen + 1];
|
char local[INET6_ADDRSTRLEN + 1];
|
||||||
int len = 0;
|
int len = 0;
|
||||||
void *laddr;
|
void *laddr;
|
||||||
void *raddr;
|
void *raddr;
|
||||||
|
@ -60,8 +60,8 @@ static ssize_t netprocfs_udpstats(FAR struct netprocfs_file_s *priv,
|
|||||||
int addrlen = (domain == PF_INET) ?
|
int addrlen = (domain == PF_INET) ?
|
||||||
INET_ADDRSTRLEN : INET6_ADDRSTRLEN;
|
INET_ADDRSTRLEN : INET6_ADDRSTRLEN;
|
||||||
FAR struct udp_conn_s *conn = NULL;
|
FAR struct udp_conn_s *conn = NULL;
|
||||||
char remote[addrlen + 1];
|
char remote[INET6_ADDRSTRLEN + 1];
|
||||||
char local[addrlen + 1];
|
char local[INET6_ADDRSTRLEN + 1];
|
||||||
int len = 0;
|
int len = 0;
|
||||||
void *laddr;
|
void *laddr;
|
||||||
void *raddr;
|
void *raddr;
|
||||||
|
Loading…
Reference in New Issue
Block a user