mirror of
https://github.com/neovim/neovim.git
synced 2025-09-29 14:38:32 +00:00
refactor: replace char_u with char
Work on https://github.com/neovim/neovim/issues/459
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user