aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/keymap.c
diff options
context:
space:
mode:
authorDundar Goc <gocdundar@gmail.com>2022-05-05 13:36:14 +0200
committerDundar Goc <gocdundar@gmail.com>2022-05-09 10:03:29 +0200
commite31b32a293f6ba8708499a176234f8be1df6a145 (patch)
tree87e129c92affece6421d4585b5d5c20996891ec5 /src/nvim/keymap.c
parentdbdd58e548fcf55848359b696275fd848756db7b (diff)
downloadrneovim-e31b32a293f6ba8708499a176234f8be1df6a145.tar.gz
rneovim-e31b32a293f6ba8708499a176234f8be1df6a145.tar.bz2
rneovim-e31b32a293f6ba8708499a176234f8be1df6a145.zip
refactor: replace char_u variables and functions with char
Work on https://github.com/neovim/neovim/issues/459
Diffstat (limited to 'src/nvim/keymap.c')
-rw-r--r--src/nvim/keymap.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/nvim/keymap.c b/src/nvim/keymap.c
index 3c30389e0b..b184b42354 100644
--- a/src/nvim/keymap.c
+++ b/src/nvim/keymap.c
@@ -538,7 +538,7 @@ char_u *get_special_key_name(int c, int modifiers)
} else {
// Not a special key, only modifiers, output directly.
if (utf_char2len(c) > 1) {
- idx += utf_char2bytes(c, string + idx);
+ idx += utf_char2bytes(c, (char *)string + idx);
} else if (vim_isprintc(c)) {
string[idx++] = (char_u)c;
} else {
@@ -611,7 +611,7 @@ unsigned int special_to_buf(int key, int modifiers, bool escape_ks, char_u *dst)
assert(after >= dst && (uintmax_t)(after - dst) <= UINT_MAX);
dlen = (unsigned int)(after - dst);
} else {
- dlen += (unsigned int)utf_char2bytes(key, dst + dlen);
+ dlen += (unsigned int)utf_char2bytes(key, (char *)dst + dlen);
}
return dlen;
@@ -884,8 +884,8 @@ int get_mouse_button(int code, bool *is_click, bool *is_drag)
/// @param[in] cpo_flags Relevant flags derived from p_cpo, see CPO_TO_CPO_FLAGS.
///
/// @return Pointer to an allocated memory, which is also saved to "bufp".
-char_u *replace_termcodes(const char_u *const from, const size_t from_len, char_u **const bufp,
- const int flags, bool *const did_simplify, const int cpo_flags)
+char *replace_termcodes(const char *const from, const size_t from_len, char **const bufp,
+ const int flags, bool *const did_simplify, const int cpo_flags)
FUNC_ATTR_NONNULL_ARG(1, 3)
{
ssize_t i;
@@ -893,7 +893,7 @@ char_u *replace_termcodes(const char_u *const from, const size_t from_len, char_
char_u key;
size_t dlen = 0;
const char_u *src;
- const char_u *const end = from + from_len - 1;
+ const char_u *const end = (char_u *)from + from_len - 1;
char_u *result; // buffer for resulting string
const bool do_backslash = !(cpo_flags & FLAG_CPO_BSLASH); // backslash is a special character
@@ -904,7 +904,7 @@ char_u *replace_termcodes(const char_u *const from, const size_t from_len, char_
const size_t buf_len = from_len * 6 + 1;
result = xmalloc(buf_len);
- src = from;
+ src = (char_u *)from;
// Check for #n at start only: function key n
if ((flags & REPTERM_FROM_PART) && from_len > 1 && src[0] == '#'