diff options
author | Dundar Goc <gocdundar@gmail.com> | 2022-07-19 15:30:57 +0200 |
---|---|---|
committer | Dundar Goc <gocdundar@gmail.com> | 2022-07-31 00:52:59 +0200 |
commit | 824a729628950d72834b98faf28d18b7a94eefb2 (patch) | |
tree | d8640bdac1d1e03e340787406328f45247c63509 /src/nvim/mapping.c | |
parent | 9511faa819e8260aa7ae2c2ff140070bbc96efa9 (diff) | |
download | rneovim-824a729628950d72834b98faf28d18b7a94eefb2.tar.gz rneovim-824a729628950d72834b98faf28d18b7a94eefb2.tar.bz2 rneovim-824a729628950d72834b98faf28d18b7a94eefb2.zip |
refactor: replace char_u with char
Work on https://github.com/neovim/neovim/issues/459
Diffstat (limited to 'src/nvim/mapping.c')
-rw-r--r-- | src/nvim/mapping.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/src/nvim/mapping.c b/src/nvim/mapping.c index 9d1a847663..237586dc22 100644 --- a/src/nvim/mapping.c +++ b/src/nvim/mapping.c @@ -1230,7 +1230,7 @@ char_u *set_context_in_map_cmd(expand_T *xp, char_u *cmd, char_u *arg, bool forc /// Find all mapping/abbreviation names that match regexp "regmatch". /// For command line expansion of ":[un]map" and ":[un]abbrev" in all modes. /// @return OK if matches found, FAIL otherwise. -int ExpandMappings(regmatch_T *regmatch, int *num_file, char_u ***file) +int ExpandMappings(regmatch_T *regmatch, int *num_file, char ***file) { mapblock_T *mp; int hash; @@ -1270,7 +1270,7 @@ int ExpandMappings(regmatch_T *regmatch, int *num_file, char_u ***file) if (round == 1) { count++; } else { - (*file)[count++] = vim_strsave(p); + (*file)[count++] = (char *)vim_strsave(p); } } } @@ -1293,7 +1293,7 @@ int ExpandMappings(regmatch_T *regmatch, int *num_file, char_u ***file) if (round == 1) { count++; } else { - (*file)[count++] = p; + (*file)[count++] = (char *)p; p = NULL; } } @@ -1307,22 +1307,18 @@ int ExpandMappings(regmatch_T *regmatch, int *num_file, char_u ***file) } if (round == 1) { - *file = (char_u **)xmalloc((size_t)count * sizeof(char_u *)); + *file = xmalloc((size_t)count * sizeof(char_u *)); } } // for (round) if (count > 1) { - char_u **ptr1; - char_u **ptr2; - char_u **ptr3; - // Sort the matches sort_strings(*file, count); // Remove multiple entries - ptr1 = *file; - ptr2 = ptr1 + 1; - ptr3 = ptr1 + count; + char **ptr1 = *file; + char **ptr2 = ptr1 + 1; + char **ptr3 = ptr1 + count; while (ptr2 < ptr3) { if (STRCMP(*ptr1, *ptr2)) { |