diff --git a/test/benchmark-ping-pongs.c b/test/benchmark-ping-pongs.c index e1de83df..4518ef8d 100644 --- a/test/benchmark-ping-pongs.c +++ b/test/benchmark-ping-pongs.c @@ -174,7 +174,7 @@ static void pinger_connect_cb(uv_connect_t* req, int status) { } -static void pinger_new() { +static void pinger_new(void) { int r; struct sockaddr_in client_addr = uv_ip4_addr("0.0.0.0", 0); struct sockaddr_in server_addr = uv_ip4_addr("127.0.0.1", TEST_PORT); diff --git a/test/benchmark-pump.c b/test/benchmark-pump.c index 23944253..8ad9f4fa 100644 --- a/test/benchmark-pump.c +++ b/test/benchmark-pump.c @@ -117,7 +117,7 @@ static void show_stats(uv_timer_t* handle, int status) { } -static void read_show_stats() { +static void read_show_stats(void) { int64_t diff; uv_update_time(loop); @@ -149,7 +149,7 @@ void read_sockets_close_cb(uv_handle_t* handle) { } -static void start_stats_collection() { +static void start_stats_collection(void) { int r; /* Show-stats timer */ @@ -231,7 +231,7 @@ static void connect_cb(uv_connect_t* req, int status) { } -static void maybe_connect_some() { +static void maybe_connect_some(void) { uv_connect_t* req; uv_tcp_t* tcp; uv_pipe_t* pipe; @@ -302,7 +302,7 @@ typedef struct req_list_s { static req_list_t* req_freelist = NULL; -static uv_req_t* req_alloc() { +static uv_req_t* req_alloc(void) { req_list_t* req; req = req_freelist; diff --git a/test/benchmark-spawn.c b/test/benchmark-spawn.c index 43a71834..b78fd7e8 100644 --- a/test/benchmark-spawn.c +++ b/test/benchmark-spawn.c @@ -100,7 +100,7 @@ void on_read(uv_stream_t* pipe, ssize_t nread, uv_buf_t buf) { } -static void spawn() { +static void spawn(void) { uv_stdio_container_t stdio[2]; int r; diff --git a/test/runner-unix.c b/test/runner-unix.c index f6ea45e1..267cc7cb 100644 --- a/test/runner-unix.c +++ b/test/runner-unix.c @@ -313,7 +313,7 @@ void process_cleanup(process_info_t *p) { /* Move the console cursor one line up and back to the first column. */ -void rewind_cursor() { +void rewind_cursor(void) { fprintf(stderr, "\033[2K\r"); } diff --git a/test/runner.h b/test/runner.h index e1bd83bc..3919007b 100644 --- a/test/runner.h +++ b/test/runner.h @@ -38,7 +38,7 @@ typedef struct { char *task_name; char *process_name; - int (*main)(); + int (*main)(void); int is_helper; int show_output; } task_entry_t, bench_entry_t; @@ -55,7 +55,7 @@ typedef struct { }; #define TEST_DECLARE(name) \ - int run_test_##name(); + int run_test_##name(void); #define TEST_ENTRY(name) \ { #name, #name, &run_test_##name, 0, 0 }, @@ -64,13 +64,13 @@ typedef struct { { #name, #name, &run_test_##name, 0, 1 }, #define BENCHMARK_DECLARE(name) \ - int run_benchmark_##name(); + int run_benchmark_##name(void); #define BENCHMARK_ENTRY(name) \ { #name, #name, &run_benchmark_##name, 0, 0 }, #define HELPER_DECLARE(name) \ - int run_helper_##name(); + int run_helper_##name(void); #define HELPER_ENTRY(task_name, name) \ { #task_name, #name, &run_helper_##name, 1, 0 }, @@ -123,7 +123,7 @@ void print_tests(FILE* stream); */ /* Do platform-specific initialization. */ -void platform_init(); +void platform_init(int argc, char** argv); /* Invoke "argv[0] test-name [test-part]". Store process info in *p. */ /* Make sure that all stdio output of the processes is buffered up. */ @@ -154,6 +154,6 @@ int process_reap(process_info_t *p); void process_cleanup(process_info_t *p); /* Move the console cursor one line up and back to the first column. */ -void rewind_cursor(); +void rewind_cursor(void); #endif /* RUNNER_H_ */ diff --git a/test/task.h b/test/task.h index b351c423..de7c80ec 100644 --- a/test/task.h +++ b/test/task.h @@ -79,8 +79,6 @@ typedef enum { abort(); \ } while (0) - - /* Have our own assert, so we are sure it does not get optimized away in * a release build. */ @@ -103,15 +101,17 @@ typedef enum { uv_loop_delete(uv_default_loop()) /* Just sugar for wrapping the main() for a task or helper. */ -#define TEST_IMPL(name) \ - int run_test_##name() +#define TEST_IMPL(name) \ + int run_test_##name(void); \ + int run_test_##name(void) -#define BENCHMARK_IMPL(name) \ - int run_benchmark_##name() - -#define HELPER_IMPL(name) \ - int run_helper_##name() +#define BENCHMARK_IMPL(name) \ + int run_benchmark_##name(void); \ + int run_benchmark_##name(void) +#define HELPER_IMPL(name) \ + int run_helper_##name(void); \ + int run_helper_##name(void) /* Pause the calling thread for a number of milliseconds. */ void uv_sleep(int msec); diff --git a/test/test-delayed-accept.c b/test/test-delayed-accept.c index 064fb6a6..a5e09f9b 100644 --- a/test/test-delayed-accept.c +++ b/test/test-delayed-accept.c @@ -100,7 +100,7 @@ static void connection_cb(uv_stream_t* tcp, int status) { } -static void start_server() { +static void start_server(void) { struct sockaddr_in addr = uv_ip4_addr("0.0.0.0", TEST_PORT); uv_tcp_t* server = (uv_tcp_t*)malloc(sizeof *server); int r; @@ -153,7 +153,7 @@ static void connect_cb(uv_connect_t* req, int status) { } -static void client_connect() { +static void client_connect(void) { struct sockaddr_in addr = uv_ip4_addr("127.0.0.1", TEST_PORT); uv_tcp_t* client = (uv_tcp_t*)malloc(sizeof *client); uv_connect_t* connect_req = malloc(sizeof *connect_req); diff --git a/test/test-getsockname.c b/test/test-getsockname.c index 043c891c..7e2ae69a 100644 --- a/test/test-getsockname.c +++ b/test/test-getsockname.c @@ -165,7 +165,7 @@ static void on_connect(uv_connect_t* req, int status) { } -static int tcp_listener() { +static int tcp_listener(void) { struct sockaddr_in addr = uv_ip4_addr("0.0.0.0", server_port); struct sockaddr sockname, peername; int namelen; @@ -206,7 +206,7 @@ static int tcp_listener() { } -static void tcp_connector() { +static void tcp_connector(void) { struct sockaddr_in server_addr = uv_ip4_addr("127.0.0.1", server_port); struct sockaddr sockname; int r, namelen; @@ -261,7 +261,7 @@ static void udp_send(uv_udp_send_t* req, int status) { } -static int udp_listener() { +static int udp_listener(void) { struct sockaddr_in addr = uv_ip4_addr("0.0.0.0", server_port); struct sockaddr sockname; int namelen; diff --git a/test/test-ipc.c b/test/test-ipc.c index c37d1518..ff71b0ab 100644 --- a/test/test-ipc.c +++ b/test/test-ipc.c @@ -108,7 +108,7 @@ static void connect_cb(uv_connect_t* req, int status) { } -static void make_many_connections() { +static void make_many_connections(void) { tcp_conn* conn; struct sockaddr_in addr; int r, i; @@ -578,7 +578,7 @@ int ipc_helper(int listen_after_write) { } -int ipc_helper_tcp_connection() { +int ipc_helper_tcp_connection(void) { /* * This is launched from test-ipc.c. stdin is a duplex channel that we * over which a handle will be transmitted. diff --git a/test/test-multiple-listen.c b/test/test-multiple-listen.c index 18197d18..aced132f 100644 --- a/test/test-multiple-listen.c +++ b/test/test-multiple-listen.c @@ -44,7 +44,7 @@ static void connection_cb(uv_stream_t* tcp, int status) { } -static void start_server() { +static void start_server(void) { struct sockaddr_in addr = uv_ip4_addr("0.0.0.0", TEST_PORT); int r; @@ -71,7 +71,7 @@ static void connect_cb(uv_connect_t* req, int status) { } -static void client_connect() { +static void client_connect(void) { struct sockaddr_in addr = uv_ip4_addr("127.0.0.1", TEST_PORT); uv_connect_t* connect_req = malloc(sizeof *connect_req); int r; diff --git a/test/test-ping-pong.c b/test/test-ping-pong.c index a7b31c73..40c47f2c 100644 --- a/test/test-ping-pong.c +++ b/test/test-ping-pong.c @@ -145,7 +145,7 @@ static void pinger_on_connect(uv_connect_t *req, int status) { /* same ping-pong test, but using IPv6 connection */ -static void tcp_pinger_v6_new() { +static void tcp_pinger_v6_new(void) { int r; struct sockaddr_in6 server_addr = uv_ip6_addr("::1", TEST_PORT); pinger_t *pinger; @@ -170,7 +170,7 @@ static void tcp_pinger_v6_new() { } -static void tcp_pinger_new() { +static void tcp_pinger_new(void) { int r; struct sockaddr_in server_addr = uv_ip4_addr("127.0.0.1", TEST_PORT); pinger_t *pinger; @@ -195,7 +195,7 @@ static void tcp_pinger_new() { } -static void pipe_pinger_new() { +static void pipe_pinger_new(void) { int r; pinger_t *pinger; diff --git a/test/test-poll.c b/test/test-poll.c index eb5cb848..039e95c5 100644 --- a/test/test-poll.c +++ b/test/test-poll.c @@ -72,7 +72,7 @@ static int valid_writable_wakeups = 0; static int spurious_writable_wakeups = 0; -static int got_eagain() { +static int got_eagain(void) { #ifdef _WIN32 return WSAGetLastError() == WSAEWOULDBLOCK; #else @@ -495,7 +495,7 @@ static void server_poll_cb(uv_poll_t* handle, int status, int events) { } -static void start_server() { +static void start_server(void) { uv_os_sock_t sock; server_context_t* context; int r; @@ -511,7 +511,7 @@ static void start_server() { } -static void start_client() { +static void start_client(void) { uv_os_sock_t sock; connection_context_t* context; struct sockaddr_in server_addr = uv_ip4_addr("127.0.0.1", TEST_PORT); @@ -531,7 +531,7 @@ static void start_client() { } -static void start_poll_test() { +static void start_poll_test(void) { int i, r; #ifdef _WIN32 diff --git a/test/test-ref.c b/test/test-ref.c index 027af16f..abaaf0f8 100644 --- a/test/test-ref.c +++ b/test/test-ref.c @@ -58,7 +58,7 @@ static void fail_cb(void) { } -static void fail_cb2() { +static void fail_cb2(void) { ASSERT(0 && "fail_cb2 should not have been called"); } @@ -109,7 +109,7 @@ TEST_IMPL(ref) { TEST_IMPL(idle_ref) { uv_idle_t h; uv_idle_init(uv_default_loop(), &h); - uv_idle_start(&h, fail_cb2); + uv_idle_start(&h, (uv_idle_cb) fail_cb2); uv_unref((uv_handle_t*)&h); uv_run(uv_default_loop()); do_close(&h); @@ -132,7 +132,7 @@ TEST_IMPL(async_ref) { TEST_IMPL(prepare_ref) { uv_prepare_t h; uv_prepare_init(uv_default_loop(), &h); - uv_prepare_start(&h, fail_cb2); + uv_prepare_start(&h, (uv_prepare_cb) fail_cb2); uv_unref((uv_handle_t*)&h); uv_run(uv_default_loop()); do_close(&h); @@ -144,7 +144,7 @@ TEST_IMPL(prepare_ref) { TEST_IMPL(check_ref) { uv_check_t h; uv_check_init(uv_default_loop(), &h); - uv_check_start(&h, fail_cb2); + uv_check_start(&h, (uv_check_cb) fail_cb2); uv_unref((uv_handle_t*)&h); uv_run(uv_default_loop()); do_close(&h); diff --git a/test/test-stdio-over-pipes.c b/test/test-stdio-over-pipes.c index aeb7bd92..d412dd6f 100644 --- a/test/test-stdio-over-pipes.c +++ b/test/test-stdio-over-pipes.c @@ -182,7 +182,7 @@ static uv_buf_t on_read_alloc(uv_handle_t* handle, size_t suggested_size) { } -int stdio_over_pipes_helper() { +int stdio_over_pipes_helper(void) { /* Write several buffers to test that the write order is preserved. */ char* buffers[] = { "he",