summaryrefslogtreecommitdiff
path: root/src/vim.h
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/vim.h
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/vim.h')
-rw-r--r--src/vim.h12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/vim.h b/src/vim.h
index 7f29b613a..7e5e475f5 100644
--- a/src/vim.h
+++ b/src/vim.h
@@ -1625,14 +1625,6 @@ typedef UINT32_TYPEDEF UINT32_T;
#define MSG(s) msg((char_u *)(s))
#define MSG_ATTR(s, attr) msg_attr((char_u *)(s), (attr))
-#define EMSG(s) emsg((char_u *)(s))
-#define EMSG2(s, p) emsg2((char_u *)(s), (char_u *)(p))
-#define EMSG3(s, p, q) emsg3((char_u *)(s), (char_u *)(p), (char_u *)(q))
-#define EMSGN(s, n) emsgn((char_u *)(s), (long)(n))
-#define EMSGU(s, n) emsgu((char_u *)(s), (long_u)(n))
-#define IEMSG(s) iemsg((char_u *)(s))
-#define IEMSG2(s, p) iemsg2((char_u *)(s), (char_u *)(p))
-#define IEMSGN(s, n) iemsgn((char_u *)(s), (long)(n))
#define OUT_STR(s) out_str((char_u *)(s))
#define OUT_STR_NF(s) out_str_nf((char_u *)(s))
#define MSG_PUTS(s) msg_puts((char_u *)(s))
@@ -1676,10 +1668,10 @@ typedef UINT32_TYPEDEF UINT32_T;
# define GUI_GET_COLOR GUI_FUNCTION(get_color)
#endif
-/* Prefer using emsg3(), because perror() may send the output to the wrong
+/* Prefer using emsgf(), because perror() may send the output to the wrong
* destination and mess up the screen. */
#ifdef HAVE_STRERROR
-# define PERROR(msg) (void)emsg3((char_u *)"%s: %s", (char_u *)msg, (char_u *)strerror(errno))
+# define PERROR(msg) (void)semsg("%s: %s", (char *)msg, strerror(errno))
#else
# define PERROR(msg) do_perror(msg)
#endif