aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2019-01-13 17:10:46 +0100
committerJustin M. Keyes <justinkz@gmail.com>2019-01-13 17:53:26 +0100
commitddd4ed3ce57027eeee72041e98f7bf576b01a370 (patch)
treefcf4520154f7ad65d61ee0d7b45e594d4cc276bd
parent94fc3e01828a4f021dcb2ce9a31edabf2770cec4 (diff)
downloadrneovim-ddd4ed3ce57027eeee72041e98f7bf576b01a370.tar.gz
rneovim-ddd4ed3ce57027eeee72041e98f7bf576b01a370.tar.bz2
rneovim-ddd4ed3ce57027eeee72041e98f7bf576b01a370.zip
clang/"Dead assignment"
-rw-r--r--src/nvim/ex_docmd.c1
-rw-r--r--src/nvim/ex_getln.c4
-rw-r--r--src/nvim/fileio.c2
-rw-r--r--src/nvim/mouse.c2
-rw-r--r--src/nvim/normal.c1
5 files changed, 4 insertions, 6 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c
index ffa913efcf..f5c16d883a 100644
--- a/src/nvim/ex_docmd.c
+++ b/src/nvim/ex_docmd.c
@@ -10103,6 +10103,7 @@ Dictionary commands_array(buf_T *buf)
{
Dictionary rv = ARRAY_DICT_INIT;
Object obj = NIL;
+ (void)obj; // Avoid "dead assignment" warning.
char str[10];
garray_T *gap = (buf == NULL) ? &ucmds : &buf->b_ucmds;
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c
index 8be8d757c8..8efb027575 100644
--- a/src/nvim/ex_getln.c
+++ b/src/nvim/ex_getln.c
@@ -1808,7 +1808,6 @@ static int command_line_changed(CommandLineState *s)
if (has_event(EVENT_CMDLINECHANGED)) {
TryState tstate;
Error err = ERROR_INIT;
- bool tl_ret = true;
dict_T *dict = get_vim_var_dict(VV_EVENT);
char firstcbuf[2];
@@ -1825,14 +1824,13 @@ static int command_line_changed(CommandLineState *s)
(char_u *)firstcbuf, false, curbuf);
tv_dict_clear(dict);
- tl_ret = try_leave(&tstate, &err);
+ bool tl_ret = try_leave(&tstate, &err);
if (!tl_ret && ERROR_SET(&err)) {
msg_putchar('\n');
msg_printf_attr(HL_ATTR(HLF_E)|MSG_HIST, (char *)e_autocmd_err, err.msg);
api_clear_error(&err);
redrawcmd();
}
- tl_ret = true;
}
// 'incsearch' highlighting.
diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c
index c631057e81..ba154ea36a 100644
--- a/src/nvim/fileio.c
+++ b/src/nvim/fileio.c
@@ -760,8 +760,6 @@ readfile (
fenc = (char_u *)"utf-8";
fenc_alloced = false;
-
- c = 1;
} else if (*p_fencs == NUL) {
fenc = curbuf->b_p_fenc; /* use format from buffer */
fenc_alloced = FALSE;
diff --git a/src/nvim/mouse.c b/src/nvim/mouse.c
index bf71e6a479..887cbde921 100644
--- a/src/nvim/mouse.c
+++ b/src/nvim/mouse.c
@@ -641,7 +641,7 @@ static int mouse_adjust_click(win_T *wp, int row, int col)
linenr_T lnum = wp->w_cursor.lnum;
char_u *line = ml_get(lnum);
char_u *ptr = line;
- char_u *ptr_end = line;
+ char_u *ptr_end;
char_u *ptr_row_offset = line; // Where we begin adjusting `ptr_end`
// Find the offset where scanning should begin.
diff --git a/src/nvim/normal.c b/src/nvim/normal.c
index 32fa502940..0e3946740a 100644
--- a/src/nvim/normal.c
+++ b/src/nvim/normal.c
@@ -3770,6 +3770,7 @@ find_decl (
clearpos(&found_pos);
for (;; ) {
valid = false;
+ (void)valid; // Avoid "dead assignment" warning.
t = searchit(curwin, curbuf, &curwin->w_cursor, FORWARD,
pat, 1L, searchflags, RE_LAST, (linenr_T)0, NULL);
if (curwin->w_cursor.lnum >= old_pos.lnum)