mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -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:
@@ -695,7 +695,7 @@ perl_runtime_link_init(char *libname, int verbose)
|
||||
if ((hPerlLib = load_dll(libname)) == NULL)
|
||||
{
|
||||
if (verbose)
|
||||
EMSG2(_("E370: Could not load library %s"), libname);
|
||||
semsg(_("E370: Could not load library %s"), libname);
|
||||
return FAIL;
|
||||
}
|
||||
for (i = 0; perl_funcname_table[i].ptr; ++i)
|
||||
@@ -706,7 +706,7 @@ perl_runtime_link_init(char *libname, int verbose)
|
||||
close_dll(hPerlLib);
|
||||
hPerlLib = NULL;
|
||||
if (verbose)
|
||||
EMSG2(_(e_loadfunc), perl_funcname_table[i].name);
|
||||
semsg((const char *)_(e_loadfunc), perl_funcname_table[i].name);
|
||||
return FAIL;
|
||||
}
|
||||
}
|
||||
@@ -998,7 +998,7 @@ ex_perl(exarg_T *eap)
|
||||
#ifdef DYNAMIC_PERL
|
||||
if (!perl_enabled(TRUE))
|
||||
{
|
||||
EMSG(_(e_noperl));
|
||||
emsg(_(e_noperl));
|
||||
vim_free(script);
|
||||
return;
|
||||
}
|
||||
@@ -1025,7 +1025,7 @@ ex_perl(exarg_T *eap)
|
||||
safe = perl_get_sv("VIM::safe", FALSE);
|
||||
# ifndef MAKE_TEST /* avoid a warning for unreachable code */
|
||||
if (safe == NULL || !SvTRUE(safe))
|
||||
EMSG(_("E299: Perl evaluation forbidden in sandbox without the Safe module"));
|
||||
emsg(_("E299: Perl evaluation forbidden in sandbox without the Safe module"));
|
||||
else
|
||||
# endif
|
||||
{
|
||||
@@ -1235,7 +1235,7 @@ perl_to_vim(SV *sv, typval_T *rettv)
|
||||
key = hv_iterkey(entry, &key_len);
|
||||
|
||||
if (!key || !key_len || strlen(key) < (size_t)key_len) {
|
||||
EMSG2("Malformed key Dictionary '%s'", key && *key ? key : "(empty)");
|
||||
semsg("Malformed key Dictionary '%s'", key && *key ? key : "(empty)");
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1286,7 +1286,7 @@ do_perleval(char_u *str, typval_T *rettv)
|
||||
#ifdef DYNAMIC_PERL
|
||||
if (!perl_enabled(TRUE))
|
||||
{
|
||||
EMSG(_(e_noperl));
|
||||
emsg(_(e_noperl));
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
@@ -1304,7 +1304,7 @@ do_perleval(char_u *str, typval_T *rettv)
|
||||
safe = get_sv("VIM::safe", FALSE);
|
||||
# ifndef MAKE_TEST /* avoid a warning for unreachable code */
|
||||
if (safe == NULL || !SvTRUE(safe))
|
||||
EMSG(_("E299: Perl evaluation forbidden in sandbox without the Safe module"));
|
||||
emsg(_("E299: Perl evaluation forbidden in sandbox without the Safe module"));
|
||||
else
|
||||
# endif
|
||||
{
|
||||
@@ -1356,7 +1356,7 @@ ex_perldo(exarg_T *eap)
|
||||
#ifdef DYNAMIC_PERL
|
||||
if (!perl_enabled(TRUE))
|
||||
{
|
||||
EMSG(_(e_noperl));
|
||||
emsg(_(e_noperl));
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user