summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-04-24 15:19:04 +0200
committerBram Moolenaar <Bram@vim.org>2018-04-24 15:19:04 +0200
commit1c17ffa4611f4efe68c61f7cdd9ed692a866ba75 (patch)
tree009f678c60ced89e9f9185f848fb03fcd06d0b25
parenta2aa8a2b22de909619d7faa3ff5383a6224defc5 (diff)
patch 8.0.1753: various warnings from a static analyserv8.0.1753
Problem: Various warnings from a static analyser Solution: Add type casts, remove unneeded conditions. (Christian Brabandt, closes #2770)
-rw-r--r--src/evalfunc.c2
-rw-r--r--src/ex_cmds2.c2
-rw-r--r--src/fileio.c2
-rw-r--r--src/getchar.c10
-rw-r--r--src/normal.c2
-rw-r--r--src/os_unix.c2
-rw-r--r--src/search.c2
-rw-r--r--src/term.c4
-rw-r--r--src/version.c2
9 files changed, 15 insertions, 13 deletions
diff --git a/src/evalfunc.c b/src/evalfunc.c
index 62dc40e1d7..dd4462d4f8 100644
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -10194,7 +10194,7 @@ set_buffer_lines(buf_T *buf, linenr_T lnum, typval_T *lines, typval_T *rettv)
}
rettv->vval.v_number = 1; /* FAIL */
- if (line == NULL || lnum < 1 || lnum > curbuf->b_ml.ml_line_count + 1)
+ if (line == NULL || lnum > curbuf->b_ml.ml_line_count + 1)
break;
/* When coming here from Insert mode, sync undo, so that this can be
diff --git a/src/ex_cmds2.c b/src/ex_cmds2.c
index b11bff43c7..3e369a8a4f 100644
--- a/src/ex_cmds2.c
+++ b/src/ex_cmds2.c
@@ -1420,7 +1420,7 @@ check_due_timer(void)
if (balloonEval != NULL)
general_beval_cb(balloonEval, 0);
}
- else if (this_due > 0 && (next_due == -1 || next_due > this_due))
+ else if (next_due == -1 || next_due > this_due)
next_due = this_due;
}
#endif
diff --git a/src/fileio.c b/src/fileio.c
index 700bd3ea53..35f4fd2c2b 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -1392,7 +1392,7 @@ retry:
/* If the crypt layer is buffering, not producing
* anything yet, need to read more. */
- if (size > 0 && decrypted_size == 0)
+ if (decrypted_size == 0)
continue;
if (linerest == 0)
diff --git a/src/getchar.c b/src/getchar.c
index 285d5d5d06..623440ecf9 100644
--- a/src/getchar.c
+++ b/src/getchar.c
@@ -4119,7 +4119,7 @@ map_to_exists_mode(char_u *rhs, int mode, int abbr)
mapblock_T *mp;
int hash;
# ifdef FEAT_LOCALMAP
- int expand_buffer = FALSE;
+ int exp_buffer = FALSE;
validate_maphash();
@@ -4134,14 +4134,14 @@ map_to_exists_mode(char_u *rhs, int mode, int abbr)
if (hash > 0) /* there is only one abbr list */
break;
#ifdef FEAT_LOCALMAP
- if (expand_buffer)
+ if (exp_buffer)
mp = curbuf->b_first_abbr;
else
#endif
mp = first_abbr;
}
# ifdef FEAT_LOCALMAP
- else if (expand_buffer)
+ else if (exp_buffer)
mp = curbuf->b_maphash[hash];
# endif
else
@@ -4154,9 +4154,9 @@ map_to_exists_mode(char_u *rhs, int mode, int abbr)
}
}
# ifdef FEAT_LOCALMAP
- if (expand_buffer)
+ if (exp_buffer)
break;
- expand_buffer = TRUE;
+ exp_buffer = TRUE;
}
# endif
diff --git a/src/normal.c b/src/normal.c
index 89b2dc02a0..84867b52f8 100644
--- a/src/normal.c
+++ b/src/normal.c
@@ -2610,7 +2610,7 @@ do_mouse(
end_visual_mode();
}
}
- else if (c1 < 0)
+ else
{
tabpage_T *tp;
diff --git a/src/os_unix.c b/src/os_unix.c
index 56465601ed..c89131fa3e 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -441,7 +441,7 @@ mch_inchar(
/* no character available within "wtime" */
return 0;
- if (wtime < 0)
+ else
{
/* no character available within 'updatetime' */
did_start_blocking = TRUE;
diff --git a/src/search.c b/src/search.c
index a4b272224c..a34636227a 100644
--- a/src/search.c
+++ b/src/search.c
@@ -4071,7 +4071,7 @@ again:
goto again;
}
- if (do_include || r < 1)
+ if (do_include)
{
/* Include up to the '>'. */
while (*ml_get_cursor() != '>')
diff --git a/src/term.c b/src/term.c
index 3a27fa691d..1739f5bc53 100644
--- a/src/term.c
+++ b/src/term.c
@@ -2361,7 +2361,7 @@ term_7to8bit(char_u *p)
return 0;
}
-#ifdef FEAT_GUI
+#if defined(FEAT_GUI) || defined(PROTO)
int
term_is_gui(char_u *name)
{
@@ -2823,7 +2823,7 @@ term_get_winpos(int *x, int *y, varnumber_T timeout)
winpos_x = prev_winpos_x;
winpos_y = prev_winpos_y;
- if (timeout < 10 && prev_winpos_y >= 0 && prev_winpos_y >= 0)
+ if (timeout < 10 && prev_winpos_y >= 0 && prev_winpos_x >= 0)
{
/* Polling: return previous values if we have them. */
*x = winpos_x;
diff --git a/src/version.c b/src/version.c
index fda91e2938..6a4c97dda0 100644
--- a/src/version.c
+++ b/src/version.c
@@ -762,6 +762,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1753,
+/**/
1752,
/**/
1751,