vim-patch:8.2.4289: warnings reported by MSVC

Problem:    Warnings reported by MSVC.
Solution:   Rename variables and other fixes. (Ken Takata, closes vim/vim#9689)
5411910c77

N/A patches for version.c:

vim-patch:8.2.0091: compiler warnings for size_t / int types

Problem:    Compiler warnings for size_t / int types.
Solution:   Change type to size_t. (Mike Williams)
4d7a248b64

vim-patch:8.2.1299: compiler warning for using size_t for int and void pointer

Problem:    Compiler warning for using size_t for int and void pointer.
Solution:   Add type casts.
d3bb6a82a5

vim-patch:8.2.1906: warning for signed/unsigned

Problem:    Warning for signed/unsigned.
Solution:   Use size_t instead of int. (Mike Williams)
a360dbe3b6

vim-patch:8.2.4531: LGTM warnings for condition and buffer size

Problem:    LGTM warnings for condition always true and buffer size too small.
Solution:   Remove the useless condition.  Make the buffer larger. (Goc
            Dundar, closes vim/vim#9914)
f01a653ac5

vim-patch:8.2.4624: old Coverity warning for resource leak

Problem:    Old Coverity warning for resource leak.
Solution:   Close the file if memory allocation fails.
5d46dcfeed

vim-patch:9.0.0129: compiler warning for int/size_t usage

Problem:    Compiler warning for int/size_t usage.
Solution:   Add a type cast. (Mike Williams, closes vim/vim#10830)
ab146dac6b
This commit is contained in:
zeertzjq
2022-08-25 12:35:24 +08:00
parent e7dd65eea3
commit 6584f3a2b6

View File

@@ -1939,13 +1939,12 @@ static int ExpandFromContext(expand_T *xp, char_u *pat, int *num_file, char ***f
|| xp->xp_context == EXPAND_FILES_IN_PATH) {
// Expand file or directory names.
bool free_pat = false;
int i;
// for ":set path=" and ":set tags=" halve backslashes for escaped space
if (xp->xp_backslash != XP_BS_NONE) {
free_pat = true;
pat = vim_strsave(pat);
for (i = 0; pat[i]; i++) {
for (int i = 0; pat[i]; i++) {
if (pat[i] == '\\') {
if (xp->xp_backslash == XP_BS_THREE
&& pat[i + 1] == '\\'
@@ -1979,8 +1978,8 @@ static int ExpandFromContext(expand_T *xp, char_u *pat, int *num_file, char ***f
}
#ifdef BACKSLASH_IN_FILENAME
if (p_csl[0] != NUL && (options & WILD_IGNORE_COMPLETESLASH) == 0) {
for (int i = 0; i < *num_file; i++) {
char_u *ptr = (*file)[i];
for (int j = 0; j < *num_file; j++) {
char_u *ptr = (*file)[j];
while (*ptr != NUL) {
if (p_csl[0] == 's' && *ptr == '\\') {
*ptr = '/';