0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00

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.
This commit is contained in:
Bram Moolenaar
2019-01-13 23:38:42 +01:00
parent 05500ece62
commit f9e3e09fdc
95 changed files with 1963 additions and 2018 deletions

View File

@@ -215,7 +215,7 @@ gui_do_fork(void)
pid = fork();
if (pid < 0) /* Fork error */
{
EMSG(_("E851: Failed to create a new process for the GUI"));
emsg(_("E851: Failed to create a new process for the GUI"));
return;
}
else if (pid > 0) /* Parent */
@@ -239,7 +239,7 @@ gui_do_fork(void)
# else
waitpid(pid, &exit_status, 0);
# endif
EMSG(_("E852: The child process failed to start the GUI"));
emsg(_("E852: The child process failed to start the GUI"));
return;
}
else if (status == GUI_CHILD_IO_ERROR)
@@ -362,7 +362,7 @@ gui_init_check(void)
if (result != MAYBE)
{
if (result == FAIL)
EMSG(_("E229: Cannot start the GUI"));
emsg(_("E229: Cannot start the GUI"));
return result;
}
@@ -515,7 +515,7 @@ gui_init(void)
if (STRCMP(use_gvimrc, "NONE") != 0
&& STRCMP(use_gvimrc, "NORC") != 0
&& do_source(use_gvimrc, FALSE, DOSO_NONE) != OK)
EMSG2(_("E230: Cannot read from \"%s\""), use_gvimrc);
semsg(_("E230: Cannot read from \"%s\""), use_gvimrc);
}
else
{
@@ -649,12 +649,12 @@ gui_init(void)
gui_init_font(*p_guifont == NUL ? hl_get_font_name()
: p_guifont, FALSE) == FAIL)
{
EMSG(_("E665: Cannot start GUI, no valid font found"));
emsg(_("E665: Cannot start GUI, no valid font found"));
goto error2;
}
#ifdef FEAT_MBYTE
if (gui_get_wide_font() == FAIL)
EMSG(_("E231: 'guifontwide' invalid"));
emsg(_("E231: 'guifontwide' invalid"));
#endif
gui.num_cols = Columns;
@@ -769,7 +769,7 @@ gui_init(void)
#if defined(FEAT_XIM) && defined(FEAT_GUI_GTK)
if (!im_xim_isvalid_imactivate())
EMSG(_("E599: Value of 'imactivatekey' is invalid"));
emsg(_("E599: Value of 'imactivatekey' is invalid"));
#endif
/* When 'cmdheight' was set during startup it may not have taken
* effect yet. */
@@ -4785,7 +4785,7 @@ gui_get_color(char_u *name)
&& gui.in_use
#endif
)
EMSG2(_("E254: Cannot allocate color %s"), name);
semsg(_("E254: Cannot allocate color %s"), name);
return t;
}