refactor: replace char_u with char (#21901)

refactor: replace char_u with char

Work on https://github.com/neovim/neovim/issues/459
This commit is contained in:
dundargoc
2023-02-11 11:05:57 +01:00
committed by GitHub
parent ee87b848a2
commit 4be6c6cf0d
47 changed files with 471 additions and 475 deletions

View File

@@ -86,7 +86,7 @@ int ask_yesno(const char *const str, const bool direct)
/// Translates the interrupt character for unix to ESC.
int get_keystroke(MultiQueue *events)
{
char_u *buf = NULL;
char *buf = NULL;
int buflen = 150;
int maxlen;
int len = 0;
@@ -113,7 +113,7 @@ int get_keystroke(MultiQueue *events)
// First time: blocking wait. Second time: wait up to 100ms for a
// terminal code to complete.
n = os_inchar(buf + len, maxlen, len == 0 ? -1L : 100L, 0, events);
n = os_inchar((uint8_t *)buf + len, maxlen, len == 0 ? -1L : 100L, 0, events);
if (n > 0) {
// Replace zero and K_SPECIAL by a special key code.
n = fix_input_buffer(buf + len, n);
@@ -128,14 +128,14 @@ int get_keystroke(MultiQueue *events)
}
// Handle modifier and/or special key code.
n = buf[0];
n = (uint8_t)buf[0];
if (n == K_SPECIAL) {
n = TO_SPECIAL(buf[1], buf[2]);
if (buf[1] == KS_MODIFIER
n = TO_SPECIAL((uint8_t)buf[1], (uint8_t)buf[2]);
if ((uint8_t)buf[1] == KS_MODIFIER
|| n == K_IGNORE
|| (is_mouse_key(n) && n != K_LEFTMOUSE)) {
if (buf[1] == KS_MODIFIER) {
mod_mask = buf[2];
if ((uint8_t)buf[1] == KS_MODIFIER) {
mod_mask = (uint8_t)buf[2];
}
len -= 3;
if (len > 0) {
@@ -150,7 +150,7 @@ int get_keystroke(MultiQueue *events)
continue;
}
buf[len >= buflen ? buflen - 1 : len] = NUL;
n = utf_ptr2char((char *)buf);
n = utf_ptr2char(buf);
break;
}
xfree(buf);