diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-01-13 23:38:42 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-01-13 23:38:42 +0100 |
commit | f9e3e09fdc93be9f0d47afbc6c7df1188c2a5a0d (patch) | |
tree | a6b07005c19279a4f5d01be14f14861c2657fa95 /src/dict.c | |
parent | 05500ece6282407f9f7227aaf564e24147326863 (diff) |
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/dict.c')
-rw-r--r-- | src/dict.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/dict.c b/src/dict.c index 9b85900278..91c6e55724 100644 --- a/src/dict.c +++ b/src/dict.c @@ -644,7 +644,7 @@ dict_get_tv(char_u **arg, typval_T *rettv, int evaluate) goto failret; if (**arg != ':') { - EMSG2(_("E720: Missing colon in Dictionary: %s"), *arg); + semsg(_("E720: Missing colon in Dictionary: %s"), *arg); clear_tv(&tvkey); goto failret; } @@ -671,7 +671,7 @@ dict_get_tv(char_u **arg, typval_T *rettv, int evaluate) item = dict_find(d, key, -1); if (item != NULL) { - EMSG2(_("E721: Duplicate key in Dictionary: \"%s\""), key); + semsg(_("E721: Duplicate key in Dictionary: \"%s\""), key); clear_tv(&tvkey); clear_tv(&tv); goto failret; @@ -691,7 +691,7 @@ dict_get_tv(char_u **arg, typval_T *rettv, int evaluate) break; if (**arg != ',') { - EMSG2(_("E722: Missing comma in Dictionary: %s"), *arg); + semsg(_("E722: Missing comma in Dictionary: %s"), *arg); goto failret; } *arg = skipwhite(*arg + 1); @@ -699,7 +699,7 @@ dict_get_tv(char_u **arg, typval_T *rettv, int evaluate) if (**arg != '}') { - EMSG2(_("E723: Missing end of Dictionary '}': %s"), *arg); + semsg(_("E723: Missing end of Dictionary '}': %s"), *arg); failret: if (evaluate) dict_free(d); @@ -753,7 +753,7 @@ dict_extend(dict_T *d1, dict_T *d2, char_u *action) } else if (*action == 'e') { - EMSG2(_("E737: Key already exists: %s"), hi2->hi_key); + semsg(_("E737: Key already exists: %s"), hi2->hi_key); break; } else if (*action == 'f' && HI2DI(hi2) != di1) @@ -835,7 +835,7 @@ dict_list(typval_T *argvars, typval_T *rettv, int what) if (argvars[0].v_type != VAR_DICT) { - EMSG(_(e_dictreq)); + emsg(_(e_dictreq)); return; } if ((d = argvars[0].vval.v_dict) == NULL) |