aboutsummaryrefslogtreecommitdiff
path: root/test/functional/fixtures/tty-test.c
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2023-11-29 22:39:54 +0000
committerJosh Rahm <joshuarahm@gmail.com>2023-11-29 22:39:54 +0000
commit21cb7d04c387e4198ca8098a884c78b56ffcf4c2 (patch)
tree84fe5690df1551f0bb2bdfe1a13aacd29ebc1de7 /test/functional/fixtures/tty-test.c
parentd9c904f85a23a496df4eb6be42aa43f007b22d50 (diff)
parent4a8bf24ac690004aedf5540fa440e788459e5e34 (diff)
downloadrneovim-colorcolchar.tar.gz
rneovim-colorcolchar.tar.bz2
rneovim-colorcolchar.zip
Merge remote-tracking branch 'upstream/master' into colorcolcharcolorcolchar
Diffstat (limited to 'test/functional/fixtures/tty-test.c')
-rw-r--r--test/functional/fixtures/tty-test.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/test/functional/fixtures/tty-test.c b/test/functional/fixtures/tty-test.c
index 6ee7715021..f94af2fd12 100644
--- a/test/functional/fixtures/tty-test.c
+++ b/test/functional/fixtures/tty-test.c
@@ -1,6 +1,3 @@
-// This is an open source non-commercial project. Dear PVS-Studio, please check
-// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
-
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
@@ -11,8 +8,6 @@
# include <unistd.h>
#endif
-// -V:STRUCT_CAST:641
-#define STRUCT_CAST(Type, obj) ((Type *)(obj))
#define is_terminal(stream) (uv_guess_handle(fileno(stream)) == UV_TTY)
#define BUF_SIZE 0xfff
#define CTRL_C 0x03
@@ -108,10 +103,10 @@ static void read_cb(uv_stream_t *stream, ssize_t cnt, const uv_buf_t *buf)
.len = (size_t)cnt
#endif
};
- uv_write(&req, STRUCT_CAST(uv_stream_t, &out), &b, 1, NULL);
+ uv_write(&req, (uv_stream_t *)&out, &b, 1, NULL);
uv_run(&write_loop, UV_RUN_DEFAULT);
- uv_close(STRUCT_CAST(uv_handle_t, &out), NULL);
+ uv_close((uv_handle_t *)&out, NULL);
uv_run(&write_loop, UV_RUN_DEFAULT);
if (uv_loop_close(&write_loop)) {
abort();
@@ -181,7 +176,7 @@ int main(int argc, char **argv)
#endif
uv_tty_set_mode(&tty, UV_TTY_MODE_RAW);
tty.data = &interrupted;
- uv_read_start(STRUCT_CAST(uv_stream_t, &tty), alloc_cb, read_cb);
+ uv_read_start((uv_stream_t *)&tty, alloc_cb, read_cb);
#ifndef MSWIN
struct sigaction sa;
sigemptyset(&sa.sa_mask);