comparison src/gui_w32.c @ 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 e3dfd25b0679
children dd725a8ab112
comparison
equal deleted inserted replaced
15469:bc9b5261ed01 15470:55ccc2d353bd
1580 GuiFont font = NOFONT; 1580 GuiFont font = NOFONT;
1581 1581
1582 if (get_logfont(&lf, name, NULL, giveErrorIfMissing) == OK) 1582 if (get_logfont(&lf, name, NULL, giveErrorIfMissing) == OK)
1583 font = get_font_handle(&lf); 1583 font = get_font_handle(&lf);
1584 if (font == NOFONT && giveErrorIfMissing) 1584 if (font == NOFONT && giveErrorIfMissing)
1585 EMSG2(_(e_font), name); 1585 semsg(_(e_font), name);
1586 return font; 1586 return font;
1587 } 1587 }
1588 1588
1589 #if defined(FEAT_EVAL) || defined(PROTO) 1589 #if defined(FEAT_EVAL) || defined(PROTO)
1590 /* 1590 /*
5233 gui_mch_set_parent(char *title) 5233 gui_mch_set_parent(char *title)
5234 { 5234 {
5235 EnumWindows(FindWindowTitle, (LPARAM)title); 5235 EnumWindows(FindWindowTitle, (LPARAM)title);
5236 if (vim_parent_hwnd == NULL) 5236 if (vim_parent_hwnd == NULL)
5237 { 5237 {
5238 EMSG2(_("E671: Cannot find window title \"%s\""), title); 5238 semsg(_("E671: Cannot find window title \"%s\""), title);
5239 mch_exit(2); 5239 mch_exit(2);
5240 } 5240 }
5241 } 5241 }
5242 5242
5243 #ifndef FEAT_OLE 5243 #ifndef FEAT_OLE
5244 static void 5244 static void
5245 ole_error(char *arg) 5245 ole_error(char *arg)
5246 { 5246 {
5247 char buf[IOSIZE]; 5247 char buf[IOSIZE];
5248 5248
5249 /* Can't use EMSG() here, we have not finished initialisation yet. */ 5249 /* Can't use emsg() here, we have not finished initialisation yet. */
5250 vim_snprintf(buf, IOSIZE, 5250 vim_snprintf(buf, IOSIZE,
5251 _("E243: Argument not supported: \"-%s\"; Use the OLE version."), 5251 _("E243: Argument not supported: \"-%s\"; Use the OLE version."),
5252 arg); 5252 arg);
5253 mch_errmsg(buf); 5253 mch_errmsg(buf);
5254 } 5254 }
5466 /* NOP */ 5466 /* NOP */
5467 } 5467 }
5468 #endif 5468 #endif
5469 if (s_hwnd == NULL) 5469 if (s_hwnd == NULL)
5470 { 5470 {
5471 EMSG(_("E672: Unable to open window inside MDI application")); 5471 emsg(_("E672: Unable to open window inside MDI application"));
5472 mch_exit(2); 5472 mch_exit(2);
5473 } 5473 }
5474 } 5474 }
5475 else 5475 else
5476 { 5476 {
8669 8669
8670 if (!psign) 8670 if (!psign)
8671 { 8671 {
8672 if (sign.hImage) 8672 if (sign.hImage)
8673 close_signicon_image(&sign); 8673 close_signicon_image(&sign);
8674 EMSG(_(e_signdata)); 8674 emsg(_(e_signdata));
8675 } 8675 }
8676 return (void *)psign; 8676 return (void *)psign;
8677 8677
8678 } 8678 }
8679 8679
9023 /* partially stolen from gui_beval.c */ 9023 /* partially stolen from gui_beval.c */
9024 BalloonEval *beval; 9024 BalloonEval *beval;
9025 9025
9026 if (mesg != NULL && mesgCB != NULL) 9026 if (mesg != NULL && mesgCB != NULL)
9027 { 9027 {
9028 IEMSG(_("E232: Cannot create BalloonEval with both message and callback")); 9028 iemsg(_("E232: Cannot create BalloonEval with both message and callback"));
9029 return NULL; 9029 return NULL;
9030 } 9030 }
9031 9031
9032 beval = (BalloonEval *)alloc_clear(sizeof(BalloonEval)); 9032 beval = (BalloonEval *)alloc_clear(sizeof(BalloonEval));
9033 if (beval != NULL) 9033 if (beval != NULL)