1
0
forked from aniani/vim

patch 8.2.5077: various warnings from clang on MS-Windows

Problem:    Various warnings from clang on MS-Windows.
Solution:   Avoid the warnings. (Yegappan Lakshmanan, closes #10553)
This commit is contained in:
Yegappan Lakshmanan 2022-06-11 10:43:26 +01:00 committed by Bram Moolenaar
parent 2e7cba347f
commit a34b4460c2
7 changed files with 24 additions and 18 deletions

View File

@ -1527,7 +1527,7 @@ register_openwith(
"*\\OpenWithList\\gvim.exe", "*\\OpenWithList\\gvim.exe",
}; };
for (i = 0; ERROR_SUCCESS == lRet && i < ARRAYSIZE(openwith); i++) for (i = 0; ERROR_SUCCESS == lRet && i < (int)ARRAYSIZE(openwith); i++)
lRet = reg_create_key_and_value(hRootKey, openwith[i], NULL, "", flag); lRet = reg_create_key_and_value(hRootKey, openwith[i], NULL, "", flag);
} }

View File

@ -341,23 +341,23 @@ struct
// created when it's empty // created when it's empty
} targets[TARGET_COUNT] = } targets[TARGET_COUNT] =
{ {
{"all", "batch files"}, {"all", "batch files", NULL, NULL, NULL, NULL, NULL, NULL, ""},
{"vim", "vim.bat", "Vim.lnk", {"vim", "vim.bat", "Vim.lnk",
"vim.exe", "vim.exe", ""}, "vim.exe", "vim.exe", "", NULL, NULL, ""},
{"gvim", "gvim.bat", "gVim.lnk", {"gvim", "gvim.bat", "gVim.lnk",
"gvim.exe", "gvim.exe", ""}, "gvim.exe", "gvim.exe", "", NULL, NULL, ""},
{"evim", "evim.bat", "gVim Easy.lnk", {"evim", "evim.bat", "gVim Easy.lnk",
"evim.exe", "gvim.exe", "-y"}, "evim.exe", "gvim.exe", "-y", NULL, NULL, ""},
{"view", "view.bat", "Vim Read-only.lnk", {"view", "view.bat", "Vim Read-only.lnk",
"view.exe", "vim.exe", "-R"}, "view.exe", "vim.exe", "-R", NULL, NULL, ""},
{"gview", "gview.bat", "gVim Read-only.lnk", {"gview", "gview.bat", "gVim Read-only.lnk",
"gview.exe", "gvim.exe", "-R"}, "gview.exe", "gvim.exe", "-R", NULL, NULL, ""},
{"vimdiff", "vimdiff.bat", "Vim Diff.lnk", {"vimdiff", "vimdiff.bat", "Vim Diff.lnk",
"vimdiff.exe","vim.exe", "-d"}, "vimdiff.exe","vim.exe", "-d", NULL, NULL, ""},
{"gvimdiff","gvimdiff.bat", "gVim Diff.lnk", {"gvimdiff","gvimdiff.bat", "gVim Diff.lnk",
"gvimdiff.exe","gvim.exe", "-d"}, "gvimdiff.exe","gvim.exe", "-d", NULL, NULL, ""},
{"vimtutor","vimtutor.bat", "Vim tutor.lnk", {"vimtutor","vimtutor.bat", "Vim tutor.lnk",
"vimtutor.bat", "vimtutor.bat", ""}, "vimtutor.bat", "vimtutor.bat", "", NULL, NULL, ""},
}; };
/* Uninstall key for vim.bat, etc. */ /* Uninstall key for vim.bat, etc. */

View File

@ -191,6 +191,7 @@ shortpath_for_invalid_fname(
} }
// concat the not-shortened part of the path // concat the not-shortened part of the path
if ((*fname + len) != endp)
vim_strncpy(*fname + len, endp, sfx_len); vim_strncpy(*fname + len, endp, sfx_len);
(*fname)[new_len] = NUL; (*fname)[new_len] = NUL;
} }

View File

@ -1712,7 +1712,7 @@ gui_mch_get_color(char_u *name)
/* /*
* Try to look up a system colour. * Try to look up a system colour.
*/ */
for (i = 0; i < ARRAY_LENGTH(sys_table); i++) for (i = 0; i < (int)ARRAY_LENGTH(sys_table); i++)
if (STRICMP(name, sys_table[i].name) == 0) if (STRICMP(name, sys_table[i].name) == 0)
return GetSysColor(sys_table[i].color); return GetSysColor(sys_table[i].color);

View File

@ -1351,6 +1351,9 @@ expand_env_esc(
int mustfree; // var was allocated, need to free it later int mustfree; // var was allocated, need to free it later
int at_start = TRUE; // at start of a name int at_start = TRUE; // at start of a name
int startstr_len = 0; int startstr_len = 0;
#if defined(BACKSLASH_IN_FILENAME) || defined(AMIGA)
char_u *save_dst = dst;
#endif
if (startstr != NULL) if (startstr != NULL)
startstr_len = (int)STRLEN(startstr); startstr_len = (int)STRLEN(startstr);
@ -1575,7 +1578,7 @@ expand_env_esc(
// with it, skip a character // with it, skip a character
if (after_pathsep(dst, dst + c) if (after_pathsep(dst, dst + c)
#if defined(BACKSLASH_IN_FILENAME) || defined(AMIGA) #if defined(BACKSLASH_IN_FILENAME) || defined(AMIGA)
&& dst[-1] != ':' && (dst == save_dst || dst[-1] != ':')
#endif #endif
&& vim_ispathsep(*tail)) && vim_ispathsep(*tail))
++tail; ++tail;

View File

@ -2355,11 +2355,11 @@ theend:
* worth allowing these to make debugging of issues easier. * worth allowing these to make debugging of issues easier.
*/ */
static void static void
bad_param_handler(const wchar_t *expression, bad_param_handler(const wchar_t *expression UNUSED,
const wchar_t *function, const wchar_t *function UNUSED,
const wchar_t *file, const wchar_t *file UNUSED,
unsigned int line, unsigned int line UNUSED,
uintptr_t pReserved) uintptr_t pReserved UNUSED)
{ {
} }

View File

@ -734,6 +734,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
5077,
/**/ /**/
5076, 5076,
/**/ /**/