refactor: replace char_u with char

Work on https://github.com/neovim/neovim/issues/459
This commit is contained in:
Dundar Göc
2022-08-26 23:11:25 +02:00
committed by dundargoc
parent 9b0e1256e2
commit c5322e752e
60 changed files with 484 additions and 492 deletions

View File

@@ -29,30 +29,30 @@ EXTERN sattr_T *linebuf_attr INIT(= NULL);
// screen grid.
/// Put a ASCII character in a screen cell.
static inline void schar_from_ascii(char_u *p, const char c)
static inline void schar_from_ascii(char *p, const char c)
{
p[0] = (char_u)c;
p[0] = c;
p[1] = 0;
}
/// Put a unicode character in a screen cell.
static inline int schar_from_char(char_u *p, int c)
static inline int schar_from_char(char *p, int c)
{
int len = utf_char2bytes(c, (char *)p);
int len = utf_char2bytes(c, p);
p[len] = NUL;
return len;
}
/// compare the contents of two screen cells.
static inline int schar_cmp(char_u *sc1, char_u *sc2)
static inline int schar_cmp(char *sc1, char *sc2)
{
return strncmp((char *)sc1, (char *)sc2, sizeof(schar_T));
return strncmp(sc1, sc2, sizeof(schar_T));
}
/// copy the contents of screen cell `sc2` into cell `sc1`
static inline void schar_copy(char_u *sc1, char_u *sc2)
static inline void schar_copy(char *sc1, char *sc2)
{
xstrlcpy((char *)sc1, (char *)sc2, sizeof(schar_T));
xstrlcpy(sc1, sc2, sizeof(schar_T));
}
#ifdef INCLUDE_GENERATED_DECLARATIONS