mirror of
https://github.com/neovim/neovim.git
synced 2025-09-18 17:28:23 +00:00
refactor: replace char_u variables and functions with char
Work on https://github.com/neovim/neovim/issues/459
This commit is contained in:
@@ -375,7 +375,7 @@ static inline int parse_json_string(const char *const buf, const size_t buf_len,
|
||||
"inside string: %.*s"), LENP(p, e));
|
||||
goto parse_json_string_fail;
|
||||
}
|
||||
const int ch = utf_ptr2char((char_u *)p);
|
||||
const int ch = utf_ptr2char(p);
|
||||
// All characters above U+007F are encoded using two or more bytes
|
||||
// and thus cannot possibly be equal to *p. But utf_ptr2char({0xFF,
|
||||
// 0}) will return 0xFF, even though 0xFF cannot start any UTF-8
|
||||
@@ -392,7 +392,7 @@ static inline int parse_json_string(const char *const buf, const size_t buf_len,
|
||||
goto parse_json_string_fail;
|
||||
}
|
||||
const size_t ch_len = (size_t)utf_char2len(ch);
|
||||
assert(ch_len == (size_t)(ch ? utf_ptr2len((char_u *)p) : 1));
|
||||
assert(ch_len == (size_t)(ch ? utf_ptr2len(p) : 1));
|
||||
len += ch_len;
|
||||
p += ch_len;
|
||||
}
|
||||
|
Reference in New Issue
Block a user