diff options
| author | dundargoc <33953936+dundargoc@users.noreply.github.com> | 2022-08-30 14:52:09 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-08-30 14:52:09 +0200 |
| commit | 2828aae7b49921380f229ebf4d7432f39c6c2c2b (patch) | |
| tree | 1e26412b0eb28148ea42f51101c8f02f11dd1ed7 /src/nvim/mbyte.c | |
| parent | 9397e70b9e51ea17c71bd959e337e7e5892d97e1 (diff) | |
| download | rneovim-2828aae7b49921380f229ebf4d7432f39c6c2c2b.tar.gz rneovim-2828aae7b49921380f229ebf4d7432f39c6c2c2b.tar.bz2 rneovim-2828aae7b49921380f229ebf4d7432f39c6c2c2b.zip | |
refactor: replace char_u with char 4 (#19987)
* refactor: replace char_u with char
Work on https://github.com/neovim/neovim/issues/459
Diffstat (limited to 'src/nvim/mbyte.c')
| -rw-r--r-- | src/nvim/mbyte.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/nvim/mbyte.c b/src/nvim/mbyte.c index e703280032..b874f0dc94 100644 --- a/src/nvim/mbyte.c +++ b/src/nvim/mbyte.c @@ -1942,7 +1942,7 @@ void utf_find_illegal(void) p = get_cursor_pos_ptr(); if (vimconv.vc_type != CONV_NONE) { xfree(tofree); - tofree = string_convert(&vimconv, p, NULL); + tofree = (char_u *)string_convert(&vimconv, (char *)p, NULL); if (tofree == NULL) { break; } @@ -2521,16 +2521,14 @@ int convert_setup_ext(vimconv_T *vcp, char_u *from, bool from_unicode_is_utf8, c return OK; } -/* - * Convert text "ptr[*lenp]" according to "vcp". - * Returns the result in allocated memory and sets "*lenp". - * When "lenp" is NULL, use NUL terminated strings. - * Illegal chars are often changed to "?", unless vcp->vc_fail is set. - * When something goes wrong, NULL is returned and "*lenp" is unchanged. - */ -char_u *string_convert(const vimconv_T *const vcp, char_u *ptr, size_t *lenp) +/// Convert text "ptr[*lenp]" according to "vcp". +/// Returns the result in allocated memory and sets "*lenp". +/// When "lenp" is NULL, use NUL terminated strings. +/// Illegal chars are often changed to "?", unless vcp->vc_fail is set. +/// When something goes wrong, NULL is returned and "*lenp" is unchanged. +char *string_convert(const vimconv_T *const vcp, char *ptr, size_t *lenp) { - return string_convert_ext(vcp, ptr, lenp, NULL); + return (char *)string_convert_ext(vcp, (char_u *)ptr, lenp, NULL); } /* |