diff options
author | dundargoc <33953936+dundargoc@users.noreply.github.com> | 2022-10-21 14:47:44 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-21 20:47:44 +0800 |
commit | 784e498c4a9c1f03266ced5ec3f55c3a6c94b80d (patch) | |
tree | 55f79bf7e309d522a76f6efe0cb3ed631340f431 /src/nvim/memline.c | |
parent | e554f5c545b9ee1195d617b3ac21f24829330a31 (diff) | |
download | rneovim-784e498c4a9c1f03266ced5ec3f55c3a6c94b80d.tar.gz rneovim-784e498c4a9c1f03266ced5ec3f55c3a6c94b80d.tar.bz2 rneovim-784e498c4a9c1f03266ced5ec3f55c3a6c94b80d.zip |
refactor: clang-tidy fixes to silence clangd warning (#20683)
* refactor: readability-uppercase-literal-suffix
* refactor: readability-named-parameter
* refactor: bugprone-suspicious-string-compare
* refactor: google-readability-casting
* refactor: readability-redundant-control-flow
* refactor: bugprone-too-small-loop-variable
* refactor: readability-non-const-parameter
* refactor: readability-avoid-const-params-in-decls
* refactor: google-readability-todo
* refactor: readability-inconsistent-declaration-parameter-name
* refactor: bugprone-suspicious-missing-comma
* refactor: remove noisy or slow warnings
Diffstat (limited to 'src/nvim/memline.c')
-rw-r--r-- | src/nvim/memline.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/nvim/memline.c b/src/nvim/memline.c index 56342942db..da31235e74 100644 --- a/src/nvim/memline.c +++ b/src/nvim/memline.c @@ -437,7 +437,7 @@ void ml_open_file(buf_T *buf) if (buf->b_spell) { char *fname = vim_tempname(); if (fname != NULL) { - (void)mf_open_file(mfp, (char *)fname); // consumes fname! + (void)mf_open_file(mfp, fname); // consumes fname! } buf->b_may_swap = false; return; @@ -1193,7 +1193,7 @@ int recover_names(char_u *fname, int list, int nr, char **fname_out) // Isolate a directory name from *dirp and put it in dir_name (we know // it is large enough, so use 31000 for length). // Advance dirp to next directory name. - (void)copy_option_part(&dirp, (char *)dir_name, 31000, ","); + (void)copy_option_part(&dirp, dir_name, 31000, ","); if (dir_name[0] == '.' && dir_name[1] == NUL) { // check current dir if (fname == NULL) { @@ -1208,24 +1208,24 @@ int recover_names(char_u *fname, int list, int nr, char **fname_out) } } else { // check directory dir_name if (fname == NULL) { - names[0] = concat_fnames((char *)dir_name, "*.sw?", true); + names[0] = concat_fnames(dir_name, "*.sw?", true); // For Unix names starting with a dot are special. MS-Windows // supports this too, on some file systems. - names[1] = concat_fnames((char *)dir_name, ".*.sw?", true); - names[2] = concat_fnames((char *)dir_name, ".sw?", true); + names[1] = concat_fnames(dir_name, ".*.sw?", true); + names[2] = concat_fnames(dir_name, ".sw?", true); num_names = 3; } else { int len = (int)STRLEN(dir_name); p = dir_name + len; - if (after_pathsep((char *)dir_name, (char *)p) + if (after_pathsep(dir_name, p) && len > 1 && p[-1] == p[-2]) { // Ends with '//', Use Full path for swap name - tail = (char_u *)make_percent_swname((char *)dir_name, + tail = (char_u *)make_percent_swname(dir_name, (char *)fname_res); } else { tail = (char_u *)path_tail((char *)fname_res); - tail = (char_u *)concat_fnames((char *)dir_name, (char *)tail, true); + tail = (char_u *)concat_fnames(dir_name, (char *)tail, true); } num_names = recov_file_names(names, (char *)tail, false); xfree(tail); @@ -1262,7 +1262,7 @@ int recover_names(char_u *fname, int list, int nr, char **fname_out) for (int i = 0; i < num_files; i++) { // Do not expand wildcards, on Windows would try to expand // "%tmp%" in "%tmp%file" - if (path_full_compare((char *)p, files[i], true, false) & kEqualFiles) { + if (path_full_compare(p, files[i], true, false) & kEqualFiles) { // Remove the name from files[i]. Move further entries // down. When the array becomes empty free it here, since // FreeWild() won't be called below. @@ -1292,7 +1292,7 @@ int recover_names(char_u *fname, int list, int nr, char **fname_out) } } else { msg_puts(_(" In directory ")); - msg_home_replace((char *)dir_name); + msg_home_replace(dir_name); msg_puts(":\n"); } @@ -3485,7 +3485,7 @@ static void long_to_char(long n, char_u *s) s[3] = (char_u)(n & 0xff); } -static long char_to_long(char_u *s) +static long char_to_long(const char_u *s) { long retval; |