diff options
author | dundargoc <33953936+dundargoc@users.noreply.github.com> | 2023-01-17 14:17:40 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-17 21:17:40 +0800 |
commit | 0344bfad0fc87d2e256ea2b80de7abd069ba1dd2 (patch) | |
tree | e42d0318ed1e684bbb468661d8a1fbfe82e819ee /src/nvim/cmdhist.c | |
parent | 99186508d9a1b7536441112f9bbe48690592b5d7 (diff) | |
download | rneovim-0344bfad0fc87d2e256ea2b80de7abd069ba1dd2.tar.gz rneovim-0344bfad0fc87d2e256ea2b80de7abd069ba1dd2.tar.bz2 rneovim-0344bfad0fc87d2e256ea2b80de7abd069ba1dd2.zip |
refactor: replace char_u with char 22 (#21786)
Work on https://github.com/neovim/neovim/issues/459
Diffstat (limited to 'src/nvim/cmdhist.c')
-rw-r--r-- | src/nvim/cmdhist.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/nvim/cmdhist.c b/src/nvim/cmdhist.c index d12ac87bbb..2df82d9355 100644 --- a/src/nvim/cmdhist.c +++ b/src/nvim/cmdhist.c @@ -280,7 +280,7 @@ static HistoryType get_histtype(const char *const name, const size_t len, const } } - if (vim_strchr(":=@>?/", name[0]) != NULL && len == 1) { + if (vim_strchr(":=@>?/", (uint8_t)name[0]) != NULL && len == 1) { return hist_char2type(name[0]); } @@ -437,7 +437,7 @@ int clr_history(const int histype) /// Remove all entries matching {str} from a history. /// /// @param histype may be one of the HIST_ values. -static int del_history_entry(int histype, char_u *str) +static int del_history_entry(int histype, char *str) { if (hislen == 0 || histype < 0 || histype >= HIST_COUNT || *str == NUL || hisidx[histype] < 0) { @@ -446,7 +446,7 @@ static int del_history_entry(int histype, char_u *str) const int idx = hisidx[histype]; regmatch_T regmatch; - regmatch.regprog = vim_regcomp((char *)str, RE_MAGIC + RE_STRING); + regmatch.regprog = vim_regcomp(str, RE_MAGIC + RE_STRING); if (regmatch.regprog == NULL) { return false; } @@ -560,7 +560,7 @@ void f_histdel(typval_T *argvars, typval_T *rettv, EvalFuncData fptr) // string given: remove all matching entries char buf[NUMBUFLEN]; n = del_history_entry(get_histtype(str, strlen(str), false), - (char_u *)tv_get_string_buf(&argvars[1], buf)); + (char *)tv_get_string_buf(&argvars[1], buf)); } rettv->vval.v_number = n; } @@ -611,7 +611,7 @@ void ex_history(exarg_T *eap) int idx; int i, j, k; char *end; - char_u *arg = (char_u *)eap->arg; + char *arg = eap->arg; if (hislen == 0) { msg(_("'history' option is zero")); @@ -619,12 +619,12 @@ void ex_history(exarg_T *eap) } if (!(ascii_isdigit(*arg) || *arg == '-' || *arg == ',')) { - end = (char *)arg; + end = arg; while (ASCII_ISALPHA(*end) - || vim_strchr(":=@>/?", *end) != NULL) { + || vim_strchr(":=@>/?", (uint8_t)(*end)) != NULL) { end++; } - histype1 = get_histtype((const char *)arg, (size_t)(end - (char *)arg), false); + histype1 = get_histtype(arg, (size_t)(end - arg), false); if (histype1 == HIST_INVALID) { if (STRNICMP(arg, "all", end - (char *)arg) == 0) { histype1 = 0; @@ -637,7 +637,7 @@ void ex_history(exarg_T *eap) histype2 = histype1; } } else { - end = (char *)arg; + end = arg; } if (!get_list_range(&end, &hisidx1, &hisidx2) || *end != NUL) { semsg(_(e_trailing_arg), end); |