From f2c88e037cc770e8faff701af6fcceaa51d2a566 Mon Sep 17 00:00:00 2001 From: "Issam E. Maghni" Date: Sun, 13 Dec 2020 15:10:16 -0500 Subject: [PATCH] test: fix some warnings Fix declaration after statement and comment syntax. PR-URL: https://github.com/libuv/libuv/pull/3067 Reviewed-By: Colin Ihrig Reviewed-By: Jameson Nash Reviewed-By: Santiago Gimeno --- test/echo-server.c | 3 ++- test/test-tcp-connect-timeout.c | 2 +- test/test-udp-connect.c | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/test/echo-server.c b/test/echo-server.c index 967e3276..69d0abc9 100644 --- a/test/echo-server.c +++ b/test/echo-server.c @@ -209,6 +209,7 @@ static void on_recv(uv_udp_t* handle, const struct sockaddr* addr, unsigned flags) { uv_buf_t sndbuf; + uv_udp_send_t* req; if (nread == 0) { /* Everything OK, but nothing read. */ @@ -218,7 +219,7 @@ static void on_recv(uv_udp_t* handle, ASSERT(nread > 0); ASSERT(addr->sa_family == AF_INET); - uv_udp_send_t* req = send_alloc(); + req = send_alloc(); ASSERT(req != NULL); sndbuf = uv_buf_init(rcvbuf->base, nread); ASSERT(0 <= uv_udp_send(req, handle, &sndbuf, 1, addr, on_send)); diff --git a/test/test-tcp-connect-timeout.c b/test/test-tcp-connect-timeout.c index a67d3252..3c34e54a 100644 --- a/test/test-tcp-connect-timeout.c +++ b/test/test-tcp-connect-timeout.c @@ -111,7 +111,7 @@ static int is_supported_system(void) { if (cnt != 3) { return 0; } - // relase >= 10.0.16299 + /* relase >= 10.0.16299 */ for (cnt = 0; cnt < 3; ++cnt) { if (semver[cnt] > min_semver[cnt]) return 1; diff --git a/test/test-udp-connect.c b/test/test-udp-connect.c index 41ace117..52856f70 100644 --- a/test/test-udp-connect.c +++ b/test/test-udp-connect.c @@ -124,7 +124,7 @@ TEST_IMPL(udp_connect) { buf = uv_buf_init("EXIT", 4); - // connect() to INADDR_ANY fails on Windows wih WSAEADDRNOTAVAIL + /* connect() to INADDR_ANY fails on Windows wih WSAEADDRNOTAVAIL */ ASSERT_EQ(0, uv_ip4_addr("0.0.0.0", TEST_PORT, &tmp_addr)); r = uv_udp_connect(&client, (const struct sockaddr*) &tmp_addr); #ifdef _WIN32