aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/hardcopy.c
diff options
context:
space:
mode:
authorEliseo Martínez <eliseomarmol@gmail.com>2015-02-11 18:26:48 +0100
committerJustin M. Keyes <justinkz@gmail.com>2015-02-18 20:54:12 -0500
commit7a7c933b86cf90f394e9b3b7d1928931a6d32f39 (patch)
treec742e79c796a78a5a578c6c19d93ee4c3fe9a334 /src/nvim/hardcopy.c
parent366662d932551e558d10f09887ddf144ed5db34b (diff)
downloadrneovim-7a7c933b86cf90f394e9b3b7d1928931a6d32f39.tar.gz
rneovim-7a7c933b86cf90f394e9b3b7d1928931a6d32f39.tar.bz2
rneovim-7a7c933b86cf90f394e9b3b7d1928931a6d32f39.zip
Enable -Wconversion: ui.c.
Refactoring summary: - ui_write(): len: int --> size_t * parse_abstract_ui_codes(): len: int --> size_t * string_convert(): lenp: int * --> size_t * - string_convert_ext(): lenp : int * --> size_t * unconvlenp: int * --> size_t * * utf8len_tab_zero: char[] --> uint8_t[] * iconv_string(): slen : int --> size_t unconvlenp: int * --> size_t * resultlenp: int * --> size_t * - mch_print_text_out(): len: int --> size_t * out_pos: int --> size_t
Diffstat (limited to 'src/nvim/hardcopy.c')
-rw-r--r--src/nvim/hardcopy.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/nvim/hardcopy.c b/src/nvim/hardcopy.c
index 2dbe33d6e2..cc6aa57419 100644
--- a/src/nvim/hardcopy.c
+++ b/src/nvim/hardcopy.c
@@ -96,7 +96,7 @@
* Sets the current position at the start of line "page_line".
* If margin is TRUE start in the left margin (for header and line number).
*
- * int mch_print_text_out(char_u *p, int len);
+ * int mch_print_text_out(char_u *p, size_t len);
* Output one character of text p[len] at the current position.
* Return TRUE if there is no room for another character in the same line.
*
@@ -495,7 +495,6 @@ static void prt_header(prt_settings_T *psettings, int pagenum, linenr_T lnum)
int page_line;
char_u *tbuf;
char_u *p;
- int l;
/* Also use the space for the line number. */
if (prt_use_number())
@@ -542,9 +541,9 @@ static void prt_header(prt_settings_T *psettings, int pagenum, linenr_T lnum)
page_line = 0 - prt_header_height();
mch_print_start_line(TRUE, page_line);
for (p = tbuf; *p != NUL; ) {
- if (mch_print_text_out(p,
- (l = (*mb_ptr2len)(p))
- )) {
+ int l = (*mb_ptr2len)(p);
+ assert(l >= 0);
+ if (mch_print_text_out(p, (size_t)l)) {
++page_line;
if (page_line >= 0) /* out of room in header */
break;
@@ -884,7 +883,7 @@ static colnr_T hardcopy_line(prt_settings_T *psettings, int page_line, prt_pos_T
ppos->ff = TRUE;
need_break = 1;
} else {
- need_break = mch_print_text_out(line + col, outputlen);
+ need_break = mch_print_text_out(line + col, (size_t)outputlen);
if (has_mbyte)
print_pos += (*mb_ptr2cells)(line + col);
else
@@ -2871,7 +2870,7 @@ void mch_print_start_line(int margin, int page_line)
prt_half_width = FALSE;
}
-int mch_print_text_out(char_u *p, int len)
+int mch_print_text_out(char_u *p, size_t len)
{
int need_break;
char_u ch;