summaryrefslogtreecommitdiff
path: root/src/term.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/term.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/term.c')
-rw-r--r--src/term.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/term.c b/src/term.c
index 131e31bc7..cccc94cf8 100644
--- a/src/term.c
+++ b/src/term.c
@@ -92,7 +92,7 @@ static int term_is_builtin(char_u *name);
static int term_7to8bit(char_u *p);
#ifdef HAVE_TGETENT
-static char_u *tgetent_error(char_u *, char_u *);
+static char *tgetent_error(char_u *, char_u *);
/*
* Here is our own prototype for tgetstr(), any prototypes from the include
@@ -1357,7 +1357,7 @@ termgui_get_color(char_u *name)
t = termgui_mch_get_color(name);
if (t == INVALCOLOR)
- EMSG2(_("E254: Cannot allocate color %s"), name);
+ semsg(_("E254: Cannot allocate color %s"), name);
return t;
}
@@ -1696,14 +1696,14 @@ get_term_entries(int *height, int *width)
#endif
static void
-report_term_error(char_u *error_msg, char_u *term)
+report_term_error(char *error_msg, char_u *term)
{
struct builtin_term *termp;
mch_errmsg("\r\n");
if (error_msg != NULL)
{
- mch_errmsg((char *)error_msg);
+ mch_errmsg(error_msg);
mch_errmsg("\r\n");
}
mch_errmsg("'");
@@ -1756,7 +1756,7 @@ set_termname(char_u *term)
int termcap_cleared = FALSE;
#endif
int width = 0, height = 0;
- char_u *error_msg = NULL;
+ char *error_msg = NULL;
char_u *bs_p, *del_p;
/* In silect mode (ex -s) we don't use the 'term' option. */
@@ -2191,7 +2191,7 @@ del_mouse_termcode(
* Call tgetent()
* Return error message if it fails, NULL if it's OK.
*/
- static char_u *
+ static char *
tgetent_error(char_u *tbuf, char_u *term)
{
int i;
@@ -2210,13 +2210,13 @@ tgetent_error(char_u *tbuf, char_u *term)
if (i < 0)
# ifdef TGETENT_ZERO_ERR
- return (char_u *)_("E557: Cannot open termcap file");
+ return _("E557: Cannot open termcap file");
if (i == 0)
# endif
#ifdef TERMINFO
- return (char_u *)_("E558: Terminal entry not found in terminfo");
+ return _("E558: Terminal entry not found in terminfo");
#else
- return (char_u *)_("E559: Terminal entry not found in termcap");
+ return _("E559: Terminal entry not found in termcap");
#endif
}
return NULL;
@@ -2282,7 +2282,7 @@ add_termcap_entry(char_u *name, int force)
char_u tbuf[TBUFSZ];
char_u tstrbuf[TBUFSZ];
char_u *tp = tstrbuf;
- char_u *error_msg = NULL;
+ char *error_msg = NULL;
#endif
/*
@@ -2369,10 +2369,10 @@ add_termcap_entry(char_u *name, int force)
{
#ifdef HAVE_TGETENT
if (error_msg != NULL)
- EMSG(error_msg);
+ emsg(error_msg);
else
#endif
- EMSG2(_("E436: No \"%s\" entry in termcap"), name);
+ semsg(_("E436: No \"%s\" entry in termcap"), name);
}
return FAIL;
}
@@ -3055,7 +3055,7 @@ ttest(int pairs)
* MUST have "cm": cursor motion.
*/
if (*T_CM == NUL)
- EMSG(_("E437: terminal capability \"cm\" required"));
+ emsg(_("E437: terminal capability \"cm\" required"));
/*
* if "cs" defined, use a scroll region, it's faster.
@@ -6153,7 +6153,7 @@ replace_termcodes(
if (STRNICMP(src, "<SID>", 5) == 0)
{
if (current_sctx.sc_sid <= 0)
- EMSG(_(e_usingsid));
+ emsg(_(e_usingsid));
else
{
src += 5;