From 1c03a064870af18f50d4f11cf4c7532c5cfae495 Mon Sep 17 00:00:00 2001 From: ZviRackover Date: Wed, 29 Aug 2018 21:15:32 +0300 Subject: Refactor: remove mb_ptr2len_len, mb_ptr2cells and mb_ptr2cells_len Remove occurences of these macros. --- src/nvim/mbyte.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/nvim/mbyte.c') diff --git a/src/nvim/mbyte.c b/src/nvim/mbyte.c index 11c1897153..0bc97e1686 100644 --- a/src/nvim/mbyte.c +++ b/src/nvim/mbyte.c @@ -550,7 +550,7 @@ size_t mb_string2cells(const char_u *str) size_t clen = 0; for (const char_u *p = str; *p != NUL; p += (*mb_ptr2len)(p)) { - clen += (*mb_ptr2cells)(p); + clen += utf_ptr2cells(p); } return clen; @@ -2124,7 +2124,7 @@ static char_u *iconv_string(const vimconv_T *const vcp, char_u *str, * conversion from 'encoding' to something else. In other * situations we don't know what to skip anyway. */ *to++ = '?'; - if ((*mb_ptr2cells)((char_u *)from) > 1) + if (utf_ptr2cells((char_u *)from) > 1) *to++ = '?'; l = utfc_ptr2len_len((const char_u *)from, (int)fromlen); from += l; -- cgit From a3549286b24000dcdd4411bd5faf637e1c9a0d3d Mon Sep 17 00:00:00 2001 From: ZviRackover Date: Wed, 29 Aug 2018 23:32:57 +0300 Subject: lint: clean-up after parent commits --- src/nvim/mbyte.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/nvim/mbyte.c') diff --git a/src/nvim/mbyte.c b/src/nvim/mbyte.c index 0bc97e1686..0ee8e2bd85 100644 --- a/src/nvim/mbyte.c +++ b/src/nvim/mbyte.c @@ -2124,8 +2124,9 @@ static char_u *iconv_string(const vimconv_T *const vcp, char_u *str, * conversion from 'encoding' to something else. In other * situations we don't know what to skip anyway. */ *to++ = '?'; - if (utf_ptr2cells((char_u *)from) > 1) + if (utf_ptr2cells((char_u *)from) > 1) { *to++ = '?'; + } l = utfc_ptr2len_len((const char_u *)from, (int)fromlen); from += l; fromlen -= l; -- cgit