mirror of
https://github.com/apache/nuttx.git
synced 2026-05-20 20:44:39 +08:00
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:
@@ -60,8 +60,8 @@ static ssize_t netprocfs_tcpstats(FAR struct netprocfs_file_s *priv,
|
||||
int addrlen = (domain == PF_INET) ?
|
||||
INET_ADDRSTRLEN : INET6_ADDRSTRLEN;
|
||||
FAR struct tcp_conn_s *conn = NULL;
|
||||
char remote[addrlen + 1];
|
||||
char local[addrlen + 1];
|
||||
char remote[INET6_ADDRSTRLEN + 1];
|
||||
char local[INET6_ADDRSTRLEN + 1];
|
||||
int len = 0;
|
||||
void *laddr;
|
||||
void *raddr;
|
||||
|
||||
@@ -60,8 +60,8 @@ static ssize_t netprocfs_udpstats(FAR struct netprocfs_file_s *priv,
|
||||
int addrlen = (domain == PF_INET) ?
|
||||
INET_ADDRSTRLEN : INET6_ADDRSTRLEN;
|
||||
FAR struct udp_conn_s *conn = NULL;
|
||||
char remote[addrlen + 1];
|
||||
char local[addrlen + 1];
|
||||
char remote[INET6_ADDRSTRLEN + 1];
|
||||
char local[INET6_ADDRSTRLEN + 1];
|
||||
int len = 0;
|
||||
void *laddr;
|
||||
void *raddr;
|
||||
|
||||
Reference in New Issue
Block a user