comparison src/list.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 fc58fee685e2
comparison
equal deleted inserted replaced
15469:bc9b5261ed01 15470:55ccc2d353bd
415 listitem_T *li; 415 listitem_T *li;
416 416
417 li = list_find(l, idx - 1); 417 li = list_find(l, idx - 1);
418 if (li == NULL) 418 if (li == NULL)
419 { 419 {
420 EMSGN(_(e_listidx), idx); 420 semsg(_(e_listidx), idx);
421 return NULL; 421 return NULL;
422 } 422 }
423 return tv_get_string(&li->li_tv); 423 return tv_get_string(&li->li_tv);
424 } 424 }
425 425
912 912
913 if (**arg == ']') 913 if (**arg == ']')
914 break; 914 break;
915 if (**arg != ',') 915 if (**arg != ',')
916 { 916 {
917 EMSG2(_("E696: Missing comma in List: %s"), *arg); 917 semsg(_("E696: Missing comma in List: %s"), *arg);
918 goto failret; 918 goto failret;
919 } 919 }
920 *arg = skipwhite(*arg + 1); 920 *arg = skipwhite(*arg + 1);
921 } 921 }
922 922
923 if (**arg != ']') 923 if (**arg != ']')
924 { 924 {
925 EMSG2(_("E697: Missing end of List ']': %s"), *arg); 925 semsg(_("E697: Missing end of List ']': %s"), *arg);
926 failret: 926 failret:
927 if (evaluate) 927 if (evaluate)
928 list_free(l); 928 list_free(l);
929 return FAIL; 929 return FAIL;
930 } 930 }
967 ret = FAIL; 967 ret = FAIL;
968 break; 968 break;
969 } 969 }
970 if (ret == FAIL) 970 if (ret == FAIL)
971 { 971 {
972 EMSG(_(e_write)); 972 emsg(_(e_write));
973 break; 973 break;
974 } 974 }
975 } 975 }
976 return ret; 976 return ret;
977 } 977 }