mirror of
https://github.com/neovim/neovim.git
synced 2026-07-30 04:18:02 +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:
@@ -611,8 +611,8 @@ static inline int convert_to_json_string(garray_T *const gap, const char *const
|
||||
#define ENCODE_RAW(ch) \
|
||||
(ch >= 0x20 && utf_printable(ch))
|
||||
for (size_t i = 0; i < utf_len;) {
|
||||
const int ch = utf_ptr2char((char_u *)utf_buf + i);
|
||||
const size_t shift = (ch == 0 ? 1 : ((size_t)utf_ptr2len((char_u *)utf_buf + i)));
|
||||
const int ch = utf_ptr2char(utf_buf + i);
|
||||
const size_t shift = (ch == 0 ? 1 : ((size_t)utf_ptr2len(utf_buf + i)));
|
||||
assert(shift > 0);
|
||||
i += shift;
|
||||
switch (ch) {
|
||||
@@ -651,11 +651,11 @@ static inline int convert_to_json_string(garray_T *const gap, const char *const
|
||||
ga_append(gap, '"');
|
||||
ga_grow(gap, (int)str_len);
|
||||
for (size_t i = 0; i < utf_len;) {
|
||||
const int ch = utf_ptr2char((char_u *)utf_buf + i);
|
||||
const int ch = utf_ptr2char(utf_buf + i);
|
||||
const size_t shift = (ch == 0 ? 1 : ((size_t)utf_char2len(ch)));
|
||||
assert(shift > 0);
|
||||
// Is false on invalid unicode, but this should already be handled.
|
||||
assert(ch == 0 || shift == ((size_t)utf_ptr2len((char_u *)utf_buf + i)));
|
||||
assert(ch == 0 || shift == ((size_t)utf_ptr2len(utf_buf + i)));
|
||||
switch (ch) {
|
||||
case BS:
|
||||
case TAB:
|
||||
|
||||
Reference in New Issue
Block a user