mirror of
https://github.com/neovim/neovim.git
synced 2025-09-28 14:08:32 +00:00
strings/memory: constify and func_attr.
Fix MB_COPY_cHAR() to accept const pointers.
This commit is contained in:
@@ -143,8 +143,9 @@
|
||||
/* get length of multi-byte char, not including composing chars */
|
||||
# define mb_cptr2len(p) (enc_utf8 ? utf_ptr2len(p) : (*mb_ptr2len)(p))
|
||||
|
||||
# define MB_COPY_CHAR(f, \
|
||||
t) if (has_mbyte) mb_copy_char(&f, &t); else *t++ = *f++
|
||||
# define MB_COPY_CHAR(f, t) \
|
||||
if (has_mbyte) mb_copy_char((const char_u **)(&f), &t); \
|
||||
else *t++ = *f++
|
||||
# define MB_CHARLEN(p) (has_mbyte ? mb_charlen(p) : (int)STRLEN(p))
|
||||
# define MB_CHAR2LEN(c) (has_mbyte ? mb_char2len(c) : 1)
|
||||
# define PTR2CHAR(p) (has_mbyte ? mb_ptr2char(p) : (int)*(p))
|
||||
|
Reference in New Issue
Block a user