patch 8.1.0743: giving error messages is not flexible
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.
diff --git a/src/gui_w32.c b/src/gui_w32.c
index ad10e97..ab60fb5 100644
--- a/src/gui_w32.c
+++ b/src/gui_w32.c
@@ -1582,7 +1582,7 @@
if (get_logfont(&lf, name, NULL, giveErrorIfMissing) == OK)
font = get_font_handle(&lf);
if (font == NOFONT && giveErrorIfMissing)
- EMSG2(_(e_font), name);
+ semsg(_(e_font), name);
return font;
}
@@ -5235,7 +5235,7 @@
EnumWindows(FindWindowTitle, (LPARAM)title);
if (vim_parent_hwnd == NULL)
{
- EMSG2(_("E671: Cannot find window title \"%s\""), title);
+ semsg(_("E671: Cannot find window title \"%s\""), title);
mch_exit(2);
}
}
@@ -5246,7 +5246,7 @@
{
char buf[IOSIZE];
- /* Can't use EMSG() here, we have not finished initialisation yet. */
+ /* Can't use emsg() here, we have not finished initialisation yet. */
vim_snprintf(buf, IOSIZE,
_("E243: Argument not supported: \"-%s\"; Use the OLE version."),
arg);
@@ -5468,7 +5468,7 @@
#endif
if (s_hwnd == NULL)
{
- EMSG(_("E672: Unable to open window inside MDI application"));
+ emsg(_("E672: Unable to open window inside MDI application"));
mch_exit(2);
}
}
@@ -8671,7 +8671,7 @@
{
if (sign.hImage)
close_signicon_image(&sign);
- EMSG(_(e_signdata));
+ emsg(_(e_signdata));
}
return (void *)psign;
@@ -9025,7 +9025,7 @@
if (mesg != NULL && mesgCB != NULL)
{
- IEMSG(_("E232: Cannot create BalloonEval with both message and callback"));
+ iemsg(_("E232: Cannot create BalloonEval with both message and callback"));
return NULL;
}