diff --git a/test/benchmark-ping-pongs.c b/test/benchmark-ping-pongs.c index 4d7f5ff9..9b554325 100644 --- a/test/benchmark-ping-pongs.c +++ b/test/benchmark-ping-pongs.c @@ -125,7 +125,7 @@ static void pinger_shutdown_cb(uv_handle_t* handle, int status) { } -static void pinger_read_cb(uv_tcp_t* tcp, int nread, uv_buf_t buf) { +static void pinger_read_cb(uv_tcp_t* tcp, ssize_t nread, uv_buf_t buf) { unsigned int i; pinger_t* pinger; diff --git a/test/benchmark-pump.c b/test/benchmark-pump.c index 1e704075..a59e46df 100644 --- a/test/benchmark-pump.c +++ b/test/benchmark-pump.c @@ -154,7 +154,7 @@ static void start_stats_collection() { } -static void read_cb(uv_tcp_t* tcp, int bytes, uv_buf_t buf) { +static void read_cb(uv_tcp_t* tcp, ssize_t bytes, uv_buf_t buf) { if (nrecv_total == 0) { ASSERT(start_time == 0); uv_update_time(); diff --git a/test/echo-server.c b/test/echo-server.c index 0ba3bd4b..54f45c0d 100644 --- a/test/echo-server.c +++ b/test/echo-server.c @@ -36,7 +36,7 @@ static uv_tcp_t server; static void after_write(uv_req_t* req, int status); -static void after_read(uv_tcp_t*, int nread, uv_buf_t buf); +static void after_read(uv_tcp_t*, ssize_t nread, uv_buf_t buf); static void on_close(uv_handle_t* peer); static void on_server_close(uv_handle_t* handle); static void on_connection(uv_tcp_t*, int status); @@ -65,7 +65,7 @@ static void after_shutdown(uv_req_t* req, int status) { } -static void after_read(uv_tcp_t* handle, int nread, uv_buf_t buf) { +static void after_read(uv_tcp_t* handle, ssize_t nread, uv_buf_t buf) { int i; write_req_t *wr; uv_req_t* req; diff --git a/test/test-callback-stack.c b/test/test-callback-stack.c index 7e60f098..5de5265b 100644 --- a/test/test-callback-stack.c +++ b/test/test-callback-stack.c @@ -67,7 +67,7 @@ static void shutdown_cb(uv_req_t* req, int status) { } -static void read_cb(uv_tcp_t* tcp, int nread, uv_buf_t buf) { +static void read_cb(uv_tcp_t* tcp, ssize_t nread, uv_buf_t buf) { ASSERT(nested == 0 && "read_cb must be called from a fresh stack"); printf("Read. nread == %d\n", nread); diff --git a/test/test-delayed-accept.c b/test/test-delayed-accept.c index 8db7c502..ca406d8e 100644 --- a/test/test-delayed-accept.c +++ b/test/test-delayed-accept.c @@ -121,7 +121,7 @@ static void start_server() { } -static void read_cb(uv_tcp_t* tcp, int nread, uv_buf_t buf) { +static void read_cb(uv_tcp_t* tcp, ssize_t nread, uv_buf_t buf) { /* The server will not send anything, it should close gracefully. */ ASSERT(tcp != NULL); ASSERT(nread == -1); diff --git a/test/test-ping-pong.c b/test/test-ping-pong.c index 8ed11289..d8bf13d1 100644 --- a/test/test-ping-pong.c +++ b/test/test-ping-pong.c @@ -92,7 +92,7 @@ static void pinger_write_ping(pinger_t* pinger) { } -static void pinger_read_cb(uv_tcp_t* tcp, int nread, uv_buf_t buf) { +static void pinger_read_cb(uv_tcp_t* tcp, ssize_t nread, uv_buf_t buf) { unsigned int i; pinger_t* pinger; diff --git a/test/test-shutdown-eof.c b/test/test-shutdown-eof.c index 71a1b906..1ce81f71 100644 --- a/test/test-shutdown-eof.c +++ b/test/test-shutdown-eof.c @@ -45,7 +45,7 @@ static uv_buf_t alloc_cb(uv_tcp_t* tcp, size_t size) { } -static void read_cb(uv_tcp_t* t, int nread, uv_buf_t buf) { +static void read_cb(uv_tcp_t* t, ssize_t nread, uv_buf_t buf) { ASSERT(t == &tcp); if (!got_q) { diff --git a/test/test-tcp-writealot.c b/test/test-tcp-writealot.c index 8548889e..5105a047 100644 --- a/test/test-tcp-writealot.c +++ b/test/test-tcp-writealot.c @@ -83,7 +83,7 @@ static void shutdown_cb(uv_req_t* req, int status) { } -static void read_cb(uv_tcp_t* tcp, int nread, uv_buf_t buf) { +static void read_cb(uv_tcp_t* tcp, ssize_t nread, uv_buf_t buf) { ASSERT(tcp != NULL); if (nread < 0) { diff --git a/uv.h b/uv.h index 1161493f..c2dd5211 100644 --- a/uv.h +++ b/uv.h @@ -57,7 +57,7 @@ typedef struct uv_req_s uv_req_t; * user. */ typedef uv_buf_t (*uv_alloc_cb)(uv_tcp_t* tcp, size_t suggested_size); -typedef void (*uv_read_cb)(uv_tcp_t* tcp, int nread, uv_buf_t buf); +typedef void (*uv_read_cb)(uv_tcp_t* tcp, ssize_t nread, uv_buf_t buf); typedef void (*uv_write_cb)(uv_req_t* req, int status); typedef void (*uv_connect_cb)(uv_req_t* req, int status); typedef void (*uv_shutdown_cb)(uv_req_t* req, int status);