mirror of
https://github.com/neovim/neovim.git
synced 2025-09-23 11:38:31 +00:00
vim-patch:8.0.0454: compiler warnings for "always true" comparison (#8431)
Problem: Compiler warnings for comparing unsigned char with 256 always
being true. (Manuel Ortega)
Solution: Add type cast.
977d037336
This commit is contained in:

committed by
Justin M. Keyes

parent
c67139f8aa
commit
d2c460638c
@@ -1018,7 +1018,7 @@ int win_lbr_chartabsize(win_T *wp, char_u *line, char_u *s, colnr_T col, int *he
|
|||||||
// needs a break here
|
// needs a break here
|
||||||
if (wp->w_p_lbr
|
if (wp->w_p_lbr
|
||||||
&& vim_isbreak(c)
|
&& vim_isbreak(c)
|
||||||
&& !vim_isbreak(s[1])
|
&& !vim_isbreak((int)s[1])
|
||||||
&& wp->w_p_wrap
|
&& wp->w_p_wrap
|
||||||
&& (wp->w_width != 0)) {
|
&& (wp->w_width != 0)) {
|
||||||
// Count all characters from first non-blank after a blank up to next
|
// Count all characters from first non-blank after a blank up to next
|
||||||
@@ -1042,7 +1042,7 @@ int win_lbr_chartabsize(win_T *wp, char_u *line, char_u *s, colnr_T col, int *he
|
|||||||
c = *s;
|
c = *s;
|
||||||
|
|
||||||
if (!(c != NUL
|
if (!(c != NUL
|
||||||
&& (vim_isbreak(c) || col2 == col || !vim_isbreak(*ps)))) {
|
&& (vim_isbreak(c) || col2 == col || !vim_isbreak((int)(*ps))))) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -3454,7 +3454,8 @@ win_line (
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Found last space before word: check for line break.
|
// Found last space before word: check for line break.
|
||||||
if (wp->w_p_lbr && c0 == c && vim_isbreak(c) && !vim_isbreak(*ptr)) {
|
if (wp->w_p_lbr && c0 == c && vim_isbreak(c)
|
||||||
|
&& !vim_isbreak((int)(*ptr))) {
|
||||||
int mb_off = has_mbyte ? (*mb_head_off)(line, ptr - 1) : 0;
|
int mb_off = has_mbyte ? (*mb_head_off)(line, ptr - 1) : 0;
|
||||||
char_u *p = ptr - (mb_off + 1);
|
char_u *p = ptr - (mb_off + 1);
|
||||||
// TODO: is passing p for start of the line OK?
|
// TODO: is passing p for start of the line OK?
|
||||||
|
Reference in New Issue
Block a user