aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/event
diff options
context:
space:
mode:
authorGeorge Zhao <zhaozg@gmail.com>2018-01-17 19:40:31 +0800
committerGeorge Zhao <zhaozg@gmail.com>2018-01-18 21:30:04 +0800
commit12acf0f7a76160e33bb84876121d3a63dde3c252 (patch)
tree17534b03eddec52f6117dd0d707495c78566c2ad /src/nvim/event
parentbac86a194117008656d02951de6d303ab8687eec (diff)
downloadrneovim-12acf0f7a76160e33bb84876121d3a63dde3c252.tar.gz
rneovim-12acf0f7a76160e33bb84876121d3a63dde3c252.tar.bz2
rneovim-12acf0f7a76160e33bb84876121d3a63dde3c252.zip
Fix warning when assing size_t type value to uv_buf_t.len, convert type to ULONG on Windows.
Diffstat (limited to 'src/nvim/event')
-rw-r--r--src/nvim/event/rstream.c4
-rw-r--r--src/nvim/event/wstream.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/nvim/event/rstream.c b/src/nvim/event/rstream.c
index e0500ba828..2fbe7f6773 100644
--- a/src/nvim/event/rstream.c
+++ b/src/nvim/event/rstream.c
@@ -95,7 +95,7 @@ static void alloc_cb(uv_handle_t *handle, size_t suggested, uv_buf_t *buf)
// `uv_buf_t.len` happens to have different size on Windows.
size_t write_count;
buf->base = rbuffer_write_ptr(stream->buffer, &write_count);
- buf->len = write_count;
+ buf->len = UV_BUF_LEN(write_count);
}
// Callback invoked by libuv after it copies the data into the buffer provided
@@ -146,7 +146,7 @@ static void fread_idle_cb(uv_idle_t *handle)
// `uv_buf_t.len` happens to have different size on Windows.
size_t write_count;
stream->uvbuf.base = rbuffer_write_ptr(stream->buffer, &write_count);
- stream->uvbuf.len = write_count;
+ stream->uvbuf.len = UV_BUF_LEN(write_count);
// the offset argument to uv_fs_read is int64_t, could someone really try
// to read more than 9 quintillion (9e18) bytes?
diff --git a/src/nvim/event/wstream.c b/src/nvim/event/wstream.c
index 320006890d..d2fb52243c 100644
--- a/src/nvim/event/wstream.c
+++ b/src/nvim/event/wstream.c
@@ -90,7 +90,7 @@ bool wstream_write(Stream *stream, WBuffer *buffer)
uv_buf_t uvbuf;
uvbuf.base = buffer->data;
- uvbuf.len = buffer->size;
+ uvbuf.len = UV_BUF_LEN(buffer->size);
if (uv_write(&data->uv_req, stream->uvstream, &uvbuf, 1, write_cb)) {
xfree(data);