To: vim_dev@googlegroups.com Subject: Patch 8.2.5077 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.5077 Problem: Various warnings from clang on MS-Windows. Solution: Avoid the warnings. (Yegappan Lakshmanan, closes #10553) Files: src/dosinst.c, src/dosinst.h, src/filepath.c, src/gui_w32.c, src/misc1.c, src/os_win32.c *** ../vim-8.2.5076/src/dosinst.c 2022-06-09 20:53:47.591378904 +0100 --- src/dosinst.c 2022-06-11 10:34:51.820903718 +0100 *************** *** 1527,1533 **** "*\\OpenWithList\\gvim.exe", }; ! for (i = 0; ERROR_SUCCESS == lRet && i < ARRAYSIZE(openwith); i++) lRet = reg_create_key_and_value(hRootKey, openwith[i], NULL, "", flag); } --- 1527,1533 ---- "*\\OpenWithList\\gvim.exe", }; ! for (i = 0; ERROR_SUCCESS == lRet && i < (int)ARRAYSIZE(openwith); i++) lRet = reg_create_key_and_value(hRootKey, openwith[i], NULL, "", flag); } *** ../vim-8.2.5076/src/dosinst.h 2022-06-09 20:53:47.591378904 +0100 --- src/dosinst.h 2022-06-11 10:34:51.820903718 +0100 *************** *** 341,363 **** // created when it's empty } targets[TARGET_COUNT] = { ! {"all", "batch files"}, {"vim", "vim.bat", "Vim.lnk", ! "vim.exe", "vim.exe", ""}, {"gvim", "gvim.bat", "gVim.lnk", ! "gvim.exe", "gvim.exe", ""}, {"evim", "evim.bat", "gVim Easy.lnk", ! "evim.exe", "gvim.exe", "-y"}, {"view", "view.bat", "Vim Read-only.lnk", ! "view.exe", "vim.exe", "-R"}, {"gview", "gview.bat", "gVim Read-only.lnk", ! "gview.exe", "gvim.exe", "-R"}, {"vimdiff", "vimdiff.bat", "Vim Diff.lnk", ! "vimdiff.exe","vim.exe", "-d"}, {"gvimdiff","gvimdiff.bat", "gVim Diff.lnk", ! "gvimdiff.exe","gvim.exe", "-d"}, {"vimtutor","vimtutor.bat", "Vim tutor.lnk", ! "vimtutor.bat", "vimtutor.bat", ""}, }; /* Uninstall key for vim.bat, etc. */ --- 341,363 ---- // created when it's empty } targets[TARGET_COUNT] = { ! {"all", "batch files", NULL, NULL, NULL, NULL, NULL, NULL, ""}, {"vim", "vim.bat", "Vim.lnk", ! "vim.exe", "vim.exe", "", NULL, NULL, ""}, {"gvim", "gvim.bat", "gVim.lnk", ! "gvim.exe", "gvim.exe", "", NULL, NULL, ""}, {"evim", "evim.bat", "gVim Easy.lnk", ! "evim.exe", "gvim.exe", "-y", NULL, NULL, ""}, {"view", "view.bat", "Vim Read-only.lnk", ! "view.exe", "vim.exe", "-R", NULL, NULL, ""}, {"gview", "gview.bat", "gVim Read-only.lnk", ! "gview.exe", "gvim.exe", "-R", NULL, NULL, ""}, {"vimdiff", "vimdiff.bat", "Vim Diff.lnk", ! "vimdiff.exe","vim.exe", "-d", NULL, NULL, ""}, {"gvimdiff","gvimdiff.bat", "gVim Diff.lnk", ! "gvimdiff.exe","gvim.exe", "-d", NULL, NULL, ""}, {"vimtutor","vimtutor.bat", "Vim tutor.lnk", ! "vimtutor.bat", "vimtutor.bat", "", NULL, NULL, ""}, }; /* Uninstall key for vim.bat, etc. */ *** ../vim-8.2.5076/src/filepath.c 2022-05-16 12:37:32.914751002 +0100 --- src/filepath.c 2022-06-11 10:34:51.824903718 +0100 *************** *** 191,197 **** } // concat the not-shortened part of the path ! vim_strncpy(*fname + len, endp, sfx_len); (*fname)[new_len] = NUL; } --- 191,198 ---- } // concat the not-shortened part of the path ! if ((*fname + len) != endp) ! vim_strncpy(*fname + len, endp, sfx_len); (*fname)[new_len] = NUL; } *** ../vim-8.2.5076/src/gui_w32.c 2022-06-09 20:53:47.595378910 +0100 --- src/gui_w32.c 2022-06-11 10:34:51.824903718 +0100 *************** *** 1712,1718 **** /* * Try to look up a system colour. */ ! for (i = 0; i < ARRAY_LENGTH(sys_table); i++) if (STRICMP(name, sys_table[i].name) == 0) return GetSysColor(sys_table[i].color); --- 1712,1718 ---- /* * Try to look up a system colour. */ ! for (i = 0; i < (int)ARRAY_LENGTH(sys_table); i++) if (STRICMP(name, sys_table[i].name) == 0) return GetSysColor(sys_table[i].color); *** ../vim-8.2.5076/src/misc1.c 2022-05-09 20:09:19.286641426 +0100 --- src/misc1.c 2022-06-11 10:34:51.824903718 +0100 *************** *** 1351,1356 **** --- 1351,1359 ---- 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,1581 **** // with it, skip a character if (after_pathsep(dst, dst + c) #if defined(BACKSLASH_IN_FILENAME) || defined(AMIGA) ! && dst[-1] != ':' #endif && vim_ispathsep(*tail)) ++tail; --- 1578,1584 ---- // with it, skip a character if (after_pathsep(dst, dst + c) #if defined(BACKSLASH_IN_FILENAME) || defined(AMIGA) ! && (dst == save_dst || dst[-1] != ':') #endif && vim_ispathsep(*tail)) ++tail; *** ../vim-8.2.5076/src/os_win32.c 2022-06-09 20:53:47.595378910 +0100 --- src/os_win32.c 2022-06-11 10:34:51.824903718 +0100 *************** *** 2355,2365 **** * 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) { } --- 2355,2365 ---- * worth allowing these to make debugging of issues easier. */ static void ! 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) { } *** ../vim-8.2.5076/src/version.c 2022-06-10 15:30:27.465919326 +0100 --- src/version.c 2022-06-11 10:37:23.364938499 +0100 *************** *** 736,737 **** --- 736,739 ---- { /* Add new patch number below this line */ + /**/ + 5077, /**/ -- ARTHUR: No, hang on! Just answer the five questions ... GALAHAD: Three questions ... ARTHUR: Three questions ... And we shall watch ... and pray. "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///