summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYegappan Lakshmanan <yegappan@yahoo.com>2022-09-04 12:47:21 +0100
committerBram Moolenaar <Bram@vim.org>2022-09-04 12:47:21 +0100
commit6b085b9d7367e077ca69f4f82ba0f92cc6b6e443 (patch)
tree24a71b96fa92cd775faba432e659cd5a23d8ed0d
parentc8ac3a072f18d4b250e55e91f610fe517e218777 (diff)
downloadvim-git-6b085b9d7367e077ca69f4f82ba0f92cc6b6e443.tar.gz
patch 9.0.0376: clang warns for dead assignmentsv9.0.0376
Problem: Clang warns for dead assignments. Solution: Adjust the code. (Yegappan Lakshmanan, closes #11048)
-rw-r--r--src/insexpand.c6
-rw-r--r--src/ops.c1
-rw-r--r--src/os_unix.c7
-rw-r--r--src/userfunc.c2
-rw-r--r--src/version.c2
-rw-r--r--src/vim9instr.c20
-rw-r--r--src/viminfo.c2
-rw-r--r--src/xxd/xxd.c1
8 files changed, 14 insertions, 27 deletions
diff --git a/src/insexpand.c b/src/insexpand.c
index b91c23001..f9ee4e6e5 100644
--- a/src/insexpand.c
+++ b/src/insexpand.c
@@ -3121,8 +3121,10 @@ get_complete_info(list_T *what_list, dict_T *retdict)
? compl_curr_match->cp_number - 1 : -1);
}
- // TODO
- // if (ret == OK && (what_flag & CI_WHAT_INSERTED))
+ if (ret == OK && (what_flag & CI_WHAT_INSERTED))
+ {
+ // TODO
+ }
}
/*
diff --git a/src/ops.c b/src/ops.c
index 5629a1a66..88d85f8e0 100644
--- a/src/ops.c
+++ b/src/ops.c
@@ -1344,7 +1344,6 @@ op_tilde(oparg_T *oap)
pos.col = 0;
pos.lnum++;
}
- ptr = ml_get_buf(curbuf, pos.lnum, FALSE);
count = oap->end.col - pos.col + 1;
netbeans_removed(curbuf, pos.lnum, pos.col, (long)count);
// get the line again, it may have been flushed
diff --git a/src/os_unix.c b/src/os_unix.c
index 4dadac30a..1ac6e190b 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -4522,7 +4522,7 @@ mch_call_shell_terminal(
// restore curwin/curbuf and a few other things
aucmd_restbuf(&aco);
- // only require pressing Enter when redrawing, to avoid that system() gets
+ // Only require pressing Enter when redrawing, to avoid that system() gets
// the hit-enter prompt even though it didn't output anything.
if (!RedrawingDisabled)
wait_return(TRUE);
@@ -5021,7 +5021,6 @@ mch_call_shell_fork(
{
// finished all the lines, close pipe
close(toshell_fd);
- toshell_fd = -1;
break;
}
lp = ml_get(lnum);
@@ -5399,7 +5398,7 @@ finished:
* child already exited.
*/
if (wait_pid != pid)
- wait_pid = wait4pid(pid, &status);
+ (void)wait4pid(pid, &status);
# ifdef FEAT_GUI
// Close slave side of pty. Only do this after the child has
@@ -6495,7 +6494,7 @@ select_eintr:
#ifdef FEAT_JOB_CHANNEL
// also call when ret == 0, we may be polling a keep-open channel
if (ret >= 0)
- ret = channel_select_check(ret, &rfds, &wfds);
+ (void)channel_select_check(ret, &rfds, &wfds);
#endif
#endif // HAVE_SELECT
diff --git a/src/userfunc.c b/src/userfunc.c
index c33ec63f9..0c6f9938f 100644
--- a/src/userfunc.c
+++ b/src/userfunc.c
@@ -312,8 +312,6 @@ get_function_args(
// find the end of the expression (doesn't evaluate it)
any_default = TRUE;
p = skipwhite(p) + 1;
- whitep = p;
- p = skipwhite(p);
expr = p;
if (eval1(&p, &rettv, NULL) != FAIL)
{
diff --git a/src/version.c b/src/version.c
index 1ceb171a3..1e3f9a3bd 100644
--- a/src/version.c
+++ b/src/version.c
@@ -704,6 +704,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 376,
+/**/
375,
/**/
374,
diff --git a/src/vim9instr.c b/src/vim9instr.c
index ae4de33f4..34d4ae33f 100644
--- a/src/vim9instr.c
+++ b/src/vim9instr.c
@@ -514,10 +514,8 @@ generate_2BOOL(cctx_T *cctx, int invert, int offset)
int
generate_COND2BOOL(cctx_T *cctx)
{
- isn_T *isn;
-
RETURN_OK_IF_SKIP(cctx);
- if ((isn = generate_instr(cctx, ISN_COND2BOOL)) == NULL)
+ if (generate_instr(cctx, ISN_COND2BOOL) == NULL)
return FAIL;
// type becomes bool
@@ -741,13 +739,9 @@ generate_PUSHS(cctx_T *cctx, char_u **str)
int
generate_PUSHCHANNEL(cctx_T *cctx)
{
-#ifdef FEAT_JOB_CHANNEL
- isn_T *isn;
-#endif
-
RETURN_OK_IF_SKIP(cctx);
#ifdef FEAT_JOB_CHANNEL
- if ((isn = generate_instr_type(cctx, ISN_PUSHCHANNEL, &t_channel)) == NULL)
+ if (generate_instr_type(cctx, ISN_PUSHCHANNEL, &t_channel) == NULL)
return FAIL;
return OK;
#else
@@ -762,13 +756,9 @@ generate_PUSHCHANNEL(cctx_T *cctx)
int
generate_PUSHJOB(cctx_T *cctx)
{
-#ifdef FEAT_JOB_CHANNEL
- isn_T *isn;
-#endif
-
RETURN_OK_IF_SKIP(cctx);
#ifdef FEAT_JOB_CHANNEL
- if ((isn = generate_instr_type(cctx, ISN_PUSHJOB, &t_job)) == NULL)
+ if (generate_instr_type(cctx, ISN_PUSHJOB, &t_job) == NULL)
return FAIL;
return OK;
#else
@@ -1067,10 +1057,8 @@ generate_UNLET(cctx_T *cctx, isntype_T isn_type, char_u *name, int forceit)
int
generate_LOCKCONST(cctx_T *cctx)
{
- isn_T *isn;
-
RETURN_OK_IF_SKIP(cctx);
- if ((isn = generate_instr(cctx, ISN_LOCKCONST)) == NULL)
+ if (generate_instr(cctx, ISN_LOCKCONST) == NULL)
return FAIL;
return OK;
}
diff --git a/src/viminfo.c b/src/viminfo.c
index acdf61825..546103e97 100644
--- a/src/viminfo.c
+++ b/src/viminfo.c
@@ -2324,7 +2324,7 @@ copy_viminfo_marks(
// Read the next line. If it has the "*" mark compare the
// time stamps. Write entries from "buflist" that are
// newer.
- if (!(eof = viminfo_readline(virp)) && line[0] == TAB)
+ if (!viminfo_readline(virp) && line[0] == TAB)
{
did_read_line = TRUE;
if (line[1] == '*')
diff --git a/src/xxd/xxd.c b/src/xxd/xxd.c
index 8429b98ec..c9e4c4678 100644
--- a/src/xxd/xxd.c
+++ b/src/xxd/xxd.c
@@ -782,7 +782,6 @@ main(int argc, char *argv[])
}
p = 0;
- c = 0;
while ((length < 0 || p < length) && (c = getc_or_die(fp)) != EOF)
{
FPRINTF_OR_DIE((fpo, (hexx == hexxa) ? "%s0x%02x" : "%s0X%02X",