aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/screen.c
diff options
context:
space:
mode:
authorEliseo Martínez <eliseomarmol@gmail.com>2015-04-26 20:32:24 +0200
committerEliseo Martínez <eliseomarmol@gmail.com>2015-04-27 19:27:07 +0200
commit7c956dcbe8017dd68bf4221893bf554302b8fd90 (patch)
tree8c4fe902ae018d385f31a045d4e2338f3463c581 /src/nvim/screen.c
parentd9441444afa3e99c8116ad01b11614886aa53524 (diff)
downloadrneovim-7c956dcbe8017dd68bf4221893bf554302b8fd90.tar.gz
rneovim-7c956dcbe8017dd68bf4221893bf554302b8fd90.tar.bz2
rneovim-7c956dcbe8017dd68bf4221893bf554302b8fd90.zip
Enable -Wconversion: normal.c.
Refactor summary: - extern int opcount --> extern long opcount - bool find_decl(..., int len, ...) --> bool find_decl(..., size_t len, ...) * int find_ident_under_cursor(...) --> size_t find_ident_under_cursor(...) - int find_ident_at_pos(...) --> size_t find_ident_at_pos(...) - int modify_fname(..., int *usedlen, ..., int *fnamelen) --> int modify_fname(..., size_t *usedlen, ..., size_t *fnamelen) * char_u *eval_vars(..., int *usedlen, ...) --> char_u *eval_vars(..., size_t *usedlen, ...) - int find_cmdline_var(..., int *usedlen) --> ssize_t find_cmdline_var(..., size_t *usedlen) - static char_u *repl_cmdline(..., int srclen, ...) --> static char_u *repl_cmdline(..., size_t srclen, ...) - bool get_visual_text(..., int *lenp) --> bool get_visual_text(..., size_t *lenp) * char_u *find_file_name_in_path(..., int len, ...) --> char_u *find_file_name_in_path(..., size_t len, ...) - static char_u *eval_includeexpr(..., int len) --> static char_u *eval_includeexpr(..., size_t len) - char_u *find_file_in_path(..., int len, ...) --> char_u *find_file_in_path(..., size_t len, ...) * char_u *find_file_in_path_option(..., int len, ...) --> char_u *find_file_in_path_option(..., size_t len, ...) - char_u *find_directory_in_path(..., int len, ...) --> char_u *find_directory_in_path(..., size_t len, ...) * int spell_move_to(...) --> size_t spell_move_to(...) - int spell_check(...) --> size_t spell_check(...) - static int spell_bad_len --> static size_t spell_bad_len - void find_pattern_in_path(..., int len, ...) --> void find_pattern_in_path(..., size_t len, ...) Helped-by: Justin M. Keyes <justinkz@gmail.com>
Diffstat (limited to 'src/nvim/screen.c')
-rw-r--r--src/nvim/screen.c10
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