patch 8.1.0779: argument for message functions is inconsistent
Problem: Argument for message functions is inconsistent.
Solution: Make first argument to msg() "char *".
diff --git a/src/eval.c b/src/eval.c
index d8a9e43..d1a7fd3 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -245,8 +245,8 @@
static void check_vars(char_u *name, int len);
static typval_T *alloc_string_tv(char_u *string);
static void delete_var(hashtab_T *ht, hashitem_T *hi);
-static void list_one_var(dictitem_T *v, char_u *prefix, int *first);
-static void list_one_var_a(char_u *prefix, char_u *name, int type, char_u *string, int *first);
+static void list_one_var(dictitem_T *v, char *prefix, int *first);
+static void list_one_var_a(char *prefix, char_u *name, int type, char_u *string, int *first);
static char_u *find_option_end(char_u **arg, int *opt_flags);
/* for VIM_VERSION_ defines */
@@ -1448,7 +1448,7 @@
void
list_hashtable_vars(
hashtab_T *ht,
- char_u *prefix,
+ char *prefix,
int empty,
int *first)
{
@@ -1466,8 +1466,8 @@
di = HI2DI(hi);
// apply :filter /pat/ to variable name
- vim_strncpy((char_u *) buf, prefix, IOSIZE - 1);
- vim_strcat((char_u *) buf, di->di_key, IOSIZE);
+ vim_strncpy((char_u *)buf, (char_u *)prefix, IOSIZE - 1);
+ vim_strcat((char_u *)buf, di->di_key, IOSIZE);
if (message_filtered(buf))
continue;
@@ -1484,7 +1484,7 @@
static void
list_glob_vars(int *first)
{
- list_hashtable_vars(&globvarht, (char_u *)"", TRUE, first);
+ list_hashtable_vars(&globvarht, "", TRUE, first);
}
/*
@@ -1493,8 +1493,7 @@
static void
list_buf_vars(int *first)
{
- list_hashtable_vars(&curbuf->b_vars->dv_hashtab, (char_u *)"b:",
- TRUE, first);
+ list_hashtable_vars(&curbuf->b_vars->dv_hashtab, "b:", TRUE, first);
}
/*
@@ -1503,8 +1502,7 @@
static void
list_win_vars(int *first)
{
- list_hashtable_vars(&curwin->w_vars->dv_hashtab,
- (char_u *)"w:", TRUE, first);
+ list_hashtable_vars(&curwin->w_vars->dv_hashtab, "w:", TRUE, first);
}
/*
@@ -1513,8 +1511,7 @@
static void
list_tab_vars(int *first)
{
- list_hashtable_vars(&curtab->tp_vars->dv_hashtab,
- (char_u *)"t:", TRUE, first);
+ list_hashtable_vars(&curtab->tp_vars->dv_hashtab, "t:", TRUE, first);
}
/*
@@ -1523,7 +1520,7 @@
static void
list_vim_vars(int *first)
{
- list_hashtable_vars(&vimvarht, (char_u *)"v:", FALSE, first);
+ list_hashtable_vars(&vimvarht, "v:", FALSE, first);
}
/*
@@ -1534,7 +1531,7 @@
{
if (current_sctx.sc_sid > 0 && current_sctx.sc_sid <= ga_scripts.ga_len)
list_hashtable_vars(&SCRIPT_VARS(current_sctx.sc_sid),
- (char_u *)"s:", FALSE, first);
+ "s:", FALSE, first);
}
/*
@@ -1619,7 +1616,7 @@
s = echo_string(&tv, &tf, numbuf, 0);
c = *arg;
*arg = NUL;
- list_one_var_a((char_u *)"",
+ list_one_var_a("",
arg == arg_subsc ? name : name_start,
tv.v_type,
s == NULL ? (char_u *)"" : s,
@@ -5462,7 +5459,7 @@
}
else if (p_verbose > 0)
{
- verb_msg((char_u *)_("Not enough memory to set references, garbage collection aborted!"));
+ verb_msg(_("Not enough memory to set references, garbage collection aborted!"));
}
return did_free;
@@ -7791,7 +7788,7 @@
* List the value of one internal variable.
*/
static void
-list_one_var(dictitem_T *v, char_u *prefix, int *first)
+list_one_var(dictitem_T *v, char *prefix, int *first)
{
char_u *tofree;
char_u *s;
@@ -7805,7 +7802,7 @@
static void
list_one_var_a(
- char_u *prefix,
+ char *prefix,
char_u *name,
int type,
char_u *string,
@@ -7815,7 +7812,7 @@
msg_start();
msg_puts(prefix);
if (name != NULL) /* "a:" vars don't have a name stored */
- msg_puts(name);
+ msg_puts((char *)name);
msg_putchar(' ');
msg_advance(22);
if (type == VAR_NUMBER)
@@ -7840,7 +7837,7 @@
msg_outtrans(string);
if (type == VAR_FUNC || type == VAR_PARTIAL)
- msg_puts((char_u *)"()");
+ msg_puts("()");
if (*first)
{
msg_clr_eos();
@@ -8304,7 +8301,7 @@
*p = NUL;
msg_start();
msg_clr_eos();
- msg_puts_attr(prompt, echo_attr);
+ msg_puts_attr((char *)prompt, echo_attr);
msg_didout = FALSE;
msg_starthere();
*p = c;
@@ -8422,7 +8419,7 @@
}
}
else if (eap->cmdidx == CMD_echo)
- msg_puts_attr((char_u *)" ", echo_attr);
+ msg_puts_attr(" ", echo_attr);
p = echo_string(&rettv, &tofree, numbuf, get_copyID());
if (p != NULL)
for ( ; *p != NUL && !got_int; ++p)
@@ -8546,7 +8543,7 @@
if (eap->cmdidx == CMD_echomsg)
{
- MSG_ATTR(ga.ga_data, echo_attr);
+ msg_attr(ga.ga_data, echo_attr);
out_flush();
}
else if (eap->cmdidx == CMD_echoerr)
@@ -9159,11 +9156,11 @@
if (p != NULL)
{
verbose_enter();
- MSG_PUTS(_("\n\tLast set from "));
- MSG_PUTS(p);
+ msg_puts(_("\n\tLast set from "));
+ msg_puts((char *)p);
if (script_ctx.sc_lnum > 0)
{
- MSG_PUTS(_(" line "));
+ msg_puts(_(" line "));
msg_outnum((long)script_ctx.sc_lnum);
}
verbose_leave();