aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nvim/api/buffer.c4
-rw-r--r--src/nvim/event/rstream.c10
-rw-r--r--src/nvim/ex_getln.c2
-rw-r--r--src/nvim/file_search.c5
-rw-r--r--src/nvim/fileio.c2
-rw-r--r--src/nvim/indent_c.c2
-rw-r--r--src/nvim/os/env.c1
-rw-r--r--src/nvim/os/pty_process_win.h5
-rw-r--r--src/nvim/path.c26
9 files changed, 34 insertions, 23 deletions
diff --git a/src/nvim/api/buffer.c b/src/nvim/api/buffer.c
index b75a2c7211..037a6ee1da 100644
--- a/src/nvim/api/buffer.c
+++ b/src/nvim/api/buffer.c
@@ -395,10 +395,10 @@ void nvim_buf_set_lines(uint64_t channel_id,
mark_adjust((linenr_T)start, (linenr_T)(end - 1), MAXLNUM, extra);
}
- changed_lines((linenr_T)start, 0, (linenr_T)end, extra);
+ changed_lines((linenr_T)start, 0, (linenr_T)end, (long)extra);
if (save_curbuf.br_buf == NULL) {
- fix_cursor((linenr_T)start, (linenr_T)end, extra);
+ fix_cursor((linenr_T)start, (linenr_T)end, (linenr_T)extra);
}
end:
diff --git a/src/nvim/event/rstream.c b/src/nvim/event/rstream.c
index 92efc9fa2e..2737dad305 100644
--- a/src/nvim/event/rstream.c
+++ b/src/nvim/event/rstream.c
@@ -89,7 +89,10 @@ static void on_rbuffer_nonfull(RBuffer *buf, void *data)
static void alloc_cb(uv_handle_t *handle, size_t suggested, uv_buf_t *buf)
{
Stream *stream = handle->data;
- buf->base = rbuffer_write_ptr(stream->buffer, &buf->len);
+ // `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;
}
// Callback invoked by libuv after it copies the data into the buffer provided
@@ -136,7 +139,10 @@ static void fread_idle_cb(uv_idle_t *handle)
uv_fs_t req;
Stream *stream = handle->data;
- stream->uvbuf.base = rbuffer_write_ptr(stream->buffer, &stream->uvbuf.len);
+ // `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;
// 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/ex_getln.c b/src/nvim/ex_getln.c
index a0981a42ce..e140dfa886 100644
--- a/src/nvim/ex_getln.c
+++ b/src/nvim/ex_getln.c
@@ -579,7 +579,7 @@ static int command_line_execute(VimState *state, int key)
}
if (vim_ispathsep(ccline.cmdbuff[s->j])
#ifdef BACKSLASH_IN_FILENAME
- && vim_strchr(" *?[{`$%#", ccline.cmdbuff[s->j + 1])
+ && strchr(" *?[{`$%#", ccline.cmdbuff[s->j + 1])
== NULL
#endif
) {
diff --git a/src/nvim/file_search.c b/src/nvim/file_search.c
index f7932bc296..9592235905 100644
--- a/src/nvim/file_search.c
+++ b/src/nvim/file_search.c
@@ -322,8 +322,11 @@ vim_findfile_init (
drive[0] = path[0];
drive[1] = ':';
drive[2] = NUL;
- if (vim_FullName(drive, ff_expand_buffer, MAXPATHL, TRUE) == FAIL)
+ if (vim_FullName((const char *)drive, (char *)ff_expand_buffer, MAXPATHL,
+ true)
+ == FAIL) {
goto error_return;
+ }
path += 2;
} else
#endif
diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c
index 127efda65c..bd632b2755 100644
--- a/src/nvim/fileio.c
+++ b/src/nvim/fileio.c
@@ -5207,7 +5207,7 @@ void forward_slash(char_u *fname)
{
char_u *p;
- if (path_with_url(fname)) {
+ if (path_with_url((const char *)fname)) {
return;
}
for (p = fname; *p != NUL; p++) {
diff --git a/src/nvim/indent_c.c b/src/nvim/indent_c.c
index 7b758b4dac..4a73fbaf61 100644
--- a/src/nvim/indent_c.c
+++ b/src/nvim/indent_c.c
@@ -174,7 +174,7 @@ static char_u *skip_string(char_u *p)
char_u *paren = vim_strchr(delim, '(');
if (paren != NULL) {
- ptrdiff_t delim_len = paren - delim;
+ const ptrdiff_t delim_len = paren - delim;
for (p += 3; *p; ++p)
if (p[0] == ')' && STRNCMP(p + 1, delim, delim_len) == 0
diff --git a/src/nvim/os/env.c b/src/nvim/os/env.c
index a73d753e46..ae69462055 100644
--- a/src/nvim/os/env.c
+++ b/src/nvim/os/env.c
@@ -18,6 +18,7 @@
#include "nvim/eval.h"
#include "nvim/ex_getln.h"
#include "nvim/version.h"
+#include "nvim/fileio.h"
#ifdef WIN32
#include "nvim/mbyte.h" // for utf8_to_utf16, utf16_to_utf8
diff --git a/src/nvim/os/pty_process_win.h b/src/nvim/os/pty_process_win.h
index 20cc589925..8e2b37a1c1 100644
--- a/src/nvim/os/pty_process_win.h
+++ b/src/nvim/os/pty_process_win.h
@@ -12,8 +12,9 @@ typedef struct pty_process {
#define pty_process_spawn(job) libuv_process_spawn((LibuvProcess *)job)
#define pty_process_close(job) libuv_process_close((LibuvProcess *)job)
#define pty_process_close_master(job) libuv_process_close((LibuvProcess *)job)
-#define pty_process_resize(job, width, height)
-#define pty_process_teardown(loop)
+#define pty_process_resize(job, width, height) ( \
+ (void)job, (void)width, (void)height, 0)
+#define pty_process_teardown(loop) ((void)loop, 0)
static inline PtyProcess pty_process_init(Loop *loop, void *data)
{
diff --git a/src/nvim/path.c b/src/nvim/path.c
index e92261f4fd..d0248690d9 100644
--- a/src/nvim/path.c
+++ b/src/nvim/path.c
@@ -312,7 +312,7 @@ int path_fnamecmp(const char *fname1, const char *fname2)
///
/// @return 0 if they are equal, non-zero otherwise.
int path_fnamencmp(const char *const fname1, const char *const fname2,
- const size_t len)
+ size_t len)
FUNC_ATTR_NONNULL_ALL FUNC_ATTR_PURE FUNC_ATTR_WARN_UNUSED_RESULT
{
#ifdef BACKSLASH_IN_FILENAME
@@ -322,16 +322,16 @@ int path_fnamencmp(const char *const fname1, const char *const fname2,
const char *p1 = fname1;
const char *p2 = fname2;
while (len > 0) {
- c1 = PTR2CHAR(p1);
- c2 = PTR2CHAR(p2);
- if (c1 == NUL || c2 == NUL
- || (!((c1 == '/' || c1 == '\\') && (c2 == '\\' || c2 == '/')))
- || (p_fic ? (c1 != c2 && CH_FOLD(c1) != CH_FOLD(c2)) : c1 != c2)) {
+ c1 = PTR2CHAR((const char_u *)p1);
+ c2 = PTR2CHAR((const char_u *)p2);
+ if ((c1 == NUL || c2 == NUL
+ || (!((c1 == '/' || c1 == '\\') && (c2 == '\\' || c2 == '/'))))
+ && (p_fic ? (c1 != c2 && CH_FOLD(c1) != CH_FOLD(c2)) : c1 != c2)) {
break;
}
- len -= MB_PTR2LEN(p1);
- p1 += MB_PTR2LEN(p1);
- p2 += MB_PTR2LEN(p2);
+ len -= MB_PTR2LEN((const char_u *)p1);
+ p1 += MB_PTR2LEN((const char_u *)p1);
+ p2 += MB_PTR2LEN((const char_u *)p2);
}
return c1 - c2;
#else
@@ -819,7 +819,7 @@ static void expand_path_option(char_u *curdir, garray_T *gap)
}
STRMOVE(buf + len + 1, buf);
STRCPY(buf, curdir);
- buf[len] = PATHSEP;
+ buf[len] = (char_u)PATHSEP;
simplify_filename(buf);
}
@@ -1333,12 +1333,12 @@ static int expand_backtick(
/// When the path looks like a URL leave it unmodified.
void slash_adjust(char_u *p)
{
- if (path_with_url(p)) {
+ if (path_with_url((const char *)p)) {
return;
}
while (*p) {
- if (*p == psepcN) {
- *p = psepc;
+ if (*p == (char_u)psepcN) {
+ *p = (char_u)psepc;
}
mb_ptr_adv(p);
}