Mercurial > vim
diff src/vim.h @ 15470:55ccc2d353bd v8.1.0743
patch 8.1.0743: giving error messages is not flexible
commit https://github.com/vim/vim/commit/f9e3e09fdc93be9f0d47afbc6c7df1188c2a5a0d
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jan 13 23:38:42 2019 +0100
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.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 13 Jan 2019 23:45:08 +0100 |
parents | 1d2b5c016f17 |
children | 41fbbcea0f1b |
line wrap: on
line diff
--- 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