From 12acf0f7a76160e33bb84876121d3a63dde3c252 Mon Sep 17 00:00:00 2001 From: George Zhao Date: Wed, 17 Jan 2018 19:40:31 +0800 Subject: Fix warning when assing size_t type value to uv_buf_t.len, convert type to ULONG on Windows. --- test/functional/fixtures/tty-test.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/functional/fixtures/tty-test.c b/test/functional/fixtures/tty-test.c index edcbe23f86..9c42ca28d0 100644 --- a/test/functional/fixtures/tty-test.c +++ b/test/functional/fixtures/tty-test.c @@ -94,7 +94,14 @@ static void read_cb(uv_stream_t *stream, ssize_t cnt, const uv_buf_t *buf) uv_tty_init(&write_loop, &out, fileno(stdout), 0); uv_write_t req; - uv_buf_t b = {.base = buf->base, .len = (size_t)cnt}; + uv_buf_t b = { + .base = buf->base, +#ifdef WIN32 + .len = (ULONG)cnt +#else + .len = (size_t)cnt +#endif + }; uv_write(&req, STRUCT_CAST(uv_stream_t, &out), &b, 1, NULL); uv_run(&write_loop, UV_RUN_DEFAULT); -- cgit From 15334dcd896812d01f81f7959a51a4c4f6929195 Mon Sep 17 00:00:00 2001 From: George Zhao Date: Wed, 17 Jan 2018 19:41:16 +0800 Subject: Fix warning unused static function --- test/functional/fixtures/tty-test.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'test') diff --git a/test/functional/fixtures/tty-test.c b/test/functional/fixtures/tty-test.c index 9c42ca28d0..4f0858acdb 100644 --- a/test/functional/fixtures/tty-test.c +++ b/test/functional/fixtures/tty-test.c @@ -41,6 +41,7 @@ static void walk_cb(uv_handle_t *handle, void *arg) } } +#ifndef WIN32 static void sig_handler(int signum) { switch (signum) { @@ -57,6 +58,7 @@ static void sig_handler(int signum) return; } } +#endif #ifdef WIN32 static void sigwinch_cb(uv_signal_t *handle, int signum) -- cgit