aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/os
diff options
context:
space:
mode:
authordundargoc <33953936+dundargoc@users.noreply.github.com>2022-08-30 14:52:09 +0200
committerGitHub <noreply@github.com>2022-08-30 14:52:09 +0200
commit2828aae7b49921380f229ebf4d7432f39c6c2c2b (patch)
tree1e26412b0eb28148ea42f51101c8f02f11dd1ed7 /src/nvim/os
parent9397e70b9e51ea17c71bd959e337e7e5892d97e1 (diff)
downloadrneovim-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/os')
-rw-r--r--src/nvim/os/env.c6
-rw-r--r--src/nvim/os/fs.c8
-rw-r--r--src/nvim/os/shell.c4
3 files changed, 9 insertions, 9 deletions
diff --git a/src/nvim/os/env.c b/src/nvim/os/env.c
index 274e13e3c6..c940c86675 100644
--- a/src/nvim/os/env.c
+++ b/src/nvim/os/env.c
@@ -765,12 +765,12 @@ static char *vim_version_dir(const char *vimdir)
return NULL;
}
char *p = concat_fnames(vimdir, VIM_VERSION_NODOT, true);
- if (os_isdir((char_u *)p)) {
+ if (os_isdir(p)) {
return p;
}
xfree(p);
p = concat_fnames(vimdir, RUNTIME_DIRNAME, true);
- if (os_isdir((char_u *)p)) {
+ if (os_isdir(p)) {
return p;
}
xfree(p);
@@ -976,7 +976,7 @@ char *vim_getenv(const char *name)
assert(vim_path_end >= vim_path);
vim_path = xstrndup(vim_path, (size_t)(vim_path_end - vim_path));
- if (!os_isdir((char_u *)vim_path)) {
+ if (!os_isdir(vim_path)) {
xfree(vim_path);
vim_path = NULL;
}
diff --git a/src/nvim/os/fs.c b/src/nvim/os/fs.c
index dc96c39d25..c0d5616666 100644
--- a/src/nvim/os/fs.c
+++ b/src/nvim/os/fs.c
@@ -129,10 +129,10 @@ bool os_isrealdir(const char *name)
/// Check if the given path exists and is a directory.
///
/// @return `true` if `name` is a directory.
-bool os_isdir(const char_u *name)
+bool os_isdir(const char *name)
FUNC_ATTR_NONNULL_ALL
{
- int32_t mode = os_getperm((const char *)name);
+ int32_t mode = os_getperm(name);
if (mode < 0) {
return false;
}
@@ -865,7 +865,7 @@ int os_file_is_writable(const char *name)
int r;
RUN_UV_FS_FUNC(r, uv_fs_access, name, W_OK, NULL);
if (r == 0) {
- return os_isdir((char_u *)name) ? 2 : 1;
+ return os_isdir(name) ? 2 : 1;
}
return 0;
}
@@ -915,7 +915,7 @@ int os_mkdir_recurse(const char *const dir, int32_t mode, char **const failed_di
char *e = curdir + dirlen;
const char *const real_end = e;
const char past_head_save = *past_head;
- while (!os_isdir((char_u *)curdir)) {
+ while (!os_isdir(curdir)) {
e = path_tail_with_sep(curdir);
if (e <= past_head) {
*past_head = NUL;
diff --git a/src/nvim/os/shell.c b/src/nvim/os/shell.c
index c8267ede14..461a79c37b 100644
--- a/src/nvim/os/shell.c
+++ b/src/nvim/os/shell.c
@@ -55,7 +55,7 @@ static void save_patterns(int num_pat, char **pat, int *num_file, char ***file)
char_u *s = vim_strsave((char_u *)pat[i]);
// Be compatible with expand_filename(): halve the number of
// backslashes.
- backslash_halve(s);
+ backslash_halve((char *)s);
(*file)[i] = (char *)s;
}
*num_file = num_pat;
@@ -508,7 +508,7 @@ int os_expand_wildcards(int num_pat, char **pat, int *num_file, char ***file, in
}
// check if this entry should be included
- dir = (os_isdir((char_u *)(*file)[i]));
+ dir = (os_isdir((*file)[i]));
if ((dir && !(flags & EW_DIR)) || (!dir && !(flags & EW_FILE))) {
continue;
}