Remove char_u: message:smsg()

This commit is contained in:
Michael Reed 2015-05-13 15:29:50 -04:00
parent d666b0e48f
commit 3c5864772f
20 changed files with 192 additions and 204 deletions

View File

@ -778,17 +778,17 @@ do_bufdel (
if (deleted == 1) if (deleted == 1)
MSG(_("1 buffer unloaded")); MSG(_("1 buffer unloaded"));
else else
smsg((char_u *)_("%d buffers unloaded"), deleted); smsg(_("%d buffers unloaded"), deleted);
} else if (command == DOBUF_DEL) { } else if (command == DOBUF_DEL) {
if (deleted == 1) if (deleted == 1)
MSG(_("1 buffer deleted")); MSG(_("1 buffer deleted"));
else else
smsg((char_u *)_("%d buffers deleted"), deleted); smsg(_("%d buffers deleted"), deleted);
} else { } else {
if (deleted == 1) if (deleted == 1)
MSG(_("1 buffer wiped out")); MSG(_("1 buffer wiped out"));
else else
smsg((char_u *)_("%d buffers wiped out"), deleted); smsg(_("%d buffers wiped out"), deleted);
} }
} }
} }

View File

@ -19105,7 +19105,7 @@ call_user_func (
++no_wait_return; ++no_wait_return;
verbose_enter_scroll(); verbose_enter_scroll();
smsg((char_u *)_("calling %s"), sourcing_name); smsg(_("calling %s"), sourcing_name);
if (p_verbose >= 14) { if (p_verbose >= 14) {
char_u buf[MSG_BUF_LEN]; char_u buf[MSG_BUF_LEN];
char_u numbuf2[NUMBUFLEN]; char_u numbuf2[NUMBUFLEN];
@ -19203,9 +19203,9 @@ call_user_func (
verbose_enter_scroll(); verbose_enter_scroll();
if (aborting()) if (aborting())
smsg((char_u *)_("%s aborted"), sourcing_name); smsg(_("%s aborted"), sourcing_name);
else if (fc->rettv->v_type == VAR_NUMBER) else if (fc->rettv->v_type == VAR_NUMBER)
smsg((char_u *)_("%s returning #%" PRId64 ""), smsg(_("%s returning #%" PRId64 ""),
sourcing_name, (int64_t)fc->rettv->vval.v_number); sourcing_name, (int64_t)fc->rettv->vval.v_number);
else { else {
char_u buf[MSG_BUF_LEN]; char_u buf[MSG_BUF_LEN];
@ -19224,7 +19224,7 @@ call_user_func (
trunc_string(s, buf, MSG_BUF_CLEN, MSG_BUF_LEN); trunc_string(s, buf, MSG_BUF_CLEN, MSG_BUF_LEN);
s = buf; s = buf;
} }
smsg((char_u *)_("%s returning %s"), sourcing_name, s); smsg(_("%s returning %s"), sourcing_name, s);
xfree(tofree); xfree(tofree);
} }
} }
@ -19245,7 +19245,7 @@ call_user_func (
++no_wait_return; ++no_wait_return;
verbose_enter_scroll(); verbose_enter_scroll();
smsg((char_u *)_("continuing in %s"), sourcing_name); smsg(_("continuing in %s"), sourcing_name);
msg_puts((char_u *)"\n"); /* don't overwrite this either */ msg_puts((char_u *)"\n"); /* don't overwrite this either */
verbose_leave_scroll(); verbose_leave_scroll();

View File

@ -748,7 +748,7 @@ int do_move(linenr_T line1, linenr_T line2, linenr_T dest)
if (num_lines == 1) if (num_lines == 1)
MSG(_("1 line moved")); MSG(_("1 line moved"));
else else
smsg((char_u *)_("%" PRId64 " lines moved"), (int64_t)num_lines); smsg(_("%" PRId64 " lines moved"), (int64_t)num_lines);
} }
/* /*
@ -1439,7 +1439,7 @@ read_viminfo (
if (p_verbose > 0) { if (p_verbose > 0) {
verbose_enter(); verbose_enter();
smsg((char_u *)_("Reading viminfo file \"%s\"%s%s%s"), smsg(_("Reading viminfo file \"%s\"%s%s%s"),
fname, fname,
(flags & VIF_WANT_INFO) ? _(" info") : "", (flags & VIF_WANT_INFO) ? _(" info") : "",
(flags & VIF_WANT_MARKS) ? _(" marks") : "", (flags & VIF_WANT_MARKS) ? _(" marks") : "",
@ -1616,7 +1616,7 @@ void write_viminfo(char_u *file, int forceit)
if (p_verbose > 0) { if (p_verbose > 0) {
verbose_enter(); verbose_enter();
smsg((char_u *)_("Writing viminfo file \"%s\""), fname); smsg(_("Writing viminfo file \"%s\""), fname);
verbose_leave(); verbose_leave();
} }
@ -4440,9 +4440,9 @@ void ex_global(exarg_T *eap)
MSG(_(e_interr)); MSG(_(e_interr));
else if (ndone == 0) { else if (ndone == 0) {
if (type == 'v') if (type == 'v')
smsg((char_u *)_("Pattern found in every line: %s"), pat); smsg(_("Pattern found in every line: %s"), pat);
else else
smsg((char_u *)_("Pattern not found: %s"), pat); smsg(_("Pattern not found: %s"), pat);
} else } else
global_exe(cmd); global_exe(cmd);
@ -4682,7 +4682,7 @@ void ex_help(exarg_T *eap)
* Try to open the file specified by the "helpfile" option. * Try to open the file specified by the "helpfile" option.
*/ */
if ((helpfd = mch_fopen((char *)p_hf, READBIN)) == NULL) { if ((helpfd = mch_fopen((char *)p_hf, READBIN)) == NULL) {
smsg((char_u *)_("Sorry, help file \"%s\" not found"), p_hf); smsg(_("Sorry, help file \"%s\" not found"), p_hf);
goto erret; goto erret;
} }
fclose(helpfd); fclose(helpfd);
@ -6038,7 +6038,7 @@ static void sign_list_defined(sign_T *sp)
{ {
char_u *p; char_u *p;
smsg((char_u *)"sign %s", sp->sn_name); smsg("sign %s", sp->sn_name);
if (sp->sn_icon != NULL) { if (sp->sn_icon != NULL) {
MSG_PUTS(" icon="); MSG_PUTS(" icon=");
msg_outtrans(sp->sn_icon); msg_outtrans(sp->sn_icon);

View File

@ -169,9 +169,9 @@ void do_debug(char_u *cmd)
if (sourcing_name != NULL) if (sourcing_name != NULL)
msg(sourcing_name); msg(sourcing_name);
if (sourcing_lnum != 0) if (sourcing_lnum != 0)
smsg((char_u *)_("line %" PRId64 ": %s"), (int64_t)sourcing_lnum, cmd); smsg(_("line %" PRId64 ": %s"), (int64_t)sourcing_lnum, cmd);
else else
smsg((char_u *)_("cmd: %s"), cmd); smsg(_("cmd: %s"), cmd);
/* /*
* Repeat getting a command and executing it. * Repeat getting a command and executing it.
@ -348,7 +348,7 @@ void dbg_check_breakpoint(exarg_T *eap)
p = (char_u *)"<SNR>"; p = (char_u *)"<SNR>";
else else
p = (char_u *)""; p = (char_u *)"";
smsg((char_u *)_("Breakpoint in \"%s%s\" line %" PRId64), smsg(_("Breakpoint in \"%s%s\" line %" PRId64),
p, p,
debug_breakpoint_name + (*p == NUL ? 0 : 3), debug_breakpoint_name + (*p == NUL ? 0 : 3),
(int64_t)debug_breakpoint_lnum); (int64_t)debug_breakpoint_lnum);
@ -637,7 +637,7 @@ void ex_breaklist(exarg_T *eap)
bp = &BREAKP(i); bp = &BREAKP(i);
if (bp->dbg_type == DBG_FILE) if (bp->dbg_type == DBG_FILE)
home_replace(NULL, bp->dbg_name, NameBuff, MAXPATHL, TRUE); home_replace(NULL, bp->dbg_name, NameBuff, MAXPATHL, TRUE);
smsg((char_u *)_("%3d %s %s line %" PRId64), smsg(_("%3d %s %s line %" PRId64),
bp->dbg_nr, bp->dbg_nr,
bp->dbg_type == DBG_FUNC ? "func" : "file", bp->dbg_type == DBG_FUNC ? "func" : "file",
bp->dbg_type == DBG_FUNC ? bp->dbg_name : NameBuff, bp->dbg_type == DBG_FUNC ? bp->dbg_name : NameBuff,
@ -2127,7 +2127,7 @@ int do_in_runtimepath(char_u *name, int all, DoInRuntimepathCB callback,
{ {
if (p_verbose > 1 && name != NULL) { if (p_verbose > 1 && name != NULL) {
verbose_enter(); verbose_enter();
smsg((char_u *)_("Searching for \"%s\" in \"%s\""), smsg(_("Searching for \"%s\" in \"%s\""),
(char *)name, (char *)p_rtp); (char *)name, (char *)p_rtp);
verbose_leave(); verbose_leave();
} }
@ -2155,7 +2155,7 @@ int do_in_runtimepath(char_u *name, int all, DoInRuntimepathCB callback,
if (p_verbose > 2) { if (p_verbose > 2) {
verbose_enter(); verbose_enter();
smsg((char_u *)_("Searching for \"%s\""), buf); smsg(_("Searching for \"%s\""), buf);
verbose_leave(); verbose_leave();
} }
@ -2178,7 +2178,7 @@ int do_in_runtimepath(char_u *name, int all, DoInRuntimepathCB callback,
xfree(rtp_copy); xfree(rtp_copy);
if (p_verbose > 0 && !did_one && name != NULL) { if (p_verbose > 0 && !did_one && name != NULL) {
verbose_enter(); verbose_enter();
smsg((char_u *)_("not found in 'runtimepath': \"%s\""), name); smsg(_("not found in 'runtimepath': \"%s\""), name);
verbose_leave(); verbose_leave();
} }
@ -2316,7 +2316,7 @@ do_source (
if (fname_exp == NULL) if (fname_exp == NULL)
return retval; return retval;
if (os_isdir(fname_exp)) { if (os_isdir(fname_exp)) {
smsg((char_u *)_("Cannot source a directory: \"%s\""), fname); smsg(_("Cannot source a directory: \"%s\""), fname);
goto theend; goto theend;
} }
@ -2362,9 +2362,9 @@ do_source (
if (p_verbose > 0) { if (p_verbose > 0) {
verbose_enter(); verbose_enter();
if (sourcing_name == NULL) if (sourcing_name == NULL)
smsg((char_u *)_("could not source \"%s\""), fname); smsg(_("could not source \"%s\""), fname);
else else
smsg((char_u *)_("line %" PRId64 ": could not source \"%s\""), smsg(_("line %" PRId64 ": could not source \"%s\""),
(int64_t)sourcing_lnum, fname); (int64_t)sourcing_lnum, fname);
verbose_leave(); verbose_leave();
} }
@ -2379,9 +2379,9 @@ do_source (
if (p_verbose > 1) { if (p_verbose > 1) {
verbose_enter(); verbose_enter();
if (sourcing_name == NULL) if (sourcing_name == NULL)
smsg((char_u *)_("sourcing \"%s\""), fname); smsg(_("sourcing \"%s\""), fname);
else else
smsg((char_u *)_("line %" PRId64 ": sourcing \"%s\""), smsg(_("line %" PRId64 ": sourcing \"%s\""),
(int64_t)sourcing_lnum, fname); (int64_t)sourcing_lnum, fname);
verbose_leave(); verbose_leave();
} }
@ -2532,9 +2532,9 @@ do_source (
sourcing_lnum = save_sourcing_lnum; sourcing_lnum = save_sourcing_lnum;
if (p_verbose > 1) { if (p_verbose > 1) {
verbose_enter(); verbose_enter();
smsg((char_u *)_("finished sourcing %s"), fname); smsg(_("finished sourcing %s"), fname);
if (sourcing_name != NULL) if (sourcing_name != NULL)
smsg((char_u *)_("continuing in %s"), sourcing_name); smsg(_("continuing in %s"), sourcing_name);
verbose_leave(); verbose_leave();
} }
@ -2576,7 +2576,7 @@ void ex_scriptnames(exarg_T *eap)
if (SCRIPT_ITEM(i).sn_name != NULL) { if (SCRIPT_ITEM(i).sn_name != NULL) {
home_replace(NULL, SCRIPT_ITEM(i).sn_name, home_replace(NULL, SCRIPT_ITEM(i).sn_name,
NameBuff, MAXPATHL, TRUE); NameBuff, MAXPATHL, TRUE);
smsg((char_u *)"%3d: %s", i, NameBuff); smsg("%3d: %s", i, NameBuff);
} }
} }
@ -3141,7 +3141,7 @@ void ex_language(exarg_T *eap)
p = (char_u *)setlocale(what, NULL); p = (char_u *)setlocale(what, NULL);
if (p == NULL || *p == NUL) if (p == NULL || *p == NUL)
p = (char_u *)"Unknown"; p = (char_u *)"Unknown";
smsg((char_u *)_("Current %slanguage: \"%s\""), whatstr, p); smsg(_("Current %slanguage: \"%s\""), whatstr, p);
} else { } else {
#ifndef LC_MESSAGES #ifndef LC_MESSAGES
if (what == VIM_LC_MESSAGES) if (what == VIM_LC_MESSAGES)

View File

@ -604,7 +604,7 @@ int do_cmdline(char_u *cmdline, LineGetter fgetline,
++no_wait_return; ++no_wait_return;
verbose_enter_scroll(); verbose_enter_scroll();
smsg((char_u *)_("line %" PRId64 ": %s"), smsg(_("line %" PRId64 ": %s"),
(int64_t)sourcing_lnum, cmdline_copy); (int64_t)sourcing_lnum, cmdline_copy);
if (msg_silent == 0) if (msg_silent == 0)
msg_puts((char_u *)"\n"); /* don't overwrite this */ msg_puts((char_u *)"\n"); /* don't overwrite this */
@ -6901,7 +6901,7 @@ static void ex_pwd(exarg_T *eap)
*/ */
static void ex_equal(exarg_T *eap) static void ex_equal(exarg_T *eap)
{ {
smsg((char_u *)"%" PRId64, (int64_t)eap->line2); smsg("%" PRId64, (int64_t)eap->line2);
ex_may_print(eap); ex_may_print(eap);
} }
@ -9221,7 +9221,7 @@ static void ex_filetype(exarg_T *eap)
if (*eap->arg == NUL) { if (*eap->arg == NUL) {
/* Print current status. */ /* Print current status. */
smsg((char_u *)"filetype detection:%s plugin:%s indent:%s", smsg("filetype detection:%s plugin:%s indent:%s",
filetype_detect ? "ON" : "OFF", filetype_detect ? "ON" : "OFF",
filetype_plugin ? (filetype_detect ? "ON" : "(on)") : "OFF", filetype_plugin ? (filetype_detect ? "ON" : "(on)") : "OFF",
filetype_indent ? (filetype_detect ? "ON" : "(on)") : "OFF"); filetype_indent ? (filetype_detect ? "ON" : "(on)") : "OFF");

View File

@ -489,7 +489,7 @@ static int throw_exception(void *value, int type, char_u *cmdname)
if (debug_break_level > 0 || *p_vfile == NUL) if (debug_break_level > 0 || *p_vfile == NUL)
msg_scroll = TRUE; /* always scroll up, don't overwrite */ msg_scroll = TRUE; /* always scroll up, don't overwrite */
smsg((char_u *)_("Exception thrown: %s"), excp->value); smsg(_("Exception thrown: %s"), excp->value);
msg_puts((char_u *)"\n"); /* don't overwrite this either */ msg_puts((char_u *)"\n"); /* don't overwrite this either */
if (debug_break_level > 0 || *p_vfile == NUL) if (debug_break_level > 0 || *p_vfile == NUL)
@ -537,10 +537,9 @@ static void discard_exception(except_T *excp, int was_finished)
++no_wait_return; ++no_wait_return;
if (debug_break_level > 0 || *p_vfile == NUL) if (debug_break_level > 0 || *p_vfile == NUL)
msg_scroll = TRUE; /* always scroll up, don't overwrite */ msg_scroll = TRUE; /* always scroll up, don't overwrite */
smsg(was_finished smsg(was_finished ? _("Exception finished: %s")
? (char_u *)_("Exception finished: %s") : _("Exception discarded: %s"),
: (char_u *)_("Exception discarded: %s"), excp->value);
excp->value);
msg_puts((char_u *)"\n"); /* don't overwrite this either */ msg_puts((char_u *)"\n"); /* don't overwrite this either */
if (debug_break_level > 0 || *p_vfile == NUL) if (debug_break_level > 0 || *p_vfile == NUL)
cmdline_row = msg_row; cmdline_row = msg_row;
@ -601,7 +600,7 @@ static void catch_exception(except_T *excp)
if (debug_break_level > 0 || *p_vfile == NUL) if (debug_break_level > 0 || *p_vfile == NUL)
msg_scroll = TRUE; /* always scroll up, don't overwrite */ msg_scroll = TRUE; /* always scroll up, don't overwrite */
smsg((char_u *)_("Exception caught: %s"), excp->value); smsg(_("Exception caught: %s"), excp->value);
msg_puts((char_u *)"\n"); /* don't overwrite this either */ msg_puts((char_u *)"\n"); /* don't overwrite this either */
if (debug_break_level > 0 || *p_vfile == NUL) if (debug_break_level > 0 || *p_vfile == NUL)
@ -662,22 +661,22 @@ static void finish_exception(except_T *excp)
*/ */
static void report_pending(int action, int pending, void *value) static void report_pending(int action, int pending, void *value)
{ {
char_u *mesg; char *mesg;
char *s; char *s;
int save_msg_silent; int save_msg_silent;
assert(value || !(pending & CSTP_THROW)); assert(value || !(pending & CSTP_THROW));
switch (action) { switch (action) {
case RP_MAKE: case RP_MAKE:
mesg = (char_u *)_("%s made pending"); mesg = _("%s made pending");
break; break;
case RP_RESUME: case RP_RESUME:
mesg = (char_u *)_("%s resumed"); mesg = _("%s resumed");
break; break;
/* case RP_DISCARD: */ /* case RP_DISCARD: */
default: default:
mesg = (char_u *)_("%s discarded"); mesg = _("%s discarded");
break; break;
} }
@ -702,9 +701,9 @@ static void report_pending(int action, int pending, void *value)
default: default:
if (pending & CSTP_THROW) { if (pending & CSTP_THROW) {
vim_snprintf((char *)IObuff, IOSIZE, vim_snprintf((char *)IObuff, IOSIZE,
(char *)mesg, _("Exception")); mesg, _("Exception"));
mesg = vim_strnsave(IObuff, STRLEN(IObuff) + 4); mesg = (char *)vim_strnsave(IObuff, STRLEN(IObuff) + 4);
STRCAT(mesg, ": %s"); strcat(mesg, ": %s");
s = (char *)((except_T *)value)->value; s = (char *)((except_T *)value)->value;
} else if ((pending & CSTP_ERROR) && (pending & CSTP_INTERRUPT)) } else if ((pending & CSTP_ERROR) && (pending & CSTP_INTERRUPT))
s = _("Error and interrupt"); s = _("Error and interrupt");
@ -719,7 +718,7 @@ static void report_pending(int action, int pending, void *value)
msg_silent = FALSE; /* display messages */ msg_silent = FALSE; /* display messages */
++no_wait_return; ++no_wait_return;
msg_scroll = TRUE; /* always scroll up, don't overwrite */ msg_scroll = TRUE; /* always scroll up, don't overwrite */
smsg(mesg, (char_u *)s); smsg(mesg, s);
msg_puts((char_u *)"\n"); /* don't overwrite this either */ msg_puts((char_u *)"\n"); /* don't overwrite this either */
cmdline_row = msg_row; cmdline_row = msg_row;
--no_wait_return; --no_wait_return;

View File

@ -647,7 +647,7 @@ char_u *vim_findfile(void *search_ctx_arg)
#ifdef FF_VERBOSE #ifdef FF_VERBOSE
if (p_verbose >= 5) { if (p_verbose >= 5) {
verbose_enter_scroll(); verbose_enter_scroll();
smsg((char_u *)"Already Searched: %s (%s)", smsg("Already Searched: %s (%s)",
stackp->ffs_fix_path, stackp->ffs_wc_path); stackp->ffs_fix_path, stackp->ffs_wc_path);
/* don't overwrite this either */ /* don't overwrite this either */
msg_puts((char_u *)"\n"); msg_puts((char_u *)"\n");
@ -660,8 +660,8 @@ char_u *vim_findfile(void *search_ctx_arg)
#ifdef FF_VERBOSE #ifdef FF_VERBOSE
else if (p_verbose >= 5) { else if (p_verbose >= 5) {
verbose_enter_scroll(); verbose_enter_scroll();
smsg((char_u *)"Searching: %s (%s)", smsg("Searching: %s (%s)",
stackp->ffs_fix_path, stackp->ffs_wc_path); stackp->ffs_fix_path, stackp->ffs_wc_path);
/* don't overwrite this either */ /* don't overwrite this either */
msg_puts((char_u *)"\n"); msg_puts((char_u *)"\n");
verbose_leave_scroll(); verbose_leave_scroll();
@ -821,7 +821,7 @@ char_u *vim_findfile(void *search_ctx_arg)
) == FAIL) { ) == FAIL) {
if (p_verbose >= 5) { if (p_verbose >= 5) {
verbose_enter_scroll(); verbose_enter_scroll();
smsg((char_u *)"Already: %s", smsg("Already: %s",
file_path); file_path);
/* don't overwrite this either */ /* don't overwrite this either */
msg_puts((char_u *)"\n"); msg_puts((char_u *)"\n");
@ -848,7 +848,7 @@ char_u *vim_findfile(void *search_ctx_arg)
#ifdef FF_VERBOSE #ifdef FF_VERBOSE
if (p_verbose >= 5) { if (p_verbose >= 5) {
verbose_enter_scroll(); verbose_enter_scroll();
smsg((char_u *)"HIT: %s", file_path); smsg("HIT: %s", file_path);
/* don't overwrite this either */ /* don't overwrite this either */
msg_puts((char_u *)"\n"); msg_puts((char_u *)"\n");
verbose_leave_scroll(); verbose_leave_scroll();
@ -1011,7 +1011,7 @@ static ff_visited_list_hdr_T *ff_get_visited_list(char_u *filename, ff_visited_l
#ifdef FF_VERBOSE #ifdef FF_VERBOSE
if (p_verbose >= 5) { if (p_verbose >= 5) {
verbose_enter_scroll(); verbose_enter_scroll();
smsg((char_u *)"ff_get_visited_list: FOUND list for %s", smsg("ff_get_visited_list: FOUND list for %s",
filename); filename);
/* don't overwrite this either */ /* don't overwrite this either */
msg_puts((char_u *)"\n"); msg_puts((char_u *)"\n");
@ -1027,7 +1027,7 @@ static ff_visited_list_hdr_T *ff_get_visited_list(char_u *filename, ff_visited_l
#ifdef FF_VERBOSE #ifdef FF_VERBOSE
if (p_verbose >= 5) { if (p_verbose >= 5) {
verbose_enter_scroll(); verbose_enter_scroll();
smsg((char_u *)"ff_get_visited_list: new list for %s", filename); smsg("ff_get_visited_list: new list for %s", filename);
/* don't overwrite this either */ /* don't overwrite this either */
msg_puts((char_u *)"\n"); msg_puts((char_u *)"\n");
verbose_leave_scroll(); verbose_leave_scroll();

View File

@ -5404,8 +5404,7 @@ void aubuflocal_remove(buf_T *buf)
au_remove_pat(ap); au_remove_pat(ap);
if (p_verbose >= 6) { if (p_verbose >= 6) {
verbose_enter(); verbose_enter();
smsg((char_u *) smsg(_("auto-removing autocommand: %s <buffer=%d>"),
_("auto-removing autocommand: %s <buffer=%d>"),
event_nr2name(event), buf->b_fnum); event_nr2name(event), buf->b_fnum);
verbose_leave(); verbose_leave();
} }
@ -6835,7 +6834,7 @@ auto_next_pat (
(char *)name, (char *)ap->pat); (char *)name, (char *)ap->pat);
if (p_verbose >= 8) { if (p_verbose >= 8) {
verbose_enter(); verbose_enter();
smsg((char_u *)_("Executing %s"), sourcing_name); smsg(_("Executing %s"), sourcing_name);
verbose_leave(); verbose_leave();
} }
@ -6897,7 +6896,7 @@ char_u *getnextac(int c, void *cookie, int indent)
if (p_verbose >= 9) { if (p_verbose >= 9) {
verbose_enter_scroll(); verbose_enter_scroll();
smsg((char_u *)_("autocommand %s"), ac->cmd); smsg(_("autocommand %s"), ac->cmd);
msg_puts((char_u *)"\n"); /* don't overwrite this either */ msg_puts((char_u *)"\n"); /* don't overwrite this either */
verbose_leave_scroll(); verbose_leave_scroll();
} }

View File

@ -1115,7 +1115,7 @@ static int cs_help(exarg_T *eap)
/* Use %*s rather than %30s to ensure proper alignment in utf-8 */ /* Use %*s rather than %30s to ensure proper alignment in utf-8 */
if (space_cnt < 0) if (space_cnt < 0)
space_cnt = 0; space_cnt = 0;
(void)smsg((char_u *)_("%-5s: %s%*s (Usage: %s)"), (void)smsg(_("%-5s: %s%*s (Usage: %s)"),
cmdp->name, cmdp->name,
help, space_cnt, " ", help, space_cnt, " ",
cmdp->usage); cmdp->usage);
@ -2083,10 +2083,10 @@ static int cs_show(exarg_T *eap)
continue; continue;
if (csinfo[i].ppath != NULL) if (csinfo[i].ppath != NULL)
(void)smsg((char_u *)"%2d %-5ld %-34s %-32s", (void)smsg("%2d %-5ld %-34s %-32s",
i, (long)csinfo[i].pid, csinfo[i].fname, csinfo[i].ppath); i, (long)csinfo[i].pid, csinfo[i].fname, csinfo[i].ppath);
else else
(void)smsg((char_u *)"%2d %-5ld %-34s <none>", (void)smsg("%2d %-5ld %-34s <none>",
i, (long)csinfo[i].pid, csinfo[i].fname); i, (long)csinfo[i].pid, csinfo[i].fname);
} }
} }

View File

@ -950,13 +950,13 @@ void ml_recover(void)
} }
home_replace(NULL, mfp->mf_fname, NameBuff, MAXPATHL, TRUE); home_replace(NULL, mfp->mf_fname, NameBuff, MAXPATHL, TRUE);
smsg((char_u *)_("Using swap file \"%s\""), NameBuff); smsg(_("Using swap file \"%s\""), NameBuff);
if (buf_spname(curbuf) != NULL) if (buf_spname(curbuf) != NULL)
STRLCPY(NameBuff, buf_spname(curbuf), MAXPATHL); STRLCPY(NameBuff, buf_spname(curbuf), MAXPATHL);
else else
home_replace(NULL, curbuf->b_ffname, NameBuff, MAXPATHL, TRUE); home_replace(NULL, curbuf->b_ffname, NameBuff, MAXPATHL, TRUE);
smsg((char_u *)_("Original file \"%s\""), NameBuff); smsg(_("Original file \"%s\""), NameBuff);
msg_putchar('\n'); msg_putchar('\n');
/* /*

View File

@ -329,12 +329,12 @@ void trunc_string(char_u *s, char_u *buf, int room, int buflen)
* shorter than IOSIZE!!! * shorter than IOSIZE!!!
*/ */
int smsg(char_u *s, ...) int smsg(char *s, ...)
{ {
va_list arglist; va_list arglist;
va_start(arglist, s); va_start(arglist, s);
vim_vsnprintf((char *)IObuff, IOSIZE, (char *)s, arglist, NULL); vim_vsnprintf((char *)IObuff, IOSIZE, s, arglist, NULL);
va_end(arglist); va_end(arglist);
return msg(IObuff); return msg(IObuff);
} }

View File

@ -296,8 +296,8 @@ int call_shell(char_u *cmd, ShellOpts opts, char_u *extra_shell_arg)
if (p_verbose > 3) { if (p_verbose > 3) {
verbose_enter(); verbose_enter();
smsg((char_u *)_("Calling shell to execute: \"%s\""), smsg(_("Calling shell to execute: \"%s\""),
cmd == NULL ? p_sh : cmd); cmd == NULL ? p_sh : cmd);
ui_putc('\n'); ui_putc('\n');
verbose_leave(); verbose_leave();
} }

View File

@ -591,7 +591,7 @@ void op_reindent(oparg_T *oap, Indenter how)
if (i > 1 if (i > 1
&& (i % 50 == 0 || i == oap->line_count - 1) && (i % 50 == 0 || i == oap->line_count - 1)
&& oap->line_count > p_report) && oap->line_count > p_report)
smsg((char_u *)_("%" PRId64 " lines to indent... "), (int64_t)i); smsg(_("%" PRId64 " lines to indent... "), (int64_t)i);
/* /*
* Be vi-compatible: For lisp indenting the first line is not * Be vi-compatible: For lisp indenting the first line is not
@ -635,7 +635,7 @@ void op_reindent(oparg_T *oap, Indenter how)
if (i == 1) if (i == 1)
MSG(_("1 line indented ")); MSG(_("1 line indented "));
else else
smsg((char_u *)_("%" PRId64 " lines indented "), (int64_t)i); smsg(_("%" PRId64 " lines indented "), (int64_t)i);
} }
/* set '[ and '] marks */ /* set '[ and '] marks */
curbuf->b_op_start = oap->start; curbuf->b_op_start = oap->start;
@ -1902,7 +1902,7 @@ void op_tilde(oparg_T *oap)
if (oap->line_count == 1) if (oap->line_count == 1)
MSG(_("1 line changed")); MSG(_("1 line changed"));
else else
smsg((char_u *)_("%" PRId64 " lines changed"), (int64_t)oap->line_count); smsg(_("%" PRId64 " lines changed"), (int64_t)oap->line_count);
} }
} }
@ -2497,10 +2497,10 @@ static void op_yank_reg(oparg_T *oap, bool message, yankreg_T *reg, bool append)
else else
MSG(_("1 line yanked")); MSG(_("1 line yanked"));
} else if (oap->block_mode) } else if (oap->block_mode)
smsg((char_u *)_("block of %" PRId64 " lines yanked"), smsg(_("block of %" PRId64 " lines yanked"),
(int64_t)yanklines); (int64_t)yanklines);
else else
smsg((char_u *)_("%" PRId64 " lines yanked"), (int64_t)yanklines); smsg(_("%" PRId64 " lines yanked"), (int64_t)yanklines);
} }
} }

View File

@ -28,7 +28,7 @@ int os_chdir(const char *path)
{ {
if (p_verbose >= 5) { if (p_verbose >= 5) {
verbose_enter(); verbose_enter();
smsg((char_u *)"chdir(%s)", path); smsg("chdir(%s)", path);
verbose_leave(); verbose_leave();
} }
return uv_chdir(path); return uv_chdir(path);

View File

@ -1861,7 +1861,7 @@ void qf_age(exarg_T *eap)
static void qf_msg(qf_info_T *qi) static void qf_msg(qf_info_T *qi)
{ {
smsg((char_u *)_("error list %d of %d; %d errors"), smsg(_("error list %d of %d; %d errors"),
qi->qf_curlist + 1, qi->qf_listcount, qi->qf_curlist + 1, qi->qf_listcount,
qi->qf_lists[qi->qf_curlist].qf_count); qi->qf_lists[qi->qf_curlist].qf_count);
qf_update_buffer(qi); qf_update_buffer(qi);
@ -2888,7 +2888,7 @@ void ex_vimgrep(exarg_T *eap)
if (buf == NULL) { if (buf == NULL) {
if (!got_int) if (!got_int)
smsg((char_u *)_("Cannot open file \"%s\""), fname); smsg(_("Cannot open file \"%s\""), fname);
} else { } else {
/* Try for a match in all lines of the buffer. /* Try for a match in all lines of the buffer.
* For ":1vimgrep" look for first match only. */ * For ":1vimgrep" look for first match only. */

View File

@ -6968,7 +6968,7 @@ regprog_T *vim_regcomp(char_u *expr_arg, int re_flags)
regexp_engine = expr[4] - '0'; regexp_engine = expr[4] - '0';
expr += 5; expr += 5;
#ifdef REGEXP_DEBUG #ifdef REGEXP_DEBUG
smsg((char_u *)"New regexp mode selected (%d): %s", smsg("New regexp mode selected (%d): %s",
regexp_engine, regexp_engine,
regname[newengine]); regname[newengine]);
#endif #endif

View File

@ -4200,7 +4200,7 @@ find_pattern_in_path (
msg_trunc_attr(IObuff, TRUE, hl_attr(HLF_R)); msg_trunc_attr(IObuff, TRUE, hl_attr(HLF_R));
} else if (p_verbose >= 5) { } else if (p_verbose >= 5) {
verbose_enter(); verbose_enter();
smsg((char_u *)_("Searching included file %s"), smsg(_("Searching included file %s"),
(char *)new_fname); (char *)new_fname);
verbose_leave(); verbose_leave();
} }

View File

@ -2327,9 +2327,8 @@ static void spell_load_lang(char_u *lang)
} }
if (r == FAIL) { if (r == FAIL) {
smsg((char_u *) smsg(_("Warning: Cannot find word list \"%s.%s.spl\" or \"%s.ascii.spl\""),
_("Warning: Cannot find word list \"%s.%s.spl\" or \"%s.ascii.spl\""), lang, spell_enc(), lang);
lang, spell_enc(), lang);
} else if (sl.sl_slang != NULL) { } else if (sl.sl_slang != NULL) {
// At least one file was loaded, now load ALL the additions. // At least one file was loaded, now load ALL the additions.
STRCPY(fname_enc + STRLEN(fname_enc) - 3, "add.spl"); STRCPY(fname_enc + STRLEN(fname_enc) - 3, "add.spl");
@ -2540,14 +2539,14 @@ spell_load_file (
EMSG2(_(e_notopen), fname); EMSG2(_(e_notopen), fname);
else if (p_verbose > 2) { else if (p_verbose > 2) {
verbose_enter(); verbose_enter();
smsg(e_notopen, fname); smsg((char *)e_notopen, fname);
verbose_leave(); verbose_leave();
} }
goto endFAIL; goto endFAIL;
} }
if (p_verbose > 2) { if (p_verbose > 2) {
verbose_enter(); verbose_enter();
smsg((char_u *)_("Reading spell file \"%s\""), fname); smsg(_("Reading spell file \"%s\""), fname);
verbose_leave(); verbose_leave();
} }
@ -3824,9 +3823,8 @@ char_u *did_set_spelllang(win_T *wp)
} else } else
// This is probably an error. Give a warning and // This is probably an error. Give a warning and
// accept the words anyway. // accept the words anyway.
smsg((char_u *) smsg(_("Warning: region %s not supported"),
_("Warning: region %s not supported"), region);
region);
} else } else
region_mask = 1 << c; region_mask = 1 << c;
} }
@ -4395,8 +4393,8 @@ static afffile_T *spell_read_aff(spellinfo_T *spin, char_u *fname)
if (spin->si_conv.vc_type != CONV_NONE) { if (spin->si_conv.vc_type != CONV_NONE) {
pc = string_convert(&spin->si_conv, rline, NULL); pc = string_convert(&spin->si_conv, rline, NULL);
if (pc == NULL) { if (pc == NULL) {
smsg((char_u *)_("Conversion failure for word in %s line %d: %s"), smsg(_("Conversion failure for word in %s line %d: %s"),
fname, lnum, rline); fname, lnum, rline);
continue; continue;
} }
line = pc; line = pc;
@ -4436,8 +4434,8 @@ static afffile_T *spell_read_aff(spellinfo_T *spin, char_u *fname)
if (!spin->si_ascii if (!spin->si_ascii
&& convert_setup(&spin->si_conv, aff->af_enc, && convert_setup(&spin->si_conv, aff->af_enc,
p_enc) == FAIL) p_enc) == FAIL)
smsg((char_u *)_("Conversion in %s not supported: from %s to %s"), smsg(_("Conversion in %s not supported: from %s to %s"),
fname, aff->af_enc, p_enc); fname, aff->af_enc, p_enc);
spin->si_conv.vc_fail = true; spin->si_conv.vc_fail = true;
} else if (is_aff_rule(items, itemcnt, "FLAG", 2) } else if (is_aff_rule(items, itemcnt, "FLAG", 2)
&& aff->af_flagtype == AFT_CHAR) { && aff->af_flagtype == AFT_CHAR) {
@ -4448,8 +4446,8 @@ static afffile_T *spell_read_aff(spellinfo_T *spin, char_u *fname)
else if (STRCMP(items[1], "caplong") == 0) else if (STRCMP(items[1], "caplong") == 0)
aff->af_flagtype = AFT_CAPLONG; aff->af_flagtype = AFT_CAPLONG;
else else
smsg((char_u *)_("Invalid value for FLAG in %s line %d: %s"), smsg(_("Invalid value for FLAG in %s line %d: %s"),
fname, lnum, items[1]); fname, lnum, items[1]);
if (aff->af_rare != 0 if (aff->af_rare != 0
|| aff->af_keepcase != 0 || aff->af_keepcase != 0
|| aff->af_bad != 0 || aff->af_bad != 0
@ -4461,8 +4459,8 @@ static afffile_T *spell_read_aff(spellinfo_T *spin, char_u *fname)
|| compflags != NULL || compflags != NULL
|| aff->af_suff.ht_used > 0 || aff->af_suff.ht_used > 0
|| aff->af_pref.ht_used > 0) || aff->af_pref.ht_used > 0)
smsg((char_u *)_("FLAG after using flags in %s line %d: %s"), smsg(_("FLAG after using flags in %s line %d: %s"),
fname, lnum, items[1]); fname, lnum, items[1]);
} else if (spell_info_item(items[0]) && itemcnt > 1) { } else if (spell_info_item(items[0]) && itemcnt > 1) {
p = (char_u *)getroom(spin, p = (char_u *)getroom(spin,
(spin->si_info == NULL ? 0 : STRLEN(spin->si_info)) (spin->si_info == NULL ? 0 : STRLEN(spin->si_info))
@ -4528,17 +4526,15 @@ static afffile_T *spell_read_aff(spellinfo_T *spin, char_u *fname)
aff->af_compforbid = affitem2flag(aff->af_flagtype, items[1], aff->af_compforbid = affitem2flag(aff->af_flagtype, items[1],
fname, lnum); fname, lnum);
if (aff->af_pref.ht_used > 0) if (aff->af_pref.ht_used > 0)
smsg((char_u *)_( smsg(_("Defining COMPOUNDFORBIDFLAG after PFX item may give wrong results in %s line %d"),
"Defining COMPOUNDFORBIDFLAG after PFX item may give wrong results in %s line %d"), fname, lnum);
fname, lnum);
} else if (is_aff_rule(items, itemcnt, "COMPOUNDPERMITFLAG", 2) } else if (is_aff_rule(items, itemcnt, "COMPOUNDPERMITFLAG", 2)
&& aff->af_comppermit == 0) { && aff->af_comppermit == 0) {
aff->af_comppermit = affitem2flag(aff->af_flagtype, items[1], aff->af_comppermit = affitem2flag(aff->af_flagtype, items[1],
fname, lnum); fname, lnum);
if (aff->af_pref.ht_used > 0) if (aff->af_pref.ht_used > 0)
smsg((char_u *)_( smsg(_("Defining COMPOUNDPERMITFLAG after PFX item may give wrong results in %s line %d"),
"Defining COMPOUNDPERMITFLAG after PFX item may give wrong results in %s line %d"), fname, lnum);
fname, lnum);
} else if (is_aff_rule(items, itemcnt, "COMPOUNDFLAG", 2) } else if (is_aff_rule(items, itemcnt, "COMPOUNDFLAG", 2)
&& compflags == NULL) { && compflags == NULL) {
// Turn flag "c" into COMPOUNDRULE compatible string "c+", // Turn flag "c" into COMPOUNDRULE compatible string "c+",
@ -4551,8 +4547,8 @@ static afffile_T *spell_read_aff(spellinfo_T *spin, char_u *fname)
// We don't use the count, but do check that it's a number and // We don't use the count, but do check that it's a number and
// not COMPOUNDRULE mistyped. // not COMPOUNDRULE mistyped.
if (atoi((char *)items[1]) == 0) if (atoi((char *)items[1]) == 0)
smsg((char_u *)_("Wrong COMPOUNDRULES value in %s line %d: %s"), smsg(_("Wrong COMPOUNDRULES value in %s line %d: %s"),
fname, lnum, items[1]); fname, lnum, items[1]);
} else if (is_aff_rule(items, itemcnt, "COMPOUNDRULE", 2)) { } else if (is_aff_rule(items, itemcnt, "COMPOUNDRULE", 2)) {
// Don't use the first rule if it is a number. // Don't use the first rule if it is a number.
if (compflags != NULL || *skipdigits(items[1]) != NUL) { if (compflags != NULL || *skipdigits(items[1]) != NUL) {
@ -4573,20 +4569,20 @@ static afffile_T *spell_read_aff(spellinfo_T *spin, char_u *fname)
&& compmax == 0) { && compmax == 0) {
compmax = atoi((char *)items[1]); compmax = atoi((char *)items[1]);
if (compmax == 0) if (compmax == 0)
smsg((char_u *)_("Wrong COMPOUNDWORDMAX value in %s line %d: %s"), smsg(_("Wrong COMPOUNDWORDMAX value in %s line %d: %s"),
fname, lnum, items[1]); fname, lnum, items[1]);
} else if (is_aff_rule(items, itemcnt, "COMPOUNDMIN", 2) } else if (is_aff_rule(items, itemcnt, "COMPOUNDMIN", 2)
&& compminlen == 0) { && compminlen == 0) {
compminlen = atoi((char *)items[1]); compminlen = atoi((char *)items[1]);
if (compminlen == 0) if (compminlen == 0)
smsg((char_u *)_("Wrong COMPOUNDMIN value in %s line %d: %s"), smsg(_("Wrong COMPOUNDMIN value in %s line %d: %s"),
fname, lnum, items[1]); fname, lnum, items[1]);
} else if (is_aff_rule(items, itemcnt, "COMPOUNDSYLMAX", 2) } else if (is_aff_rule(items, itemcnt, "COMPOUNDSYLMAX", 2)
&& compsylmax == 0) { && compsylmax == 0) {
compsylmax = atoi((char *)items[1]); compsylmax = atoi((char *)items[1]);
if (compsylmax == 0) if (compsylmax == 0)
smsg((char_u *)_("Wrong COMPOUNDSYLMAX value in %s line %d: %s"), smsg(_("Wrong COMPOUNDSYLMAX value in %s line %d: %s"),
fname, lnum, items[1]); fname, lnum, items[1]);
} else if (is_aff_rule(items, itemcnt, "CHECKCOMPOUNDDUP", 1)) { } else if (is_aff_rule(items, itemcnt, "CHECKCOMPOUNDDUP", 1)) {
compoptions |= COMP_CHECKDUP; compoptions |= COMP_CHECKDUP;
} else if (is_aff_rule(items, itemcnt, "CHECKCOMPOUNDREP", 1)) { } else if (is_aff_rule(items, itemcnt, "CHECKCOMPOUNDREP", 1)) {
@ -4597,8 +4593,8 @@ static afffile_T *spell_read_aff(spellinfo_T *spin, char_u *fname)
compoptions |= COMP_CHECKTRIPLE; compoptions |= COMP_CHECKTRIPLE;
} else if (is_aff_rule(items, itemcnt, "CHECKCOMPOUNDPATTERN", 2)) { } else if (is_aff_rule(items, itemcnt, "CHECKCOMPOUNDPATTERN", 2)) {
if (atoi((char *)items[1]) == 0) if (atoi((char *)items[1]) == 0)
smsg((char_u *)_("Wrong CHECKCOMPOUNDPATTERN value in %s line %d: %s"), smsg(_("Wrong CHECKCOMPOUNDPATTERN value in %s line %d: %s"),
fname, lnum, items[1]); fname, lnum, items[1]);
} else if (is_aff_rule(items, itemcnt, "CHECKCOMPOUNDPATTERN", 3)) { } else if (is_aff_rule(items, itemcnt, "CHECKCOMPOUNDPATTERN", 3)) {
garray_T *gap = &spin->si_comppat; garray_T *gap = &spin->si_comppat;
int i; int i;
@ -4650,12 +4646,11 @@ static afffile_T *spell_read_aff(spellinfo_T *spin, char_u *fname)
if (!HASHITEM_EMPTY(hi)) { if (!HASHITEM_EMPTY(hi)) {
cur_aff = HI2AH(hi); cur_aff = HI2AH(hi);
if (cur_aff->ah_combine != (*items[2] == 'Y')) if (cur_aff->ah_combine != (*items[2] == 'Y'))
smsg((char_u *)_( smsg(_("Different combining flag in continued affix block in %s line %d: %s"),
"Different combining flag in continued affix block in %s line %d: %s"), fname, lnum, items[1]);
fname, lnum, items[1]);
if (!cur_aff->ah_follows) if (!cur_aff->ah_follows)
smsg((char_u *)_("Duplicate affix in %s line %d: %s"), smsg(_("Duplicate affix in %s line %d: %s"),
fname, lnum, items[1]); fname, lnum, items[1]);
} else { } else {
// New affix letter. // New affix letter.
cur_aff = (affheader_T *)getroom(spin, cur_aff = (affheader_T *)getroom(spin,
@ -4674,8 +4669,9 @@ static afffile_T *spell_read_aff(spellinfo_T *spin, char_u *fname)
|| cur_aff->ah_flag == aff->af_nosuggest || cur_aff->ah_flag == aff->af_nosuggest
|| cur_aff->ah_flag == aff->af_needcomp || cur_aff->ah_flag == aff->af_needcomp
|| cur_aff->ah_flag == aff->af_comproot) || cur_aff->ah_flag == aff->af_comproot)
smsg((char_u *)_( smsg(_("Affix also used for "
"Affix also used for BAD/RARE/KEEPCASE/NEEDAFFIX/NEEDCOMPOUND/NOSUGGEST in %s line %d: %s"), "BAD/RARE/KEEPCASE/NEEDAFFIX/NEEDCOMPOUND/NOSUGGEST"
"in %s line %d: %s"),
fname, lnum, items[1]); fname, lnum, items[1]);
STRCPY(cur_aff->ah_key, items[1]); STRCPY(cur_aff->ah_key, items[1]);
hash_add(tp, cur_aff->ah_key); hash_add(tp, cur_aff->ah_key);
@ -4697,10 +4693,10 @@ static afffile_T *spell_read_aff(spellinfo_T *spin, char_u *fname)
if (itemcnt > lasti if (itemcnt > lasti
&& !aff->af_ignoreextra && !aff->af_ignoreextra
&& *items[lasti] != '#') && *items[lasti] != '#')
smsg((char_u *)_(e_afftrailing), fname, lnum, items[lasti]); smsg(_(e_afftrailing), fname, lnum, items[lasti]);
if (STRCMP(items[2], "Y") != 0 && STRCMP(items[2], "N") != 0) if (STRCMP(items[2], "Y") != 0 && STRCMP(items[2], "N") != 0)
smsg((char_u *)_("Expected Y or N in %s line %d: %s"), smsg(_("Expected Y or N in %s line %d: %s"),
fname, lnum, items[2]); fname, lnum, items[2]);
if (*items[0] == 'P' && aff->af_pfxpostpone) { if (*items[0] == 'P' && aff->af_pfxpostpone) {
@ -4735,7 +4731,7 @@ static afffile_T *spell_read_aff(spellinfo_T *spin, char_u *fname)
if (itemcnt > lasti && *items[lasti] != '#' if (itemcnt > lasti && *items[lasti] != '#'
&& (STRCMP(items[lasti], "-") != 0 && (STRCMP(items[lasti], "-") != 0
|| itemcnt != lasti + 1)) || itemcnt != lasti + 1))
smsg((char_u *)_(e_afftrailing), fname, lnum, items[lasti]); smsg(_(e_afftrailing), fname, lnum, items[lasti]);
// New item for an affix letter. // New item for an affix letter.
--aff_todo; --aff_todo;
@ -4775,8 +4771,8 @@ static afffile_T *spell_read_aff(spellinfo_T *spin, char_u *fname)
aff_entry->ae_prog = vim_regcomp(buf, aff_entry->ae_prog = vim_regcomp(buf,
RE_MAGIC + RE_STRING + RE_STRICT); RE_MAGIC + RE_STRING + RE_STRICT);
if (aff_entry->ae_prog == NULL) if (aff_entry->ae_prog == NULL)
smsg((char_u *)_("Broken condition in %s line %d: %s"), smsg(_("Broken condition in %s line %d: %s"),
fname, lnum, items[4]); fname, lnum, items[4]);
} }
// For postponed prefixes we need an entry in si_prefcond // For postponed prefixes we need an entry in si_prefcond
@ -4893,8 +4889,8 @@ static afffile_T *spell_read_aff(spellinfo_T *spin, char_u *fname)
|| is_aff_rule(items, itemcnt, "REPSAL", 2)) { || is_aff_rule(items, itemcnt, "REPSAL", 2)) {
/* Ignore REP/REPSAL count */; /* Ignore REP/REPSAL count */;
if (!isdigit(*items[1])) if (!isdigit(*items[1]))
smsg((char_u *)_("Expected REP(SAL) count in %s line %d"), smsg(_("Expected REP(SAL) count in %s line %d"),
fname, lnum); fname, lnum);
} else if ((STRCMP(items[0], "REP") == 0 } else if ((STRCMP(items[0], "REP") == 0
|| STRCMP(items[0], "REPSAL") == 0) || STRCMP(items[0], "REPSAL") == 0)
&& itemcnt >= 3) { && itemcnt >= 3) {
@ -4902,7 +4898,7 @@ static afffile_T *spell_read_aff(spellinfo_T *spin, char_u *fname)
// Myspell ignores extra arguments, we require it starts with // Myspell ignores extra arguments, we require it starts with
// # to detect mistakes. // # to detect mistakes.
if (itemcnt > 3 && items[3][0] != '#') if (itemcnt > 3 && items[3][0] != '#')
smsg((char_u *)_(e_afftrailing), fname, lnum, items[3]); smsg(_(e_afftrailing), fname, lnum, items[3]);
if (items[0][3] == 'S' ? do_repsal : do_rep) { if (items[0][3] == 'S' ? do_repsal : do_rep) {
// Replace underscore with space (can't include a space // Replace underscore with space (can't include a space
// directly). // directly).
@ -4922,8 +4918,8 @@ static afffile_T *spell_read_aff(spellinfo_T *spin, char_u *fname)
// First line contains the count. // First line contains the count.
found_map = true; found_map = true;
if (!isdigit(*items[1])) if (!isdigit(*items[1]))
smsg((char_u *)_("Expected MAP count in %s line %d"), smsg(_("Expected MAP count in %s line %d"),
fname, lnum); fname, lnum);
} else if (do_mapline) { } else if (do_mapline) {
int c; int c;
@ -4934,8 +4930,8 @@ static afffile_T *spell_read_aff(spellinfo_T *spin, char_u *fname)
&& vim_strchr(spin->si_map.ga_data, c) && vim_strchr(spin->si_map.ga_data, c)
!= NULL) != NULL)
|| vim_strchr(p, c) != NULL) || vim_strchr(p, c) != NULL)
smsg((char_u *)_("Duplicate character in MAP in %s line %d"), smsg(_("Duplicate character in MAP in %s line %d"),
fname, lnum); fname, lnum);
} }
// We simply concatenate all the MAP strings, separated by // We simply concatenate all the MAP strings, separated by
@ -4978,8 +4974,8 @@ static afffile_T *spell_read_aff(spellinfo_T *spin, char_u *fname)
} }
} }
} else } else
smsg((char_u *)_("Unrecognized or duplicate item in %s line %d: %s"), smsg(_("Unrecognized or duplicate item in %s line %d: %s"),
fname, lnum, items[0]); fname, lnum, items[0]);
} }
} }
@ -4999,7 +4995,7 @@ static afffile_T *spell_read_aff(spellinfo_T *spin, char_u *fname)
&& !enc_utf8 && !enc_utf8
) { ) {
if (fol == NULL || low == NULL || upp == NULL) if (fol == NULL || low == NULL || upp == NULL)
smsg((char_u *)_("Missing FOL/LOW/UPP line in %s"), fname); smsg(_("Missing FOL/LOW/UPP line in %s"), fname);
else else
(void)set_spell_chartab(fol, low, upp); (void)set_spell_chartab(fol, low, upp);
} }
@ -5022,7 +5018,7 @@ static afffile_T *spell_read_aff(spellinfo_T *spin, char_u *fname)
if (compsylmax != 0) { if (compsylmax != 0) {
if (syllable == NULL) if (syllable == NULL)
smsg((char_u *)_("COMPOUNDSYLMAX used without SYLLABLE")); smsg(_("COMPOUNDSYLMAX used without SYLLABLE"));
aff_check_number(spin->si_compsylmax, compsylmax, "COMPOUNDSYLMAX"); aff_check_number(spin->si_compsylmax, compsylmax, "COMPOUNDSYLMAX");
spin->si_compsylmax = compsylmax; spin->si_compsylmax = compsylmax;
} }
@ -5052,10 +5048,10 @@ static afffile_T *spell_read_aff(spellinfo_T *spin, char_u *fname)
if (sofofrom != NULL || sofoto != NULL) { if (sofofrom != NULL || sofoto != NULL) {
if (sofofrom == NULL || sofoto == NULL) if (sofofrom == NULL || sofoto == NULL)
smsg((char_u *)_("Missing SOFO%s line in %s"), smsg(_("Missing SOFO%s line in %s"),
sofofrom == NULL ? "FROM" : "TO", fname); sofofrom == NULL ? "FROM" : "TO", fname);
else if (!GA_EMPTY(&spin->si_sal)) else if (!GA_EMPTY(&spin->si_sal))
smsg((char_u *)_("Both SAL and SOFO lines in %s"), fname); smsg(_("Both SAL and SOFO lines in %s"), fname);
else { else {
aff_check_string(spin->si_sofofr, sofofrom, "SOFOFROM"); aff_check_string(spin->si_sofofr, sofofrom, "SOFOFROM");
aff_check_string(spin->si_sofoto, sofoto, "SOFOTO"); aff_check_string(spin->si_sofoto, sofoto, "SOFOTO");
@ -5133,14 +5129,14 @@ static unsigned affitem2flag(int flagtype, char_u *item, char_u *fname, int lnum
res = get_affitem(flagtype, &p); res = get_affitem(flagtype, &p);
if (res == 0) { if (res == 0) {
if (flagtype == AFT_NUM) if (flagtype == AFT_NUM)
smsg((char_u *)_("Flag is not a number in %s line %d: %s"), smsg(_("Flag is not a number in %s line %d: %s"),
fname, lnum, item); fname, lnum, item);
else else
smsg((char_u *)_("Illegal flag in %s line %d: %s"), smsg(_("Illegal flag in %s line %d: %s"),
fname, lnum, item); fname, lnum, item);
} }
if (*p != NUL) { if (*p != NUL) {
smsg((char_u *)_(e_affname), fname, lnum, item); smsg(_(e_affname), fname, lnum, item);
return 0; return 0;
} }
@ -5294,16 +5290,16 @@ static bool flag_in_afflist(int flagtype, char_u *afflist, unsigned flag)
static void aff_check_number(int spinval, int affval, char *name) static void aff_check_number(int spinval, int affval, char *name)
{ {
if (spinval != 0 && spinval != affval) if (spinval != 0 && spinval != affval)
smsg((char_u *)_( smsg(_("%s value differs from what is used in another .aff file"),
"%s value differs from what is used in another .aff file"), name); name);
} }
// Give a warning when "spinval" and "affval" strings are set and not the same. // Give a warning when "spinval" and "affval" strings are set and not the same.
static void aff_check_string(char_u *spinval, char_u *affval, char *name) static void aff_check_string(char_u *spinval, char_u *affval, char *name)
{ {
if (spinval != NULL && STRCMP(spinval, affval) != 0) if (spinval != NULL && STRCMP(spinval, affval) != 0)
smsg((char_u *)_( smsg(_("%s value differs from what is used in another .aff file"),
"%s value differs from what is used in another .aff file"), name); name);
} }
// Returns true if strings "s1" and "s2" are equal. Also consider both being // Returns true if strings "s1" and "s2" are equal. Also consider both being
@ -5434,8 +5430,8 @@ static int spell_read_dic(spellinfo_T *spin, char_u *fname, afffile_T *affile)
if (spin->si_conv.vc_type != CONV_NONE) { if (spin->si_conv.vc_type != CONV_NONE) {
pc = string_convert(&spin->si_conv, line, NULL); pc = string_convert(&spin->si_conv, line, NULL);
if (pc == NULL) { if (pc == NULL) {
smsg((char_u *)_("Conversion failure for word in %s line %d: %s"), smsg(_("Conversion failure for word in %s line %d: %s"),
fname, lnum, line); fname, lnum, line);
continue; continue;
} }
w = pc; w = pc;
@ -5490,11 +5486,11 @@ static int spell_read_dic(spellinfo_T *spin, char_u *fname, afffile_T *affile)
hi = hash_lookup(&ht, dw, hash); hi = hash_lookup(&ht, dw, hash);
if (!HASHITEM_EMPTY(hi)) { if (!HASHITEM_EMPTY(hi)) {
if (p_verbose > 0) if (p_verbose > 0)
smsg((char_u *)_("Duplicate word in %s line %d: %s"), smsg(_("Duplicate word in %s line %d: %s"),
fname, lnum, dw); fname, lnum, dw);
else if (duplicate == 0) else if (duplicate == 0)
smsg((char_u *)_("First duplicate word in %s line %d: %s"), smsg(_("First duplicate word in %s line %d: %s"),
fname, lnum, dw); fname, lnum, dw);
++duplicate; ++duplicate;
} else } else
hash_add_item(&ht, hi, dw, hash); hash_add_item(&ht, hi, dw, hash);
@ -5545,10 +5541,10 @@ static int spell_read_dic(spellinfo_T *spin, char_u *fname, afffile_T *affile)
} }
if (duplicate > 0) if (duplicate > 0)
smsg((char_u *)_("%d duplicate word(s) in %s"), duplicate, fname); smsg(_("%d duplicate word(s) in %s"), duplicate, fname);
if (spin->si_ascii && non_ascii > 0) if (spin->si_ascii && non_ascii > 0)
smsg((char_u *)_("Ignored %d word(s) with non-ASCII characters in %s"), smsg(_("Ignored %d word(s) with non-ASCII characters in %s"),
non_ascii, fname); non_ascii, fname);
hash_clear(&ht); hash_clear(&ht);
fclose(fd); fclose(fd);
@ -5938,8 +5934,8 @@ static int spell_read_wordfile(spellinfo_T *spin, char_u *fname)
if (spin->si_conv.vc_type != CONV_NONE) { if (spin->si_conv.vc_type != CONV_NONE) {
pc = string_convert(&spin->si_conv, rline, NULL); pc = string_convert(&spin->si_conv, rline, NULL);
if (pc == NULL) { if (pc == NULL) {
smsg((char_u *)_("Conversion failure for word in %s line %d: %s"), smsg(_("Conversion failure for word in %s line %d: %s"),
fname, lnum, rline); fname, lnum, rline);
continue; continue;
} }
line = pc; line = pc;
@ -5952,13 +5948,11 @@ static int spell_read_wordfile(spellinfo_T *spin, char_u *fname)
++line; ++line;
if (STRNCMP(line, "encoding=", 9) == 0) { if (STRNCMP(line, "encoding=", 9) == 0) {
if (spin->si_conv.vc_type != CONV_NONE) if (spin->si_conv.vc_type != CONV_NONE)
smsg((char_u *)_( smsg(_("Duplicate /encoding= line ignored in %s line %d: %s"),
"Duplicate /encoding= line ignored in %s line %d: %s"), fname, lnum, line - 1);
fname, lnum, line - 1);
else if (did_word) else if (did_word)
smsg((char_u *)_( smsg(_("/encoding= line after word ignored in %s line %d: %s"),
"/encoding= line after word ignored in %s line %d: %s"), fname, lnum, line - 1);
fname, lnum, line - 1);
else { else {
char_u *enc; char_u *enc;
@ -5968,8 +5962,8 @@ static int spell_read_wordfile(spellinfo_T *spin, char_u *fname)
if (!spin->si_ascii if (!spin->si_ascii
&& convert_setup(&spin->si_conv, enc, && convert_setup(&spin->si_conv, enc,
p_enc) == FAIL) p_enc) == FAIL)
smsg((char_u *)_("Conversion in %s not supported: from %s to %s"), smsg(_("Conversion in %s not supported: from %s to %s"),
fname, line, p_enc); fname, line, p_enc);
xfree(enc); xfree(enc);
spin->si_conv.vc_fail = true; spin->si_conv.vc_fail = true;
} }
@ -5978,13 +5972,13 @@ static int spell_read_wordfile(spellinfo_T *spin, char_u *fname)
if (STRNCMP(line, "regions=", 8) == 0) { if (STRNCMP(line, "regions=", 8) == 0) {
if (spin->si_region_count > 1) if (spin->si_region_count > 1)
smsg((char_u *)_("Duplicate /regions= line ignored in %s line %d: %s"), smsg(_("Duplicate /regions= line ignored in %s line %d: %s"),
fname, lnum, line); fname, lnum, line);
else { else {
line += 8; line += 8;
if (STRLEN(line) > 16) if (STRLEN(line) > 16)
smsg((char_u *)_("Too many regions in %s line %d: %s"), smsg(_("Too many regions in %s line %d: %s"),
fname, lnum, line); fname, lnum, line);
else { else {
spin->si_region_count = (int)STRLEN(line) / 2; spin->si_region_count = (int)STRLEN(line) / 2;
STRCPY(spin->si_region_name, line); STRCPY(spin->si_region_name, line);
@ -5996,8 +5990,8 @@ static int spell_read_wordfile(spellinfo_T *spin, char_u *fname)
continue; continue;
} }
smsg((char_u *)_("/ line ignored in %s line %d: %s"), smsg(_("/ line ignored in %s line %d: %s"),
fname, lnum, line - 1); fname, lnum, line - 1);
continue; continue;
} }
@ -6022,14 +6016,14 @@ static int spell_read_wordfile(spellinfo_T *spin, char_u *fname)
l = *p - '0'; l = *p - '0';
if (l > spin->si_region_count) { if (l > spin->si_region_count) {
smsg((char_u *)_("Invalid region nr in %s line %d: %s"), smsg(_("Invalid region nr in %s line %d: %s"),
fname, lnum, p); fname, lnum, p);
break; break;
} }
regionmask |= 1 << (l - 1); regionmask |= 1 << (l - 1);
} else { } else {
smsg((char_u *)_("Unrecognized flags in %s line %d: %s"), smsg(_("Unrecognized flags in %s line %d: %s"),
fname, lnum, p); fname, lnum, p);
break; break;
} }
++p; ++p;
@ -7146,8 +7140,8 @@ static void spell_make_sugfile(spellinfo_T *spin, char_u *wfname)
if (sug_maketable(spin) == FAIL) if (sug_maketable(spin) == FAIL)
goto theend; goto theend;
smsg((char_u *)_("Number of words after soundfolding: %" PRId64), smsg(_("Number of words after soundfolding: %" PRId64),
(int64_t)spin->si_spellbuf->b_ml.ml_line_count); (int64_t)spin->si_spellbuf->b_ml.ml_line_count);
// Compress the soundfold trie. // Compress the soundfold trie.
spell_message(spin, (char_u *)_(msg_compressing)); spell_message(spin, (char_u *)_(msg_compressing));
@ -7254,7 +7248,7 @@ static int sug_filltree(spellinfo_T *spin, slang_T *slang)
} }
} }
smsg((char_u *)_("Total number of words: %d"), words_done); smsg(_("Total number of words: %d"), words_done);
return OK; return OK;
} }
@ -7847,8 +7841,8 @@ spell_add_word (
fputc('#', fd); fputc('#', fd);
if (undo) { if (undo) {
home_replace(NULL, fname, NameBuff, MAXPATHL, TRUE); home_replace(NULL, fname, NameBuff, MAXPATHL, TRUE);
smsg((char_u *)_("Word '%.*s' removed from %s"), smsg(_("Word '%.*s' removed from %s"),
len, word, NameBuff); len, word, NameBuff);
} }
} }
fseek(fd, fpos_next, SEEK_SET); fseek(fd, fpos_next, SEEK_SET);
@ -7890,7 +7884,7 @@ spell_add_word (
fclose(fd); fclose(fd);
home_replace(NULL, fname, NameBuff, MAXPATHL, TRUE); home_replace(NULL, fname, NameBuff, MAXPATHL, TRUE);
smsg((char_u *)_("Word '%.*s' added to %s"), len, word, NameBuff); smsg(_("Word '%.*s' added to %s"), len, word, NameBuff);
} }
} }
@ -8457,8 +8451,8 @@ void spell_suggest(int count)
MSG(_("Sorry, no suggestions")); MSG(_("Sorry, no suggestions"));
else if (count > 0) { else if (count > 0) {
if (count > sug.su_ga.ga_len) if (count > sug.su_ga.ga_len)
smsg((char_u *)_("Sorry, only %" PRId64 " suggestions"), smsg(_("Sorry, only %" PRId64 " suggestions"),
(int64_t)sug.su_ga.ga_len); (int64_t)sug.su_ga.ga_len);
} else { } else {
xfree(repl_from); xfree(repl_from);
repl_from = NULL; repl_from = NULL;
@ -11190,7 +11184,6 @@ badword:
} }
} }
} }
// smsg("word %s (%d): %s (%d)", sftword, sftnr, theword, orgnr);
} }
} }

View File

@ -856,7 +856,7 @@ do_tag (
* file didn't exist. Otherwise an EMSG() is given below. * file didn't exist. Otherwise an EMSG() is given below.
*/ */
if (nofile_fname != NULL && error_cur_match != cur_match) if (nofile_fname != NULL && error_cur_match != cur_match)
smsg((char_u *)_("File \"%s\" does not exist"), nofile_fname); smsg(_("File \"%s\" does not exist"), nofile_fname);
ic = (matches[cur_match][0] & MT_IC_OFF); ic = (matches[cur_match][0] & MT_IC_OFF);
@ -1289,7 +1289,7 @@ find_tags (
if (p_verbose >= 5) { if (p_verbose >= 5) {
verbose_enter(); verbose_enter();
smsg((char_u *)_("Searching tags file %s"), tag_fname); smsg(_("Searching tags file %s"), tag_fname);
verbose_leave(); verbose_leave();
} }
} }
@ -2742,7 +2742,7 @@ add_tag_field (
if (dict_find(dict, (char_u *)field_name, -1) != NULL) { if (dict_find(dict, (char_u *)field_name, -1) != NULL) {
if (p_verbose > 0) { if (p_verbose > 0) {
verbose_enter(); verbose_enter();
smsg((char_u *)_("Duplicate field name: %s"), field_name); smsg(_("Duplicate field name: %s"), field_name);
verbose_leave(); verbose_leave();
} }
return FAIL; return FAIL;

View File

@ -159,12 +159,12 @@ static void u_check_tree(u_header_T *uhp,
/* Check pointers back are correct. */ /* Check pointers back are correct. */
if (uhp->uh_next.ptr != exp_uh_next) { if (uhp->uh_next.ptr != exp_uh_next) {
EMSG("uh_next wrong"); EMSG("uh_next wrong");
smsg((char_u *)"expected: 0x%x, actual: 0x%x", smsg("expected: 0x%x, actual: 0x%x",
exp_uh_next, uhp->uh_next.ptr); exp_uh_next, uhp->uh_next.ptr);
} }
if (uhp->uh_alt_prev.ptr != exp_uh_alt_prev) { if (uhp->uh_alt_prev.ptr != exp_uh_alt_prev) {
EMSG("uh_alt_prev wrong"); EMSG("uh_alt_prev wrong");
smsg((char_u *)"expected: 0x%x, actual: 0x%x", smsg("expected: 0x%x, actual: 0x%x",
exp_uh_alt_prev, uhp->uh_alt_prev.ptr); exp_uh_alt_prev, uhp->uh_alt_prev.ptr);
} }
@ -198,7 +198,7 @@ static void u_check(int newhead_may_be_NULL) {
EMSGN("b_u_curhead invalid: 0x%x", curbuf->b_u_curhead); EMSGN("b_u_curhead invalid: 0x%x", curbuf->b_u_curhead);
if (header_count != curbuf->b_u_numhead) { if (header_count != curbuf->b_u_numhead) {
EMSG("b_u_numhead invalid"); EMSG("b_u_numhead invalid");
smsg((char_u *)"expected: %" PRId64 ", actual: %" PRId64, smsg("expected: %" PRId64 ", actual: %" PRId64,
(int64_t)header_count, (int64_t)curbuf->b_u_numhead); (int64_t)header_count, (int64_t)curbuf->b_u_numhead);
} }
} }
@ -1013,8 +1013,7 @@ void u_write_undo(char_u *name, int forceit, buf_T *buf, char_u *hash)
if (file_name == NULL) { if (file_name == NULL) {
if (p_verbose > 0) { if (p_verbose > 0) {
verbose_enter(); verbose_enter();
smsg((char_u *) smsg(_("Cannot write undo file in any directory in 'undodir'"));
_("Cannot write undo file in any directory in 'undodir'"));
verbose_leave(); verbose_leave();
} }
return; return;
@ -1048,9 +1047,8 @@ void u_write_undo(char_u *name, int forceit, buf_T *buf, char_u *hash)
if (name != NULL || p_verbose > 0) { if (name != NULL || p_verbose > 0) {
if (name == NULL) if (name == NULL)
verbose_enter(); verbose_enter();
smsg((char_u *) smsg(_("Will not overwrite with undo file, cannot read: %s"),
_("Will not overwrite with undo file, cannot read: %s"), file_name);
file_name);
if (name == NULL) if (name == NULL)
verbose_leave(); verbose_leave();
} }
@ -1064,9 +1062,8 @@ void u_write_undo(char_u *name, int forceit, buf_T *buf, char_u *hash)
if (name != NULL || p_verbose > 0) { if (name != NULL || p_verbose > 0) {
if (name == NULL) if (name == NULL)
verbose_enter(); verbose_enter();
smsg((char_u *) smsg(_("Will not overwrite, this is not an undo file: %s"),
_("Will not overwrite, this is not an undo file: %s"), file_name);
file_name);
if (name == NULL) if (name == NULL)
verbose_leave(); verbose_leave();
} }
@ -1094,7 +1091,7 @@ void u_write_undo(char_u *name, int forceit, buf_T *buf, char_u *hash)
(void)os_setperm(file_name, perm); (void)os_setperm(file_name, perm);
if (p_verbose > 0) { if (p_verbose > 0) {
verbose_enter(); verbose_enter();
smsg((char_u *)_("Writing undo file: %s"), file_name); smsg(_("Writing undo file: %s"), file_name);
verbose_leave(); verbose_leave();
} }
@ -1236,8 +1233,8 @@ void u_read_undo(char_u *name, char_u *hash, char_u *orig_name)
&& file_info_undo.stat.st_uid != getuid()) { && file_info_undo.stat.st_uid != getuid()) {
if (p_verbose > 0) { if (p_verbose > 0) {
verbose_enter(); verbose_enter();
smsg((char_u *)_("Not reading undo file, owner differs: %s"), smsg(_("Not reading undo file, owner differs: %s"),
file_name); file_name);
verbose_leave(); verbose_leave();
} }
return; return;
@ -1249,7 +1246,7 @@ void u_read_undo(char_u *name, char_u *hash, char_u *orig_name)
if (p_verbose > 0) { if (p_verbose > 0) {
verbose_enter(); verbose_enter();
smsg((char_u *)_("Reading undo file: %s"), file_name); smsg(_("Reading undo file: %s"), file_name);
verbose_leave(); verbose_leave();
} }
@ -1483,7 +1480,7 @@ void u_read_undo(char_u *name, char_u *hash, char_u *orig_name)
#endif #endif
if (name != NULL) { if (name != NULL) {
smsg((char_u *)_("Finished reading undo file %s"), file_name); smsg(_("Finished reading undo file %s"), file_name);
} }
goto theend; goto theend;
@ -2289,7 +2286,7 @@ u_undo_end (
} }
} }
smsg((char_u *)_("%" PRId64 " %s; %s #%" PRId64 " %s"), smsg(_("%" PRId64 " %s; %s #%" PRId64 " %s"),
u_oldcount < 0 ? (int64_t)-u_oldcount : (int64_t)u_oldcount, u_oldcount < 0 ? (int64_t)-u_oldcount : (int64_t)u_oldcount,
_(msgstr), _(msgstr),
did_undo ? _("before") : _("after"), did_undo ? _("before") : _("after"),