]> granicus.if.org Git - vim/commitdiff
patch 8.2.5077: various warnings from clang on MS-Windows v8.2.5077
authorYegappan Lakshmanan <yegappan@yahoo.com>
Sat, 11 Jun 2022 09:43:26 +0000 (10:43 +0100)
committerBram Moolenaar <Bram@vim.org>
Sat, 11 Jun 2022 09:43:26 +0000 (10:43 +0100)
Problem:    Various warnings from clang on MS-Windows.
Solution:   Avoid the warnings. (Yegappan Lakshmanan, closes #10553)

src/dosinst.c
src/dosinst.h
src/filepath.c
src/gui_w32.c
src/misc1.c
src/os_win32.c
src/version.c

index 416528c0978d45e3e2df2d225ba02c5ff9202b9f..60e3c649ac39936bcbe60f94e15168490add95cc 100644 (file)
@@ -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);
     }
 
index 774a56d3dcbfb01a033bd0448d8637aa0ca625d7..f1d3dc6eb5991c02a4e2d62d3c5512541f060243 100644 (file)
@@ -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. */
index 3f7825ceda22f22ddabe7f932f5512f2ac4e8c7c..654d03aab0553c52b50cd451d103dc4d05dd4828 100644 (file)
@@ -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;
     }
 
index cbfe6627ffd0111d1e7081fc293412b84a78f819..7bdbf418da29f5fd3253be3861f05d922100b7f1 100644 (file)
@@ -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);
 
index 9bbe3ad3858063c864575980f7facfc2197ed54b..fd85eff9c83322334eccf7fa27e1f1f3cf4ca75f 100644 (file)
@@ -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;
index 07befb8f2a78000e94799777365a4987f084f620..da48bfd615ad80c1e252b6531cc278af29b4da04 100644 (file)
@@ -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)
 {
 }
 
index 091cdbac086dd25f615402385648ce29233e3d00..f5c0fd7c5f1b53ca89437d264ef7d23f3ca6d1d0 100644 (file)
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    5077,
 /**/
     5076,
 /**/