diff options
author | dundargoc <gocdundar@gmail.com> | 2022-11-26 18:57:46 +0100 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2023-01-09 17:03:40 +0800 |
commit | 08c2c7480619ccdf0c92fe6ce76da5b73b0e395b (patch) | |
tree | 2759bc2cb18bd7edc20fd17e7e0aeb8631bd957c /src/nvim/drawline.c | |
parent | 53adccb6e0292f7ba5524121c0200a73aec977a6 (diff) | |
download | rneovim-08c2c7480619ccdf0c92fe6ce76da5b73b0e395b.tar.gz rneovim-08c2c7480619ccdf0c92fe6ce76da5b73b0e395b.tar.bz2 rneovim-08c2c7480619ccdf0c92fe6ce76da5b73b0e395b.zip |
refactor: replace char_u with char
Work on https://github.com/neovim/neovim/issues/459
Diffstat (limited to 'src/nvim/drawline.c')
-rw-r--r-- | src/nvim/drawline.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/nvim/drawline.c b/src/nvim/drawline.c index 74e493926f..9669c0c9a1 100644 --- a/src/nvim/drawline.c +++ b/src/nvim/drawline.c @@ -137,39 +137,39 @@ static void margin_columns_win(win_T *wp, int *left_col, int *right_col) /// Handles composing chars and arabic shaping state. static int line_putchar(buf_T *buf, LineState *s, schar_T *dest, int maxcells, bool rl, int vcol) { - const char_u *p = (char_u *)s->p; - int cells = utf_ptr2cells((char *)p); - int c_len = utfc_ptr2len((char *)p); + const char *p = s->p; + int cells = utf_ptr2cells(p); + int c_len = utfc_ptr2len(p); int u8c, u8cc[MAX_MCO]; if (cells > maxcells) { return -1; } - u8c = utfc_ptr2char((char *)p, u8cc); + u8c = utfc_ptr2char(p, u8cc); if (*p == TAB) { cells = MIN(tabstop_padding(vcol, buf->b_p_ts, buf->b_p_vts_array), maxcells); for (int c = 0; c < cells; c++) { schar_from_ascii(dest[c], ' '); } goto done; - } else if (*p < 0x80 && u8cc[0] == 0) { - schar_from_ascii(dest[0], (char)(*p)); + } else if ((uint8_t)(*p) < 0x80 && u8cc[0] == 0) { + schar_from_ascii(dest[0], *p); s->prev_c = u8c; } else { if (p_arshape && !p_tbidi && ARABIC_CHAR(u8c)) { // Do Arabic shaping. int pc, pc1, nc; int pcc[MAX_MCO]; - int firstbyte = *p; + int firstbyte = (uint8_t)(*p); // The idea of what is the previous and next // character depends on 'rightleft'. if (rl) { pc = s->prev_c; pc1 = s->prev_c1; - nc = utf_ptr2char((char *)p + c_len); + nc = utf_ptr2char(p + c_len); s->prev_c1 = u8cc[0]; } else { - pc = utfc_ptr2char((char *)p + c_len, pcc); + pc = utfc_ptr2char(p + c_len, pcc); nc = s->prev_c; pc1 = pcc[0]; } |