diff src/buffer.c @ 15543:dd725a8ab112 v8.1.0779

patch 8.1.0779: argument for message functions is inconsistent commit https://github.com/vim/vim/commit/32526b3c1846025f0e655f41efd4e5428da16b6c Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jan 19 17:43:09 2019 +0100 patch 8.1.0779: argument for message functions is inconsistent Problem: Argument for message functions is inconsistent. Solution: Make first argument to msg() "char *".
author Bram Moolenaar <Bram@vim.org>
date Sat, 19 Jan 2019 17:45:07 +0100
parents 41fbbcea0f1b
children d89c5b339c2a
line wrap: on
line diff
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -1083,7 +1083,7 @@ handle_swap_exists(bufref_T *old_curbuf)
 	/* User selected Recover at ATTENTION prompt. */
 	msg_scroll = TRUE;
 	ml_recover();
-	MSG_PUTS("\n");	/* don't overwrite the last message */
+	msg_puts("\n");	/* don't overwrite the last message */
 	cmdline_row = msg_row;
 	do_modelines(0);
 
@@ -3449,17 +3449,17 @@ fileinfo(
 {
     char_u	*name;
     int		n;
-    char_u	*p;
-    char_u	*buffer;
+    char	*p;
+    char	*buffer;
     size_t	len;
 
-    buffer = alloc(IOSIZE);
+    buffer = (char *)alloc(IOSIZE);
     if (buffer == NULL)
 	return;
 
     if (fullname > 1)	    /* 2 CTRL-G: include buffer number */
     {
-	vim_snprintf((char *)buffer, IOSIZE, "buf %d: ", curbuf->b_fnum);
+	vim_snprintf(buffer, IOSIZE, "buf %d: ", curbuf->b_fnum);
 	p = buffer + STRLEN(buffer);
     }
     else
@@ -3467,18 +3467,18 @@ fileinfo(
 
     *p++ = '"';
     if (buf_spname(curbuf) != NULL)
-	vim_strncpy(p, buf_spname(curbuf), IOSIZE - (p - buffer) - 1);
+	vim_strncpy((char_u *)p, buf_spname(curbuf), IOSIZE - (p - buffer) - 1);
     else
     {
 	if (!fullname && curbuf->b_fname != NULL)
 	    name = curbuf->b_fname;
 	else
 	    name = curbuf->b_ffname;
-	home_replace(shorthelp ? curbuf : NULL, name, p,
+	home_replace(shorthelp ? curbuf : NULL, name, (char_u *)p,
 					  (int)(IOSIZE - (p - buffer)), TRUE);
     }
 
-    vim_snprintf_add((char *)buffer, IOSIZE, "\"%s%s%s%s%s%s",
+    vim_snprintf_add(buffer, IOSIZE, "\"%s%s%s%s%s%s",
 	    curbufIsChanged() ? (shortmess(SHM_MOD)
 					  ?  " [+]" : _(" [Modified]")) : " ",
 	    (curbuf->b_flags & BF_NOTEDITED)
@@ -3506,29 +3506,30 @@ fileinfo(
 	n = (int)(((long)curwin->w_cursor.lnum * 100L) /
 					    (long)curbuf->b_ml.ml_line_count);
     if (curbuf->b_ml.ml_flags & ML_EMPTY)
-	vim_snprintf_add((char *)buffer, IOSIZE, "%s", _(no_lines_msg));
+	vim_snprintf_add(buffer, IOSIZE, "%s", _(no_lines_msg));
 #ifdef FEAT_CMDL_INFO
     else if (p_ru)
 	/* Current line and column are already on the screen -- webb */
-	vim_snprintf_add((char *)buffer, IOSIZE,
+	vim_snprintf_add(buffer, IOSIZE,
 		NGETTEXT("%ld line --%d%%--", "%ld lines --%d%%--",
 						   curbuf->b_ml.ml_line_count),
 		(long)curbuf->b_ml.ml_line_count, n);
 #endif
     else
     {
-	vim_snprintf_add((char *)buffer, IOSIZE,
+	vim_snprintf_add(buffer, IOSIZE,
 		_("line %ld of %ld --%d%%-- col "),
 		(long)curwin->w_cursor.lnum,
 		(long)curbuf->b_ml.ml_line_count,
 		n);
 	validate_virtcol();
 	len = STRLEN(buffer);
-	col_print(buffer + len, IOSIZE - len,
+	col_print((char_u *)buffer + len, IOSIZE - len,
 		   (int)curwin->w_cursor.col + 1, (int)curwin->w_virtcol + 1);
     }
 
-    (void)append_arg_number(curwin, buffer, IOSIZE, !shortmess(SHM_FILE));
+    (void)append_arg_number(curwin, (char_u *)buffer, IOSIZE,
+							 !shortmess(SHM_FILE));
 
     if (dont_truncate)
     {
@@ -3542,14 +3543,14 @@ fileinfo(
     }
     else
     {
-	p = msg_trunc_attr(buffer, FALSE, 0);
+	p = (char *)msg_trunc_attr(buffer, FALSE, 0);
 	if (restart_edit != 0 || (msg_scrolled && !need_wait_return))
 	    /* Need to repeat the message after redrawing when:
 	     * - When restart_edit is set (otherwise there will be a delay
 	     *   before redrawing).
 	     * - When the screen was scrolled but there is no wait-return
 	     *   prompt. */
-	    set_keep_msg(p, 0);
+	    set_keep_msg((char_u *)p, 0);
     }
 
     vim_free(buffer);