aboutsummaryrefslogtreecommitdiff
path: root/test/functional
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2017-05-20 03:25:22 +0300
committerZyX <kp-pav@yandex.ru>2017-05-20 03:25:22 +0300
commitdf6778588614dbb9e4060cbc9f69de3a9aac689e (patch)
tree52f97c94f29dd9e805e43d4835c0f6a68c463906 /test/functional
parent2411b6f137feaf49ff8a09985cd4d9c447030309 (diff)
downloadrneovim-df6778588614dbb9e4060cbc9f69de3a9aac689e.tar.gz
rneovim-df6778588614dbb9e4060cbc9f69de3a9aac689e.tar.bz2
rneovim-df6778588614dbb9e4060cbc9f69de3a9aac689e.zip
*: Fix all V641 errors
Diffstat (limited to 'test/functional')
-rw-r--r--test/functional/fixtures/tty-test.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/test/functional/fixtures/tty-test.c b/test/functional/fixtures/tty-test.c
index 3406b3a202..7ba21d652a 100644
--- a/test/functional/fixtures/tty-test.c
+++ b/test/functional/fixtures/tty-test.c
@@ -6,6 +6,9 @@
#include <stdlib.h>
#include <uv.h>
+// -V:STRUCT_CAST:641
+#define STRUCT_CAST(Type, obj) ((Type *)(obj))
+
uv_tty_t tty;
#ifdef _WIN32
@@ -88,9 +91,9 @@ static void read_cb(uv_stream_t *stream, ssize_t cnt, const uv_buf_t *buf)
uv_tty_init(&write_loop, &out, 1, 0);
uv_write_t req;
uv_buf_t b = {.base = buf->base, .len = (size_t)cnt};
- uv_write(&req, (uv_stream_t *)&out, &b, 1, NULL);
+ uv_write(&req, STRUCT_CAST(uv_stream_t, &out), &b, 1, NULL);
uv_run(&write_loop, UV_RUN_DEFAULT);
- uv_close((uv_handle_t *)&out, NULL);
+ uv_close(STRUCT_CAST(uv_handle_t, &out), NULL);
uv_run(&write_loop, UV_RUN_DEFAULT);
if (uv_loop_close(&write_loop)) {
abort();
@@ -149,7 +152,7 @@ int main(int argc, char **argv)
uv_tty_init(uv_default_loop(), &tty, fileno(stderr), 1);
uv_tty_set_mode(&tty, UV_TTY_MODE_RAW);
tty.data = &interrupted;
- uv_read_start((uv_stream_t *)&tty, alloc_cb, read_cb);
+ uv_read_start(STRUCT_CAST(uv_stream_t, &tty), alloc_cb, read_cb);
#ifndef WIN32
struct sigaction sa;
sigemptyset(&sa.sa_mask);