summaryrefslogtreecommitdiffstats
path: root/src/buffer.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-01-19 17:43:09 +0100
committerBram Moolenaar <Bram@vim.org>2019-01-19 17:43:09 +0100
commit32526b3c1846025f0e655f41efd4e5428da16b6c (patch)
treee9f3ea5e0daaada049e905b5f1b38b4a45511f3d /src/buffer.c
parentd383c92ec1d14ffd5c3802f0ffd763e91d547fa8 (diff)
patch 8.1.0779: argument for message functions is inconsistentv8.1.0779
Problem: Argument for message functions is inconsistent. Solution: Make first argument to msg() "char *".
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/src/buffer.c b/src/buffer.c
index c22773f7a4..18e08ad18e 100644
--- 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);