diff options
author | Eliseo Martínez <eliseomarmol@gmail.com> | 2015-04-28 10:31:42 +0200 |
---|---|---|
committer | Eliseo Martínez <eliseomarmol@gmail.com> | 2015-04-28 10:31:42 +0200 |
commit | 3450762f0a1e91166aaea27ea80312d39d6f83b6 (patch) | |
tree | 8c4fe902ae018d385f31a045d4e2338f3463c581 /src/nvim/screen.c | |
parent | d9441444afa3e99c8116ad01b11614886aa53524 (diff) | |
parent | 7c956dcbe8017dd68bf4221893bf554302b8fd90 (diff) | |
download | rneovim-3450762f0a1e91166aaea27ea80312d39d6f83b6.tar.gz rneovim-3450762f0a1e91166aaea27ea80312d39d6f83b6.tar.bz2 rneovim-3450762f0a1e91166aaea27ea80312d39d6f83b6.zip |
Merge #2518: Enable -Wconversion. (3)
Reviewed-by: Justin M. Keyes <justinkz@gmail.com>
Diffstat (limited to 'src/nvim/screen.c')
-rw-r--r-- | src/nvim/screen.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/nvim/screen.c b/src/nvim/screen.c index a680599f9b..dc94f331fd 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -2465,7 +2465,7 @@ win_line ( /* When spell checking a word we need to figure out the start of the * word and if it's badly spelled or not. */ if (has_spell) { - int len; + size_t len; colnr_T linecol = (colnr_T)(ptr - line); hlf_T spell_hlf = HLF_COUNT; @@ -2485,7 +2485,8 @@ win_line ( word_end = (int)(spell_to_word_end(ptr, wp) - line + 1); } else { /* bad word found, use attributes until end of word */ - word_end = wp->w_cursor.col + len + 1; + assert(len <= INT_MAX); + word_end = wp->w_cursor.col + (int)len + 1; /* Turn index into actual attributes. */ if (spell_hlf != HLF_COUNT) @@ -3252,8 +3253,9 @@ win_line ( else p = prev_ptr; cap_col -= (int)(prev_ptr - line); - len = spell_check(wp, p, &spell_hlf, &cap_col, - nochange); + size_t tmplen = spell_check(wp, p, &spell_hlf, &cap_col, nochange); + assert(tmplen <= INT_MAX); + len = (int)tmplen; word_end = v + len; /* In Insert mode only highlight a word that |