From 32526b3c1846025f0e655f41efd4e5428da16b6c Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 19 Jan 2019 17:43:09 +0100 Subject: patch 8.1.0779: argument for message functions is inconsistent Problem: Argument for message functions is inconsistent. Solution: Make first argument to msg() "char *". --- src/buffer.c | 31 ++++++----- src/crypt.c | 4 +- src/edit.c | 16 +++--- src/eval.c | 49 ++++++++--------- src/evalfunc.c | 4 +- src/ex_cmds.c | 28 +++++----- src/ex_cmds2.c | 14 ++--- src/ex_docmd.c | 26 ++++----- src/ex_eval.c | 8 +-- src/ex_getln.c | 20 +++---- src/farsi.c | 8 +-- src/farsi.h | 6 +- src/fileio.c | 47 ++++++++-------- src/getchar.c | 14 ++--- src/globals.h | 2 +- src/gui.c | 4 +- src/gui_w32.c | 2 +- src/hardcopy.c | 2 +- src/if_cscope.c | 29 +++++----- src/if_mzsch.c | 4 +- src/if_perl.xs | 4 +- src/if_py_both.h | 8 +-- src/if_ruby.c | 10 ++-- src/if_tcl.c | 4 +- src/mark.c | 12 ++-- src/mbyte.c | 4 +- src/memline.c | 138 +++++++++++++++++++++++----------------------- src/menu.c | 14 ++--- src/message.c | 149 +++++++++++++++++++++++++------------------------- src/misc1.c | 19 ++++--- src/misc2.c | 12 ++-- src/netbeans.c | 4 +- src/normal.c | 14 ++--- src/ops.c | 30 +++++----- src/option.c | 18 +++--- src/os_amiga.c | 12 ++-- src/os_unix.c | 52 +++++++++--------- src/os_win32.c | 6 +- src/proto/eval.pro | 2 +- src/proto/message.pro | 33 ++++------- src/quickfix.c | 20 +++---- src/regexp.c | 4 +- src/screen.c | 55 ++++++++++--------- src/search.c | 30 +++++----- src/sign.c | 26 ++++----- src/spell.c | 18 +++--- src/spellfile.c | 26 ++++----- src/syntax.c | 134 ++++++++++++++++++++++----------------------- src/tag.c | 24 ++++---- src/term.c | 8 +-- src/ui.c | 4 +- src/undo.c | 16 +++--- src/userfunc.c | 44 +++++++-------- src/version.c | 94 +++++++++++++++---------------- src/vim.h | 7 --- src/window.c | 4 +- 56 files changed, 679 insertions(+), 698 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); diff --git a/src/crypt.c b/src/crypt.c index f82ee7bdb7..47617e9a9c 100644 --- a/src/crypt.c +++ b/src/crypt.c @@ -513,7 +513,7 @@ crypt_check_method(int method) if (method < CRYPT_M_BF2) { msg_scroll = TRUE; - MSG(_("Warning: Using a weak encryption method; see :help 'cm'")); + msg(_("Warning: Using a weak encryption method; see :help 'cm'")); } } @@ -555,7 +555,7 @@ crypt_get_key( { if (p2 != NULL && STRCMP(p1, p2) != 0) { - MSG(_("Keys don't match!")); + msg(_("Keys don't match!")); crypt_free_key(p1); crypt_free_key(p2); p2 = NULL; diff --git a/src/edit.c b/src/edit.c index ea50e80184..482e644e8d 100644 --- a/src/edit.c +++ b/src/edit.c @@ -2387,8 +2387,8 @@ has_compl_option(int dict_opt) { ctrl_x_mode = CTRL_X_NORMAL; edit_submode = NULL; - msg_attr(dict_opt ? (char_u *)_("'dictionary' option is empty") - : (char_u *)_("'thesaurus' option is empty"), + msg_attr(dict_opt ? _("'dictionary' option is empty") + : _("'thesaurus' option is empty"), HL_ATTR(HLF_E)); if (emsg_silent == 0) { @@ -3385,7 +3385,7 @@ ins_compl_files( { vim_snprintf((char *)IObuff, IOSIZE, _("Scanning dictionary: %s"), (char *)files[i]); - (void)msg_trunc_attr(IObuff, TRUE, HL_ATTR(HLF_R)); + (void)msg_trunc_attr((char *)IObuff, TRUE, HL_ATTR(HLF_R)); } if (fp != NULL) @@ -4500,7 +4500,7 @@ ins_compl_get_exp(pos_T *ini) : ins_buf->b_sfname == NULL ? ins_buf->b_fname : ins_buf->b_sfname); - (void)msg_trunc_attr(IObuff, TRUE, HL_ATTR(HLF_R)); + (void)msg_trunc_attr((char *)IObuff, TRUE, HL_ATTR(HLF_R)); } else if (*e_cpt == NUL) break; @@ -4530,7 +4530,7 @@ ins_compl_get_exp(pos_T *ini) { type = CTRL_X_TAGS; vim_snprintf((char *)IObuff, IOSIZE, _("Scanning tags.")); - (void)msg_trunc_attr(IObuff, TRUE, HL_ATTR(HLF_R)); + (void)msg_trunc_attr((char *)IObuff, TRUE, HL_ATTR(HLF_R)); } else type = -1; @@ -5132,7 +5132,7 @@ ins_compl_next( } vim_snprintf((char *)IObuff, IOSIZE, "%s %s%s", lead, s > compl_shown_match->cp_fname ? "<" : "", s); - msg(IObuff); + msg((char *)IObuff); redraw_cmdline = FALSE; /* don't overwrite! */ } } @@ -5878,7 +5878,7 @@ ins_complete(int c, int enable_pum) if (edit_submode_extra != NULL) { if (!p_smd) - msg_attr(edit_submode_extra, + msg_attr((char *)edit_submode_extra, edit_submode_highl < HLF_COUNT ? HL_ATTR(edit_submode_highl) : 0); } @@ -8856,7 +8856,7 @@ ins_esc( if (reg_recording != 0 || restart_edit != NUL) showmode(); else if (p_smd) - MSG(""); + msg(""); return TRUE; /* exit Insert mode */ } diff --git a/src/eval.c b/src/eval.c index d8a9e4318a..d1a7fd37dd 100644 --- a/src/eval.c +++ b/src/eval.c @@ -245,8 +245,8 @@ static char_u * make_expanded_name(char_u *in_start, char_u *expr_start, char_u 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 @@ skip_var_one(char_u *arg) void list_hashtable_vars( hashtab_T *ht, - char_u *prefix, + char *prefix, int empty, int *first) { @@ -1466,8 +1466,8 @@ list_hashtable_vars( 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 @@ list_hashtable_vars( 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 @@ list_glob_vars(int *first) 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 @@ list_buf_vars(int *first) 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 @@ list_win_vars(int *first) 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 @@ list_tab_vars(int *first) 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 @@ list_script_vars(int *first) { 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 @@ list_arg_vars(exarg_T *eap, char_u *arg, int *first) 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 @@ garbage_collect(int testing) } 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 @@ delete_var(hashtab_T *ht, hashitem_T *hi) * 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 @@ list_one_var(dictitem_T *v, char_u *prefix, int *first) static void list_one_var_a( - char_u *prefix, + char *prefix, char_u *name, int type, char_u *string, @@ -7815,7 +7812,7 @@ list_one_var_a( 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 @@ list_one_var_a( 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 @@ get_user_input( *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 @@ ex_echo(exarg_T *eap) } } 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 @@ ex_execute(exarg_T *eap) 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 @@ last_set_msg(sctx_T script_ctx) 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(); diff --git a/src/evalfunc.c b/src/evalfunc.c index 1bdb722635..ac009e6e9a 100644 --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -7169,7 +7169,7 @@ f_inputlist(typval_T *argvars, typval_T *rettv) for (li = argvars[0].vval.v_list->lv_first; li != NULL; li = li->li_next) { - msg_puts(tv_get_string(&li->li_tv)); + msg_puts((char *)tv_get_string(&li->li_tv)); msg_putchar('\n'); } @@ -7198,7 +7198,7 @@ f_inputrestore(typval_T *argvars UNUSED, typval_T *rettv) } else if (p_verbose > 1) { - verb_msg((char_u *)_("called inputrestore() more often than inputsave()")); + verb_msg(_("called inputrestore() more often than inputsave()")); rettv->vval.v_number = 1; /* Failed */ } } diff --git a/src/ex_cmds.c b/src/ex_cmds.c index 25322c2bd8..b6bd3d348e 100644 --- a/src/ex_cmds.c +++ b/src/ex_cmds.c @@ -62,7 +62,7 @@ do_ascii(exarg_T *eap UNUSED) c = gchar_cursor(); if (c == NUL) { - MSG("NUL"); + msg("NUL"); return; } @@ -152,7 +152,7 @@ do_ascii(exarg_T *eap UNUSED) } #endif - msg(IObuff); + msg((char *)IObuff); } /* @@ -1490,11 +1490,11 @@ do_filter( { if (do_in) { - vim_snprintf((char *)msg_buf, sizeof(msg_buf), + vim_snprintf(msg_buf, sizeof(msg_buf), _("%ld lines filtered"), (long)linecount); if (msg(msg_buf) && !msg_scroll) /* save message to display it after redraw */ - set_keep_msg(msg_buf, 0); + set_keep_msg((char_u *)msg_buf, 0); } else msgmore((long)linecount); @@ -1586,7 +1586,7 @@ do_shell( if (!winstart) starttermcap(); /* don't want a message box here */ #endif - MSG_PUTS(_("[No write since last change]\n")); + msg_puts(_("[No write since last change]\n")); #ifdef FEAT_GUI_MSWIN if (!winstart) stoptermcap(); @@ -3028,11 +3028,11 @@ print_line_no_prefix( int use_number, int list) { - char_u numbuf[30]; + char numbuf[30]; if (curwin->w_p_nu || use_number) { - vim_snprintf((char *)numbuf, sizeof(numbuf), + vim_snprintf(numbuf, sizeof(numbuf), "%*ld ", number_width(curwin), (long)lnum); msg_puts_attr(numbuf, HL_ATTR(HLF_N)); /* Highlight line nrs */ } @@ -5926,7 +5926,7 @@ outofmem: beginline(BL_WHITE | BL_FIX); } if (!do_sub_msg(subflags.do_count) && subflags.do_ask) - MSG(""); + msg(""); } else global_need_beginline = TRUE; @@ -5939,7 +5939,7 @@ outofmem: if (got_int) /* interrupted */ emsg(_(e_interr)); else if (got_match) /* did find something but nothing substituted */ - MSG(""); + msg(""); else if (subflags.do_error) /* nothing found */ semsg(_(e_patnotf2), get_search_pat()); } @@ -5995,13 +5995,13 @@ do_sub_msg( : NGETTEXT("%ld substitution on %ld lines", "%ld substitutions on %ld lines", sub_nsubs); - vim_snprintf_add((char *)msg_buf, sizeof(msg_buf), + vim_snprintf_add(msg_buf, sizeof(msg_buf), NGETTEXT(msg_single, msg_plural, sub_nlines), sub_nsubs, (long)sub_nlines); if (msg(msg_buf)) /* save message to display it after redraw */ - set_keep_msg(msg_buf, 0); + set_keep_msg((char_u *)msg_buf, 0); return TRUE; } if (got_int) @@ -6147,7 +6147,7 @@ ex_global(exarg_T *eap) * pass 2: execute the command for each line that has been marked */ if (got_int) - MSG(_(e_interr)); + msg(_(e_interr)); else if (ndone == 0) { if (type == 'v') @@ -7755,7 +7755,7 @@ ex_oldfiles(exarg_T *eap UNUSED) char_u *fname; if (l == NULL) - msg((char_u *)_("No old files")); + msg(_("No old files")); else { msg_start(); @@ -7767,7 +7767,7 @@ ex_oldfiles(exarg_T *eap UNUSED) if (!message_filtered(fname)) { msg_outnum((long)nr); - MSG_PUTS(": "); + msg_puts(": "); msg_outtrans(fname); msg_clr_eos(); msg_putchar('\n'); diff --git a/src/ex_cmds2.c b/src/ex_cmds2.c index d044fdb2c0..72d28c52d1 100644 --- a/src/ex_cmds2.c +++ b/src/ex_cmds2.c @@ -143,7 +143,7 @@ do_debug(char_u *cmd) debug_mode = TRUE; if (!debug_did_msg) - MSG(_("Entering Debug mode. Type \"cont\" to continue.")); + msg(_("Entering Debug mode. Type \"cont\" to continue.")); if (debug_oldval != NULL) { smsg(_("Oldval = \"%s\""), debug_oldval); @@ -157,7 +157,7 @@ do_debug(char_u *cmd) debug_newval = NULL; } if (sourcing_name != NULL) - msg(sourcing_name); + msg((char *)sourcing_name); if (sourcing_lnum != 0) smsg(_("line %ld: %s"), (long)sourcing_lnum, cmd); else @@ -390,7 +390,7 @@ do_checkbacktracelevel(void) if (debug_backtrace_level < 0) { debug_backtrace_level = 0; - MSG(_("frame is zero")); + msg(_("frame is zero")); } else { @@ -857,7 +857,7 @@ ex_breaklist(exarg_T *eap UNUSED) int i; if (dbg_breakp.ga_len == 0) - MSG(_("No breakpoints defined")); + msg(_("No breakpoints defined")); else for (i = 0; i < dbg_breakp.ga_len; ++i) { @@ -2430,7 +2430,7 @@ buf_write_all(buf_T *buf, int forceit) if (curbuf != old_curbuf) { msg_source(HL_ATTR(HLF_W)); - MSG(_("Warning: Entered other buffer unexpectedly (check autocommands)")); + msg(_("Warning: Entered other buffer unexpectedly (check autocommands)")); } return retval; } @@ -4112,7 +4112,7 @@ source_pyx_file(exarg_T *eap, char_u *fname) vim_snprintf((char *)IObuff, IOSIZE, _("W20: Required python version 2.x not supported, ignoring file: %s"), fname); - MSG(IObuff); + msg((char *)IObuff); # endif return; } @@ -4124,7 +4124,7 @@ source_pyx_file(exarg_T *eap, char_u *fname) vim_snprintf((char *)IObuff, IOSIZE, _("W21: Required python version 3.x not supported, ignoring file: %s"), fname); - MSG(IObuff); + msg((char *)IObuff); # endif return; } diff --git a/src/ex_docmd.c b/src/ex_docmd.c index 97976442eb..8a9b2f4bf9 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -562,7 +562,7 @@ do_exmode( ++hold_gui_events; #endif - MSG(_("Entering Ex mode. Type \"visual\" to go to Normal mode.")); + msg(_("Entering Ex mode. Type \"visual\" to go to Normal mode.")); while (exmode_active) { /* Check for a ":normal" command and no more characters left. */ @@ -1019,7 +1019,7 @@ do_cmdline( smsg(_("line %ld: %s"), (long)sourcing_lnum, cmdline_copy); if (msg_silent == 0) - msg_puts((char_u *)"\n"); /* don't overwrite this */ + msg_puts("\n"); /* don't overwrite this */ verbose_leave_scroll(); --no_wait_return; @@ -6043,7 +6043,7 @@ uc_list(char_u *name, size_t name_len) /* Put out the title first time */ if (!found) - MSG_PUTS_TITLE(_("\n Name Args Address Complete Definition")); + msg_puts_title(_("\n Name Args Address Complete Definition")); found = TRUE; msg_putchar('\n'); if (got_int) @@ -6150,7 +6150,7 @@ uc_list(char_u *name, size_t name_len) } if (!found) - MSG(_("No user-defined commands found")); + msg(_("No user-defined commands found")); } static char * @@ -7239,13 +7239,13 @@ ex_colorscheme(exarg_T *eap) } if (p != NULL) { - MSG(p); + msg((char *)p); vim_free(p); } else - MSG("default"); + msg("default"); #else - MSG(_("unknown")); + msg(_("unknown")); #endif } else if (load_colors(eap->arg) == FAIL) @@ -7256,7 +7256,7 @@ ex_colorscheme(exarg_T *eap) ex_highlight(exarg_T *eap) { if (*eap->arg == NUL && eap->cmd[2] == '!') - MSG(_("Greetings, Vim user!")); + msg(_("Greetings, Vim user!")); do_highlight(eap->arg, eap->forceit, FALSE); } @@ -7672,7 +7672,7 @@ ex_tabonly(exarg_T *eap) else # endif if (first_tabpage->tp_next == NULL) - MSG(_("Already only one tab page")); + msg(_("Already only one tab page")); else { tab_number = get_tabpage_arg(eap); @@ -8921,9 +8921,9 @@ ex_popup(exarg_T *eap) ex_swapname(exarg_T *eap UNUSED) { if (curbuf->b_ml.ml_mfp == NULL || curbuf->b_ml.ml_mfp->mf_fname == NULL) - MSG(_("No swap file")); + msg(_("No swap file")); else - msg(curbuf->b_ml.ml_mfp->mf_fname); + msg((char *)curbuf->b_ml.ml_mfp->mf_fname); } /* @@ -9221,7 +9221,7 @@ ex_pwd(exarg_T *eap UNUSED) #ifdef BACKSLASH_IN_FILENAME slash_adjust(NameBuff); #endif - msg(NameBuff); + msg((char *)NameBuff); } else emsg(_("E187: Unknown")); @@ -9402,7 +9402,7 @@ ex_winpos(exarg_T *eap) # endif { sprintf((char *)IObuff, _("Window position: X %d, Y %d"), x, y); - msg(IObuff); + msg((char *)IObuff); } else # endif diff --git a/src/ex_eval.c b/src/ex_eval.c index 10a9dbcbfb..63bca67180 100644 --- a/src/ex_eval.c +++ b/src/ex_eval.c @@ -556,7 +556,7 @@ throw_exception(void *value, except_type_T type, char_u *cmdname) msg_scroll = TRUE; /* always scroll up, don't overwrite */ smsg(_("Exception thrown: %s"), excp->value); - msg_puts((char_u *)"\n"); /* don't overwrite this either */ + msg_puts("\n"); /* don't overwrite this either */ if (debug_break_level > 0 || *p_vfile == NUL) cmdline_row = msg_row; @@ -610,7 +610,7 @@ discard_exception(except_T *excp, int was_finished) ? _("Exception finished: %s") : _("Exception discarded: %s"), excp->value); - msg_puts((char_u *)"\n"); /* don't overwrite this either */ + msg_puts("\n"); /* don't overwrite this either */ if (debug_break_level > 0 || *p_vfile == NUL) cmdline_row = msg_row; --no_wait_return; @@ -679,7 +679,7 @@ catch_exception(except_T *excp) msg_scroll = TRUE; /* always scroll up, don't overwrite */ smsg(_("Exception caught: %s"), excp->value); - msg_puts((char_u *)"\n"); /* don't overwrite this either */ + msg_puts("\n"); /* don't overwrite this either */ if (debug_break_level > 0 || *p_vfile == NUL) cmdline_row = msg_row; @@ -806,7 +806,7 @@ report_pending(int action, int pending, void *value) ++no_wait_return; msg_scroll = TRUE; /* always scroll up, don't overwrite */ smsg(mesg, s); - msg_puts((char_u *)"\n"); /* don't overwrite this either */ + msg_puts("\n"); /* don't overwrite this either */ cmdline_row = msg_row; --no_wait_return; if (debug_break_level > 0) diff --git a/src/ex_getln.c b/src/ex_getln.c index 70dd77a49e..fc48a9b723 100644 --- a/src/ex_getln.c +++ b/src/ex_getln.c @@ -158,7 +158,7 @@ abandon_cmdline(void) VIM_CLEAR(ccline.cmdbuff); if (msg_scrolled == 0) compute_cmdrow(); - MSG(""); + msg(""); redraw_cmdline = TRUE; } @@ -2786,7 +2786,7 @@ getexmodeline( while (indent >= 8) { ga_append(&line_ga, TAB); - msg_puts((char_u *)" "); + msg_puts(" "); indent -= 8; } while (indent-- > 0) @@ -3769,7 +3769,7 @@ redrawcmdprompt(void) msg_putchar(ccline.cmdfirstc); if (ccline.cmdprompt != NULL) { - msg_puts_attr(ccline.cmdprompt, ccline.cmdattr); + msg_puts_attr((char *)ccline.cmdprompt, ccline.cmdattr); ccline.cmdindent = msg_col + (msg_row - cmdline_row) * Columns; /* do the reverse of set_cmdspos() */ if (ccline.cmdfirstc != NUL) @@ -3961,7 +3961,7 @@ nextwild( return FAIL; } - MSG_PUTS("..."); /* show that we are busy */ + msg_puts("..."); /* show that we are busy */ out_flush(); i = (int)(xp->xp_pattern - ccline.cmdbuff); @@ -4611,10 +4611,10 @@ showmatches(expand_T *xp, int wildmenu UNUSED) if (xp->xp_context == EXPAND_TAGS_LISTFILES) { - MSG_PUTS_ATTR(_("tagname"), HL_ATTR(HLF_T)); + msg_puts_attr(_("tagname"), HL_ATTR(HLF_T)); msg_clr_eos(); msg_advance(maxlen - 3); - MSG_PUTS_ATTR(_(" kind file\n"), HL_ATTR(HLF_T)); + msg_puts_attr(_(" kind file\n"), HL_ATTR(HLF_T)); } /* list the files line by line */ @@ -4628,9 +4628,9 @@ showmatches(expand_T *xp, int wildmenu UNUSED) msg_outtrans_attr(files_found[k], HL_ATTR(HLF_D)); p = files_found[k] + STRLEN(files_found[k]) + 1; msg_advance(maxlen + 1); - msg_puts(p); + msg_puts((char *)p); msg_advance(maxlen + 3); - msg_puts_long_attr(p + 2, HL_ATTR(HLF_D)); + msg_outtrans_long_attr(p + 2, HL_ATTR(HLF_D)); break; } for (j = maxlen - lastlen; --j >= 0; ) @@ -6635,7 +6635,7 @@ ex_history(exarg_T *eap) if (hislen == 0) { - MSG(_("'history' option is zero")); + msg(_("'history' option is zero")); return; } @@ -6678,7 +6678,7 @@ ex_history(exarg_T *eap) { STRCPY(IObuff, "\n # "); STRCAT(STRCAT(IObuff, history_names[histype1]), " history"); - MSG_PUTS_TITLE(IObuff); + msg_puts_title((char *)IObuff); idx = hisidx[histype1]; hist = history[histype1]; j = hisidx1; diff --git a/src/farsi.c b/src/farsi.c index ebed47e6e2..48dd991b07 100644 --- a/src/farsi.c +++ b/src/farsi.c @@ -1719,7 +1719,7 @@ conv_to_pvim(void) /* Assume the screen has been messed up: clear it and redraw. */ redraw_later(CLEAR); - MSG_ATTR(farsi_text_1, HL_ATTR(HLF_S)); + msg_attr(farsi_text_1, HL_ATTR(HLF_S)); } /* @@ -1747,7 +1747,7 @@ conv_to_pstd(void) /* Assume the screen has been messed up: clear it and redraw. */ redraw_later(CLEAR); - MSG_ATTR(farsi_text_2, HL_ATTR(HLF_S)); + msg_attr(farsi_text_2, HL_ATTR(HLF_S)); } /* @@ -2150,13 +2150,13 @@ farsi_f8(cmdarg_T *cap UNUSED) { p_fkmap = 0; do_cmdline_cmd((char_u *)"set norl"); - MSG(""); + msg(""); } else { p_fkmap = 1; do_cmdline_cmd((char_u *)"set rl"); - MSG(""); + msg(""); } curwin->w_farsi = curwin->w_farsi ^ W_R_L; diff --git a/src/farsi.h b/src/farsi.h index 33f197479f..e91bdf7272 100644 --- a/src/farsi.h +++ b/src/farsi.h @@ -186,7 +186,7 @@ /* special Farsi text messages */ -EXTERN char_u farsi_text_1[] +EXTERN char farsi_text_1[] #ifdef DO_INIT = { YE_, _SIN, RE, ALEF_, _FE, ' ', 'V', 'I', 'M', ' ', F_HE, _BE, ' ', SHIN, RE, _GAF, DAL,' ', NOON, @@ -194,7 +194,7 @@ EXTERN char_u farsi_text_1[] #endif ; -EXTERN char_u farsi_text_2[] +EXTERN char farsi_text_2[] #ifdef DO_INIT = { YE_, _SIN, RE, ALEF_, _FE, ' ', FARSI_3, FARSI_3, FARSI_4, FARSI_2, ' ', DAL, RE, ALEF, DAL, _NOON, @@ -227,7 +227,7 @@ EXTERN char_u farsi_text_4[] ; #endif -EXTERN char_u farsi_text_5[] +EXTERN char farsi_text_5[] #ifdef DO_INIT = { ' ', YE_, _SIN, RE, ALEF_, _FE, '\0'} #endif diff --git a/src/fileio.c b/src/fileio.c index 23fe504527..168c26ed36 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -2586,7 +2586,7 @@ failed: p = msg_may_trunc(FALSE, IObuff); else #endif - p = msg_trunc_attr(IObuff, FALSE, 0); + p = (char_u *)msg_trunc_attr((char *)IObuff, FALSE, 0); if (read_stdin || read_buffer || restart_edit != 0 || (msg_scrolled != 0 && !need_wait_return)) /* Need to repeat the message after redrawing when: @@ -2902,28 +2902,28 @@ readfile_charconvert( int *fdp) /* in/out: file descriptor of file */ { char_u *tmpname; - char_u *errmsg = NULL; + char *errmsg = NULL; tmpname = vim_tempname('r', FALSE); if (tmpname == NULL) - errmsg = (char_u *)_("Can't find temp file for conversion"); + errmsg = _("Can't find temp file for conversion"); else { close(*fdp); /* close the input file, ignore errors */ *fdp = -1; if (eval_charconvert(fenc, enc_utf8 ? (char_u *)"utf-8" : p_enc, fname, tmpname) == FAIL) - errmsg = (char_u *)_("Conversion with 'charconvert' failed"); + errmsg = _("Conversion with 'charconvert' failed"); if (errmsg == NULL && (*fdp = mch_open((char *)tmpname, O_RDONLY | O_EXTRA, 0)) < 0) - errmsg = (char_u *)_("can't read output of 'charconvert'"); + errmsg = _("can't read output of 'charconvert'"); } if (errmsg != NULL) { /* Don't use emsg(), it breaks mappings, the retry with * another type of conversion might still work. */ - MSG(errmsg); + msg(errmsg); if (tmpname != NULL) { mch_remove(tmpname); /* delete converted file */ @@ -4908,7 +4908,7 @@ restore_backup: * know we got the message. */ if (got_int) { - MSG(_(e_interr)); + msg(_(e_interr)); out_flush(); } if ((fd = mch_open((char *)backup, O_RDONLY | O_EXTRA, 0)) >= 0) @@ -5007,7 +5007,7 @@ restore_backup: STRCAT(IObuff, shortmess(SHM_WRI) ? _(" [w]") : _(" written")); } - set_keep_msg(msg_trunc_attr(IObuff, FALSE, 0), 0); + set_keep_msg((char_u *)msg_trunc_attr((char *)IObuff, FALSE, 0), 0); } /* When written everything correctly: reset 'modified'. Unless not @@ -5157,9 +5157,9 @@ nofail: retval = FAIL; if (end == 0) { - MSG_PUTS_ATTR(_("\nWARNING: Original file may be lost or damaged\n"), + msg_puts_attr(_("\nWARNING: Original file may be lost or damaged\n"), attr | MSG_HIST); - MSG_PUTS_ATTR(_("don't quit the editor until the file is successfully written!"), + msg_puts_attr(_("don't quit the editor until the file is successfully written!"), attr | MSG_HIST); /* Update the timestamp to avoid an "overwrite changed file" @@ -5372,7 +5372,7 @@ check_mtime(buf_T *buf, stat_T *st) msg_scroll = TRUE; /* don't overwrite messages here */ msg_silent = 0; /* must give this prompt */ /* don't use emsg() here, don't want to flush the buffers */ - MSG_ATTR(_("WARNING: The file has been changed since reading it!!!"), + msg_attr(_("WARNING: The file has been changed since reading it!!!"), HL_ATTR(HLF_E)); if (ask_yesno((char_u *)_("Do you really want to write to it"), TRUE) == 'n') @@ -6807,7 +6807,7 @@ check_timestamps( if (need_wait_return && didit == 2) { /* make sure msg isn't overwritten */ - msg_puts((char_u *)"\n"); + msg_puts("\n"); out_flush(); } } @@ -7093,10 +7093,9 @@ buf_check_timestamp( if (!autocmd_busy) { msg_start(); - msg_puts_attr((char_u *)tbuf, HL_ATTR(HLF_E) + MSG_HIST); + msg_puts_attr(tbuf, HL_ATTR(HLF_E) + MSG_HIST); if (*mesg2 != NUL) - msg_puts_attr((char_u *)mesg2, - HL_ATTR(HLF_W) + MSG_HIST); + msg_puts_attr(mesg2, HL_ATTR(HLF_W) + MSG_HIST); msg_clr_eos(); (void)msg_end(); if (emsg_silent == 0) @@ -7926,12 +7925,12 @@ show_autocmd(AutoPat *ap, event_T event) if (ap->group != AUGROUP_DEFAULT) { if (AUGROUP_NAME(ap->group) == NULL) - msg_puts_attr(get_deleted_augroup(), HL_ATTR(HLF_E)); + msg_puts_attr((char *)get_deleted_augroup(), HL_ATTR(HLF_E)); else - msg_puts_attr(AUGROUP_NAME(ap->group), HL_ATTR(HLF_T)); - msg_puts((char_u *)" "); + msg_puts_attr((char *)AUGROUP_NAME(ap->group), HL_ATTR(HLF_T)); + msg_puts(" "); } - msg_puts_attr(event_nr2name(event), HL_ATTR(HLF_T)); + msg_puts_attr((char *)event_nr2name(event), HL_ATTR(HLF_T)); last_event = event; last_group = ap->group; msg_putchar('\n'); @@ -8210,8 +8209,8 @@ do_augroup(char_u *arg, int del_group) { if (AUGROUP_NAME(i) != NULL) { - msg_puts(AUGROUP_NAME(i)); - msg_puts((char_u *)" "); + msg_puts((char *)AUGROUP_NAME(i)); + msg_puts(" "); } } msg_clr_eos(); @@ -8535,7 +8534,7 @@ do_autocmd(char_u *arg_in, int forceit) if (!forceit && *cmd == NUL) { /* Highlight title */ - MSG_PUTS_TITLE(_("\n--- Autocommands ---")); + msg_puts_title(_("\n--- Autocommands ---")); } /* @@ -8902,7 +8901,7 @@ do_doautocmd( nothing_done = FALSE; if (nothing_done && do_msg) - MSG(_("No matching autocommands")); + msg(_("No matching autocommands")); if (did_something != NULL) *did_something = !nothing_done; @@ -9939,7 +9938,7 @@ getnextac(int c UNUSED, void *cookie, int indent UNUSED) { verbose_enter_scroll(); smsg(_("autocommand %s"), ac->cmd); - msg_puts((char_u *)"\n"); /* don't overwrite this either */ + msg_puts("\n"); /* don't overwrite this either */ verbose_leave_scroll(); } retval = vim_strsave(ac->cmd); diff --git a/src/getchar.c b/src/getchar.c index a51af9dd98..c0cfd92d67 100644 --- a/src/getchar.c +++ b/src/getchar.c @@ -1942,7 +1942,7 @@ vungetc(int c) } /* - * Get a character: + * Get a byte: * 1. from the stuffbuffer * This is used for abbreviated commands like "D" -> "d$". * Also used to redo a command for ".". @@ -3728,9 +3728,9 @@ do_map( ) { if (abbrev) - MSG(_("No abbreviation found")); + msg(_("No abbreviation found")); else - MSG(_("No mapping found")); + msg(_("No mapping found")); } goto theend; /* listing finished */ } @@ -4047,7 +4047,7 @@ showmap( mapchars = map_mode_to_chars(mp->m_mode); if (mapchars != NULL) { - msg_puts(mapchars); + msg_puts((char *)mapchars); len = (int)STRLEN(mapchars); vim_free(mapchars); } @@ -4064,9 +4064,9 @@ showmap( } while (len < 12); if (mp->m_noremap == REMAP_NONE) - msg_puts_attr((char_u *)"*", HL_ATTR(HLF_8)); + msg_puts_attr("*", HL_ATTR(HLF_8)); else if (mp->m_noremap == REMAP_SCRIPT) - msg_puts_attr((char_u *)"&", HL_ATTR(HLF_8)); + msg_puts_attr("&", HL_ATTR(HLF_8)); else msg_putchar(' '); @@ -4078,7 +4078,7 @@ showmap( /* Use FALSE below if we only want things like to show up as such on * the rhs, and not M-x etc, TRUE gets both -- webb */ if (*mp->m_str == NUL) - msg_puts_attr((char_u *)"", HL_ATTR(HLF_8)); + msg_puts_attr("", HL_ATTR(HLF_8)); else { /* Remove escaping of CSI, because "m_str" is in a format to be used diff --git a/src/globals.h b/src/globals.h index 645c93608c..d9cd467cac 100644 --- a/src/globals.h +++ b/src/globals.h @@ -989,7 +989,7 @@ EXTERN char_u *IObuff; /* sprintf's are done in this buffer, size is IOSIZE */ EXTERN char_u *NameBuff; /* file names are expanded in this * buffer, size is MAXPATHL */ -EXTERN char_u msg_buf[MSG_BUF_LEN]; /* small buffer for messages */ +EXTERN char msg_buf[MSG_BUF_LEN]; /* small buffer for messages */ /* When non-zero, postpone redrawing. */ EXTERN int RedrawingDisabled INIT(= 0); diff --git a/src/gui.c b/src/gui.c index 8677787622..9278df9735 100644 --- a/src/gui.c +++ b/src/gui.c @@ -2750,7 +2750,7 @@ gui_redraw_block( vim_snprintf((char *)IObuff, IOSIZE, "INTERNAL ERROR: NUL in ScreenLines in row %ld", (long)gui.row); - msg(IObuff); + msg((char *)IObuff); } } # ifdef FEAT_GUI_GTK @@ -5323,7 +5323,7 @@ gui_do_findrepl( } } else - MSG(_("No match at cursor, finding next")); + msg(_("No match at cursor, finding next")); vim_regfree(regmatch.regprog); } } diff --git a/src/gui_w32.c b/src/gui_w32.c index ab60fb5181..ceaa041b69 100644 --- a/src/gui_w32.c +++ b/src/gui_w32.c @@ -5128,7 +5128,7 @@ _WndProc( && GetMenuState(s_menuBar, pMenu->id, MF_BYCOMMAND) != -1) { ++msg_hist_off; - msg(pMenu->strings[MENU_INDEX_TIP]); + msg((char *)pMenu->strings[MENU_INDEX_TIP]); --msg_hist_off; setcursor(); out_flush(); diff --git a/src/hardcopy.c b/src/hardcopy.c index 508cf413fd..45800a16f6 100644 --- a/src/hardcopy.c +++ b/src/hardcopy.c @@ -657,7 +657,7 @@ ex_hardcopy(exarg_T *eap) bytes_to_print += (long_u)STRLEN(skipwhite(ml_get(lnum))); if (bytes_to_print == 0) { - MSG(_("No text to be printed")); + msg(_("No text to be printed")); goto print_fail_no_begin; } diff --git a/src/if_cscope.c b/src/if_cscope.c index 4904424d15..4cc053ed0f 100644 --- a/src/if_cscope.c +++ b/src/if_cscope.c @@ -212,7 +212,7 @@ do_cscope_general( { if (!cmdp->cansplit) { - (void)MSG_PUTS(_("This cscope command does not support splitting the window.\n")); + (void)msg_puts(_("This cscope command does not support splitting the window.\n")); return; } postponed_split = -1; @@ -1280,7 +1280,7 @@ cs_help(exarg_T *eap UNUSED) { cscmd_T *cmdp = cs_cmds; - (void)MSG_PUTS(_("cscope commands:\n")); + (void)msg_puts(_("cscope commands:\n")); while (cmdp->name != NULL) { char *help = _(cmdp->help); @@ -1294,7 +1294,7 @@ cs_help(exarg_T *eap UNUSED) help, space_cnt, " ", cmdp->usage); if (strcmp(cmdp->name, "find") == 0) - MSG_PUTS(_("\n" + msg_puts(_("\n" " a: Find assignments to this symbol\n" " c: Find functions calling this function\n" " d: Find functions called by this function\n" @@ -1992,14 +1992,14 @@ cs_print_tags_priv(char **matches, char **cntxts, int num_matches) { bufsize = newsize; (void)sprintf(buf, cstag_msg, ptag); - MSG_PUTS_ATTR(buf, HL_ATTR(HLF_T)); + msg_puts_attr(buf, HL_ATTR(HLF_T)); } vim_free(tbuf); - MSG_PUTS_ATTR(_("\n # line"), HL_ATTR(HLF_T)); /* strlen is 7 */ + msg_puts_attr(_("\n # line"), HL_ATTR(HLF_T)); /* strlen is 7 */ msg_advance(msg_col + 2); - MSG_PUTS_ATTR(_("filename / context / line\n"), HL_ATTR(HLF_T)); + msg_puts_attr(_("filename / context / line\n"), HL_ATTR(HLF_T)); num = 1; for (i = 0; i < num_matches; i++) @@ -2043,9 +2043,10 @@ cs_print_tags_priv(char **matches, char **cntxts, int num_matches) { /* csfmt_str = "%4d %6s "; */ (void)sprintf(buf, csfmt_str, num, lno); - MSG_PUTS_ATTR(buf, HL_ATTR(HLF_CM)); + msg_puts_attr(buf, HL_ATTR(HLF_CM)); } - MSG_PUTS_LONG_ATTR(cs_pathcomponents(fname), HL_ATTR(HLF_CM)); + msg_outtrans_long_attr((char_u *)cs_pathcomponents(fname), + HL_ATTR(HLF_CM)); /* compute the required space for the context */ if (cntxts[idx] != NULL) @@ -2074,13 +2075,13 @@ cs_print_tags_priv(char **matches, char **cntxts, int num_matches) if (msg_col + (int)strlen(buf) >= (int)Columns) msg_putchar('\n'); msg_advance(12); - MSG_PUTS_LONG(buf); + msg_outtrans_long_attr((char_u *)buf, 0); msg_putchar('\n'); } if (extra != NULL) { msg_advance(13); - MSG_PUTS_LONG(extra); + msg_outtrans_long_attr((char_u *)extra, 0); } vim_free(tbuf); /* only after printing extra due to strtok use */ @@ -2371,7 +2372,7 @@ cs_reset(exarg_T *eap UNUSED) * "Added cscope database..." */ sprintf(buf, " (#%d)", i); - MSG_PUTS_ATTR(buf, HL_ATTR(HLF_R)); + msg_puts_attr(buf, HL_ATTR(HLF_R)); } } vim_free(dblist[i]); @@ -2383,7 +2384,7 @@ cs_reset(exarg_T *eap UNUSED) vim_free(fllist); if (p_csverbose) - MSG_ATTR(_("All cscope databases reset"), HL_ATTR(HLF_R) | MSG_HIST); + msg_attr(_("All cscope databases reset"), HL_ATTR(HLF_R) | MSG_HIST); return CSCOPE_SUCCESS; } /* cs_reset */ @@ -2464,10 +2465,10 @@ cs_show(exarg_T *eap UNUSED) { short i; if (cs_cnt_connections() == 0) - MSG_PUTS(_("no cscope connections\n")); + msg_puts(_("no cscope connections\n")); else { - MSG_PUTS_ATTR( + msg_puts_attr( _(" # pid database name prepend path\n"), HL_ATTR(HLF_T)); for (i = 0; i < csinfo_size; i++) diff --git a/src/if_mzsch.c b/src/if_mzsch.c index 503a1e4e16..16c4c88df5 100644 --- a/src/if_mzsch.c +++ b/src/if_mzsch.c @@ -1574,7 +1574,7 @@ do_intrnl_output(char *mesg, int error) if (error) emsg(prev); else - MSG(prev); + msg(prev); prev = p + 1; p = strchr(prev, '\n'); } @@ -1582,7 +1582,7 @@ do_intrnl_output(char *mesg, int error) if (error) emsg(prev); else - MSG(prev); + msg(prev); } static void diff --git a/src/if_perl.xs b/src/if_perl.xs index 356108598b..203bb6a679 100644 --- a/src/if_perl.xs +++ b/src/if_perl.xs @@ -798,11 +798,11 @@ msg_split( while ((next = strchr(token, '\n')) && !got_int) { *next++ = '\0'; /* replace \n with \0 */ - msg_attr((char_u *)token, attr); + msg_attr(token, attr); token = next; } if (*token && !got_int) - msg_attr((char_u *)token, attr); + msg_attr(token, attr); } #ifndef FEAT_EVAL diff --git a/src/if_py_both.h b/src/if_py_both.h index 85141e11a0..233489ecc6 100644 --- a/src/if_py_both.h +++ b/src/if_py_both.h @@ -409,12 +409,6 @@ writer(writefn fn, char_u *str, PyInt n) } } - static int -msg_wrapper(char *text) -{ - return msg((char_u *)text); -} - static int write_output(OutputObject *self, PyObject *string) { @@ -427,7 +421,7 @@ write_output(OutputObject *self, PyObject *string) Py_BEGIN_ALLOW_THREADS Python_Lock_Vim(); - writer((writefn)(error ? emsg : msg_wrapper), (char_u *)str, len); + writer((writefn)(error ? emsg : msg), (char_u *)str, len); Python_Release_Vim(); Py_END_ALLOW_THREADS PyMem_Free(str); diff --git a/src/if_ruby.c b/src/if_ruby.c index fb1b25b5e1..9c91f3177c 100644 --- a/src/if_ruby.c +++ b/src/if_ruby.c @@ -1057,11 +1057,11 @@ static void error_print(int state) # ifdef RUBY21_OR_LATER bt = rb_funcallv(error, rb_intern("backtrace"), 0, 0); for (i = 0; i < RARRAY_LEN(bt); i++) - msg_attr((char_u *)RSTRING_PTR(RARRAY_AREF(bt, i)), attr); + msg_attr(RSTRING_PTR(RARRAY_AREF(bt, i)), attr); # else bt = rb_funcall2(error, rb_intern("backtrace"), 0, 0); for (i = 0; i < RARRAY_LEN(bt); i++) - msg_attr((char_u *)RSTRING_PTR(RARRAY_PTR(bt)[i]), attr); + msg_attr(RSTRING_PTR(RARRAY_PTR(bt)[i]), attr); # endif break; default: @@ -1083,11 +1083,11 @@ static VALUE vim_message(VALUE self UNUSED, VALUE str) strcpy(buff, RSTRING_PTR(str)); p = strchr(buff, '\n'); if (p) *p = '\0'; - MSG(buff); + msg(buff); } else { - MSG(""); + msg(""); } return Qnil; } @@ -1641,7 +1641,7 @@ static VALUE f_p(int argc, VALUE *argv, VALUE self UNUSED) if (i > 0) rb_str_cat(str, ", ", 2); rb_str_concat(str, rb_inspect(argv[i])); } - MSG(RSTRING_PTR(str)); + msg(RSTRING_PTR(str)); if (argc == 1) ret = argv[0]; diff --git a/src/if_tcl.c b/src/if_tcl.c index abef6134d0..eb6684c8f1 100644 --- a/src/if_tcl.c +++ b/src/if_tcl.c @@ -1832,11 +1832,11 @@ tclmsg(char *text) while ((next=strchr(text, '\n'))) { *next++ = '\0'; - MSG(text); + msg(text); text = next; } if (*text) - MSG(text); + msg(text); } static void diff --git a/src/mark.c b/src/mark.c index a9d73b52d5..de4b0f97b4 100644 --- a/src/mark.c +++ b/src/mark.c @@ -761,7 +761,7 @@ show_one_mark( else { if (arg == NULL) - MSG(_("No marks set")); + msg(_("No marks set")); else semsg(_("E283: No marks matching \"%s\""), arg); } @@ -774,7 +774,7 @@ show_one_mark( if (!did_title) { /* Highlight title */ - MSG_PUTS_TITLE(_("\nmark line col file/text")); + msg_puts_title(_("\nmark line col file/text")); did_title = TRUE; } msg_putchar('\n'); @@ -895,7 +895,7 @@ ex_jumps(exarg_T *eap UNUSED) cleanup_jumplist(curwin, TRUE); /* Highlight title */ - MSG_PUTS_TITLE(_("\n jump line col file/text")); + msg_puts_title(_("\n jump line col file/text")); for (i = 0; i < curwin->w_jumplistlen && !got_int; ++i) { if (curwin->w_jumplist[i].fmark.mark.lnum != 0) @@ -928,7 +928,7 @@ ex_jumps(exarg_T *eap UNUSED) out_flush(); } if (curwin->w_jumplistidx == curwin->w_jumplistlen) - MSG_PUTS("\n>"); + msg_puts("\n>"); } void @@ -949,7 +949,7 @@ ex_changes(exarg_T *eap UNUSED) char_u *name; /* Highlight title */ - MSG_PUTS_TITLE(_("\nchange line col text")); + msg_puts_title(_("\nchange line col text")); for (i = 0; i < curbuf->b_changelistlen && !got_int; ++i) { @@ -975,7 +975,7 @@ ex_changes(exarg_T *eap UNUSED) out_flush(); } if (curwin->w_changelistidx == curbuf->b_changelistlen) - MSG_PUTS("\n>"); + msg_puts("\n>"); } #endif diff --git a/src/mbyte.c b/src/mbyte.c index 66a3cc29d1..b6758a1c12 100644 --- a/src/mbyte.c +++ b/src/mbyte.c @@ -3745,7 +3745,7 @@ show_utf8(void) len = utfc_ptr2len(line); if (len == 0) { - MSG("NUL"); + msg("NUL"); return; } @@ -3770,7 +3770,7 @@ show_utf8(void) break; } - msg(IObuff); + msg((char *)IObuff); } /* diff --git a/src/memline.c b/src/memline.c index ca0c71137f..87c2a11385 100644 --- a/src/memline.c +++ b/src/memline.c @@ -1174,7 +1174,7 @@ ml_recover(void) /* list the names of the swap files */ (void)recover_names(fname, TRUE, 0, NULL); msg_putchar('\n'); - MSG_PUTS(_("Enter number of swap file to use (0 to quit): ")); + msg_puts(_("Enter number of swap file to use (0 to quit): ")); i = get_number(FALSE, NULL); if (i < 1 || i > len) goto theend; @@ -1243,9 +1243,9 @@ ml_recover(void) if ((hp = mf_get(mfp, (blocknr_T)0, 1)) == NULL) { msg_start(); - MSG_PUTS_ATTR(_("Unable to read block 0 from "), attr | MSG_HIST); + msg_puts_attr(_("Unable to read block 0 from "), attr | MSG_HIST); msg_outtrans_attr(mfp->mf_fname, attr | MSG_HIST); - MSG_PUTS_ATTR(_("\nMaybe no changes were made or Vim did not update the swap file."), + msg_puts_attr(_("\nMaybe no changes were made or Vim did not update the swap file."), attr | MSG_HIST); msg_end(); goto theend; @@ -1255,9 +1255,9 @@ ml_recover(void) { msg_start(); msg_outtrans_attr(mfp->mf_fname, MSG_HIST); - MSG_PUTS_ATTR(_(" cannot be used with this version of Vim.\n"), + msg_puts_attr(_(" cannot be used with this version of Vim.\n"), MSG_HIST); - MSG_PUTS_ATTR(_("Use Vim version 3.0.\n"), MSG_HIST); + msg_puts_attr(_("Use Vim version 3.0.\n"), MSG_HIST); msg_end(); goto theend; } @@ -1272,17 +1272,17 @@ ml_recover(void) msg_outtrans_attr(mfp->mf_fname, attr | MSG_HIST); #if defined(MSWIN) if (STRNCMP(b0p->b0_hname, "PC ", 3) == 0) - MSG_PUTS_ATTR(_(" cannot be used with this version of Vim.\n"), + msg_puts_attr(_(" cannot be used with this version of Vim.\n"), attr | MSG_HIST); else #endif - MSG_PUTS_ATTR(_(" cannot be used on this computer.\n"), + msg_puts_attr(_(" cannot be used on this computer.\n"), attr | MSG_HIST); - MSG_PUTS_ATTR(_("The file was created on "), attr | MSG_HIST); + msg_puts_attr(_("The file was created on "), attr | MSG_HIST); /* avoid going past the end of a corrupted hostname */ b0p->b0_fname[0] = NUL; - MSG_PUTS_ATTR(b0p->b0_hname, attr | MSG_HIST); - MSG_PUTS_ATTR(_(",\nor the file has been damaged."), attr | MSG_HIST); + msg_puts_attr((char *)b0p->b0_hname, attr | MSG_HIST); + msg_puts_attr(_(",\nor the file has been damaged."), attr | MSG_HIST); msg_end(); goto theend; } @@ -1315,7 +1315,7 @@ ml_recover(void) { msg_start(); msg_outtrans_attr(mfp->mf_fname, attr | MSG_HIST); - MSG_PUTS_ATTR(_(" has been damaged (page size is smaller than minimum value).\n"), + msg_puts_attr(_(" has been damaged (page size is smaller than minimum value).\n"), attr | MSG_HIST); msg_end(); goto theend; @@ -1413,10 +1413,10 @@ ml_recover(void) if (*curbuf->b_p_key != NUL) { smsg(_("Swap file is encrypted: \"%s\""), fname_used); - MSG_PUTS(_("\nIf you entered a new crypt key but did not write the text file,")); - MSG_PUTS(_("\nenter the new crypt key.")); - MSG_PUTS(_("\nIf you wrote the text file after changing the crypt key press enter")); - MSG_PUTS(_("\nto use the same key for text file and swap file")); + msg_puts(_("\nIf you entered a new crypt key but did not write the text file,")); + msg_puts(_("\nenter the new crypt key.")); + msg_puts(_("\nIf you wrote the text file after changing the crypt key press enter")); + msg_puts(_("\nto use the same key for text file and swap file")); } else smsg(_(need_key_msg), fname_used); @@ -1681,29 +1681,29 @@ ml_recover(void) else if (error) { ++no_wait_return; - MSG(">>>>>>>>>>>>>"); + msg(">>>>>>>>>>>>>"); emsg(_("E312: Errors detected while recovering; look for lines starting with ???")); --no_wait_return; - MSG(_("See \":help E312\" for more information.")); - MSG(">>>>>>>>>>>>>"); + msg(_("See \":help E312\" for more information.")); + msg(">>>>>>>>>>>>>"); } else { if (curbuf->b_changed) { - MSG(_("Recovery completed. You should check if everything is OK.")); - MSG_PUTS(_("\n(You might want to write out this file under another name\n")); - MSG_PUTS(_("and run diff with the original file to check for changes)")); + msg(_("Recovery completed. You should check if everything is OK.")); + msg_puts(_("\n(You might want to write out this file under another name\n")); + msg_puts(_("and run diff with the original file to check for changes)")); } else - MSG(_("Recovery completed. Buffer contents equals file contents.")); - MSG_PUTS(_("\nYou may want to delete the .swp file now.\n\n")); + msg(_("Recovery completed. Buffer contents equals file contents.")); + msg_puts(_("\nYou may want to delete the .swp file now.\n\n")); cmdline_row = msg_row; } #ifdef FEAT_CRYPT if (*buf->b_p_key != NUL && STRCMP(curbuf->b_p_key, buf->b_p_key) != 0) { - MSG_PUTS(_("Using crypt key from swap file for the text file.\n")); + msg_puts(_("Using crypt key from swap file for the text file.\n")); set_option_value((char_u *)"key", 0L, buf->b_p_key, OPT_LOCAL); } #endif @@ -1785,7 +1785,7 @@ recover_names( if (list) { /* use msg() to start the scrolling properly */ - msg((char_u *)_("Swap files found:")); + msg(_("Swap files found:")); msg_putchar('\n'); } @@ -1966,15 +1966,15 @@ recover_names( if (dir_name[0] == '.' && dir_name[1] == NUL) { if (fname == NULL) - MSG_PUTS(_(" In current directory:\n")); + msg_puts(_(" In current directory:\n")); else - MSG_PUTS(_(" Using specified name:\n")); + msg_puts(_(" Using specified name:\n")); } else { - MSG_PUTS(_(" In directory ")); + msg_puts(_(" In directory ")); msg_home_replace(dir_name); - MSG_PUTS(":\n"); + msg_puts(":\n"); } if (num_files) @@ -1983,14 +1983,14 @@ recover_names( { /* print the swap file name */ msg_outnum((long)++file_count); - MSG_PUTS(". "); - msg_puts(gettail(files[i])); + msg_puts(". "); + msg_puts((char *)gettail(files[i])); msg_putchar('\n'); (void)swapfile_info(files[i]); } } else - MSG_PUTS(_(" -- none --\n")); + msg_puts(_(" -- none --\n")); out_flush(); } else @@ -2106,19 +2106,19 @@ swapfile_info(char_u *fname) /* print name of owner of the file */ if (mch_get_uname(st.st_uid, uname, B0_UNAME_SIZE) == OK) { - MSG_PUTS(_(" owned by: ")); + msg_puts(_(" owned by: ")); msg_outtrans(uname); - MSG_PUTS(_(" dated: ")); + msg_puts(_(" dated: ")); } else #endif - MSG_PUTS(_(" dated: ")); + msg_puts(_(" dated: ")); x = st.st_mtime; /* Manx C can't do &st.st_mtime */ p = ctime(&x); /* includes '\n' */ if (p == NULL) - MSG_PUTS("(invalid)\n"); + msg_puts("(invalid)\n"); else - MSG_PUTS(p); + msg_puts(p); } /* @@ -2131,47 +2131,47 @@ swapfile_info(char_u *fname) { if (STRNCMP(b0.b0_version, "VIM 3.0", 7) == 0) { - MSG_PUTS(_(" [from Vim version 3.0]")); + msg_puts(_(" [from Vim version 3.0]")); } else if (ml_check_b0_id(&b0) == FAIL) { - MSG_PUTS(_(" [does not look like a Vim swap file]")); + msg_puts(_(" [does not look like a Vim swap file]")); } else { - MSG_PUTS(_(" file name: ")); + msg_puts(_(" file name: ")); if (b0.b0_fname[0] == NUL) - MSG_PUTS(_("[No Name]")); + msg_puts(_("[No Name]")); else msg_outtrans(b0.b0_fname); - MSG_PUTS(_("\n modified: ")); - MSG_PUTS(b0.b0_dirty ? _("YES") : _("no")); + msg_puts(_("\n modified: ")); + msg_puts(b0.b0_dirty ? _("YES") : _("no")); if (*(b0.b0_uname) != NUL) { - MSG_PUTS(_("\n user name: ")); + msg_puts(_("\n user name: ")); msg_outtrans(b0.b0_uname); } if (*(b0.b0_hname) != NUL) { if (*(b0.b0_uname) != NUL) - MSG_PUTS(_(" host name: ")); + msg_puts(_(" host name: ")); else - MSG_PUTS(_("\n host name: ")); + msg_puts(_("\n host name: ")); msg_outtrans(b0.b0_hname); } if (char_to_long(b0.b0_pid) != 0L) { - MSG_PUTS(_("\n process ID: ")); + msg_puts(_("\n process ID: ")); msg_outnum(char_to_long(b0.b0_pid)); #if defined(UNIX) /* EMX kill() not working correctly, it seems */ if (kill((pid_t)char_to_long(b0.b0_pid), 0) == 0) { - MSG_PUTS(_(" (STILL RUNNING)")); + msg_puts(_(" (STILL RUNNING)")); # if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG) process_still_running = TRUE; # endif @@ -2183,19 +2183,19 @@ swapfile_info(char_u *fname) { #if defined(MSWIN) if (STRNCMP(b0.b0_hname, "PC ", 3) == 0) - MSG_PUTS(_("\n [not usable with this version of Vim]")); + msg_puts(_("\n [not usable with this version of Vim]")); else #endif - MSG_PUTS(_("\n [not usable on this computer]")); + msg_puts(_("\n [not usable on this computer]")); } } } else - MSG_PUTS(_(" [cannot be read]")); + msg_puts(_(" [cannot be read]")); close(fd); } else - MSG_PUTS(_(" [cannot be opened]")); + msg_puts(_(" [cannot be opened]")); msg_putchar('\n'); return x; @@ -2414,7 +2414,7 @@ theend: if (message) { if (status == OK) - MSG(_("File preserved")); + msg(_("File preserved")); else emsg(_("E314: Preserve failed")); } @@ -4373,39 +4373,39 @@ attention_message( ++no_wait_return; (void)emsg(_("E325: ATTENTION")); - MSG_PUTS(_("\nFound a swap file by the name \"")); + msg_puts(_("\nFound a swap file by the name \"")); msg_home_replace(fname); - MSG_PUTS("\"\n"); + msg_puts("\"\n"); sx = swapfile_info(fname); - MSG_PUTS(_("While opening file \"")); + msg_puts(_("While opening file \"")); msg_outtrans(buf->b_fname); - MSG_PUTS("\"\n"); + msg_puts("\"\n"); if (mch_stat((char *)buf->b_fname, &st) == -1) { - MSG_PUTS(_(" CANNOT BE FOUND")); + msg_puts(_(" CANNOT BE FOUND")); } else { - MSG_PUTS(_(" dated: ")); + msg_puts(_(" dated: ")); x = st.st_mtime; /* Manx C can't do &st.st_mtime */ p = ctime(&x); /* includes '\n' */ if (p == NULL) - MSG_PUTS("(invalid)\n"); + msg_puts("(invalid)\n"); else - MSG_PUTS(p); + msg_puts(p); if (sx != 0 && x > sx) - MSG_PUTS(_(" NEWER than swap file!\n")); + msg_puts(_(" NEWER than swap file!\n")); } /* Some of these messages are long to allow translation to * other languages. */ - MSG_PUTS(_("\n(1) Another program may be editing the same file. If this is the case,\n be careful not to end up with two different instances of the same\n file when making changes. Quit, or continue with caution.\n")); - MSG_PUTS(_("(2) An edit session for this file crashed.\n")); - MSG_PUTS(_(" If this is the case, use \":recover\" or \"vim -r ")); + msg_puts(_("\n(1) Another program may be editing the same file. If this is the case,\n be careful not to end up with two different instances of the same\n file when making changes. Quit, or continue with caution.\n")); + msg_puts(_("(2) An edit session for this file crashed.\n")); + msg_puts(_(" If this is the case, use \":recover\" or \"vim -r ")); msg_outtrans(buf->b_fname); - MSG_PUTS(_("\"\n to recover the changes (see \":help recovery\").\n")); - MSG_PUTS(_(" If you did this already, delete the swap file \"")); + msg_puts(_("\"\n to recover the changes (see \":help recovery\").\n")); + msg_puts(_(" If you did this already, delete the swap file \"")); msg_outtrans(fname); - MSG_PUTS(_("\"\n to avoid this message.\n")); + msg_puts(_("\"\n to avoid this message.\n")); cmdline_row = msg_row; --no_wait_return; } @@ -4890,7 +4890,7 @@ findswapname( else #endif { - MSG_PUTS("\n"); + msg_puts("\n"); if (msg_silent == 0) /* call wait_return() later */ need_wait_return = TRUE; diff --git a/src/menu.c b/src/menu.c index a5c24c2699..7c934ea430 100644 --- a/src/menu.c +++ b/src/menu.c @@ -1151,7 +1151,7 @@ show_menus(char_u *path_name, int modes) /* Now we have found the matching menu, and we list the mappings */ /* Highlight title */ - MSG_PUTS_TITLE(_("\n--- Menus ---")); + msg_puts_title(_("\n--- Menus ---")); show_menus_recursive(parent, modes, 0); return OK; @@ -1175,11 +1175,11 @@ show_menus_recursive(vimmenu_T *menu, int modes, int depth) if (got_int) /* "q" hit for "--more--" */ return; for (i = 0; i < depth; i++) - MSG_PUTS(" "); + msg_puts(" "); if (menu->priority) { msg_outnum((long)menu->priority); - MSG_PUTS(" "); + msg_puts(" "); } /* Same highlighting as for directories!? */ msg_outtrans_attr(menu->name, HL_ATTR(HLF_D)); @@ -1194,8 +1194,8 @@ show_menus_recursive(vimmenu_T *menu, int modes, int depth) if (got_int) /* "q" hit for "--more--" */ return; for (i = 0; i < depth + 2; i++) - MSG_PUTS(" "); - msg_puts((char_u*)menu_mode_chars[bit]); + msg_puts(" "); + msg_puts(menu_mode_chars[bit]); if (menu->noremap[bit] == REMAP_NONE) msg_putchar('*'); else if (menu->noremap[bit] == REMAP_SCRIPT) @@ -1210,9 +1210,9 @@ show_menus_recursive(vimmenu_T *menu, int modes, int depth) msg_putchar('-'); else msg_putchar(' '); - MSG_PUTS(" "); + msg_puts(" "); if (*menu->strings[bit] == NUL) - msg_puts_attr((char_u *)"", HL_ATTR(HLF_8)); + msg_puts_attr("", HL_ATTR(HLF_8)); else msg_outtrans_special(menu->strings[bit], FALSE); } diff --git a/src/message.c b/src/message.c index 9969632dd1..448173c0b9 100644 --- a/src/message.c +++ b/src/message.c @@ -19,7 +19,7 @@ static void add_msg_hist(char_u *s, int len, int attr); static void hit_return_msg(void); static void msg_home_replace_attr(char_u *fname, int attr); -static void msg_puts_attr_len(char_u *str, int maxlen, int attr); +static void msg_puts_attr_len(char *str, int maxlen, int attr); static void msg_puts_display(char_u *str, int maxlen, int attr, int recurse); static void msg_scroll_up(void); static void inc_msg_scrolled(void); @@ -96,7 +96,7 @@ static int verbose_did_open = FALSE; * return TRUE if wait_return not called */ int -msg(char_u *s) +msg(char *s) { return msg_attr_keep(s, 0, FALSE); } @@ -107,7 +107,7 @@ msg(char_u *s) * Like msg() but keep it silent when 'verbosefile' is set. */ int -verb_msg(char_u *s) +verb_msg(char *s) { int n; @@ -120,14 +120,14 @@ verb_msg(char_u *s) #endif int -msg_attr(char_u *s, int attr) +msg_attr(char *s, int attr) { return msg_attr_keep(s, attr, FALSE); } int msg_attr_keep( - char_u *s, + char *s, int attr, int keep) /* TRUE: set keep_msg if it doesn't scroll */ { @@ -137,12 +137,12 @@ msg_attr_keep( /* Skip messages not matching ":filter pattern". * Don't filter when there is an error. */ - if (!emsg_on_display && message_filtered(s)) + if (!emsg_on_display && message_filtered((char_u *)s)) return TRUE; #ifdef FEAT_EVAL if (attr == 0) - set_vim_var_string(VV_STATUSMSG, s, -1); + set_vim_var_string(VV_STATUSMSG, (char_u *)s, -1); #endif /* @@ -156,12 +156,12 @@ msg_attr_keep( /* Add message to history (unless it's a repeated kept message or a * truncated message) */ - if (s != keep_msg + if ((char_u *)s != keep_msg || (*s != '<' && last_msg_hist != NULL && last_msg_hist->msg != NULL && STRCMP(s, last_msg_hist->msg))) - add_msg_hist(s, -1, attr); + add_msg_hist((char_u *)s, -1, attr); #ifdef FEAT_JOB_CHANNEL if (emsg_to_channel_log) @@ -171,22 +171,22 @@ msg_attr_keep( /* When displaying keep_msg, don't let msg_start() free it, caller must do * that. */ - if (s == keep_msg) + if ((char_u *)s == keep_msg) keep_msg = NULL; /* Truncate the message if needed. */ msg_start(); - buf = msg_strtrunc(s, FALSE); + buf = msg_strtrunc((char_u *)s, FALSE); if (buf != NULL) - s = buf; + s = (char *)buf; - msg_outtrans_attr(s, attr); + msg_outtrans_attr((char_u *)s, attr); msg_clr_eos(); retval = msg_end(); - if (keep && retval && vim_strsize(s) < (int)(Rows - cmdline_row - 1) - * Columns + sc_col) - set_keep_msg(s, 0); + if (keep && retval && vim_strsize((char_u *)s) + < (int)(Rows - cmdline_row - 1) * Columns + sc_col) + set_keep_msg((char_u *)s, 0); vim_free(buf); --entered; @@ -376,7 +376,7 @@ smsg(const char *s, ...) va_start(arglist, s); vim_vsnprintf((char *)IObuff, IOSIZE, s, arglist); va_end(arglist); - return msg(IObuff); + return msg((char *)IObuff); } int @@ -390,7 +390,7 @@ smsg_attr(int attr, const char *s, ...) va_start(arglist, s); vim_vsnprintf((char *)IObuff, IOSIZE, s, arglist); va_end(arglist); - return msg_attr(IObuff, attr); + return msg_attr((char *)IObuff, attr); } int @@ -404,7 +404,7 @@ smsg_attr_keep(int attr, const char *s, ...) va_start(arglist, s); vim_vsnprintf((char *)IObuff, IOSIZE, s, arglist); va_end(arglist); - return msg_attr_keep(IObuff, attr, TRUE); + return msg_attr_keep((char *)IObuff, attr, TRUE); } #endif @@ -502,13 +502,13 @@ msg_source(int attr) p = get_emsg_source(); if (p != NULL) { - msg_attr(p, attr); + msg_attr((char *)p, attr); vim_free(p); } p = get_emsg_lnum(); if (p != NULL) { - msg_attr(p, HL_ATTR(HLF_N)); + msg_attr((char *)p, HL_ATTR(HLF_N)); vim_free(p); last_sourcing_lnum = sourcing_lnum; /* only once for each line */ } @@ -611,7 +611,7 @@ emsg_core(char_u *s) /* When testing some errors are turned into a normal message. */ if (ignore_error(s)) /* don't call msg() if it results in a dialog */ - return msg_use_printf() ? FALSE : msg(s); + return msg_use_printf() ? FALSE : msg((char *)s); #endif called_emsg = TRUE; @@ -716,7 +716,7 @@ emsg_core(char_u *s) * Display the error message itself. */ msg_nowait = FALSE; /* wait for this msg */ - r = msg_attr(s, attr); + r = msg_attr((char *)s, attr); #ifdef FEAT_JOB_CHANNEL emsg_to_channel_log = FALSE; @@ -817,22 +817,23 @@ emsg_invreg(int name) * Careful: The string may be changed by msg_may_trunc()!