diff options
author | bfredl <bjorn.linse@gmail.com> | 2022-05-16 14:24:29 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-16 14:24:29 +0200 |
commit | b9b5577d6d8e07d1e39020c8fc05f817f2e81c66 (patch) | |
tree | 0d4b5f8b4db1ad7b4cd6d93c89d149e9e2d84570 /src/nvim/os | |
parent | 14d653b421d3ee4e0d641e45e67dafe43809e502 (diff) | |
parent | f0148de7907ec297647816d51c79745be729439e (diff) | |
download | rneovim-b9b5577d6d8e07d1e39020c8fc05f817f2e81c66.tar.gz rneovim-b9b5577d6d8e07d1e39020c8fc05f817f2e81c66.tar.bz2 rneovim-b9b5577d6d8e07d1e39020c8fc05f817f2e81c66.zip |
Merge pull request #18578 from dundargoc/refactor/remove-char_u
refactor: remove char_u
Diffstat (limited to 'src/nvim/os')
-rw-r--r-- | src/nvim/os/env.c | 11 | ||||
-rw-r--r-- | src/nvim/os/shell.c | 8 | ||||
-rw-r--r-- | src/nvim/os/signal.c | 6 | ||||
-rw-r--r-- | src/nvim/os/stdpaths.c | 2 |
4 files changed, 12 insertions, 15 deletions
diff --git a/src/nvim/os/env.c b/src/nvim/os/env.c index d0435cd968..c03fd60f03 100644 --- a/src/nvim/os/env.c +++ b/src/nvim/os/env.c @@ -529,9 +529,9 @@ void free_homedir(void) /// again soon. /// @param src String containing environment variables to expand /// @see {expand_env} -char_u *expand_env_save(char_u *src) +char *expand_env_save(char *src) { - return expand_env_save_opt(src, false); + return (char *)expand_env_save_opt((char_u *)src, false); } /// Similar to expand_env_save() but when "one" is `true` handle the string as @@ -644,7 +644,7 @@ void expand_env_esc(char_u *restrict srcp, char_u *restrict dst, int dstlen, boo #endif } else if (src[1] == NUL // home directory || vim_ispathsep(src[1]) - || vim_strchr((char_u *)" ,\t\n", src[1]) != NULL) { + || vim_strchr(" ,\t\n", src[1]) != NULL) { var = (char_u *)homedir; tail = src + 1; } else { // user directory @@ -884,8 +884,7 @@ void vim_get_prefix_from_exepath(char *exe_name) { // TODO(bfredl): param could have been written as "char exe_name[MAXPATHL]" // but c_grammar.lua does not recognize it (yet). - xstrlcpy(exe_name, (char *)get_vim_var_str(VV_PROGPATH), - MAXPATHL * sizeof(*exe_name)); + xstrlcpy(exe_name, get_vim_var_str(VV_PROGPATH), MAXPATHL * sizeof(*exe_name)); char *path_end = (char *)path_tail_with_sep((char_u *)exe_name); *path_end = '\0'; // remove the trailing "nvim.exe" path_end = path_tail(exe_name); @@ -940,7 +939,7 @@ char *vim_getenv(const char *name) // - the directory name from 'helpfile' (unless it contains '$') // - the executable name from argv[0] if (vim_path == NULL) { - if (p_hf != NULL && vim_strchr(p_hf, '$') == NULL) { + if (p_hf != NULL && vim_strchr((char *)p_hf, '$') == NULL) { vim_path = (char *)p_hf; } diff --git a/src/nvim/os/shell.c b/src/nvim/os/shell.c index 34d9015071..d331bd21a2 100644 --- a/src/nvim/os/shell.c +++ b/src/nvim/os/shell.c @@ -36,7 +36,7 @@ #define NS_1_SECOND 1000000000U // 1 second, in nanoseconds #define OUT_DATA_THRESHOLD 1024 * 10U // 10KB, "a few screenfuls" of data. -#define SHELL_SPECIAL (char_u *)"\t \"&'$;<>()\\|" +#define SHELL_SPECIAL "\t \"&'$;<>()\\|" typedef struct { char *data; @@ -73,7 +73,7 @@ static bool have_wildcard(int num, char_u **file) static bool have_dollars(int num, char_u **file) { for (int i = 0; i < num; i++) { - if (vim_strchr(file[i], '$') != NULL) { + if (vim_strchr((char *)file[i], '$') != NULL) { return true; } } @@ -151,7 +151,7 @@ int os_expand_wildcards(int num_pat, char_u **pat, int *num_file, char_u ***file // Don't allow the use of backticks in secure. if (secure) { for (i = 0; i < num_pat; i++) { - if (vim_strchr(pat[i], '`') != NULL + if (vim_strchr((char *)pat[i], '`') != NULL && (check_secure())) { return FAIL; } @@ -1213,7 +1213,7 @@ static void read_input(DynamicBuffer *buf) dynamic_buffer_ensure(buf, buf->len + len); buf->data[buf->len++] = NUL; } else { - char_u *s = vim_strchr(lp + written, NL); + char_u *s = (char_u *)vim_strchr((char *)lp + written, NL); len = s == NULL ? l : (size_t)(s - (lp + written)); dynamic_buffer_ensure(buf, buf->len + len); memcpy(buf->data + buf->len, lp + written, len); diff --git a/src/nvim/os/signal.c b/src/nvim/os/signal.c index 79e042b8a5..cd591801ed 100644 --- a/src/nvim/os/signal.c +++ b/src/nvim/os/signal.c @@ -210,14 +210,12 @@ static void on_signal(SignalWatcher *handle, int signum, void *data) break; #ifdef SIGUSR1 case SIGUSR1: - apply_autocmds(EVENT_SIGNAL, (char_u *)"SIGUSR1", curbuf->b_fname, true, - curbuf); + apply_autocmds(EVENT_SIGNAL, "SIGUSR1", curbuf->b_fname, true, curbuf); break; #endif #ifdef SIGWINCH case SIGWINCH: - apply_autocmds(EVENT_SIGNAL, (char_u *)"SIGWINCH", curbuf->b_fname, true, - curbuf); + apply_autocmds(EVENT_SIGNAL, "SIGWINCH", curbuf->b_fname, true, curbuf); break; #endif default: diff --git a/src/nvim/os/stdpaths.c b/src/nvim/os/stdpaths.c index faeb2fe829..a382392bd3 100644 --- a/src/nvim/os/stdpaths.c +++ b/src/nvim/os/stdpaths.c @@ -82,7 +82,7 @@ char *stdpaths_get_xdg_var(const XDGVarType idx) if (env_val != NULL) { ret = xstrdup(env_val); } else if (fallback) { - ret = (char *)expand_env_save((char_u *)fallback); + ret = expand_env_save((char *)fallback); } return ret; |