strings/memory: constify and func_attr.

Fix MB_COPY_cHAR() to accept const pointers.
This commit is contained in:
Scott Prager
2014-11-19 14:44:45 -05:00
parent 763b62698a
commit ecf81c3f20
6 changed files with 70 additions and 47 deletions

View File

@@ -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))