summaryrefslogtreecommitdiff
path: root/src/os_mswin.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-01-13 23:38:42 +0100
committerBram Moolenaar <Bram@vim.org>2019-01-13 23:38:42 +0100
commitf9e3e09fdc93be9f0d47afbc6c7df1188c2a5a0d (patch)
treea6b07005c19279a4f5d01be14f14861c2657fa95 /src/os_mswin.c
parent05500ece6282407f9f7227aaf564e24147326863 (diff)
downloadvim-git-f9e3e09fdc93be9f0d47afbc6c7df1188c2a5a0d.tar.gz
patch 8.1.0743: giving error messages is not flexiblev8.1.0743
Problem: Giving error messages is not flexible. Solution: Add semsg(). Change argument from "char_u *" to "char *", also for msg() and get rid of most MSG macros. (Ozaki Kiichi, closes #3302) Also make emsg() accept a "char *" argument. Get rid of an enormous number of type casts.
Diffstat (limited to 'src/os_mswin.c')
-rw-r--r--src/os_mswin.c29
1 files changed, 10 insertions, 19 deletions
diff --git a/src/os_mswin.c b/src/os_mswin.c
index 3d74bdc7a..6310f47bc 100644
--- a/src/os_mswin.c
+++ b/src/os_mswin.c
@@ -776,7 +776,7 @@ mch_chdir(char *path)
if (p_verbose >= 5)
{
verbose_enter();
- smsg((char_u *)"chdir(%s)", path);
+ smsg("chdir(%s)", path);
verbose_leave();
}
if (isalpha(path[0]) && path[1] == ':') /* has a drive name */
@@ -841,7 +841,7 @@ mch_check_messages(void)
int
mch_screenmode(char_u *arg UNUSED)
{
- EMSG(_(e_screenmode));
+ emsg(_(e_screenmode));
return FAIL;
}
@@ -1004,7 +1004,7 @@ mch_libcall(
if (!fRunTimeLinkSuccess)
{
- EMSG2(_(e_libcall), funcname);
+ semsg(_(e_libcall), funcname);
return FAIL;
}
@@ -1524,7 +1524,7 @@ mch_print_init(prt_settings_T *psettings, char_u *jobname, int forceit)
if (prt_dlg.hDC == NULL)
{
- EMSG(_("E237: Printer selection failed"));
+ emsg(_("E237: Printer selection failed"));
mch_print_cleanup();
return FALSE;
}
@@ -1601,7 +1601,7 @@ mch_print_init(prt_settings_T *psettings, char_u *jobname, int forceit)
vim_memset(&fLogFont, 0, sizeof(fLogFont));
if (get_logfont(&fLogFont, p_pfn, prt_dlg.hDC, TRUE) == FAIL)
{
- EMSG2(_("E613: Unknown printer font: %s"), p_pfn);
+ semsg(_("E613: Unknown printer font: %s"), p_pfn);
mch_print_cleanup();
return FALSE;
}
@@ -1662,7 +1662,7 @@ init_fail_dlg:
FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL, err, 0, (LPTSTR)(&buf), 0, NULL);
- EMSG2(_("E238: Print error: %s"),
+ semsg(_("E238: Print error: %s"),
buf == NULL ? (char_u *)_("Unknown") : buf);
LocalFree((LPVOID)(buf));
}
@@ -2504,7 +2504,7 @@ serverSendToVim(
if (target == 0)
{
if (!silent)
- EMSG2(_(e_noserver), name);
+ semsg(_(e_noserver), name);
return -1;
}
@@ -3070,9 +3070,7 @@ get_logfont(
}
if (cp->name == NULL && verbose)
{
- vim_snprintf((char *)IObuff, IOSIZE,
- _("E244: Illegal charset name \"%s\" in font name \"%s\""), p, name);
- EMSG(IObuff);
+ semsg(_("E244: Illegal charset name \"%s\" in font name \"%s\""), p, name);
break;
}
break;
@@ -3090,21 +3088,14 @@ get_logfont(
}
if (qp->name == NULL && verbose)
{
- vim_snprintf((char *)IObuff, IOSIZE,
- _("E244: Illegal quality name \"%s\" in font name \"%s\""), p, name);
- EMSG(IObuff);
+ semsg(_("E244: Illegal quality name \"%s\" in font name \"%s\""), p, name);
break;
}
break;
}
default:
if (verbose)
- {
- vim_snprintf((char *)IObuff, IOSIZE,
- _("E245: Illegal char '%c' in font name \"%s\""),
- p[-1], name);
- EMSG(IObuff);
- }
+ semsg(_("E245: Illegal char '%c' in font name \"%s\""), p[-1], name);
goto theend;
}
while (*p == ':')