From 7c956dcbe8017dd68bf4221893bf554302b8fd90 Mon Sep 17 00:00:00 2001 From: Eliseo Martínez Date: Sun, 26 Apr 2015 20:32:24 +0200 Subject: 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 --- src/nvim/screen.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/nvim/screen.c') 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 -- cgit