diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/buffer.c | 6 | ||||
-rw-r--r-- | src/nvim/eval.c | 10 | ||||
-rw-r--r-- | src/nvim/ex_cmds.c | 14 | ||||
-rw-r--r-- | src/nvim/ex_cmds2.c | 32 | ||||
-rw-r--r-- | src/nvim/ex_docmd.c | 6 | ||||
-rw-r--r-- | src/nvim/ex_eval.c | 29 | ||||
-rw-r--r-- | src/nvim/file_search.c | 14 | ||||
-rw-r--r-- | src/nvim/fileio.c | 7 | ||||
-rw-r--r-- | src/nvim/if_cscope.c | 6 | ||||
-rw-r--r-- | src/nvim/memline.c | 4 | ||||
-rw-r--r-- | src/nvim/message.c | 4 | ||||
-rw-r--r-- | src/nvim/misc2.c | 4 | ||||
-rw-r--r-- | src/nvim/ops.c | 10 | ||||
-rw-r--r-- | src/nvim/os/fs.c | 2 | ||||
-rw-r--r-- | src/nvim/quickfix.c | 4 | ||||
-rw-r--r-- | src/nvim/regexp.c | 2 | ||||
-rw-r--r-- | src/nvim/search.c | 2 | ||||
-rw-r--r-- | src/nvim/spell.c | 203 | ||||
-rw-r--r-- | src/nvim/tag.c | 6 | ||||
-rw-r--r-- | src/nvim/undo.c | 31 |
20 files changed, 192 insertions, 204 deletions
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index 094e80086c..fd55e8c7a0 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -778,17 +778,17 @@ do_bufdel ( if (deleted == 1) MSG(_("1 buffer unloaded")); else - smsg((char_u *)_("%d buffers unloaded"), deleted); + smsg(_("%d buffers unloaded"), deleted); } else if (command == DOBUF_DEL) { if (deleted == 1) MSG(_("1 buffer deleted")); else - smsg((char_u *)_("%d buffers deleted"), deleted); + smsg(_("%d buffers deleted"), deleted); } else { if (deleted == 1) MSG(_("1 buffer wiped out")); else - smsg((char_u *)_("%d buffers wiped out"), deleted); + smsg(_("%d buffers wiped out"), deleted); } } } diff --git a/src/nvim/eval.c b/src/nvim/eval.c index d6b1960155..906659a1f3 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -19105,7 +19105,7 @@ call_user_func ( ++no_wait_return; verbose_enter_scroll(); - smsg((char_u *)_("calling %s"), sourcing_name); + smsg(_("calling %s"), sourcing_name); if (p_verbose >= 14) { char_u buf[MSG_BUF_LEN]; char_u numbuf2[NUMBUFLEN]; @@ -19203,9 +19203,9 @@ call_user_func ( verbose_enter_scroll(); if (aborting()) - smsg((char_u *)_("%s aborted"), sourcing_name); + smsg(_("%s aborted"), sourcing_name); 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); else { char_u buf[MSG_BUF_LEN]; @@ -19224,7 +19224,7 @@ call_user_func ( trunc_string(s, buf, MSG_BUF_CLEN, MSG_BUF_LEN); s = buf; } - smsg((char_u *)_("%s returning %s"), sourcing_name, s); + smsg(_("%s returning %s"), sourcing_name, s); xfree(tofree); } } @@ -19245,7 +19245,7 @@ call_user_func ( ++no_wait_return; 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 */ verbose_leave_scroll(); diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c index 67ff1605f0..ecd65bfab2 100644 --- a/src/nvim/ex_cmds.c +++ b/src/nvim/ex_cmds.c @@ -748,7 +748,7 @@ int do_move(linenr_T line1, linenr_T line2, linenr_T dest) if (num_lines == 1) MSG(_("1 line moved")); 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) { verbose_enter(); - smsg((char_u *)_("Reading viminfo file \"%s\"%s%s%s"), + smsg(_("Reading viminfo file \"%s\"%s%s%s"), fname, (flags & VIF_WANT_INFO) ? _(" info") : "", (flags & VIF_WANT_MARKS) ? _(" marks") : "", @@ -1616,7 +1616,7 @@ void write_viminfo(char_u *file, int forceit) if (p_verbose > 0) { verbose_enter(); - smsg((char_u *)_("Writing viminfo file \"%s\""), fname); + smsg(_("Writing viminfo file \"%s\""), fname); verbose_leave(); } @@ -4440,9 +4440,9 @@ void ex_global(exarg_T *eap) MSG(_(e_interr)); else if (ndone == 0) { if (type == 'v') - smsg((char_u *)_("Pattern found in every line: %s"), pat); + smsg(_("Pattern found in every line: %s"), pat); else - smsg((char_u *)_("Pattern not found: %s"), pat); + smsg(_("Pattern not found: %s"), pat); } else global_exe(cmd); @@ -4682,7 +4682,7 @@ void ex_help(exarg_T *eap) * Try to open the file specified by the "helpfile" option. */ 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; } fclose(helpfd); @@ -6038,7 +6038,7 @@ static void sign_list_defined(sign_T *sp) { char_u *p; - smsg((char_u *)"sign %s", sp->sn_name); + smsg("sign %s", sp->sn_name); if (sp->sn_icon != NULL) { MSG_PUTS(" icon="); msg_outtrans(sp->sn_icon); diff --git a/src/nvim/ex_cmds2.c b/src/nvim/ex_cmds2.c index b4c159b0db..3fe4acc471 100644 --- a/src/nvim/ex_cmds2.c +++ b/src/nvim/ex_cmds2.c @@ -169,9 +169,9 @@ void do_debug(char_u *cmd) if (sourcing_name != NULL) msg(sourcing_name); 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 - smsg((char_u *)_("cmd: %s"), cmd); + smsg(_("cmd: %s"), cmd); /* * Repeat getting a command and executing it. @@ -348,7 +348,7 @@ void dbg_check_breakpoint(exarg_T *eap) p = (char_u *)"<SNR>"; else p = (char_u *)""; - smsg((char_u *)_("Breakpoint in \"%s%s\" line %" PRId64), + smsg(_("Breakpoint in \"%s%s\" line %" PRId64), p, debug_breakpoint_name + (*p == NUL ? 0 : 3), (int64_t)debug_breakpoint_lnum); @@ -637,7 +637,7 @@ void ex_breaklist(exarg_T *eap) bp = &BREAKP(i); if (bp->dbg_type == DBG_FILE) 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_type == DBG_FUNC ? "func" : "file", 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) { verbose_enter(); - smsg((char_u *)_("Searching for \"%s\" in \"%s\""), + smsg(_("Searching for \"%s\" in \"%s\""), (char *)name, (char *)p_rtp); verbose_leave(); } @@ -2155,7 +2155,7 @@ int do_in_runtimepath(char_u *name, int all, DoInRuntimepathCB callback, if (p_verbose > 2) { verbose_enter(); - smsg((char_u *)_("Searching for \"%s\""), buf); + smsg(_("Searching for \"%s\""), buf); verbose_leave(); } @@ -2178,7 +2178,7 @@ int do_in_runtimepath(char_u *name, int all, DoInRuntimepathCB callback, xfree(rtp_copy); if (p_verbose > 0 && !did_one && name != NULL) { verbose_enter(); - smsg((char_u *)_("not found in 'runtimepath': \"%s\""), name); + smsg(_("not found in 'runtimepath': \"%s\""), name); verbose_leave(); } @@ -2316,7 +2316,7 @@ do_source ( if (fname_exp == NULL) return retval; if (os_isdir(fname_exp)) { - smsg((char_u *)_("Cannot source a directory: \"%s\""), fname); + smsg(_("Cannot source a directory: \"%s\""), fname); goto theend; } @@ -2362,9 +2362,9 @@ do_source ( if (p_verbose > 0) { verbose_enter(); if (sourcing_name == NULL) - smsg((char_u *)_("could not source \"%s\""), fname); + smsg(_("could not source \"%s\""), fname); else - smsg((char_u *)_("line %" PRId64 ": could not source \"%s\""), + smsg(_("line %" PRId64 ": could not source \"%s\""), (int64_t)sourcing_lnum, fname); verbose_leave(); } @@ -2379,9 +2379,9 @@ do_source ( if (p_verbose > 1) { verbose_enter(); if (sourcing_name == NULL) - smsg((char_u *)_("sourcing \"%s\""), fname); + smsg(_("sourcing \"%s\""), fname); else - smsg((char_u *)_("line %" PRId64 ": sourcing \"%s\""), + smsg(_("line %" PRId64 ": sourcing \"%s\""), (int64_t)sourcing_lnum, fname); verbose_leave(); } @@ -2532,9 +2532,9 @@ do_source ( sourcing_lnum = save_sourcing_lnum; if (p_verbose > 1) { verbose_enter(); - smsg((char_u *)_("finished sourcing %s"), fname); + smsg(_("finished sourcing %s"), fname); if (sourcing_name != NULL) - smsg((char_u *)_("continuing in %s"), sourcing_name); + smsg(_("continuing in %s"), sourcing_name); verbose_leave(); } @@ -2576,7 +2576,7 @@ void ex_scriptnames(exarg_T *eap) if (SCRIPT_ITEM(i).sn_name != NULL) { home_replace(NULL, SCRIPT_ITEM(i).sn_name, 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); if (p == NULL || *p == NUL) p = (char_u *)"Unknown"; - smsg((char_u *)_("Current %slanguage: \"%s\""), whatstr, p); + smsg(_("Current %slanguage: \"%s\""), whatstr, p); } else { #ifndef LC_MESSAGES if (what == VIM_LC_MESSAGES) diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index c1572d5e6e..ee935773b4 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -604,7 +604,7 @@ int do_cmdline(char_u *cmdline, LineGetter fgetline, ++no_wait_return; verbose_enter_scroll(); - smsg((char_u *)_("line %" PRId64 ": %s"), + smsg(_("line %" PRId64 ": %s"), (int64_t)sourcing_lnum, cmdline_copy); if (msg_silent == 0) 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) { - smsg((char_u *)"%" PRId64, (int64_t)eap->line2); + smsg("%" PRId64, (int64_t)eap->line2); ex_may_print(eap); } @@ -9221,7 +9221,7 @@ static void ex_filetype(exarg_T *eap) if (*eap->arg == NUL) { /* 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_plugin ? (filetype_detect ? "ON" : "(on)") : "OFF", filetype_indent ? (filetype_detect ? "ON" : "(on)") : "OFF"); diff --git a/src/nvim/ex_eval.c b/src/nvim/ex_eval.c index 224d9e9bf7..5c2751fa00 100644 --- a/src/nvim/ex_eval.c +++ b/src/nvim/ex_eval.c @@ -489,7 +489,7 @@ static int throw_exception(void *value, int type, char_u *cmdname) if (debug_break_level > 0 || *p_vfile == NUL) 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 */ 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; if (debug_break_level > 0 || *p_vfile == NUL) msg_scroll = TRUE; /* always scroll up, don't overwrite */ - smsg(was_finished - ? (char_u *)_("Exception finished: %s") - : (char_u *)_("Exception discarded: %s"), - excp->value); + smsg(was_finished ? _("Exception finished: %s") + : _("Exception discarded: %s"), + excp->value); msg_puts((char_u *)"\n"); /* don't overwrite this either */ if (debug_break_level > 0 || *p_vfile == NUL) cmdline_row = msg_row; @@ -601,7 +600,7 @@ static void catch_exception(except_T *excp) if (debug_break_level > 0 || *p_vfile == NUL) 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 */ 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) { - char_u *mesg; - char *s; + char *mesg; + char *s; int save_msg_silent; assert(value || !(pending & CSTP_THROW)); switch (action) { case RP_MAKE: - mesg = (char_u *)_("%s made pending"); + mesg = _("%s made pending"); break; case RP_RESUME: - mesg = (char_u *)_("%s resumed"); + mesg = _("%s resumed"); break; /* case RP_DISCARD: */ default: - mesg = (char_u *)_("%s discarded"); + mesg = _("%s discarded"); break; } @@ -702,9 +701,9 @@ static void report_pending(int action, int pending, void *value) default: if (pending & CSTP_THROW) { vim_snprintf((char *)IObuff, IOSIZE, - (char *)mesg, _("Exception")); - mesg = vim_strnsave(IObuff, STRLEN(IObuff) + 4); - STRCAT(mesg, ": %s"); + mesg, _("Exception")); + mesg = (char *)vim_strnsave(IObuff, STRLEN(IObuff) + 4); + strcat(mesg, ": %s"); s = (char *)((except_T *)value)->value; } else if ((pending & CSTP_ERROR) && (pending & CSTP_INTERRUPT)) s = _("Error and interrupt"); @@ -719,7 +718,7 @@ static void report_pending(int action, int pending, void *value) msg_silent = FALSE; /* display messages */ ++no_wait_return; 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 */ cmdline_row = msg_row; --no_wait_return; diff --git a/src/nvim/file_search.c b/src/nvim/file_search.c index 855de6595f..39a5ec062b 100644 --- a/src/nvim/file_search.c +++ b/src/nvim/file_search.c @@ -647,7 +647,7 @@ char_u *vim_findfile(void *search_ctx_arg) #ifdef FF_VERBOSE if (p_verbose >= 5) { verbose_enter_scroll(); - smsg((char_u *)"Already Searched: %s (%s)", + smsg("Already Searched: %s (%s)", stackp->ffs_fix_path, stackp->ffs_wc_path); /* don't overwrite this either */ msg_puts((char_u *)"\n"); @@ -660,8 +660,8 @@ char_u *vim_findfile(void *search_ctx_arg) #ifdef FF_VERBOSE else if (p_verbose >= 5) { verbose_enter_scroll(); - smsg((char_u *)"Searching: %s (%s)", - stackp->ffs_fix_path, stackp->ffs_wc_path); + smsg("Searching: %s (%s)", + stackp->ffs_fix_path, stackp->ffs_wc_path); /* don't overwrite this either */ msg_puts((char_u *)"\n"); verbose_leave_scroll(); @@ -821,7 +821,7 @@ char_u *vim_findfile(void *search_ctx_arg) ) == FAIL) { if (p_verbose >= 5) { verbose_enter_scroll(); - smsg((char_u *)"Already: %s", + smsg("Already: %s", file_path); /* don't overwrite this either */ msg_puts((char_u *)"\n"); @@ -848,7 +848,7 @@ char_u *vim_findfile(void *search_ctx_arg) #ifdef FF_VERBOSE if (p_verbose >= 5) { verbose_enter_scroll(); - smsg((char_u *)"HIT: %s", file_path); + smsg("HIT: %s", file_path); /* don't overwrite this either */ msg_puts((char_u *)"\n"); 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 if (p_verbose >= 5) { verbose_enter_scroll(); - smsg((char_u *)"ff_get_visited_list: FOUND list for %s", + smsg("ff_get_visited_list: FOUND list for %s", filename); /* don't overwrite this either */ 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 if (p_verbose >= 5) { 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 */ msg_puts((char_u *)"\n"); verbose_leave_scroll(); diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c index f5cf226da4..4dfa155e61 100644 --- a/src/nvim/fileio.c +++ b/src/nvim/fileio.c @@ -5404,8 +5404,7 @@ void aubuflocal_remove(buf_T *buf) au_remove_pat(ap); if (p_verbose >= 6) { verbose_enter(); - smsg((char_u *) - _("auto-removing autocommand: %s <buffer=%d>"), + smsg(_("auto-removing autocommand: %s <buffer=%d>"), event_nr2name(event), buf->b_fnum); verbose_leave(); } @@ -6835,7 +6834,7 @@ auto_next_pat ( (char *)name, (char *)ap->pat); if (p_verbose >= 8) { verbose_enter(); - smsg((char_u *)_("Executing %s"), sourcing_name); + smsg(_("Executing %s"), sourcing_name); verbose_leave(); } @@ -6897,7 +6896,7 @@ char_u *getnextac(int c, void *cookie, int indent) if (p_verbose >= 9) { 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 */ verbose_leave_scroll(); } diff --git a/src/nvim/if_cscope.c b/src/nvim/if_cscope.c index b5751f0a6e..8629f1a6ba 100644 --- a/src/nvim/if_cscope.c +++ b/src/nvim/if_cscope.c @@ -1115,7 +1115,7 @@ static int cs_help(exarg_T *eap) /* Use %*s rather than %30s to ensure proper alignment in utf-8 */ if (space_cnt < 0) space_cnt = 0; - (void)smsg((char_u *)_("%-5s: %s%*s (Usage: %s)"), + (void)smsg(_("%-5s: %s%*s (Usage: %s)"), cmdp->name, help, space_cnt, " ", cmdp->usage); @@ -2083,10 +2083,10 @@ static int cs_show(exarg_T *eap) continue; 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); else - (void)smsg((char_u *)"%2d %-5ld %-34s <none>", + (void)smsg("%2d %-5ld %-34s <none>", i, (long)csinfo[i].pid, csinfo[i].fname); } } diff --git a/src/nvim/memline.c b/src/nvim/memline.c index 29263144a4..d654749acd 100644 --- a/src/nvim/memline.c +++ b/src/nvim/memline.c @@ -950,13 +950,13 @@ void ml_recover(void) } 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) STRLCPY(NameBuff, buf_spname(curbuf), MAXPATHL); else home_replace(NULL, curbuf->b_ffname, NameBuff, MAXPATHL, TRUE); - smsg((char_u *)_("Original file \"%s\""), NameBuff); + smsg(_("Original file \"%s\""), NameBuff); msg_putchar('\n'); /* diff --git a/src/nvim/message.c b/src/nvim/message.c index 3667cf3be5..800d908741 100644 --- a/src/nvim/message.c +++ b/src/nvim/message.c @@ -329,12 +329,12 @@ void trunc_string(char_u *s, char_u *buf, int room, int buflen) * shorter than IOSIZE!!! */ -int smsg(char_u *s, ...) +int smsg(char *s, ...) { va_list arglist; va_start(arglist, s); - vim_vsnprintf((char *)IObuff, IOSIZE, (char *)s, arglist, NULL); + vim_vsnprintf((char *)IObuff, IOSIZE, s, arglist, NULL); va_end(arglist); return msg(IObuff); } diff --git a/src/nvim/misc2.c b/src/nvim/misc2.c index 87a9556202..d9bc35470f 100644 --- a/src/nvim/misc2.c +++ b/src/nvim/misc2.c @@ -296,8 +296,8 @@ int call_shell(char_u *cmd, ShellOpts opts, char_u *extra_shell_arg) if (p_verbose > 3) { verbose_enter(); - smsg((char_u *)_("Calling shell to execute: \"%s\""), - cmd == NULL ? p_sh : cmd); + smsg(_("Calling shell to execute: \"%s\""), + cmd == NULL ? p_sh : cmd); ui_putc('\n'); verbose_leave(); } diff --git a/src/nvim/ops.c b/src/nvim/ops.c index 268f2ac94f..2cbf74ac90 100644 --- a/src/nvim/ops.c +++ b/src/nvim/ops.c @@ -591,7 +591,7 @@ void op_reindent(oparg_T *oap, Indenter how) if (i > 1 && (i % 50 == 0 || i == oap->line_count - 1) && 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 @@ -635,7 +635,7 @@ void op_reindent(oparg_T *oap, Indenter how) if (i == 1) MSG(_("1 line indented ")); else - smsg((char_u *)_("%" PRId64 " lines indented "), (int64_t)i); + smsg(_("%" PRId64 " lines indented "), (int64_t)i); } /* set '[ and '] marks */ curbuf->b_op_start = oap->start; @@ -1902,7 +1902,7 @@ void op_tilde(oparg_T *oap) if (oap->line_count == 1) MSG(_("1 line changed")); 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 MSG(_("1 line yanked")); } else if (oap->block_mode) - smsg((char_u *)_("block of %" PRId64 " lines yanked"), + smsg(_("block of %" PRId64 " lines yanked"), (int64_t)yanklines); else - smsg((char_u *)_("%" PRId64 " lines yanked"), (int64_t)yanklines); + smsg(_("%" PRId64 " lines yanked"), (int64_t)yanklines); } } diff --git a/src/nvim/os/fs.c b/src/nvim/os/fs.c index 2a41001cde..52c10d0ca7 100644 --- a/src/nvim/os/fs.c +++ b/src/nvim/os/fs.c @@ -28,7 +28,7 @@ int os_chdir(const char *path) { if (p_verbose >= 5) { verbose_enter(); - smsg((char_u *)"chdir(%s)", path); + smsg("chdir(%s)", path); verbose_leave(); } return uv_chdir(path); diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c index 7e22da6e7a..4d53238381 100644 --- a/src/nvim/quickfix.c +++ b/src/nvim/quickfix.c @@ -1861,7 +1861,7 @@ void qf_age(exarg_T *eap) 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_lists[qi->qf_curlist].qf_count); qf_update_buffer(qi); @@ -2888,7 +2888,7 @@ void ex_vimgrep(exarg_T *eap) if (buf == NULL) { if (!got_int) - smsg((char_u *)_("Cannot open file \"%s\""), fname); + smsg(_("Cannot open file \"%s\""), fname); } else { /* Try for a match in all lines of the buffer. * For ":1vimgrep" look for first match only. */ diff --git a/src/nvim/regexp.c b/src/nvim/regexp.c index 133935b9c6..3e287e590b 100644 --- a/src/nvim/regexp.c +++ b/src/nvim/regexp.c @@ -6968,7 +6968,7 @@ regprog_T *vim_regcomp(char_u *expr_arg, int re_flags) regexp_engine = expr[4] - '0'; expr += 5; #ifdef REGEXP_DEBUG - smsg((char_u *)"New regexp mode selected (%d): %s", + smsg("New regexp mode selected (%d): %s", regexp_engine, regname[newengine]); #endif diff --git a/src/nvim/search.c b/src/nvim/search.c index 3542d1f711..464e112900 100644 --- a/src/nvim/search.c +++ b/src/nvim/search.c @@ -4200,7 +4200,7 @@ find_pattern_in_path ( msg_trunc_attr(IObuff, TRUE, hl_attr(HLF_R)); } else if (p_verbose >= 5) { verbose_enter(); - smsg((char_u *)_("Searching included file %s"), + smsg(_("Searching included file %s"), (char *)new_fname); verbose_leave(); } diff --git a/src/nvim/spell.c b/src/nvim/spell.c index 91db9be282..d79ee4d200 100644 --- a/src/nvim/spell.c +++ b/src/nvim/spell.c @@ -2327,9 +2327,8 @@ static void spell_load_lang(char_u *lang) } if (r == FAIL) { - smsg((char_u *) - _("Warning: Cannot find word list \"%s.%s.spl\" or \"%s.ascii.spl\""), - lang, spell_enc(), lang); + smsg(_("Warning: Cannot find word list \"%s.%s.spl\" or \"%s.ascii.spl\""), + lang, spell_enc(), lang); } else if (sl.sl_slang != NULL) { // At least one file was loaded, now load ALL the additions. STRCPY(fname_enc + STRLEN(fname_enc) - 3, "add.spl"); @@ -2540,14 +2539,14 @@ spell_load_file ( EMSG2(_(e_notopen), fname); else if (p_verbose > 2) { verbose_enter(); - smsg(e_notopen, fname); + smsg((char *)e_notopen, fname); verbose_leave(); } goto endFAIL; } if (p_verbose > 2) { verbose_enter(); - smsg((char_u *)_("Reading spell file \"%s\""), fname); + smsg(_("Reading spell file \"%s\""), fname); verbose_leave(); } @@ -3824,9 +3823,8 @@ char_u *did_set_spelllang(win_T *wp) } else // This is probably an error. Give a warning and // accept the words anyway. - smsg((char_u *) - _("Warning: region %s not supported"), - region); + smsg(_("Warning: region %s not supported"), + region); } else 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) { pc = string_convert(&spin->si_conv, rline, NULL); if (pc == NULL) { - smsg((char_u *)_("Conversion failure for word in %s line %d: %s"), - fname, lnum, rline); + smsg(_("Conversion failure for word in %s line %d: %s"), + fname, lnum, rline); continue; } line = pc; @@ -4436,8 +4434,8 @@ static afffile_T *spell_read_aff(spellinfo_T *spin, char_u *fname) if (!spin->si_ascii && convert_setup(&spin->si_conv, aff->af_enc, p_enc) == FAIL) - smsg((char_u *)_("Conversion in %s not supported: from %s to %s"), - fname, aff->af_enc, p_enc); + smsg(_("Conversion in %s not supported: from %s to %s"), + fname, aff->af_enc, p_enc); spin->si_conv.vc_fail = true; } else if (is_aff_rule(items, itemcnt, "FLAG", 2) && 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) aff->af_flagtype = AFT_CAPLONG; else - smsg((char_u *)_("Invalid value for FLAG in %s line %d: %s"), - fname, lnum, items[1]); + smsg(_("Invalid value for FLAG in %s line %d: %s"), + fname, lnum, items[1]); if (aff->af_rare != 0 || aff->af_keepcase != 0 || aff->af_bad != 0 @@ -4461,8 +4459,8 @@ static afffile_T *spell_read_aff(spellinfo_T *spin, char_u *fname) || compflags != NULL || aff->af_suff.ht_used > 0 || aff->af_pref.ht_used > 0) - smsg((char_u *)_("FLAG after using flags in %s line %d: %s"), - fname, lnum, items[1]); + smsg(_("FLAG after using flags in %s line %d: %s"), + fname, lnum, items[1]); } else if (spell_info_item(items[0]) && itemcnt > 1) { p = (char_u *)getroom(spin, (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], fname, lnum); if (aff->af_pref.ht_used > 0) - smsg((char_u *)_( - "Defining COMPOUNDFORBIDFLAG after PFX item may give wrong results in %s line %d"), - fname, lnum); + smsg(_("Defining COMPOUNDFORBIDFLAG after PFX item may give wrong results in %s line %d"), + fname, lnum); } else if (is_aff_rule(items, itemcnt, "COMPOUNDPERMITFLAG", 2) && aff->af_comppermit == 0) { aff->af_comppermit = affitem2flag(aff->af_flagtype, items[1], fname, lnum); if (aff->af_pref.ht_used > 0) - smsg((char_u *)_( - "Defining COMPOUNDPERMITFLAG after PFX item may give wrong results in %s line %d"), - fname, lnum); + smsg(_("Defining COMPOUNDPERMITFLAG after PFX item may give wrong results in %s line %d"), + fname, lnum); } else if (is_aff_rule(items, itemcnt, "COMPOUNDFLAG", 2) && compflags == NULL) { // 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 // not COMPOUNDRULE mistyped. if (atoi((char *)items[1]) == 0) - smsg((char_u *)_("Wrong COMPOUNDRULES value in %s line %d: %s"), - fname, lnum, items[1]); + smsg(_("Wrong COMPOUNDRULES value in %s line %d: %s"), + fname, lnum, items[1]); } else if (is_aff_rule(items, itemcnt, "COMPOUNDRULE", 2)) { // Don't use the first rule if it is a number. 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 = atoi((char *)items[1]); if (compmax == 0) - smsg((char_u *)_("Wrong COMPOUNDWORDMAX value in %s line %d: %s"), - fname, lnum, items[1]); + smsg(_("Wrong COMPOUNDWORDMAX value in %s line %d: %s"), + fname, lnum, items[1]); } else if (is_aff_rule(items, itemcnt, "COMPOUNDMIN", 2) && compminlen == 0) { compminlen = atoi((char *)items[1]); if (compminlen == 0) - smsg((char_u *)_("Wrong COMPOUNDMIN value in %s line %d: %s"), - fname, lnum, items[1]); + smsg(_("Wrong COMPOUNDMIN value in %s line %d: %s"), + fname, lnum, items[1]); } else if (is_aff_rule(items, itemcnt, "COMPOUNDSYLMAX", 2) && compsylmax == 0) { compsylmax = atoi((char *)items[1]); if (compsylmax == 0) - smsg((char_u *)_("Wrong COMPOUNDSYLMAX value in %s line %d: %s"), - fname, lnum, items[1]); + smsg(_("Wrong COMPOUNDSYLMAX value in %s line %d: %s"), + fname, lnum, items[1]); } else if (is_aff_rule(items, itemcnt, "CHECKCOMPOUNDDUP", 1)) { compoptions |= COMP_CHECKDUP; } 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; } else if (is_aff_rule(items, itemcnt, "CHECKCOMPOUNDPATTERN", 2)) { if (atoi((char *)items[1]) == 0) - smsg((char_u *)_("Wrong CHECKCOMPOUNDPATTERN value in %s line %d: %s"), - fname, lnum, items[1]); + smsg(_("Wrong CHECKCOMPOUNDPATTERN value in %s line %d: %s"), + fname, lnum, items[1]); } else if (is_aff_rule(items, itemcnt, "CHECKCOMPOUNDPATTERN", 3)) { garray_T *gap = &spin->si_comppat; int i; @@ -4650,12 +4646,11 @@ static afffile_T *spell_read_aff(spellinfo_T *spin, char_u *fname) if (!HASHITEM_EMPTY(hi)) { cur_aff = HI2AH(hi); if (cur_aff->ah_combine != (*items[2] == 'Y')) - smsg((char_u *)_( - "Different combining flag in continued affix block in %s line %d: %s"), - fname, lnum, items[1]); + smsg(_("Different combining flag in continued affix block in %s line %d: %s"), + fname, lnum, items[1]); if (!cur_aff->ah_follows) - smsg((char_u *)_("Duplicate affix in %s line %d: %s"), - fname, lnum, items[1]); + smsg(_("Duplicate affix in %s line %d: %s"), + fname, lnum, items[1]); } else { // New affix letter. 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_needcomp || cur_aff->ah_flag == aff->af_comproot) - smsg((char_u *)_( - "Affix also used for BAD/RARE/KEEPCASE/NEEDAFFIX/NEEDCOMPOUND/NOSUGGEST in %s line %d: %s"), + smsg(_("Affix also used for " + "BAD/RARE/KEEPCASE/NEEDAFFIX/NEEDCOMPOUND/NOSUGGEST" + "in %s line %d: %s"), fname, lnum, items[1]); STRCPY(cur_aff->ah_key, items[1]); 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 && !aff->af_ignoreextra && *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) - 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]); 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] != '#' && (STRCMP(items[lasti], "-") != 0 || 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. --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, RE_MAGIC + RE_STRING + RE_STRICT); if (aff_entry->ae_prog == NULL) - smsg((char_u *)_("Broken condition in %s line %d: %s"), - fname, lnum, items[4]); + smsg(_("Broken condition in %s line %d: %s"), + fname, lnum, items[4]); } // 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)) { /* Ignore REP/REPSAL count */; if (!isdigit(*items[1])) - smsg((char_u *)_("Expected REP(SAL) count in %s line %d"), - fname, lnum); + smsg(_("Expected REP(SAL) count in %s line %d"), + fname, lnum); } else if ((STRCMP(items[0], "REP") == 0 || STRCMP(items[0], "REPSAL") == 0) && 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 // # to detect mistakes. 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) { // Replace underscore with space (can't include a space // directly). @@ -4922,8 +4918,8 @@ static afffile_T *spell_read_aff(spellinfo_T *spin, char_u *fname) // First line contains the count. found_map = true; if (!isdigit(*items[1])) - smsg((char_u *)_("Expected MAP count in %s line %d"), - fname, lnum); + smsg(_("Expected MAP count in %s line %d"), + fname, lnum); } else if (do_mapline) { 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) != NULL) || vim_strchr(p, c) != NULL) - smsg((char_u *)_("Duplicate character in MAP in %s line %d"), - fname, lnum); + smsg(_("Duplicate character in MAP in %s line %d"), + fname, lnum); } // 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 - smsg((char_u *)_("Unrecognized or duplicate item in %s line %d: %s"), - fname, lnum, items[0]); + smsg(_("Unrecognized or duplicate item in %s line %d: %s"), + fname, lnum, items[0]); } } @@ -4999,7 +4995,7 @@ static afffile_T *spell_read_aff(spellinfo_T *spin, char_u *fname) && !enc_utf8 ) { 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 (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 (syllable == NULL) - smsg((char_u *)_("COMPOUNDSYLMAX used without SYLLABLE")); + smsg(_("COMPOUNDSYLMAX used without SYLLABLE")); aff_check_number(spin->si_compsylmax, compsylmax, "COMPOUNDSYLMAX"); 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) - smsg((char_u *)_("Missing SOFO%s line in %s"), - sofofrom == NULL ? "FROM" : "TO", fname); + smsg(_("Missing SOFO%s line in %s"), + sofofrom == NULL ? "FROM" : "TO", fname); 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 { aff_check_string(spin->si_sofofr, sofofrom, "SOFOFROM"); 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); if (res == 0) { if (flagtype == AFT_NUM) - smsg((char_u *)_("Flag is not a number in %s line %d: %s"), - fname, lnum, item); + smsg(_("Flag is not a number in %s line %d: %s"), + fname, lnum, item); else - smsg((char_u *)_("Illegal flag in %s line %d: %s"), - fname, lnum, item); + smsg(_("Illegal flag in %s line %d: %s"), + fname, lnum, item); } if (*p != NUL) { - smsg((char_u *)_(e_affname), fname, lnum, item); + smsg(_(e_affname), fname, lnum, item); 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) { if (spinval != 0 && spinval != affval) - smsg((char_u *)_( - "%s value differs from what is used in another .aff file"), name); + smsg(_("%s value differs from what is used in another .aff file"), + name); } // 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) { if (spinval != NULL && STRCMP(spinval, affval) != 0) - smsg((char_u *)_( - "%s value differs from what is used in another .aff file"), name); + smsg(_("%s value differs from what is used in another .aff file"), + name); } // 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) { pc = string_convert(&spin->si_conv, line, NULL); if (pc == NULL) { - smsg((char_u *)_("Conversion failure for word in %s line %d: %s"), - fname, lnum, line); + smsg(_("Conversion failure for word in %s line %d: %s"), + fname, lnum, line); continue; } 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); if (!HASHITEM_EMPTY(hi)) { if (p_verbose > 0) - smsg((char_u *)_("Duplicate word in %s line %d: %s"), - fname, lnum, dw); + smsg(_("Duplicate word in %s line %d: %s"), + fname, lnum, dw); else if (duplicate == 0) - smsg((char_u *)_("First duplicate word in %s line %d: %s"), - fname, lnum, dw); + smsg(_("First duplicate word in %s line %d: %s"), + fname, lnum, dw); ++duplicate; } else 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) - 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) - smsg((char_u *)_("Ignored %d word(s) with non-ASCII characters in %s"), - non_ascii, fname); + smsg(_("Ignored %d word(s) with non-ASCII characters in %s"), + non_ascii, fname); hash_clear(&ht); 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) { pc = string_convert(&spin->si_conv, rline, NULL); if (pc == NULL) { - smsg((char_u *)_("Conversion failure for word in %s line %d: %s"), - fname, lnum, rline); + smsg(_("Conversion failure for word in %s line %d: %s"), + fname, lnum, rline); continue; } line = pc; @@ -5952,13 +5948,11 @@ static int spell_read_wordfile(spellinfo_T *spin, char_u *fname) ++line; if (STRNCMP(line, "encoding=", 9) == 0) { if (spin->si_conv.vc_type != CONV_NONE) - smsg((char_u *)_( - "Duplicate /encoding= line ignored in %s line %d: %s"), - fname, lnum, line - 1); + smsg(_("Duplicate /encoding= line ignored in %s line %d: %s"), + fname, lnum, line - 1); else if (did_word) - smsg((char_u *)_( - "/encoding= line after word ignored in %s line %d: %s"), - fname, lnum, line - 1); + smsg(_("/encoding= line after word ignored in %s line %d: %s"), + fname, lnum, line - 1); else { char_u *enc; @@ -5968,8 +5962,8 @@ static int spell_read_wordfile(spellinfo_T *spin, char_u *fname) if (!spin->si_ascii && convert_setup(&spin->si_conv, enc, p_enc) == FAIL) - smsg((char_u *)_("Conversion in %s not supported: from %s to %s"), - fname, line, p_enc); + smsg(_("Conversion in %s not supported: from %s to %s"), + fname, line, p_enc); xfree(enc); 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 (spin->si_region_count > 1) - smsg((char_u *)_("Duplicate /regions= line ignored in %s line %d: %s"), - fname, lnum, line); + smsg(_("Duplicate /regions= line ignored in %s line %d: %s"), + fname, lnum, line); else { line += 8; if (STRLEN(line) > 16) - smsg((char_u *)_("Too many regions in %s line %d: %s"), - fname, lnum, line); + smsg(_("Too many regions in %s line %d: %s"), + fname, lnum, line); else { spin->si_region_count = (int)STRLEN(line) / 2; STRCPY(spin->si_region_name, line); @@ -5996,8 +5990,8 @@ static int spell_read_wordfile(spellinfo_T *spin, char_u *fname) continue; } - smsg((char_u *)_("/ line ignored in %s line %d: %s"), - fname, lnum, line - 1); + smsg(_("/ line ignored in %s line %d: %s"), + fname, lnum, line - 1); continue; } @@ -6022,14 +6016,14 @@ static int spell_read_wordfile(spellinfo_T *spin, char_u *fname) l = *p - '0'; if (l > spin->si_region_count) { - smsg((char_u *)_("Invalid region nr in %s line %d: %s"), - fname, lnum, p); + smsg(_("Invalid region nr in %s line %d: %s"), + fname, lnum, p); break; } regionmask |= 1 << (l - 1); } else { - smsg((char_u *)_("Unrecognized flags in %s line %d: %s"), - fname, lnum, p); + smsg(_("Unrecognized flags in %s line %d: %s"), + fname, lnum, p); break; } ++p; @@ -7146,8 +7140,8 @@ static void spell_make_sugfile(spellinfo_T *spin, char_u *wfname) if (sug_maketable(spin) == FAIL) goto theend; - smsg((char_u *)_("Number of words after soundfolding: %" PRId64), - (int64_t)spin->si_spellbuf->b_ml.ml_line_count); + smsg(_("Number of words after soundfolding: %" PRId64), + (int64_t)spin->si_spellbuf->b_ml.ml_line_count); // Compress the soundfold trie. 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; } @@ -7847,8 +7841,8 @@ spell_add_word ( fputc('#', fd); if (undo) { home_replace(NULL, fname, NameBuff, MAXPATHL, TRUE); - smsg((char_u *)_("Word '%.*s' removed from %s"), - len, word, NameBuff); + smsg(_("Word '%.*s' removed from %s"), + len, word, NameBuff); } } fseek(fd, fpos_next, SEEK_SET); @@ -7890,7 +7884,7 @@ spell_add_word ( fclose(fd); 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")); else if (count > 0) { if (count > sug.su_ga.ga_len) - smsg((char_u *)_("Sorry, only %" PRId64 " suggestions"), - (int64_t)sug.su_ga.ga_len); + smsg(_("Sorry, only %" PRId64 " suggestions"), + (int64_t)sug.su_ga.ga_len); } else { xfree(repl_from); repl_from = NULL; @@ -11190,7 +11184,6 @@ badword: } } } - // smsg("word %s (%d): %s (%d)", sftword, sftnr, theword, orgnr); } } diff --git a/src/nvim/tag.c b/src/nvim/tag.c index 27834e2577..75055cc21a 100644 --- a/src/nvim/tag.c +++ b/src/nvim/tag.c @@ -856,7 +856,7 @@ do_tag ( * file didn't exist. Otherwise an EMSG() is given below. */ 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); @@ -1289,7 +1289,7 @@ find_tags ( if (p_verbose >= 5) { verbose_enter(); - smsg((char_u *)_("Searching tags file %s"), tag_fname); + smsg(_("Searching tags file %s"), tag_fname); verbose_leave(); } } @@ -2742,7 +2742,7 @@ add_tag_field ( if (dict_find(dict, (char_u *)field_name, -1) != NULL) { if (p_verbose > 0) { verbose_enter(); - smsg((char_u *)_("Duplicate field name: %s"), field_name); + smsg(_("Duplicate field name: %s"), field_name); verbose_leave(); } return FAIL; diff --git a/src/nvim/undo.c b/src/nvim/undo.c index ef1ac60599..329af8acdd 100644 --- a/src/nvim/undo.c +++ b/src/nvim/undo.c @@ -159,12 +159,12 @@ static void u_check_tree(u_header_T *uhp, /* Check pointers back are correct. */ if (uhp->uh_next.ptr != exp_uh_next) { 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); } if (uhp->uh_alt_prev.ptr != exp_uh_alt_prev) { 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); } @@ -198,7 +198,7 @@ static void u_check(int newhead_may_be_NULL) { EMSGN("b_u_curhead invalid: 0x%x", curbuf->b_u_curhead); if (header_count != curbuf->b_u_numhead) { 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); } } @@ -1013,8 +1013,7 @@ void u_write_undo(char_u *name, int forceit, buf_T *buf, char_u *hash) if (file_name == NULL) { if (p_verbose > 0) { verbose_enter(); - smsg((char_u *) - _("Cannot write undo file in any directory in 'undodir'")); + smsg(_("Cannot write undo file in any directory in 'undodir'")); verbose_leave(); } 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) verbose_enter(); - smsg((char_u *) - _("Will not overwrite with undo file, cannot read: %s"), - file_name); + smsg(_("Will not overwrite with undo file, cannot read: %s"), + file_name); if (name == NULL) 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) verbose_enter(); - smsg((char_u *) - _("Will not overwrite, this is not an undo file: %s"), - file_name); + smsg(_("Will not overwrite, this is not an undo file: %s"), + file_name); if (name == NULL) 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); if (p_verbose > 0) { verbose_enter(); - smsg((char_u *)_("Writing undo file: %s"), file_name); + smsg(_("Writing undo file: %s"), file_name); 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()) { if (p_verbose > 0) { verbose_enter(); - smsg((char_u *)_("Not reading undo file, owner differs: %s"), - file_name); + smsg(_("Not reading undo file, owner differs: %s"), + file_name); verbose_leave(); } return; @@ -1249,7 +1246,7 @@ void u_read_undo(char_u *name, char_u *hash, char_u *orig_name) if (p_verbose > 0) { verbose_enter(); - smsg((char_u *)_("Reading undo file: %s"), file_name); + smsg(_("Reading undo file: %s"), file_name); verbose_leave(); } @@ -1483,7 +1480,7 @@ void u_read_undo(char_u *name, char_u *hash, char_u *orig_name) #endif if (name != NULL) { - smsg((char_u *)_("Finished reading undo file %s"), file_name); + smsg(_("Finished reading undo file %s"), file_name); } 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, _(msgstr), did_undo ? _("before") : _("after"), |