To: vim_dev@googlegroups.com Subject: Patch 8.2.4289 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.4289 Problem: Warnings reported by MSVC. Solution: Rename variables and other fixes. (Ken Takata, closes #9689) Files: src/cmdexpand.c, src/drawscreen.c, src/filepath.c, src/getchar.c, src/menu.c, src/os_win32.c, src/version.c *** ../vim-8.2.4288/src/cmdexpand.c 2022-01-08 16:19:18.497639954 +0000 --- src/cmdexpand.c 2022-02-03 13:30:40.870416708 +0000 *************** *** 1993,2003 **** #ifdef BACKSLASH_IN_FILENAME if (p_csl[0] != NUL && (options & WILD_IGNORE_COMPLETESLASH) == 0) { ! int i; ! for (i = 0; i < *num_file; ++i) { ! char_u *ptr = (*file)[i]; while (*ptr != NUL) { --- 1993,2003 ---- #ifdef BACKSLASH_IN_FILENAME if (p_csl[0] != NUL && (options & WILD_IGNORE_COMPLETESLASH) == 0) { ! int j; ! for (j = 0; j < *num_file; ++j) { ! char_u *ptr = (*file)[j]; while (*ptr != NUL) { *** ../vim-8.2.4288/src/drawscreen.c 2022-01-28 15:28:00.204927781 +0000 --- src/drawscreen.c 2022-02-03 13:30:40.870416708 +0000 *************** *** 2554,2570 **** // See the version that was fixed. if (use_vtp() && get_conpty_fix_type() < 1) { ! int i; ! for (i = 0; i < Rows; ++i) if (enc_utf8) ! if ((*mb_off2cells)(LineOffset[i] + Columns - 2, ! LineOffset[i] + screen_Columns) > 1) ! screen_draw_rectangle(i, Columns - 2, 1, 2, FALSE); else ! screen_draw_rectangle(i, Columns - 1, 1, 1, FALSE); else ! screen_char(LineOffset[i] + Columns - 1, i, Columns - 1); } #endif --- 2554,2570 ---- // See the version that was fixed. if (use_vtp() && get_conpty_fix_type() < 1) { ! int k; ! for (k = 0; k < Rows; ++k) if (enc_utf8) ! if ((*mb_off2cells)(LineOffset[k] + Columns - 2, ! LineOffset[k] + screen_Columns) > 1) ! screen_draw_rectangle(k, Columns - 2, 1, 2, FALSE); else ! screen_draw_rectangle(k, Columns - 1, 1, 1, FALSE); else ! screen_char(LineOffset[k] + Columns - 1, k, Columns - 1); } #endif *** ../vim-8.2.4288/src/filepath.c 2022-01-31 14:59:33.514943760 +0000 --- src/filepath.c 2022-02-03 13:30:40.870416708 +0000 *************** *** 372,383 **** { if (GetLongPathNameW(wfname, buf, _MAX_PATH)) { ! char_u *p = utf16_to_enc(buf, NULL); ! if (p != NULL) { vim_free(*bufp); // free any allocated file name ! *bufp = *fnamep = p; } } vim_free(wfname); --- 372,383 ---- { if (GetLongPathNameW(wfname, buf, _MAX_PATH)) { ! char_u *q = utf16_to_enc(buf, NULL); ! if (q != NULL) { vim_free(*bufp); // free any allocated file name ! *bufp = *fnamep = q; } } vim_free(wfname); *** ../vim-8.2.4288/src/getchar.c 2022-01-31 14:59:33.514943760 +0000 --- src/getchar.c 2022-02-03 13:30:40.870416708 +0000 *************** *** 1768,1783 **** c == K_TEAROFF) { char_u name[200]; ! int i; // get menu path, it ends with a ! for (i = 0; (c = vgetorpeek(TRUE)) != '\r'; ) { ! name[i] = c; ! if (i < 199) ! ++i; } ! name[i] = NUL; gui_make_tearoff(name); continue; } --- 1768,1783 ---- c == K_TEAROFF) { char_u name[200]; ! int j; // get menu path, it ends with a ! for (j = 0; (c = vgetorpeek(TRUE)) != '\r'; ) { ! name[j] = c; ! if (j < 199) ! ++j; } ! name[j] = NUL; gui_make_tearoff(name); continue; } *** ../vim-8.2.4288/src/menu.c 2022-01-08 16:19:18.505639885 +0000 --- src/menu.c 2022-02-03 13:30:40.870416708 +0000 *************** *** 677,683 **** } } ! # if defined(FEAT_GUI_MSWIN) & defined(FEAT_TEAROFF) // When adding a new submenu, may add a tearoff item if ( addtearoff && *next_name --- 677,683 ---- } } ! # if defined(FEAT_GUI_MSWIN) && defined(FEAT_TEAROFF) // When adding a new submenu, may add a tearoff item if ( addtearoff && *next_name *** ../vim-8.2.4288/src/os_win32.c 2022-02-03 13:05:28.813273685 +0000 --- src/os_win32.c 2022-02-03 13:30:40.870416708 +0000 *************** *** 452,458 **** HANDLE hHandle, DWORD dwMilliseconds) { ! if (read_console_input(NULL, NULL, -2, NULL)) return WAIT_OBJECT_0; return WaitForSingleObject(hHandle, dwMilliseconds); } --- 452,458 ---- HANDLE hHandle, DWORD dwMilliseconds) { ! if (read_console_input(NULL, NULL, (DWORD)-2, NULL)) return WAIT_OBJECT_0; return WaitForSingleObject(hHandle, dwMilliseconds); } *************** *** 724,730 **** for (i = 0; libintl_entry[i].name != NULL && libintl_entry[i].ptr != NULL; ++i) { ! if ((*libintl_entry[i].ptr = (FARPROC)GetProcAddress(hLibintlDLL, libintl_entry[i].name)) == NULL) { dyn_libintl_end(); --- 724,730 ---- for (i = 0; libintl_entry[i].name != NULL && libintl_entry[i].ptr != NULL; ++i) { ! if ((*libintl_entry[i].ptr = GetProcAddress(hLibintlDLL, libintl_entry[i].name)) == NULL) { dyn_libintl_end(); *** ../vim-8.2.4288/src/version.c 2022-02-03 13:05:28.813273685 +0000 --- src/version.c 2022-02-03 13:32:12.486277758 +0000 *************** *** 9468,9474 **** // The rightmost column doesn't need a separator. // Sacrifice it to fit in one more column if possible. ncol = (int) (Columns + 1) / width; ! nrow = item_count / ncol + (item_count % ncol ? 1 : 0); // "i" counts columns then rows. "idx" counts rows then columns. for (i = 0; !got_int && i < nrow * ncol; ++i) --- 9470,9476 ---- // The rightmost column doesn't need a separator. // Sacrifice it to fit in one more column if possible. ncol = (int) (Columns + 1) / width; ! nrow = item_count / ncol + ((item_count % ncol) ? 1 : 0); // "i" counts columns then rows. "idx" counts rows then columns. for (i = 0; !got_int && i < nrow * ncol; ++i) *** ../vim-8.2.4288/src/version.c 2022-02-03 13:05:28.813273685 +0000 --- src/version.c 2022-02-03 13:32:12.486277758 +0000 *************** *** 748,749 **** --- 748,751 ---- { /* Add new patch number below this line */ + /**/ + 4289, /**/ -- Every engineer dreams about saving the universe and having sex with aliens. This is much more glamorous than the real life of an engineer, which consists of hiding from the universe and having sex without the participation of other life forms. (Scott Adams - The Dilbert principle) /// 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 ///