diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-01-13 23:38:42 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-01-13 23:38:42 +0100 |
commit | f9e3e09fdc93be9f0d47afbc6c7df1188c2a5a0d (patch) | |
tree | a6b07005c19279a4f5d01be14f14861c2657fa95 /src/if_perl.xs | |
parent | 05500ece6282407f9f7227aaf564e24147326863 (diff) | |
download | vim-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/if_perl.xs')
-rw-r--r-- | src/if_perl.xs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/if_perl.xs b/src/if_perl.xs index 251daf424..09a7fba4c 100644 --- a/src/if_perl.xs +++ b/src/if_perl.xs @@ -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 |