diff --git a/test/benchmark-udp-pummel.c b/test/benchmark-udp-pummel.c index 1a186c27..a183c962 100644 --- a/test/benchmark-udp-pummel.c +++ b/test/benchmark-udp-pummel.c @@ -43,7 +43,8 @@ struct receiver_state { uv_udp_t udp_handle; }; -static unsigned int packet_counter = 1e6; /* not used in timed mode */ +/* not used in timed mode */ +static unsigned int packet_counter = (unsigned int) 1e6; static int n_senders_; static int n_receivers_; @@ -190,7 +191,8 @@ static int do_packet_storm(int n_senders, duration = uv_hrtime(); ASSERT(0 == uv_run(loop)); duration = uv_hrtime() - duration; - duration = duration / 1e6; /* convert from nanoseconds to milliseconds */ + /* convert from nanoseconds to milliseconds */ + duration = duration / (uint64_t) 1e6; printf("udp_packet_storm_%dv%d: %.0f/s received, %.0f/s sent. " "%u received, %u sent in %.1f seconds.\n", diff --git a/test/test-tcp-open.c b/test/test-tcp-open.c index 48188d24..40d3f5fa 100644 --- a/test/test-tcp-open.c +++ b/test/test-tcp-open.c @@ -50,7 +50,6 @@ static void startup(void) { static uv_os_sock_t create_tcp_socket(void) { uv_os_sock_t sock; - int r; sock = socket(AF_INET, SOCK_STREAM, IPPROTO_IP); #ifdef _WIN32 @@ -63,7 +62,7 @@ static uv_os_sock_t create_tcp_socket(void) { { /* Allow reuse of the port. */ int yes = 1; - r = setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof yes); + int r = setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof yes); ASSERT(r == 0); } #endif diff --git a/test/test-udp-open.c b/test/test-udp-open.c index 9168549e..5fcebac0 100644 --- a/test/test-udp-open.c +++ b/test/test-udp-open.c @@ -46,7 +46,6 @@ static void startup(void) { static uv_os_sock_t create_udp_socket(void) { uv_os_sock_t sock; - int r; sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_IP); #ifdef _WIN32 @@ -59,7 +58,7 @@ static uv_os_sock_t create_udp_socket(void) { { /* Allow reuse of the port. */ int yes = 1; - r = setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof yes); + int r = setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof yes); ASSERT(r == 0); } #endif