diff options
author | dundargoc <33953936+dundargoc@users.noreply.github.com> | 2022-06-28 11:31:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-28 02:31:54 -0700 |
commit | 014a88799a1d175ad121c520c9cc5bd0bb2d8813 (patch) | |
tree | db5d1acdc8ea6fe58f78b1aabc62b3ee5fc7875a /src/nvim/os | |
parent | 7e1cf6b7642f0ab14656d853d44f4409b2987b9c (diff) | |
download | rneovim-014a88799a1d175ad121c520c9cc5bd0bb2d8813.tar.gz rneovim-014a88799a1d175ad121c520c9cc5bd0bb2d8813.tar.bz2 rneovim-014a88799a1d175ad121c520c9cc5bd0bb2d8813.zip |
refactor: replace char_u #18429
Work on https://github.com/neovim/neovim/issues/459
Diffstat (limited to 'src/nvim/os')
-rw-r--r-- | src/nvim/os/env.c | 18 | ||||
-rw-r--r-- | src/nvim/os/shell.c | 4 |
2 files changed, 11 insertions, 11 deletions
diff --git a/src/nvim/os/env.c b/src/nvim/os/env.c index 4bc003bc7f..3a213605dc 100644 --- a/src/nvim/os/env.c +++ b/src/nvim/os/env.c @@ -1033,7 +1033,7 @@ char *vim_getenv(const char *name) /// a list of them. /// /// @return length of the string put into dst, does not include NUL byte. -size_t home_replace(const buf_T *const buf, const char_u *src, char_u *const dst, size_t dstlen, +size_t home_replace(const buf_T *const buf, const char *src, char *const dst, size_t dstlen, const bool one) FUNC_ATTR_NONNULL_ARG(3) { @@ -1085,9 +1085,9 @@ size_t home_replace(const buf_T *const buf, const char_u *src, char_u *const dst } if (!one) { - src = (char_u *)skipwhite((char *)src); + src = skipwhite((char *)src); } - char *dst_p = (char *)dst; + char *dst_p = dst; while (*src && dstlen > 0) { // Here we are at the beginning of a file name. // First, check to see if the beginning of the file name matches @@ -1123,11 +1123,11 @@ size_t home_replace(const buf_T *const buf, const char_u *src, char_u *const dst // if (!one) skip to separator: space or comma. while (*src && (one || (*src != ',' && *src != ' ')) && --dstlen > 0) { - *dst_p++ = (char)(*src++); + *dst_p++ = *src++; } // Skip separator. while ((*src == ' ' || *src == ',') && --dstlen > 0) { - *dst_p++ = (char)(*src++); + *dst_p++ = *src++; } } // If (dstlen == 0) out of space, what to do??? @@ -1137,7 +1137,7 @@ size_t home_replace(const buf_T *const buf, const char_u *src, char_u *const dst if (must_free) { xfree(homedir_env_mod); } - return (size_t)(dst_p - (char *)dst); + return (size_t)(dst_p - dst); } /// Like home_replace, store the replaced string in allocated memory. @@ -1149,9 +1149,9 @@ char_u *home_replace_save(buf_T *buf, char_u *src) FUNC_ATTR_NONNULL_RET if (src != NULL) { // just in case len += STRLEN(src); } - char_u *dst = xmalloc(len); - home_replace(buf, src, dst, len, true); - return dst; + char *dst = xmalloc(len); + home_replace(buf, (char *)src, dst, len, true); + return (char_u *)dst; } /// Function given to ExpandGeneric() to obtain an environment variable name. diff --git a/src/nvim/os/shell.c b/src/nvim/os/shell.c index d331bd21a2..9283ea2e42 100644 --- a/src/nvim/os/shell.c +++ b/src/nvim/os/shell.c @@ -854,9 +854,9 @@ static int do_os_system(char **argv, const char *input, size_t len, char **outpu // Failed, probably 'shell' is not executable. if (!silent) { msg_puts(_("\nshell failed to start: ")); - msg_outtrans((char_u *)os_strerror(status)); + msg_outtrans((char *)os_strerror(status)); msg_puts(": "); - msg_outtrans((char_u *)prog); + msg_outtrans(prog); msg_putchar('\n'); } multiqueue_free(events); |