summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYegappan Lakshmanan <yegappan@yahoo.com>2022-06-11 10:43:26 +0100
committerBram Moolenaar <Bram@vim.org>2022-06-11 10:43:26 +0100
commita34b4460c2843c67a35a2d236b01e6cb9bc38734 (patch)
tree8e59b458c22bad964993b790511d05fc131e4b94
parent2e7cba347fc8b746add12aa5e0e9f6218a76c788 (diff)
downloadvim-git-a34b4460c2843c67a35a2d236b01e6cb9bc38734.tar.gz
patch 8.2.5077: various warnings from clang on MS-Windowsv8.2.5077
Problem: Various warnings from clang on MS-Windows. Solution: Avoid the warnings. (Yegappan Lakshmanan, closes #10553)
-rw-r--r--src/dosinst.c2
-rw-r--r--src/dosinst.h18
-rw-r--r--src/filepath.c3
-rw-r--r--src/gui_w32.c2
-rw-r--r--src/misc1.c5
-rw-r--r--src/os_win32.c10
-rw-r--r--src/version.c2
7 files changed, 24 insertions, 18 deletions
diff --git a/src/dosinst.c b/src/dosinst.c
index 416528c09..60e3c649a 100644
--- a/src/dosinst.c
+++ b/src/dosinst.c
@@ -1527,7 +1527,7 @@ register_openwith(
"*\\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);
}
diff --git a/src/dosinst.h b/src/dosinst.h
index 774a56d3d..f1d3dc6eb 100644
--- a/src/dosinst.h
+++ b/src/dosinst.h
@@ -341,23 +341,23 @@ struct
// created when it's empty
} targets[TARGET_COUNT] =
{
- {"all", "batch files"},
+ {"all", "batch files", NULL, NULL, NULL, NULL, NULL, NULL, ""},
{"vim", "vim.bat", "Vim.lnk",
- "vim.exe", "vim.exe", ""},
+ "vim.exe", "vim.exe", "", NULL, NULL, ""},
{"gvim", "gvim.bat", "gVim.lnk",
- "gvim.exe", "gvim.exe", ""},
+ "gvim.exe", "gvim.exe", "", NULL, NULL, ""},
{"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.exe", "vim.exe", "-R"},
+ "view.exe", "vim.exe", "-R", NULL, NULL, ""},
{"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.exe","vim.exe", "-d"},
+ "vimdiff.exe","vim.exe", "-d", NULL, NULL, ""},
{"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.bat", "vimtutor.bat", ""},
+ "vimtutor.bat", "vimtutor.bat", "", NULL, NULL, ""},
};
/* Uninstall key for vim.bat, etc. */
diff --git a/src/filepath.c b/src/filepath.c
index 3f7825ced..654d03aab 100644
--- a/src/filepath.c
+++ b/src/filepath.c
@@ -191,7 +191,8 @@ shortpath_for_invalid_fname(
}
// concat the not-shortened part of the path
- vim_strncpy(*fname + len, endp, sfx_len);
+ if ((*fname + len) != endp)
+ vim_strncpy(*fname + len, endp, sfx_len);
(*fname)[new_len] = NUL;
}
diff --git a/src/gui_w32.c b/src/gui_w32.c
index cbfe6627f..7bdbf418d 100644
--- a/src/gui_w32.c
+++ b/src/gui_w32.c
@@ -1712,7 +1712,7 @@ gui_mch_get_color(char_u *name)
/*
* 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)
return GetSysColor(sys_table[i].color);
diff --git a/src/misc1.c b/src/misc1.c
index 9bbe3ad38..fd85eff9c 100644
--- a/src/misc1.c
+++ b/src/misc1.c
@@ -1351,6 +1351,9 @@ expand_env_esc(
int mustfree; // var was allocated, need to free it later
int at_start = TRUE; // at start of a name
int startstr_len = 0;
+#if defined(BACKSLASH_IN_FILENAME) || defined(AMIGA)
+ char_u *save_dst = dst;
+#endif
if (startstr != NULL)
startstr_len = (int)STRLEN(startstr);
@@ -1575,7 +1578,7 @@ expand_env_esc(
// with it, skip a character
if (after_pathsep(dst, dst + c)
#if defined(BACKSLASH_IN_FILENAME) || defined(AMIGA)
- && dst[-1] != ':'
+ && (dst == save_dst || dst[-1] != ':')
#endif
&& vim_ispathsep(*tail))
++tail;
diff --git a/src/os_win32.c b/src/os_win32.c
index 07befb8f2..da48bfd61 100644
--- a/src/os_win32.c
+++ b/src/os_win32.c
@@ -2355,11 +2355,11 @@ theend:
* worth allowing these to make debugging of issues easier.
*/
static void
-bad_param_handler(const wchar_t *expression,
- const wchar_t *function,
- const wchar_t *file,
- unsigned int line,
- uintptr_t pReserved)
+bad_param_handler(const wchar_t *expression UNUSED,
+ const wchar_t *function UNUSED,
+ const wchar_t *file UNUSED,
+ unsigned int line UNUSED,
+ uintptr_t pReserved UNUSED)
{
}
diff --git a/src/version.c b/src/version.c
index 091cdbac0..f5c0fd7c5 100644
--- a/src/version.c
+++ b/src/version.c
@@ -735,6 +735,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 5077,
+/**/
5076,
/**/
5075,