diff options
author | Dundar Goc <gocdundar@gmail.com> | 2022-05-05 13:36:14 +0200 |
---|---|---|
committer | Dundar Goc <gocdundar@gmail.com> | 2022-05-09 10:03:29 +0200 |
commit | e31b32a293f6ba8708499a176234f8be1df6a145 (patch) | |
tree | 87e129c92affece6421d4585b5d5c20996891ec5 /src/nvim/eval/decode.c | |
parent | dbdd58e548fcf55848359b696275fd848756db7b (diff) | |
download | rneovim-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/eval/decode.c')
-rw-r--r-- | src/nvim/eval/decode.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/nvim/eval/decode.c b/src/nvim/eval/decode.c index 93e0a6cfb7..2dd18c0942 100644 --- a/src/nvim/eval/decode.c +++ b/src/nvim/eval/decode.c @@ -415,7 +415,7 @@ static inline int parse_json_string(const char *const buf, const size_t buf_len, #define PUT_FST_IN_PAIR(fst_in_pair, str_end) \ do { \ if (fst_in_pair != 0) { \ - str_end += utf_char2bytes(fst_in_pair, (char_u *)str_end); \ + str_end += utf_char2bytes(fst_in_pair, str_end); \ fst_in_pair = 0; \ } \ } while (0) @@ -440,15 +440,14 @@ static inline int parse_json_string(const char *const buf, const size_t buf_len, fst_in_pair = (int)ch; } else if (SURROGATE_LO_START <= ch && ch <= SURROGATE_LO_END && fst_in_pair != 0) { - const int full_char = ( - (int)(ch - SURROGATE_LO_START) + const int full_char = ((int)(ch - SURROGATE_LO_START) + ((fst_in_pair - SURROGATE_HI_START) << 10) + SURROGATE_FIRST_CHAR); - str_end += utf_char2bytes(full_char, (char_u *)str_end); + str_end += utf_char2bytes(full_char, str_end); fst_in_pair = 0; } else { PUT_FST_IN_PAIR(fst_in_pair, str_end); - str_end += utf_char2bytes((int)ch, (char_u *)str_end); + str_end += utf_char2bytes((int)ch, str_end); } break; } |