aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/event/stream.c
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2023-11-30 20:35:25 +0000
committerJosh Rahm <joshuarahm@gmail.com>2023-11-30 20:35:25 +0000
commit1b7b916b7631ddf73c38e3a0070d64e4636cb2f3 (patch)
treecd08258054db80bb9a11b1061bb091c70b76926a /src/nvim/event/stream.c
parenteaa89c11d0f8aefbb512de769c6c82f61a8baca3 (diff)
parent4a8bf24ac690004aedf5540fa440e788459e5e34 (diff)
downloadrneovim-aucmd_textputpost.tar.gz
rneovim-aucmd_textputpost.tar.bz2
rneovim-aucmd_textputpost.zip
Merge remote-tracking branch 'upstream/master' into aucmd_textputpostaucmd_textputpost
Diffstat (limited to 'src/nvim/event/stream.c')
-rw-r--r--src/nvim/event/stream.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/nvim/event/stream.c b/src/nvim/event/stream.c
index 0a4918636a..aff116bad9 100644
--- a/src/nvim/event/stream.c
+++ b/src/nvim/event/stream.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 <assert.h>
#include <stdbool.h>
#include <stddef.h>
@@ -9,8 +6,8 @@
#include "nvim/event/loop.h"
#include "nvim/event/stream.h"
+#include "nvim/func_attr.h"
#include "nvim/log.h"
-#include "nvim/macros.h"
#include "nvim/rbuffer.h"
#ifdef MSWIN
# include "nvim/os/os_win_console.h"
@@ -37,9 +34,8 @@ int stream_set_blocking(int fd, bool blocking)
uv_loop_init(&loop);
uv_pipe_init(&loop, &stream, 0);
uv_pipe_open(&stream, fd);
- int retval = uv_stream_set_blocking(STRUCT_CAST(uv_stream_t, &stream),
- blocking);
- uv_close(STRUCT_CAST(uv_handle_t, &stream), NULL);
+ int retval = uv_stream_set_blocking((uv_stream_t *)&stream, blocking);
+ uv_close((uv_handle_t *)&stream, NULL);
uv_run(&loop, UV_RUN_NOWAIT); // not necessary, but couldn't hurt.
uv_loop_close(&loop);
return retval;
@@ -71,12 +67,12 @@ void stream_init(Loop *loop, Stream *stream, int fd, uv_stream_t *uvstream)
dwMode |= ENABLE_VIRTUAL_TERMINAL_INPUT;
SetConsoleMode(stream->uv.tty.handle, dwMode);
}
- stream->uvstream = STRUCT_CAST(uv_stream_t, &stream->uv.tty);
+ stream->uvstream = (uv_stream_t *)&stream->uv.tty;
} else {
#endif
uv_pipe_init(&loop->uv, &stream->uv.pipe, 0);
uv_pipe_open(&stream->uv.pipe, fd);
- stream->uvstream = STRUCT_CAST(uv_stream_t, &stream->uv.pipe);
+ stream->uvstream = (uv_stream_t *)&stream->uv.pipe;
#ifdef MSWIN
}
#endif