aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2017-05-20 17:07:35 +0200
committerGitHub <noreply@github.com>2017-05-20 17:07:35 +0200
commitbde46fdeceec8f9dd675f0e31080d732308573d9 (patch)
tree0044b6fd7f2f1682941e053ea686ec98a1d4f898 /test
parent3280765f2dde4ba6d120387908d735ed763db01c (diff)
parent7dc7d2f83f30eb2df1c5408ffceda244ced2f468 (diff)
downloadrneovim-bde46fdeceec8f9dd675f0e31080d732308573d9.tar.gz
rneovim-bde46fdeceec8f9dd675f0e31080d732308573d9.tar.bz2
rneovim-bde46fdeceec8f9dd675f0e31080d732308573d9.zip
Merge #6772 from ZyX-I/fix-pvs-errors
Diffstat (limited to 'test')
-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);