Skip to content

Commit 1c17ffa

Browse files
committed
patch 8.0.1753: various warnings from a static analyser
Problem: Various warnings from a static analyser Solution: Add type casts, remove unneeded conditions. (Christian Brabandt, closes #2770)
1 parent a2aa8a2 commit 1c17ffa

File tree

9 files changed

+15
-13
lines changed

9 files changed

+15
-13
lines changed

src/evalfunc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10194,7 +10194,7 @@ set_buffer_lines(buf_T *buf, linenr_T lnum, typval_T *lines, typval_T *rettv)
1019410194
}
1019510195

1019610196
rettv->vval.v_number = 1; /* FAIL */
10197-
if (line == NULL || lnum < 1 || lnum > curbuf->b_ml.ml_line_count + 1)
10197+
if (line == NULL || lnum > curbuf->b_ml.ml_line_count + 1)
1019810198
break;
1019910199

1020010200
/* When coming here from Insert mode, sync undo, so that this can be

src/ex_cmds2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1420,7 +1420,7 @@ check_due_timer(void)
14201420
if (balloonEval != NULL)
14211421
general_beval_cb(balloonEval, 0);
14221422
}
1423-
else if (this_due > 0 && (next_due == -1 || next_due > this_due))
1423+
else if (next_due == -1 || next_due > this_due)
14241424
next_due = this_due;
14251425
}
14261426
#endif

src/fileio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1392,7 +1392,7 @@ readfile(
13921392

13931393
/* If the crypt layer is buffering, not producing
13941394
* anything yet, need to read more. */
1395-
if (size > 0 && decrypted_size == 0)
1395+
if (decrypted_size == 0)
13961396
continue;
13971397

13981398
if (linerest == 0)

src/getchar.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4119,7 +4119,7 @@ map_to_exists_mode(char_u *rhs, int mode, int abbr)
41194119
mapblock_T *mp;
41204120
int hash;
41214121
# ifdef FEAT_LOCALMAP
4122-
int expand_buffer = FALSE;
4122+
int exp_buffer = FALSE;
41234123

41244124
validate_maphash();
41254125

@@ -4134,14 +4134,14 @@ map_to_exists_mode(char_u *rhs, int mode, int abbr)
41344134
if (hash > 0) /* there is only one abbr list */
41354135
break;
41364136
#ifdef FEAT_LOCALMAP
4137-
if (expand_buffer)
4137+
if (exp_buffer)
41384138
mp = curbuf->b_first_abbr;
41394139
else
41404140
#endif
41414141
mp = first_abbr;
41424142
}
41434143
# ifdef FEAT_LOCALMAP
4144-
else if (expand_buffer)
4144+
else if (exp_buffer)
41454145
mp = curbuf->b_maphash[hash];
41464146
# endif
41474147
else
@@ -4154,9 +4154,9 @@ map_to_exists_mode(char_u *rhs, int mode, int abbr)
41544154
}
41554155
}
41564156
# ifdef FEAT_LOCALMAP
4157-
if (expand_buffer)
4157+
if (exp_buffer)
41584158
break;
4159-
expand_buffer = TRUE;
4159+
exp_buffer = TRUE;
41604160
}
41614161
# endif
41624162

src/normal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2610,7 +2610,7 @@ do_mouse(
26102610
end_visual_mode();
26112611
}
26122612
}
2613-
else if (c1 < 0)
2613+
else
26142614
{
26152615
tabpage_T *tp;
26162616

src/os_unix.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ mch_inchar(
441441
/* no character available within "wtime" */
442442
return 0;
443443

444-
if (wtime < 0)
444+
else
445445
{
446446
/* no character available within 'updatetime' */
447447
did_start_blocking = TRUE;

src/search.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4071,7 +4071,7 @@ current_tagblock(
40714071
goto again;
40724072
}
40734073

4074-
if (do_include || r < 1)
4074+
if (do_include)
40754075
{
40764076
/* Include up to the '>'. */
40774077
while (*ml_get_cursor() != '>')

src/term.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2361,7 +2361,7 @@ term_7to8bit(char_u *p)
23612361
return 0;
23622362
}
23632363

2364-
#ifdef FEAT_GUI
2364+
#if defined(FEAT_GUI) || defined(PROTO)
23652365
int
23662366
term_is_gui(char_u *name)
23672367
{
@@ -2823,7 +2823,7 @@ term_get_winpos(int *x, int *y, varnumber_T timeout)
28232823

28242824
winpos_x = prev_winpos_x;
28252825
winpos_y = prev_winpos_y;
2826-
if (timeout < 10 && prev_winpos_y >= 0 && prev_winpos_y >= 0)
2826+
if (timeout < 10 && prev_winpos_y >= 0 && prev_winpos_x >= 0)
28272827
{
28282828
/* Polling: return previous values if we have them. */
28292829
*x = winpos_x;

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -761,6 +761,8 @@ static char *(features[]) =
761761

762762
static int included_patches[] =
763763
{ /* Add new patch number below this line */
764+
/**/
765+
1753,
764766
/**/
765767
1752,
766768
/**/

0 commit comments

Comments
 (0)