diff options
author | Dundar Göc <gocdundar@gmail.com> | 2022-08-26 23:11:25 +0200 |
---|---|---|
committer | Dundar Göc <gocdundar@gmail.com> | 2022-08-27 17:59:43 +0200 |
commit | 691f4715c0cf4bc11ea2280db8777e6dd174a8ac (patch) | |
tree | 5fbd18d7d350d0df98cae0f620bafc2fd94006e7 /src/nvim/mbyte.c | |
parent | 09c6ce8c4e4c6415cca9b834539ed0df461373f6 (diff) | |
download | rneovim-691f4715c0cf4bc11ea2280db8777e6dd174a8ac.tar.gz rneovim-691f4715c0cf4bc11ea2280db8777e6dd174a8ac.tar.bz2 rneovim-691f4715c0cf4bc11ea2280db8777e6dd174a8ac.zip |
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 | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/nvim/mbyte.c b/src/nvim/mbyte.c index 9213457608..dab6c8fbd3 100644 --- a/src/nvim/mbyte.c +++ b/src/nvim/mbyte.c @@ -2160,27 +2160,27 @@ char_u *enc_skip(char_u *p) return p; } -/* - * Find the canonical name for encoding "enc". - * When the name isn't recognized, returns "enc" itself, but with all lower - * case characters and '_' replaced with '-'. - * Returns an allocated string. - */ -char_u *enc_canonize(char_u *enc) FUNC_ATTR_NONNULL_RET +/// Find the canonical name for encoding "enc". +/// When the name isn't recognized, returns "enc" itself, but with all lower +/// case characters and '_' replaced with '-'. +/// +/// @return an allocated string. +char *enc_canonize(char *enc) + FUNC_ATTR_NONNULL_RET { char_u *p, *s; int i; if (STRCMP(enc, "default") == 0) { // Use the default encoding as found by set_init_1(). - return vim_strsave(fenc_default); + return (char *)vim_strsave(fenc_default); } // copy "enc" to allocated memory, with room for two '-' char_u *r = xmalloc(STRLEN(enc) + 3); // Make it all lower case and replace '_' with '-'. p = r; - for (s = enc; *s != NUL; s++) { + for (s = (char_u *)enc; *s != NUL; s++) { if (*s == '_') { *p++ = '-'; } else { @@ -2224,7 +2224,7 @@ char_u *enc_canonize(char_u *enc) FUNC_ATTR_NONNULL_RET xfree(r); r = vim_strsave((char_u *)enc_canon_table[i].name); } - return r; + return (char *)r; } /// Search for an encoding alias of "name". @@ -2309,7 +2309,7 @@ enc_locale_copy_enc: buf[i] = NUL; } - return enc_canonize((char_u *)buf); + return (char_u *)enc_canonize(buf); } #if defined(HAVE_ICONV) |