diff options
| author | Justin M. Keyes <justinkz@gmail.com> | 2017-05-20 17:07:35 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-05-20 17:07:35 +0200 |
| commit | bde46fdeceec8f9dd675f0e31080d732308573d9 (patch) | |
| tree | 0044b6fd7f2f1682941e053ea686ec98a1d4f898 /src/nvim/event/socket.c | |
| parent | 3280765f2dde4ba6d120387908d735ed763db01c (diff) | |
| parent | 7dc7d2f83f30eb2df1c5408ffceda244ced2f468 (diff) | |
| download | rneovim-bde46fdeceec8f9dd675f0e31080d732308573d9.tar.gz rneovim-bde46fdeceec8f9dd675f0e31080d732308573d9.tar.bz2 rneovim-bde46fdeceec8f9dd675f0e31080d732308573d9.zip | |
Merge #6772 from ZyX-I/fix-pvs-errors
Diffstat (limited to 'src/nvim/event/socket.c')
| -rw-r--r-- | src/nvim/event/socket.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/nvim/event/socket.c b/src/nvim/event/socket.c index e536d79a2a..922e9c8be8 100644 --- a/src/nvim/event/socket.c +++ b/src/nvim/event/socket.c @@ -16,6 +16,7 @@ #include "nvim/strings.h" #include "nvim/path.h" #include "nvim/memory.h" +#include "nvim/macros.h" #ifdef INCLUDE_GENERATED_DECLARATIONS # include "event/socket.c.generated.h" @@ -71,10 +72,10 @@ void socket_watcher_init(Loop *loop, SocketWatcher *watcher, if (tcp) { uv_tcp_init(&loop->uv, &watcher->uv.tcp.handle); - watcher->stream = (uv_stream_t *)&watcher->uv.tcp.handle; + watcher->stream = STRUCT_CAST(uv_stream_t, &watcher->uv.tcp.handle); } else { uv_pipe_init(&loop->uv, &watcher->uv.pipe.handle, 0); - watcher->stream = (uv_stream_t *)&watcher->uv.pipe.handle; + watcher->stream = STRUCT_CAST(uv_stream_t, &watcher->uv.pipe.handle); } watcher->stream->data = watcher; @@ -122,10 +123,10 @@ int socket_watcher_accept(SocketWatcher *watcher, Stream *stream) uv_stream_t *client; if (watcher->stream->type == UV_TCP) { - client = (uv_stream_t *)&stream->uv.tcp; + client = STRUCT_CAST(uv_stream_t, &stream->uv.tcp); uv_tcp_init(watcher->uv.tcp.handle.loop, (uv_tcp_t *)client); } else { - client = (uv_stream_t *)&stream->uv.pipe; + client = STRUCT_CAST(uv_stream_t, &stream->uv.pipe); uv_pipe_init(watcher->uv.pipe.handle.loop, (uv_pipe_t *)client, 0); } |