aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/fileio.c
diff options
context:
space:
mode:
authorDundar Göc <gocdundar@gmail.com>2022-08-26 23:11:25 +0200
committerdundargoc <gocdundar@gmail.com>2022-09-01 10:47:42 +0200
commit49e893f296bca9eef5ff45a3d746c261d055bf10 (patch)
tree37b6cb103f0fbff4922708e2996e51223c3204ba /src/nvim/fileio.c
parent48ca1d4ce8c0a142e90e06b3cd37f1315c5eb715 (diff)
downloadrneovim-49e893f296bca9eef5ff45a3d746c261d055bf10.tar.gz
rneovim-49e893f296bca9eef5ff45a3d746c261d055bf10.tar.bz2
rneovim-49e893f296bca9eef5ff45a3d746c261d055bf10.zip
refactor: replace char_u with char
Work on https://github.com/neovim/neovim/issues/459
Diffstat (limited to 'src/nvim/fileio.c')
-rw-r--r--src/nvim/fileio.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c
index 517424f4c1..889e569672 100644
--- a/src/nvim/fileio.c
+++ b/src/nvim/fileio.c
@@ -719,7 +719,7 @@ int readfile(char *fname, char *sfname, linenr_T from, linenr_T lines_to_skip,
fenc_alloced = false;
} else {
fenc_next = p_fencs; // try items in 'fileencodings'
- fenc = (char *)next_fenc(&fenc_next, &fenc_alloced);
+ fenc = next_fenc(&fenc_next, &fenc_alloced);
}
/*
@@ -813,7 +813,7 @@ retry:
xfree(fenc);
}
if (fenc_next != NULL) {
- fenc = (char *)next_fenc(&fenc_next, &fenc_alloced);
+ fenc = next_fenc(&fenc_next, &fenc_alloced);
} else {
fenc = "";
fenc_alloced = false;
@@ -2068,25 +2068,25 @@ void set_forced_fenc(exarg_T *eap)
/// NULL.
/// When *pp is not set to NULL, the result is in allocated memory and "alloced"
/// is set to true.
-static char_u *next_fenc(char **pp, bool *alloced)
+static char *next_fenc(char **pp, bool *alloced)
FUNC_ATTR_NONNULL_ALL FUNC_ATTR_NONNULL_RET
{
- char_u *p;
- char_u *r;
+ char *p;
+ char *r;
*alloced = false;
if (**pp == NUL) {
*pp = NULL;
- return (char_u *)"";
+ return "";
}
- p = (char_u *)vim_strchr((*pp), ',');
+ p = vim_strchr((*pp), ',');
if (p == NULL) {
- r = (char_u *)enc_canonize(*pp);
+ r = enc_canonize(*pp);
*pp += STRLEN(*pp);
} else {
- r = vim_strnsave((char_u *)(*pp), (size_t)(p - (char_u *)(*pp)));
- *pp = (char *)p + 1;
- p = (char_u *)enc_canonize((char *)r);
+ r = xstrnsave(*pp, (size_t)(p - *pp));
+ *pp = p + 1;
+ p = enc_canonize(r);
xfree(r);
r = p;
}