diff options
author | dundargoc <33953936+dundargoc@users.noreply.github.com> | 2023-01-19 15:25:56 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-19 22:25:56 +0800 |
commit | 4c531714ff24d82bf1a85decf0e0c63c5785e686 (patch) | |
tree | aa8497a87a1c248b932cb77ed1f735598299d316 /src/nvim/ex_docmd.c | |
parent | adfad50ac03030abf2533db9f56fa681af6cdc1f (diff) | |
download | rneovim-4c531714ff24d82bf1a85decf0e0c63c5785e686.tar.gz rneovim-4c531714ff24d82bf1a85decf0e0c63c5785e686.tar.bz2 rneovim-4c531714ff24d82bf1a85decf0e0c63c5785e686.zip |
refactor: replace char_u with char 25 (#21838)
refactor: replace char_u with char
Work on https://github.com/neovim/neovim/issues/459
Diffstat (limited to 'src/nvim/ex_docmd.c')
-rw-r--r-- | src/nvim/ex_docmd.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index 08d4065e98..eefb1ae1ce 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -3710,7 +3710,7 @@ char *replace_makeprg(exarg_T *eap, char *arg, char **cmdlinep) if ((eap->cmdidx == CMD_make || eap->cmdidx == CMD_lmake || isgrep) && !grep_internal(eap->cmdidx)) { const char *program = isgrep ? (*curbuf->b_p_gp == NUL ? p_gp : curbuf->b_p_gp) - : (*curbuf->b_p_mp == NUL ? (char *)p_mp : curbuf->b_p_mp); + : (*curbuf->b_p_mp == NUL ? p_mp : curbuf->b_p_mp); arg = skipwhite(arg); @@ -3767,8 +3767,8 @@ int expand_filename(exarg_T *eap, char **cmdlinep, char **errormsgp) // Try to find a match at this position. size_t srclen; int escaped; - char *repl = (char *)eval_vars(p, (char_u *)eap->arg, &srclen, &(eap->do_ecmd_lnum), - errormsgp, &escaped, true); + char *repl = eval_vars(p, eap->arg, &srclen, &(eap->do_ecmd_lnum), + errormsgp, &escaped, true); if (*errormsgp != NULL) { // error detected return FAIL; } @@ -3868,7 +3868,7 @@ int expand_filename(exarg_T *eap, char **cmdlinep, char **errormsgp) backslash_halve(eap->arg); } #else - backslash_halve((char_u *)eap->arg); + backslash_halve(eap->arg); #endif if (has_wildcards) { @@ -6725,8 +6725,8 @@ ssize_t find_cmdline_var(const char *src, size_t *usedlen) /// @return an allocated string if a valid match was found. /// Returns NULL if no match was found. "usedlen" then still contains the /// number of characters to skip. -char_u *eval_vars(char *src, const char_u *srcstart, size_t *usedlen, linenr_T *lnump, - char **errormsg, int *escaped, bool empty_is_error) +char *eval_vars(char *src, const char *srcstart, size_t *usedlen, linenr_T *lnump, char **errormsg, + int *escaped, bool empty_is_error) { char *result; char *resultbuf = NULL; @@ -6750,7 +6750,7 @@ char_u *eval_vars(char *src, const char_u *srcstart, size_t *usedlen, linenr_T * // Skip when preceded with a backslash "\%" and "\#". // Note: In "\\%" the % is also not recognized! - if ((char_u *)src > srcstart && src[-1] == '\\') { + if (src > srcstart && src[-1] == '\\') { *usedlen = 0; STRMOVE(src - 1, (char *)src); // remove backslash return NULL; @@ -6985,7 +6985,7 @@ char_u *eval_vars(char *src, const char_u *srcstart, size_t *usedlen, linenr_T * result = xstrnsave(result, resultlen); } xfree(resultbuf); - return (char_u *)result; + return result; } /// Expand the <sfile> string in "arg". @@ -7002,8 +7002,7 @@ char *expand_sfile(char *arg) // replace "<sfile>" with the sourced file name, and do ":" stuff size_t srclen; char *errormsg; - char *repl = (char *)eval_vars(p, (char_u *)result, &srclen, NULL, &errormsg, NULL, - true); + char *repl = eval_vars(p, result, &srclen, NULL, &errormsg, NULL, true); if (errormsg != NULL) { if (*errormsg) { emsg(errormsg); |