Mercurial > vim
comparison src/os_win32.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 | de63593896b3 |
children | ba876ced4f1f |
comparison
equal
deleted
inserted
replaced
15469:bc9b5261ed01 | 15470:55ccc2d353bd |
---|---|
631 if (!hLibintlDLL) | 631 if (!hLibintlDLL) |
632 { | 632 { |
633 if (p_verbose > 0) | 633 if (p_verbose > 0) |
634 { | 634 { |
635 verbose_enter(); | 635 verbose_enter(); |
636 EMSG2(_(e_loadlib), GETTEXT_DLL); | 636 semsg(_(e_loadlib), GETTEXT_DLL); |
637 verbose_leave(); | 637 verbose_leave(); |
638 } | 638 } |
639 return 0; | 639 return 0; |
640 } | 640 } |
641 for (i = 0; libintl_entry[i].name != NULL | 641 for (i = 0; libintl_entry[i].name != NULL |
646 { | 646 { |
647 dyn_libintl_end(); | 647 dyn_libintl_end(); |
648 if (p_verbose > 0) | 648 if (p_verbose > 0) |
649 { | 649 { |
650 verbose_enter(); | 650 verbose_enter(); |
651 EMSG2(_(e_loadfunc), libintl_entry[i].name); | 651 semsg(_(e_loadfunc), libintl_entry[i].name); |
652 verbose_leave(); | 652 verbose_leave(); |
653 } | 653 } |
654 return 0; | 654 return 0; |
655 } | 655 } |
656 } | 656 } |
5180 x = 0; | 5180 x = 0; |
5181 else | 5181 else |
5182 { | 5182 { |
5183 x = -1; | 5183 x = -1; |
5184 #ifdef FEAT_GUI_W32 | 5184 #ifdef FEAT_GUI_W32 |
5185 EMSG(_("E371: Command not found")); | 5185 emsg(_("E371: Command not found")); |
5186 #endif | 5186 #endif |
5187 } | 5187 } |
5188 | 5188 |
5189 if (newcmd != cmdbase) | 5189 if (newcmd != cmdbase) |
5190 vim_free(newcmd); | 5190 vim_free(newcmd); |
5258 #if defined(FEAT_GUI_W32) | 5258 #if defined(FEAT_GUI_W32) |
5259 && ((options & SHELL_DOOUT) || s_dont_use_vimrun || !p_stmp) | 5259 && ((options & SHELL_DOOUT) || s_dont_use_vimrun || !p_stmp) |
5260 #endif | 5260 #endif |
5261 ) | 5261 ) |
5262 { | 5262 { |
5263 smsg((char_u *)_("shell returned %d"), x); | 5263 smsg(_("shell returned %d"), x); |
5264 msg_putchar('\n'); | 5264 msg_putchar('\n'); |
5265 } | 5265 } |
5266 #ifdef FEAT_TITLE | 5266 #ifdef FEAT_TITLE |
5267 resettitle(); | 5267 resettitle(); |
5268 #endif | 5268 #endif |
5487 ifd[0] = job_io_file_open(fname, GENERIC_READ, | 5487 ifd[0] = job_io_file_open(fname, GENERIC_READ, |
5488 FILE_SHARE_READ | FILE_SHARE_WRITE, | 5488 FILE_SHARE_READ | FILE_SHARE_WRITE, |
5489 &saAttr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL); | 5489 &saAttr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL); |
5490 if (ifd[0] == INVALID_HANDLE_VALUE) | 5490 if (ifd[0] == INVALID_HANDLE_VALUE) |
5491 { | 5491 { |
5492 EMSG2(_(e_notopen), fname); | 5492 semsg(_(e_notopen), fname); |
5493 goto failed; | 5493 goto failed; |
5494 } | 5494 } |
5495 } | 5495 } |
5496 else if (!use_null_for_in && | 5496 else if (!use_null_for_in && |
5497 (!CreatePipe(&ifd[0], &ifd[1], &saAttr, 0) | 5497 (!CreatePipe(&ifd[0], &ifd[1], &saAttr, 0) |
5505 ofd[1] = job_io_file_open(fname, GENERIC_WRITE, | 5505 ofd[1] = job_io_file_open(fname, GENERIC_WRITE, |
5506 FILE_SHARE_READ | FILE_SHARE_WRITE, | 5506 FILE_SHARE_READ | FILE_SHARE_WRITE, |
5507 &saAttr, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL); | 5507 &saAttr, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL); |
5508 if (ofd[1] == INVALID_HANDLE_VALUE) | 5508 if (ofd[1] == INVALID_HANDLE_VALUE) |
5509 { | 5509 { |
5510 EMSG2(_(e_notopen), fname); | 5510 semsg(_(e_notopen), fname); |
5511 goto failed; | 5511 goto failed; |
5512 } | 5512 } |
5513 } | 5513 } |
5514 else if (!use_null_for_out && | 5514 else if (!use_null_for_out && |
5515 (!CreatePipe(&ofd[0], &ofd[1], &saAttr, 0) | 5515 (!CreatePipe(&ofd[0], &ofd[1], &saAttr, 0) |
5523 efd[1] = job_io_file_open(fname, GENERIC_WRITE, | 5523 efd[1] = job_io_file_open(fname, GENERIC_WRITE, |
5524 FILE_SHARE_READ | FILE_SHARE_WRITE, | 5524 FILE_SHARE_READ | FILE_SHARE_WRITE, |
5525 &saAttr, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL); | 5525 &saAttr, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL); |
5526 if (efd[1] == INVALID_HANDLE_VALUE) | 5526 if (efd[1] == INVALID_HANDLE_VALUE) |
5527 { | 5527 { |
5528 EMSG2(_(e_notopen), fname); | 5528 semsg(_(e_notopen), fname); |
5529 goto failed; | 5529 goto failed; |
5530 } | 5530 } |
5531 } | 5531 } |
5532 else if (!use_out_for_err && !use_null_for_err && | 5532 else if (!use_out_for_err && !use_null_for_err && |
5533 (!CreatePipe(&efd[0], &efd[1], &saAttr, 0) | 5533 (!CreatePipe(&efd[0], &efd[1], &saAttr, 0) |