To: vim_dev@googlegroups.com Subject: Patch 9.0.1234 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 9.0.1234 Problem: The code style has to be checked manually. Solution: Add basic code style checks in a test. Fix or avoid uncovered problems. Files: src/testdir/test_codestyle.vim, src/testdir/Make_all.mak, src/blowfish.c, src/cindent.c, src/crypt_zip.c, src/diff.c, src/digraph.c, src/ex_cmds.c, src/gui_beval.c, src/gui_motif.c, src/gui_photon.c, src/gui_x11.c, src/gui_xmebw.c, src/if_cscope.c, src/if_lua.c, src/if_python3.c, src/insexpand.c, src/nbdebug.c, src/os_amiga.c, src/os_mac_conv.c, src/os_vms.c, src/quickfix.c, src/regexp_bt.c, src/regexp_nfa.c, src/search.c, src/termlib.c, src/uninstall.c, src/ex_cmds.h, src/macros.h, src/optiondefs.h, src/nbdebug.h, src/nv_cmds.h, src/vim.h *** ../vim-9.0.1233/src/testdir/test_codestyle.vim 2023-01-22 21:14:13.453865250 +0000 --- src/testdir/test_codestyle.vim 2023-01-22 21:13:34.765868543 +0000 *************** *** 0 **** --- 1,45 ---- + " Test for checking the source code style. + + def Test_source_files() + for fname in glob('../*.[ch]', 0, 1) + exe 'edit ' .. fname + + cursor(1, 1) + var lnum = search(' \t') + assert_equal(0, lnum, fname .. ': space before tab') + + cursor(1, 1) + lnum = search('\s$') + assert_equal(0, lnum, fname .. ': trailing white space') + + # some files don't stick to the Vim style rules + if fname =~ 'iscygpty.c' + continue + endif + + # Examples in comments use "condition) {", skip them. + # Skip if a double quote or digit comes after the "{". + # Skip specific string used in os_unix.c. + # Also skip fold markers. + var skip = 'getline(".") =~ "condition) {" || getline(".") =~ "vimglob_func" || getline(".") =~ "{\"" || getline(".") =~ "{\\d" || getline(".") =~ "{{{"' + cursor(1, 1) + lnum = search(')\s*{', '', 0, 0, skip) + assert_equal(0, lnum, fname .. ': curly after closing paren') + + cursor(1, 1) + # Examples in comments use double quotes. + skip = "getline('.') =~ '\"'" + # Avoid examples that contain: "} else + lnum = search('[^"]}\s*else', '', 0, 0, skip) + assert_equal(0, lnum, fname .. ': curly before "else"') + + cursor(1, 1) + lnum = search('else\s*{', '', 0, 0, skip) + assert_equal(0, lnum, fname .. ': curly after "else"') + endfor + + bwipe! + enddef + + + " vim: shiftwidth=2 sts=2 expandtab *** ../vim-9.0.1233/src/testdir/Make_all.mak 2022-12-20 20:01:09.624090908 +0000 --- src/testdir/Make_all.mak 2023-01-22 19:11:06.183039542 +0000 *************** *** 97,102 **** --- 97,103 ---- test_cmdline \ test_cmdmods \ test_cmdwin \ + test_codestyle \ test_command_count \ test_comments \ test_comparators \ *************** *** 359,364 **** --- 360,366 ---- test_cmdline.res \ test_cmdmods.res \ test_cmdwin.res \ + test_codestyle.res \ test_command_count.res \ test_comments.res \ test_comparators.res \ *** ../vim-9.0.1233/src/blowfish.c 2021-12-31 19:22:00.000000000 +0000 --- src/blowfish.c 2023-01-22 19:22:45.814930503 +0000 *************** *** 517,523 **** // We can't simply use sizeof(UINT32_T), it would generate a compiler // warning. ! if (ui != 0xffffffffUL || ui + 1 != 0) { err++; emsg(_(e_sizeof_uint32_isnot_four)); } --- 517,524 ---- // We can't simply use sizeof(UINT32_T), it would generate a compiler // warning. ! if (ui != 0xffffffffUL || ui + 1 != 0) ! { err++; emsg(_(e_sizeof_uint32_isnot_four)); } *************** *** 573,585 **** } } ! #define BF_CFB_UPDATE(bfs, c) { \ bfs->cfb_buffer[bfs->update_offset] ^= (char_u)c; \ if (++bfs->update_offset == bfs->cfb_len) \ bfs->update_offset = 0; \ } ! #define BF_RANBYTE(bfs, t) { \ if ((bfs->randbyte_offset & BF_BLOCK_MASK) == 0) \ bf_e_cblock(bfs, &(bfs->cfb_buffer[bfs->randbyte_offset])); \ t = bfs->cfb_buffer[bfs->randbyte_offset]; \ --- 574,588 ---- } } ! #define BF_CFB_UPDATE(bfs, c) \ ! { \ bfs->cfb_buffer[bfs->update_offset] ^= (char_u)c; \ if (++bfs->update_offset == bfs->cfb_len) \ bfs->update_offset = 0; \ } ! #define BF_RANBYTE(bfs, t) \ ! { \ if ((bfs->randbyte_offset & BF_BLOCK_MASK) == 0) \ bf_e_cblock(bfs, &(bfs->cfb_buffer[bfs->randbyte_offset])); \ t = bfs->cfb_buffer[bfs->randbyte_offset]; \ *** ../vim-9.0.1233/src/cindent.c 2023-01-09 19:04:19.296528376 +0000 --- src/cindent.c 2023-01-22 20:20:20.838418430 +0000 *************** *** 2641,2647 **** // It could have been something like // case 1: if (asdf && ! // ldfd) { // } if ((curbuf->b_ind_js || curbuf->b_ind_keep_case_label) && cin_iscase(skipwhite(ml_get_curline()), FALSE)) --- 2641,2647 ---- // It could have been something like // case 1: if (asdf && ! // condition) { // } if ((curbuf->b_ind_js || curbuf->b_ind_keep_case_label) && cin_iscase(skipwhite(ml_get_curline()), FALSE)) *************** *** 3275,3281 **** } // Check if we are after an "if", "while", etc. ! // Also allow " } else". if (cin_is_cinword(l) || cin_iselse(skipwhite(l))) { // Found an unterminated line after an if (), line up --- 3275,3281 ---- } // Check if we are after an "if", "while", etc. ! // Also allow "} else". if (cin_is_cinword(l) || cin_iselse(skipwhite(l))) { // Found an unterminated line after an if (), line up *************** *** 3335,3341 **** { // If we're looking at "} else", let's make sure we // find the opening brace of the enclosing scope, ! // not the one from "if () {". if (*l == '}') curwin->w_cursor.col = (colnr_T)(l - ml_get_curline()) + 1; --- 3335,3341 ---- { // If we're looking at "} else", let's make sure we // find the opening brace of the enclosing scope, ! // not the one from "if (condition) {". if (*l == '}') curwin->w_cursor.col = (colnr_T)(l - ml_get_curline()) + 1; *************** *** 3680,3686 **** // line needs to be indented as a function type spec. // Don't do this if the current line looks like a comment or if the // current line is terminated, ie. ends in ';', or if the current line ! // contains { or }: "void f() {\n if (1)" if (cur_curpos.lnum < curbuf->b_ml.ml_line_count && !cin_nocode(theline) && vim_strchr(theline, '{') == NULL --- 3680,3686 ---- // line needs to be indented as a function type spec. // Don't do this if the current line looks like a comment or if the // current line is terminated, ie. ends in ';', or if the current line ! // contains { or }: "void f(condition) {\n if (1)" if (cur_curpos.lnum < curbuf->b_ml.ml_line_count && !cin_nocode(theline) && vim_strchr(theline, '{') == NULL *** ../vim-9.0.1233/src/crypt_zip.c 2021-06-20 11:51:47.000000000 +0100 --- src/crypt_zip.c 2023-01-22 20:17:15.790435844 +0000 *************** *** 60,66 **** /* * Return the next byte in the pseudo-random sequence. */ ! #define DECRYPT_BYTE_ZIP(keys, t) { \ short_u temp = (short_u)keys[2] | 2; \ t = (int)(((unsigned)(temp * (temp ^ 1U)) >> 8) & 0xff); \ } --- 60,67 ---- /* * Return the next byte in the pseudo-random sequence. */ ! #define DECRYPT_BYTE_ZIP(keys, t) \ ! { \ short_u temp = (short_u)keys[2] | 2; \ t = (int)(((unsigned)(temp * (temp ^ 1U)) >> 8) & 0xff); \ } *** ../vim-9.0.1233/src/diff.c 2023-01-09 19:04:19.300528373 +0000 --- src/diff.c 2023-01-22 20:27:41.426292325 +0000 *************** *** 1680,1688 **** { if (dio->dio_internal) { ! if (line_idx >= dout->dout_ga.ga_len) { break; // did last line - } hunk = ((diffhunk_T **)dout->dout_ga.ga_data)[line_idx++]; } else --- 1680,1687 ---- { if (dio->dio_internal) { ! if (line_idx >= dout->dout_ga.ga_len) break; // did last line hunk = ((diffhunk_T **)dout->dout_ga.ga_data)[line_idx++]; } else *** ../vim-9.0.1233/src/digraph.c 2023-01-09 19:04:19.300528373 +0000 --- src/digraph.c 2023-01-22 20:28:00.606284103 +0000 *************** *** 2093,2099 **** if (has_mbyte) buf[(*mb_char2bytes)(code, buf)] = NUL; ! else { buf[0] = code; buf[1] = NUL; } --- 2093,2100 ---- if (has_mbyte) buf[(*mb_char2bytes)(code, buf)] = NUL; ! else ! { buf[0] = code; buf[1] = NUL; } *** ../vim-9.0.1233/src/ex_cmds.c 2023-01-09 19:04:19.304528371 +0000 --- src/ex_cmds.c 2023-01-22 20:28:37.686268823 +0000 *************** *** 722,728 **** { mark_adjust_nofold(line2 + 1, dest, -num_lines, 0L); #ifdef FEAT_FOLDING ! FOR_ALL_TAB_WINDOWS(tp, win) { if (win->w_buffer == curbuf) foldMoveRange(&win->w_folds, line1, line2, dest); } --- 722,729 ---- { mark_adjust_nofold(line2 + 1, dest, -num_lines, 0L); #ifdef FEAT_FOLDING ! FOR_ALL_TAB_WINDOWS(tp, win) ! { if (win->w_buffer == curbuf) foldMoveRange(&win->w_folds, line1, line2, dest); } *************** *** 737,743 **** { mark_adjust_nofold(dest + 1, line1 - 1, num_lines, 0L); #ifdef FEAT_FOLDING ! FOR_ALL_TAB_WINDOWS(tp, win) { if (win->w_buffer == curbuf) foldMoveRange(&win->w_folds, dest + 1, line1 - 1, line2); } --- 738,745 ---- { mark_adjust_nofold(dest + 1, line1 - 1, num_lines, 0L); #ifdef FEAT_FOLDING ! FOR_ALL_TAB_WINDOWS(tp, win) ! { if (win->w_buffer == curbuf) foldMoveRange(&win->w_folds, dest + 1, line1 - 1, line2); } *** ../vim-9.0.1233/src/gui_beval.c 2023-01-08 13:44:21.065352366 +0000 --- src/gui_beval.c 2023-01-22 20:32:19.082191401 +0000 *************** *** 645,651 **** XtTranslateKeycode(gui.dpy, event->xkey.keycode, event->xkey.state, &modifier, &keysym); ! if ((keysym == XK_Shift_L) || (keysym == XK_Shift_R)) { beval->showState = ShS_UPDATE_PENDING; (*beval->msgCB)(beval, 0); } --- 645,652 ---- XtTranslateKeycode(gui.dpy, event->xkey.keycode, event->xkey.state, &modifier, &keysym); ! if ((keysym == XK_Shift_L) || (keysym == XK_Shift_R)) ! { beval->showState = ShS_UPDATE_PENDING; (*beval->msgCB)(beval, 0); } *** ../vim-9.0.1233/src/gui_motif.c 2023-01-08 13:44:21.069352345 +0000 --- src/gui_motif.c 2023-01-22 20:33:46.146166153 +0000 *************** *** 167,182 **** Dimension width, height; tab_scroll_w = XtNameToWidget(tabLine, scroller_name); ! if (tab_scroll_w != (Widget)0) { XtVaGetValues(tab_scroll_w, XmNx, &pos_x, XmNy, &pos_y, XmNwidth, &width, XmNheight, &height, NULL); ! if (pos_x >= 0) { // Tab scroller (next) is visible ! if ((event->x >= pos_x) && (event->x <= pos_x + width) && ! (event->y >= pos_y) && (event->y <= pos_y + height)) { // Clicked on the scroller return TRUE; - } } } return FALSE; --- 167,183 ---- Dimension width, height; tab_scroll_w = XtNameToWidget(tabLine, scroller_name); ! if (tab_scroll_w != (Widget)0) ! { XtVaGetValues(tab_scroll_w, XmNx, &pos_x, XmNy, &pos_y, XmNwidth, &width, XmNheight, &height, NULL); ! if (pos_x >= 0) ! { // Tab scroller (next) is visible ! if (event->x >= pos_x && event->x <= pos_x + width ! && event->y >= pos_y && event->y <= pos_y + height) // Clicked on the scroller return TRUE; } } return FALSE; *** ../vim-9.0.1233/src/gui_photon.c 2023-01-08 13:44:21.069352345 +0000 --- src/gui_photon.c 2023-01-22 20:34:16.478157880 +0000 *************** *** 361,367 **** PhWindowEvent_t *we = info->cbdata; ushort_t *width, *height; ! switch (we->event_f) { case Ph_WM_CLOSE: gui_shell_closed(); break; --- 361,368 ---- PhWindowEvent_t *we = info->cbdata; ushort_t *width, *height; ! switch (we->event_f) ! { case Ph_WM_CLOSE: gui_shell_closed(); break; *** ../vim-9.0.1233/src/gui_x11.c 2023-01-08 13:44:21.073352325 +0000 --- src/gui_x11.c 2023-01-22 20:34:45.938150059 +0000 *************** *** 3095,3104 **** unsigned int mask; if (gui.wid && XQueryPointer(gui.dpy, gui.wid, &root, &child, ! &rootx, &rooty, &winx, &winy, &mask)) { *x = winx; *y = winy; ! } else { *x = -1; *y = -1; } --- 3095,3107 ---- unsigned int mask; if (gui.wid && XQueryPointer(gui.dpy, gui.wid, &root, &child, ! &rootx, &rooty, &winx, &winy, &mask)) ! { *x = winx; *y = winy; ! } ! else ! { *x = -1; *y = -1; } *** ../vim-9.0.1233/src/gui_xmebw.c 2021-12-27 17:12:21.000000000 +0000 --- src/gui_xmebw.c 2023-01-22 20:38:05.646102399 +0000 *************** *** 281,301 **** // width height ncolors cpp [x_hot y_hot] "12 12 4 1 0 0", // colors ! " s iconColor1 m black c #000000", ". s none m none c none", "X s topShadowColor m none c #DCDEE5", "o s bottomShadowColor m black c #5D6069", // pixels ! " ..", ! " XXXXXXXX ..", ! " X....... o.", ! " X....... o.", ! " X....... o.", ! " X....... o.", ! " X....... o.", ! " X....... o.", ! " X....... o.", ! " o.", "..ooooooooo.", "............"}; --- 281,301 ---- // width height ncolors cpp [x_hot y_hot] "12 12 4 1 0 0", // colors ! "# s iconColor1 m black c #000000", ". s none m none c none", "X s topShadowColor m none c #DCDEE5", "o s bottomShadowColor m black c #5D6069", // pixels ! "##########..", ! "#XXXXXXXX#..", ! "#X.......#o.", ! "#X.......#o.", ! "#X.......#o.", ! "#X.......#o.", ! "#X.......#o.", ! "#X.......#o.", ! "#X.......#o.", ! "##########o.", "..ooooooooo.", "............"}; *** ../vim-9.0.1233/src/if_cscope.c 2023-01-12 12:33:25.420525192 +0000 --- src/if_cscope.c 2023-01-22 20:39:48.078080910 +0000 *************** *** 1463,1469 **** return -1; } (void)strcpy(csinfo[i].ppath, (const char *)ppath); ! } else csinfo[i].ppath = NULL; if (flags != NULL) --- 1463,1470 ---- return -1; } (void)strcpy(csinfo[i].ppath, (const char *)ppath); ! } ! else csinfo[i].ppath = NULL; if (flags != NULL) *************** *** 1475,1481 **** return -1; } (void)strcpy(csinfo[i].flags, (const char *)flags); ! } else csinfo[i].flags = NULL; #if defined(UNIX) --- 1476,1483 ---- return -1; } (void)strcpy(csinfo[i].flags, (const char *)flags); ! } ! else csinfo[i].flags = NULL; #if defined(UNIX) *** ../vim-9.0.1233/src/if_lua.c 2023-01-12 12:33:25.424525189 +0000 --- src/if_lua.c 2023-01-22 20:40:06.854077163 +0000 *************** *** 657,665 **** lua_pushvalue(L, pos); lua_tableref = luaL_ref(L, LUA_REGISTRYINDEX); ! if (lua_getmetatable(L, pos)) { lua_getfield(L, -1, LUA___CALL); ! if (lua_isfunction(L, -1)) { char_u *name; int lua_funcref = luaL_ref(L, LUA_REGISTRYINDEX); luaV_CFuncState *state = ALLOC_CLEAR_ONE(luaV_CFuncState); --- 657,667 ---- lua_pushvalue(L, pos); lua_tableref = luaL_ref(L, LUA_REGISTRYINDEX); ! if (lua_getmetatable(L, pos)) ! { lua_getfield(L, -1, LUA___CALL); ! if (lua_isfunction(L, -1)) ! { char_u *name; int lua_funcref = luaL_ref(L, LUA_REGISTRYINDEX); luaV_CFuncState *state = ALLOC_CLEAR_ONE(luaV_CFuncState); *************** *** 827,833 **** luatyp *o = NULL; \ if (obj == NULL) \ lua_pushnil(L); \ ! else { \ luaV_getudata(L, obj); \ if (lua_isnil(L, -1)) /* not interned? */ \ { \ --- 829,836 ---- luatyp *o = NULL; \ if (obj == NULL) \ lua_pushnil(L); \ ! else \ ! { \ luaV_getudata(L, obj); \ if (lua_isnil(L, -1)) /* not interned? */ \ { \ *** ../vim-9.0.1233/src/if_python3.c 2023-01-12 12:33:25.424525189 +0000 --- src/if_python3.c 2023-01-22 20:44:40.122027472 +0000 *************** *** 1505,1511 **** { long _idx = PyLong_AsLong(idx); return BufferItem((BufferObject *)(self), _idx); ! } else if (PySlice_Check(idx)) { Py_ssize_t start, stop, step, slicelen; --- 1505,1512 ---- { long _idx = PyLong_AsLong(idx); return BufferItem((BufferObject *)(self), _idx); ! } ! else if (PySlice_Check(idx)) { Py_ssize_t start, stop, step, slicelen; *************** *** 1539,1545 **** return RBAsItem((BufferObject *)(self), n, val, 1, (Py_ssize_t)((BufferObject *)(self))->buf->b_ml.ml_line_count, NULL); ! } else if (PySlice_Check(idx)) { Py_ssize_t start, stop, step, slicelen; --- 1540,1547 ---- return RBAsItem((BufferObject *)(self), n, val, 1, (Py_ssize_t)((BufferObject *)(self))->buf->b_ml.ml_line_count, NULL); ! } ! else if (PySlice_Check(idx)) { Py_ssize_t start, stop, step, slicelen; *************** *** 1623,1629 **** { long _idx = PyLong_AsLong(idx); return RangeItem((RangeObject *)(self), _idx); ! } else if (PySlice_Check(idx)) { Py_ssize_t start, stop, step, slicelen; --- 1625,1632 ---- { long _idx = PyLong_AsLong(idx); return RangeItem((RangeObject *)(self), _idx); ! } ! else if (PySlice_Check(idx)) { Py_ssize_t start, stop, step, slicelen; *** ../vim-9.0.1233/src/insexpand.c 2022-11-15 13:57:35.122066675 +0000 --- src/insexpand.c 2023-01-22 20:46:52.922005807 +0000 *************** *** 263,289 **** /* * Functions to check the current CTRL-X mode. */ ! int ctrl_x_mode_none(void) { return ctrl_x_mode == 0; } ! int ctrl_x_mode_normal(void) { return ctrl_x_mode == CTRL_X_NORMAL; } ! int ctrl_x_mode_scroll(void) { return ctrl_x_mode == CTRL_X_SCROLL; } ! int ctrl_x_mode_whole_line(void) { return ctrl_x_mode == CTRL_X_WHOLE_LINE; } ! int ctrl_x_mode_files(void) { return ctrl_x_mode == CTRL_X_FILES; } ! int ctrl_x_mode_tags(void) { return ctrl_x_mode == CTRL_X_TAGS; } ! int ctrl_x_mode_path_patterns(void) { ! return ctrl_x_mode == CTRL_X_PATH_PATTERNS; } ! int ctrl_x_mode_path_defines(void) { ! return ctrl_x_mode == CTRL_X_PATH_DEFINES; } ! int ctrl_x_mode_dictionary(void) { return ctrl_x_mode == CTRL_X_DICTIONARY; } ! int ctrl_x_mode_thesaurus(void) { return ctrl_x_mode == CTRL_X_THESAURUS; } ! int ctrl_x_mode_cmdline(void) { ! return ctrl_x_mode == CTRL_X_CMDLINE || ctrl_x_mode == CTRL_X_CMDLINE_CTRL_X; } ! int ctrl_x_mode_function(void) { return ctrl_x_mode == CTRL_X_FUNCTION; } ! int ctrl_x_mode_omni(void) { return ctrl_x_mode == CTRL_X_OMNI; } ! int ctrl_x_mode_spell(void) { return ctrl_x_mode == CTRL_X_SPELL; } ! static int ctrl_x_mode_eval(void) { return ctrl_x_mode == CTRL_X_EVAL; } ! int ctrl_x_mode_line_or_eval(void) { ! return ctrl_x_mode == CTRL_X_WHOLE_LINE || ctrl_x_mode == CTRL_X_EVAL; } /* * Whether other than default completion has been selected. --- 263,301 ---- /* * Functions to check the current CTRL-X mode. */ ! int ctrl_x_mode_none(void) ! { return ctrl_x_mode == 0; } ! int ctrl_x_mode_normal(void) ! { return ctrl_x_mode == CTRL_X_NORMAL; } ! int ctrl_x_mode_scroll(void) ! { return ctrl_x_mode == CTRL_X_SCROLL; } ! int ctrl_x_mode_whole_line(void) ! { return ctrl_x_mode == CTRL_X_WHOLE_LINE; } ! int ctrl_x_mode_files(void) ! { return ctrl_x_mode == CTRL_X_FILES; } ! int ctrl_x_mode_tags(void) ! { return ctrl_x_mode == CTRL_X_TAGS; } ! int ctrl_x_mode_path_patterns(void) ! { return ctrl_x_mode == CTRL_X_PATH_PATTERNS; } ! int ctrl_x_mode_path_defines(void) ! { return ctrl_x_mode == CTRL_X_PATH_DEFINES; } ! int ctrl_x_mode_dictionary(void) ! { return ctrl_x_mode == CTRL_X_DICTIONARY; } ! int ctrl_x_mode_thesaurus(void) ! { return ctrl_x_mode == CTRL_X_THESAURUS; } ! int ctrl_x_mode_cmdline(void) ! { return ctrl_x_mode == CTRL_X_CMDLINE || ctrl_x_mode == CTRL_X_CMDLINE_CTRL_X; } ! int ctrl_x_mode_function(void) ! { return ctrl_x_mode == CTRL_X_FUNCTION; } ! int ctrl_x_mode_omni(void) ! { return ctrl_x_mode == CTRL_X_OMNI; } ! int ctrl_x_mode_spell(void) ! { return ctrl_x_mode == CTRL_X_SPELL; } ! static int ctrl_x_mode_eval(void) ! { return ctrl_x_mode == CTRL_X_EVAL; } ! int ctrl_x_mode_line_or_eval(void) ! { return ctrl_x_mode == CTRL_X_WHOLE_LINE || ctrl_x_mode == CTRL_X_EVAL; } /* * Whether other than default completion has been selected. *** ../vim-9.0.1233/src/nbdebug.c 2021-08-02 17:01:25.000000000 +0100 --- src/nbdebug.c 2023-01-22 20:49:56.529977713 +0000 *************** *** 59,71 **** #endif // for debugging purposes only ! if (wait_flags & WT_ENV && wait_var && getenv(wait_var) != NULL) { sleep(atoi(getenv(wait_var))); ! } else if (wait_flags & WT_WAIT && lookup("~/.gvimwait")) { sleep(wait_secs > 0 && wait_secs < 120 ? wait_secs : 20); ! } else if (wait_flags & WT_STOP && lookup("~/.gvimstop")) { int w = 1; ! while (w) { ; } } --- 59,77 ---- #endif // for debugging purposes only ! if (wait_flags & WT_ENV && wait_var && getenv(wait_var) != NULL) ! { sleep(atoi(getenv(wait_var))); ! } ! else if (wait_flags & WT_WAIT && lookup("~/.gvimwait")) ! { sleep(wait_secs > 0 && wait_secs < 120 ? wait_secs : 20); ! } ! else if (wait_flags & WT_STOP && lookup("~/.gvimstop")) ! { int w = 1; ! while (w) ! { ; } } *************** *** 86,94 **** nb_debug = fopen(file, "a"); time(&now); fprintf(nb_debug, "%s", get_ctime(now, TRUE)); ! if (level_var && (cp = getenv(level_var)) != NULL) { nb_dlevel = strtoul(cp, NULL, 0); ! } else { nb_dlevel = NB_TRACE; // default level } #ifdef USE_NB_ERRORHANDLER --- 92,103 ---- nb_debug = fopen(file, "a"); time(&now); fprintf(nb_debug, "%s", get_ctime(now, TRUE)); ! if (level_var && (cp = getenv(level_var)) != NULL) ! { nb_dlevel = strtoul(cp, NULL, 0); ! } ! else ! { nb_dlevel = NB_TRACE; // default level } #ifdef USE_NB_ERRORHANDLER *************** *** 103,109 **** { va_list ap; ! if (nb_debug != NULL && nb_dlevel & NB_TRACE) { va_start(ap, fmt); vfprintf(nb_debug, fmt, ap); va_end(ap); --- 112,119 ---- { va_list ap; ! if (nb_debug != NULL && nb_dlevel & NB_TRACE) ! { va_start(ap, fmt); vfprintf(nb_debug, fmt, ap); va_end(ap); *************** *** 144,150 **** "XRequest", buf, "Unknown", msg, sizeof(msg)); nbdbg("\tMajor opcode of failed request: %d (%s)\n", err->request_code, msg); ! if (err->request_code > 128) { nbdbg("\tMinor opcode of failed request: %d\n", err->minor_code); } --- 154,161 ---- "XRequest", buf, "Unknown", msg, sizeof(msg)); nbdbg("\tMajor opcode of failed request: %d (%s)\n", err->request_code, msg); ! if (err->request_code > 128) ! { nbdbg("\tMinor opcode of failed request: %d\n", err->minor_code); } *** ../vim-9.0.1233/src/os_amiga.c 2023-01-16 18:19:01.907301080 +0000 --- src/os_amiga.c 2023-01-22 20:50:26.693973287 +0000 *************** *** 1250,1256 **** // Allocate space for a packet, make it public and clear it packet = (struct StandardPacket *) AllocMem((long) sizeof(struct StandardPacket), MEMF_PUBLIC | MEMF_CLEAR); ! if (!packet) { DeletePort(replyport); return (0); } --- 1250,1257 ---- // Allocate space for a packet, make it public and clear it packet = (struct StandardPacket *) AllocMem((long) sizeof(struct StandardPacket), MEMF_PUBLIC | MEMF_CLEAR); ! if (!packet) ! { DeletePort(replyport); return (0); } *** ../vim-9.0.1233/src/os_mac_conv.c 2023-01-16 18:19:01.907301080 +0000 --- src/os_mac_conv.c 2023-01-22 20:50:57.885968752 +0000 *************** *** 107,113 **** // Determine output buffer size CFStringGetBytes(cfstr, convertRange, to, NULL, FALSE, NULL, 0, (CFIndex *)&buflen); retval = (buflen > 0) ? alloc(buflen) : NULL; ! if (retval == NULL) { CFRelease(cfstr); return NULL; } --- 107,114 ---- // Determine output buffer size CFStringGetBytes(cfstr, convertRange, to, NULL, FALSE, NULL, 0, (CFIndex *)&buflen); retval = (buflen > 0) ? alloc(buflen) : NULL; ! if (retval == NULL) ! { CFRelease(cfstr); return NULL; } *************** *** 543,549 **** utf8_str = CFStringCreateWithBytes(NULL, from, fromLen, kCFStringEncodingUTF8, FALSE); ! if (utf8_str == NULL) { if (actualLen) *actualLen = 0; return NULL; --- 544,551 ---- utf8_str = CFStringCreateWithBytes(NULL, from, fromLen, kCFStringEncodingUTF8, FALSE); ! if (utf8_str == NULL) ! { if (actualLen) *actualLen = 0; return NULL; *** ../vim-9.0.1233/src/os_vms.c 2022-05-09 19:13:02.000000000 +0100 --- src/os_vms.c 2023-01-22 20:56:40.193920801 +0000 *************** *** 118,124 **** if ( tmode == TMODE_RAW ) set_tty(0, 0); ! else{ switch (orgmode.width) { case 132: OUT_STR_NF((char_u *)"\033[?3h\033>"); break; --- 118,125 ---- if ( tmode == TMODE_RAW ) set_tty(0, 0); ! else ! { switch (orgmode.width) { case 132: OUT_STR_NF((char_u *)"\033[?3h\033>"); break; *************** *** 379,394 **** return 1; // accept all DECC$K_FILE and DECC$K_DIRECTORY ! if (vms_match_num == 0) { // first time through, setup some things ! if (NULL == vms_fmatch) { vms_fmatch = ALLOC_MULT(char_u *, EXPL_ALLOC_INC); if (!vms_fmatch) return 0; vms_match_alloced = EXPL_ALLOC_INC; vms_match_free = EXPL_ALLOC_INC; } ! else { // re-use existing space vms_match_free = vms_match_alloced; } --- 380,398 ---- return 1; // accept all DECC$K_FILE and DECC$K_DIRECTORY ! if (vms_match_num == 0) ! { // first time through, setup some things ! if (NULL == vms_fmatch) ! { vms_fmatch = ALLOC_MULT(char_u *, EXPL_ALLOC_INC); if (!vms_fmatch) return 0; vms_match_alloced = EXPL_ALLOC_INC; vms_match_free = EXPL_ALLOC_INC; } ! else ! { // re-use existing space vms_match_free = vms_match_alloced; } *************** *** 399,409 **** name=vms_tolower(name); // if name already exists, don't add it ! for (i = 0; i 0) --- 470,481 ---- vms_match_num = 0; // reset collection counter result = decc$translate_vms(vms_fixfilename(buf)); ! if ( (int) result == 0 || (int) result == -1 ) ! { cnt = 0; ! } ! else ! { cnt = decc$to_vms(result, vms_wproc, 1 /*allow wild*/ , (flags & EW_DIR ? 0:1 ) /*allow directory*/) ; } if (cnt > 0) *************** *** 524,532 **** // the result from the decc$translate_vms needs to be handled // otherwise it might create ACCVIO error in decc$to_vms result = decc$translate_vms(vms_fixfilename(path)); ! if ( (int) result == 0 || (int) result == -1 ) { cnt = 0; ! } else { cnt = decc$to_vms(result, vms_wproc, 1 /*allow_wild*/, (flags & EW_DIR ? 0:1 ) /*allow directory*/); } if (cnt > 0) --- 533,544 ---- // the result from the decc$translate_vms needs to be handled // otherwise it might create ACCVIO error in decc$to_vms result = decc$translate_vms(vms_fixfilename(path)); ! if ( (int) result == 0 || (int) result == -1 ) ! { cnt = 0; ! } ! else ! { cnt = decc$to_vms(result, vms_wproc, 1 /*allow_wild*/, (flags & EW_DIR ? 0:1 ) /*allow directory*/); } if (cnt > 0) *************** *** 554,560 **** // copy vms filename portion up to last colon // (node and/or disk) lastcolon = strrchr(in, ':'); // find last colon ! if (lastcolon != NULL) { len = lastcolon - in + 1; strncpy(out, in, len); out += len; --- 566,573 ---- // copy vms filename portion up to last colon // (node and/or disk) lastcolon = strrchr(in, ':'); // find last colon ! if (lastcolon != NULL) ! { len = lastcolon - in + 1; strncpy(out, in, len); out += len; *************** *** 565,589 **** // start of directory portion ch = *in; ! if ((ch == '[') || (ch == '/') || (ch == '<')) { // start of directory(s) ? ch = '['; SKIP_FOLLOWING_SLASHES(in); ! } else if (EQN(in, "../", 3)) { // Unix parent directory? *out++ = '['; *out++ = '-'; end_of_dir = out; ch = '.'; in += 2; SKIP_FOLLOWING_SLASHES(in); ! } else { // not a special character ! while (EQN(in, "./", 2)) { // Ignore Unix "current dir" in += 2; SKIP_FOLLOWING_SLASHES(in); } ! if (strchr(in, '/') == NULL) { // any more Unix directories ? strcpy(out, in); // No - get rest of the spec return; ! } else { *out++ = '['; // Yes, denote a Vms subdirectory ch = '.'; --in; --- 578,611 ---- // start of directory portion ch = *in; ! if ((ch == '[') || (ch == '/') || (ch == '<')) // start of directory(s) ? ! { ch = '['; SKIP_FOLLOWING_SLASHES(in); ! } ! else if (EQN(in, "../", 3)) // Unix parent directory? ! { *out++ = '['; *out++ = '-'; end_of_dir = out; ch = '.'; in += 2; SKIP_FOLLOWING_SLASHES(in); ! } ! else ! { // not a special character ! while (EQN(in, "./", 2)) // Ignore Unix "current dir" ! { in += 2; SKIP_FOLLOWING_SLASHES(in); } ! if (strchr(in, '/') == NULL) // any more Unix directories ? ! { strcpy(out, in); // No - get rest of the spec return; ! } ! else ! { *out++ = '['; // Yes, denote a Vms subdirectory ch = '.'; --in; *************** *** 596,621 **** *out++ = ch; ++in; ! while (*in != '\0') { ch = *in; ! if ((ch == ']') || (ch == '/') || (ch == '>') ) { // end of (sub)directory ? end_of_dir = out; ch = '.'; SKIP_FOLLOWING_SLASHES(in); } ! else if (EQN(in, "../", 3)) { // Unix parent directory? *out++ = '-'; end_of_dir = out; ch = '.'; in += 2; SKIP_FOLLOWING_SLASHES(in); } ! else { ! while (EQN(in, "./", 2)) { // Ignore Unix "current dir" ! end_of_dir = out; ! in += 2; ! SKIP_FOLLOWING_SLASHES(in); ! ch = *in; } } --- 618,648 ---- *out++ = ch; ++in; ! while (*in != '\0') ! { ch = *in; ! if ((ch == ']') || (ch == '/') || (ch == '>') ) // end of (sub)directory ? ! { end_of_dir = out; ch = '.'; SKIP_FOLLOWING_SLASHES(in); } ! else if (EQN(in, "../", 3)) // Unix parent directory? ! { *out++ = '-'; end_of_dir = out; ch = '.'; in += 2; SKIP_FOLLOWING_SLASHES(in); } ! else ! { ! while (EQN(in, "./", 2)) // Ignore Unix "current dir" ! { ! end_of_dir = out; ! in += 2; ! SKIP_FOLLOWING_SLASHES(in); ! ch = *in; } } *************** *** 709,717 **** *cp = '\0'; else if ((cp = vim_strrchr( fname, '.')) != NULL ) { ! if ((fp = vim_strrchr( fname, ']')) != NULL ) {;} ! else if ((fp = vim_strrchr( fname, '>')) != NULL ) {;} ! else fp = fname; while ( *fp != '\0' && fp < cp ) if ( *fp++ == '.' ) --- 736,747 ---- *cp = '\0'; else if ((cp = vim_strrchr( fname, '.')) != NULL ) { ! if ((fp = vim_strrchr( fname, ']')) != NULL ) ! {;} ! else if ((fp = vim_strrchr( fname, '>')) != NULL ) ! {;} ! else ! fp = fname; while ( *fp != '\0' && fp < cp ) if ( *fp++ == '.' ) *************** *** 750,756 **** if (!iochan) get_tty(); ! if (sec > 0) { // time-out specified; convert it to absolute time // sec>0 requirement of lib$cvtf_to_internal_time() --- 780,787 ---- if (!iochan) get_tty(); ! if (sec > 0) ! { // time-out specified; convert it to absolute time // sec>0 requirement of lib$cvtf_to_internal_time() *************** *** 780,786 **** return 0; // error } ! while (TRUE) { // select() status = sys$qiow(0, iochan, IO$_SENSEMODE | IO$M_TYPEAHDCNT, iosb, 0, 0, &typeahead, 8, 0, 0, 0, 0); --- 811,818 ---- return 0; // error } ! while (TRUE) ! { // select() status = sys$qiow(0, iochan, IO$_SENSEMODE | IO$M_TYPEAHDCNT, iosb, 0, 0, &typeahead, 8, 0, 0, 0, 0); *************** *** 791,803 **** return 1; // ready to read // there's nothing to read; what now? ! if (msec == 0) { // immediate time-out; return impatiently return 0; ! } else if (msec < 0) { // no time-out; wait on indefinitely return 1; // fakeout to force a wait in vms_read() ! } else { // time-out needs to be checked status = sys$gettim(&time_curr); if (status != SS$_NORMAL) --- 823,840 ---- return 1; // ready to read // there's nothing to read; what now? ! if (msec == 0) ! { // immediate time-out; return impatiently return 0; ! } ! else if (msec < 0) ! { // no time-out; wait on indefinitely return 1; // fakeout to force a wait in vms_read() ! } ! else ! { // time-out needs to be checked status = sys$gettim(&time_curr); if (status != SS$_NORMAL) *** ../vim-9.0.1233/src/quickfix.c 2023-01-18 18:17:43.865053454 +0000 --- src/quickfix.c 2023-01-22 21:02:45.409907817 +0000 *************** *** 283,289 **** {'m', ".\\+"}, // 7 #define FMT_PATTERN_R 8 {'r', ".*"}, // 8 ! {'p', "[- .]*"}, // 9 {'v', "\\d\\+"}, // 10 {'s', ".\\+"}, // 11 {'o', ".\\+"} // 12 --- 283,289 ---- {'m', ".\\+"}, // 7 #define FMT_PATTERN_R 8 {'r', ".*"}, // 8 ! {'p', "[- .]*"}, // 9 {'v', "\\d\\+"}, // 10 {'s', ".\\+"}, // 11 {'o', ".\\+"} // 12 *************** *** 3623,3629 **** if (qfp->qf_module != NULL && *qfp->qf_module != NUL) vim_snprintf((char *)IObuff, IOSIZE, "%2d %s", qf_idx, (char *)qfp->qf_module); ! else { if (qfp->qf_fnum != 0 && (buf = buflist_findnr(qfp->qf_fnum)) != NULL) { --- 3623,3630 ---- if (qfp->qf_module != NULL && *qfp->qf_module != NUL) vim_snprintf((char *)IObuff, IOSIZE, "%2d %s", qf_idx, (char *)qfp->qf_module); ! else ! { if (qfp->qf_fnum != 0 && (buf = buflist_findnr(qfp->qf_fnum)) != NULL) { *** ../vim-9.0.1233/src/regexp_bt.c 2023-01-18 18:17:43.865053454 +0000 --- src/regexp_bt.c 2023-01-22 20:58:07.993908916 +0000 *************** *** 2696,2706 **** REG_MULTI ? save_se_multi((savep), (posp)) : save_se_one((savep), (pp)) // After a failed match restore the sub-expressions. ! #define restore_se(savep, posp, pp) { \ if (REG_MULTI) \ *(posp) = (savep)->se_u.pos; \ else \ ! *(pp) = (savep)->se_u.ptr; } /* * Tentatively set the sub-expression start to the current position (after --- 2696,2708 ---- REG_MULTI ? save_se_multi((savep), (posp)) : save_se_one((savep), (pp)) // After a failed match restore the sub-expressions. ! #define restore_se(savep, posp, pp) \ ! { \ if (REG_MULTI) \ *(posp) = (savep)->se_u.pos; \ else \ ! *(pp) = (savep)->se_u.ptr; \ ! } /* * Tentatively set the sub-expression start to the current position (after *** ../vim-9.0.1233/src/regexp_nfa.c 2023-01-18 18:17:43.869053455 +0000 --- src/regexp_nfa.c 2023-01-22 21:03:40.893906259 +0000 *************** *** 5799,5808 **** goto theend; } ! #define ADD_STATE_IF_MATCH(state) \ ! if (result) { \ ! add_state = state->out; \ ! add_off = clen; \ } /* --- 5799,5809 ---- goto theend; } ! #define ADD_STATE_IF_MATCH(state) \ ! if (result) \ ! { \ ! add_state = state->out; \ ! add_off = clen; \ } /* *** ../vim-9.0.1233/src/search.c 2022-12-23 19:05:54.662600613 +0000 --- src/search.c 2023-01-22 21:04:13.657905123 +0000 *************** *** 161,167 **** add_to_history(HIST_SEARCH, pat, TRUE, NUL); if (used_pat) ! *used_pat = pat; vim_free(mr_pattern); #ifdef FEAT_RIGHTLEFT --- 161,167 ---- add_to_history(HIST_SEARCH, pat, TRUE, NUL); if (used_pat) ! *used_pat = pat; vim_free(mr_pattern); #ifdef FEAT_RIGHTLEFT *************** *** 2641,2647 **** * (actually, we skip #\( et al) */ if (curbuf->b_p_lisp ! && vim_strchr((char_u *)"(){}[]", c) != NULL && pos.col > 1 && check_prevcol(linep, pos.col, '\\', NULL) && check_prevcol(linep, pos.col - 1, '#', NULL)) --- 2641,2647 ---- * (actually, we skip #\( et al) */ if (curbuf->b_p_lisp ! && vim_strchr((char_u *)"{}()[]", c) != NULL && pos.col > 1 && check_prevcol(linep, pos.col, '\\', NULL) && check_prevcol(linep, pos.col - 1, '#', NULL)) *** ../vim-9.0.1233/src/termlib.c 2021-06-05 19:57:28.000000000 +0100 --- src/termlib.c 2023-01-22 21:05:48.453901000 +0000 *************** *** 286,300 **** if (!*tmp) break; ! if (_match(id, tmp) == len) { tmp += len; // find '=' '@' or '#' if (*tmp == '@') // :xx@: entry for tc return 0; // deleted entry hold= *buf; ! while (*++tmp && *tmp != ':') { // not at end of field ! switch(*tmp) { case '\\': // Expand escapes here ! switch(*++tmp) { case 0: // ignore backslashes tmp--; // at end of entry break; // shouldn't happen --- 286,304 ---- if (!*tmp) break; ! if (_match(id, tmp) == len) ! { tmp += len; // find '=' '@' or '#' if (*tmp == '@') // :xx@: entry for tc return 0; // deleted entry hold= *buf; ! while (*++tmp && *tmp != ':') // not at end of field ! { ! switch(*tmp) ! { case '\\': // Expand escapes here ! switch(*++tmp) ! { case 0: // ignore backslashes tmp--; // at end of entry break; // shouldn't happen *************** *** 401,411 **** bufp = buffer; ptr = cm; ! while (*ptr) { ! if ((c = *ptr++) != '%') { // normal char *bufp++ = c; ! } else { // % escape ! switch(c = *ptr++) { case 'd': // decimal bufp = _addfmt(bufp, "%d", line); line = col; --- 405,420 ---- bufp = buffer; ptr = cm; ! while (*ptr) ! { ! if ((c = *ptr++) != '%') // normal char ! { *bufp++ = c; ! } ! else ! { // % escape ! switch(c = *ptr++) ! { case 'd': // decimal bufp = _addfmt(bufp, "%d", line); line = col; *************** *** 430,436 **** if (line == '\t' || // these are line == '\n' || // chars that line == '\004' || // UNIX hates ! line == '\0') { line++; // so go to next pos if (reverse == (line == col)) addup=1; // and mark UP --- 439,446 ---- if (line == '\t' || // these are line == '\n' || // chars that line == '\004' || // UNIX hates ! line == '\0') ! { line++; // so go to next pos if (reverse == (line == col)) addup=1; // and mark UP *************** *** 472,478 **** } if (addup) // add upline ! if (UP) { ptr=UP; while (VIM_ISDIGIT(*ptr) || *ptr == '.') ptr++; --- 482,489 ---- } if (addup) // add upline ! if (UP) ! { ptr=UP; while (VIM_ISDIGIT(*ptr) || *ptr == '.') ptr++; *************** *** 483,489 **** } if (addbak) // add backspace ! if (BC) { ptr=BC; while (VIM_ISDIGIT(*ptr) || *ptr == '.') ptr++; --- 494,501 ---- } if (addbak) // add backspace ! if (BC) ! { ptr=BC; while (VIM_ISDIGIT(*ptr) || *ptr == '.') ptr++; *************** *** 536,552 **** counter, // digits atol(const char *); ! if (VIM_ISDIGIT(*cp)) { counter = 0; frac = 1000; while (VIM_ISDIGIT(*cp)) counter = counter * 10L + (long)(*cp++ - '0'); if (*cp == '.') ! while (VIM_ISDIGIT(*++cp)) { counter = counter * 10L + (long)(*cp++ - '0'); frac = frac * 10; } ! if (*cp!='*') { // multiply by affected lines if (affcnt>1) affcnt = 1; } else --- 548,567 ---- counter, // digits atol(const char *); ! if (VIM_ISDIGIT(*cp)) ! { counter = 0; frac = 1000; while (VIM_ISDIGIT(*cp)) counter = counter * 10L + (long)(*cp++ - '0'); if (*cp == '.') ! while (VIM_ISDIGIT(*++cp)) ! { counter = counter * 10L + (long)(*cp++ - '0'); frac = frac * 10; } ! if (*cp!='*') // multiply by affected lines ! { if (affcnt>1) affcnt = 1; } else *** ../vim-9.0.1233/src/uninstall.c 2020-02-17 21:50:46.000000000 +0000 --- src/uninstall.c 2023-01-22 21:06:06.645900076 +0000 *************** *** 49,55 **** if (advapi_lib != NULL) delete_key_ex = (LONG (WINAPI *)(HKEY, LPCTSTR, REGSAM, DWORD))GetProcAddress(advapi_lib, "RegDeleteKeyExA"); } ! if (delete_key_ex != NULL) { return (*delete_key_ex)(hRootKey, key, flag, 0); } return RegDeleteKey(hRootKey, key); --- 49,56 ---- if (advapi_lib != NULL) delete_key_ex = (LONG (WINAPI *)(HKEY, LPCTSTR, REGSAM, DWORD))GetProcAddress(advapi_lib, "RegDeleteKeyExA"); } ! if (delete_key_ex != NULL) ! { return (*delete_key_ex)(hRootKey, key, flag, 0); } return RegDeleteKey(hRootKey, key); *** ../vim-9.0.1233/src/ex_cmds.h 2023-01-05 19:59:13.999418051 +0000 --- src/ex_cmds.h 2023-01-22 21:06:39.053898348 +0000 *************** *** 98,104 **** * Not supported commands are included to avoid ambiguities. */ #ifdef DO_DECLARE_EXCMD ! # define EXCMD(a, b, c, d, e) {(char_u *)b, c, (long_u)(d), e} typedef void (*ex_func_T) (exarg_T *eap); --- 98,105 ---- * Not supported commands are included to avoid ambiguities. */ #ifdef DO_DECLARE_EXCMD ! # define EXCMD(a, b, c, d, e) \ ! {(char_u *)b, c, (long_u)(d), e} typedef void (*ex_func_T) (exarg_T *eap); *** ../vim-9.0.1233/src/macros.h 2022-12-31 15:12:58.046637322 +0000 --- src/macros.h 2023-01-22 21:07:27.741895593 +0000 *************** *** 274,287 **** # ifdef MSWIN # ifndef isnan # define isnan(x) _isnan(x) ! static __inline int isinf(double x) { return !_finite(x) && !_isnan(x); } # endif # else # ifndef HAVE_ISNAN ! static inline int isnan(double x) { return x != x; } # endif # ifndef HAVE_ISINF ! static inline int isinf(double x) { return !isnan(x) && isnan(x - x); } # endif # endif # if !defined(INFINITY) --- 274,290 ---- # ifdef MSWIN # ifndef isnan # define isnan(x) _isnan(x) ! static __inline int isinf(double x) ! { return !_finite(x) && !_isnan(x); } # endif # else # ifndef HAVE_ISNAN ! static inline int isnan(double x) ! { return x != x; } # endif # ifndef HAVE_ISINF ! static inline int isinf(double x) ! { return !isnan(x) && isnan(x - x); } # endif # endif # if !defined(INFINITY) *************** *** 335,341 **** */ #define VIM_CLEAR(p) \ do { \ ! if ((p) != NULL) { \ vim_free(p); \ (p) = NULL; \ } \ --- 338,345 ---- */ #define VIM_CLEAR(p) \ do { \ ! if ((p) != NULL) \ ! { \ vim_free(p); \ (p) = NULL; \ } \ *** ../vim-9.0.1233/src/optiondefs.h 2023-01-10 12:37:33.253580676 +0000 --- src/optiondefs.h 2023-01-22 21:07:59.905893642 +0000 *************** *** 2849,2855 **** {(char_u *)TRUE, (char_u *)0L} SCTX_INIT}, // terminal output codes ! #define p_term(sss, vvv) {sss, NULL, P_STRING|P_VI_DEF|P_RALL|P_SECURE, \ (char_u *)&vvv, PV_NONE, \ {(char_u *)"", (char_u *)0L} SCTX_INIT}, --- 2849,2856 ---- {(char_u *)TRUE, (char_u *)0L} SCTX_INIT}, // terminal output codes ! #define p_term(sss, vvv) \ ! {sss, NULL, P_STRING|P_VI_DEF|P_RALL|P_SECURE, \ (char_u *)&vvv, PV_NONE, \ {(char_u *)"", (char_u *)0L} SCTX_INIT}, *** ../vim-9.0.1233/src/nbdebug.h 2021-08-02 17:01:25.000000000 +0100 --- src/nbdebug.h 2023-01-22 21:08:43.629890827 +0000 *************** *** 15,21 **** # ifndef ASSERT # define ASSERT(c) \ ! if (!(c)) { \ fprintf(stderr, "Assertion failed: line %d, file %s\n", \ __LINE__, __FILE__); \ fflush(stderr); \ --- 15,22 ---- # ifndef ASSERT # define ASSERT(c) \ ! if (!(c)) \ ! { \ fprintf(stderr, "Assertion failed: line %d, file %s\n", \ __LINE__, __FILE__); \ fflush(stderr); \ *** ../vim-9.0.1233/src/nv_cmds.h 2022-01-31 12:09:54.000000000 +0000 --- src/nv_cmds.h 2023-01-22 21:09:24.657888037 +0000 *************** *** 25,31 **** /* * Used when building Vim. */ ! # define NVCMD(a, b, c, d) {a, b, c, d} #ifdef FEAT_GUI #define NV_VER_SCROLLBAR nv_ver_scrollbar --- 25,32 ---- /* * Used when building Vim. */ ! # define NVCMD(a, b, c, d) \ ! {a, b, c, d} #ifdef FEAT_GUI #define NV_VER_SCROLLBAR nv_ver_scrollbar *** ../vim-9.0.1233/src/vim.h 2023-01-22 18:38:45.502261340 +0000 --- src/vim.h 2023-01-22 21:11:11.441880198 +0000 *************** *** 2498,2521 **** # define gtk_widget_set_window(wid, win) \ do { (wid)->window = (win); } while (0) # define gtk_widget_set_can_default(wid, can) \ ! do { if (can) { GTK_WIDGET_SET_FLAGS(wid, GTK_CAN_DEFAULT); } \ ! else { GTK_WIDGET_UNSET_FLAGS(wid, GTK_CAN_DEFAULT); } } while (0) # define gtk_widget_set_can_focus(wid, can) \ ! do { if (can) { GTK_WIDGET_SET_FLAGS(wid, GTK_CAN_FOCUS); } \ ! else { GTK_WIDGET_UNSET_FLAGS(wid, GTK_CAN_FOCUS); } } while (0) # define gtk_widget_set_visible(wid, vis) \ ! do { if (vis) { gtk_widget_show(wid); } \ ! else { gtk_widget_hide(wid); } } while (0) # endif # if !GTK_CHECK_VERSION(2,20,0) # define gtk_widget_get_mapped(wid) GTK_WIDGET_MAPPED(wid) # define gtk_widget_get_realized(wid) GTK_WIDGET_REALIZED(wid) # define gtk_widget_set_mapped(wid, map) \ ! do { if (map) { GTK_WIDGET_SET_FLAGS(wid, GTK_MAPPED); } \ ! else { GTK_WIDGET_UNSET_FLAGS(wid, GTK_MAPPED); } } while (0) # define gtk_widget_set_realized(wid, rea) \ ! do { if (rea) { GTK_WIDGET_SET_FLAGS(wid, GTK_REALIZED); } \ ! else { GTK_WIDGET_UNSET_FLAGS(wid, GTK_REALIZED); } } while (0) # endif #endif --- 2498,2531 ---- # define gtk_widget_set_window(wid, win) \ do { (wid)->window = (win); } while (0) # define gtk_widget_set_can_default(wid, can) \ ! do { if (can) \ ! { GTK_WIDGET_SET_FLAGS(wid, GTK_CAN_DEFAULT); } \ ! else \ ! { GTK_WIDGET_UNSET_FLAGS(wid, GTK_CAN_DEFAULT); } } while (0) # define gtk_widget_set_can_focus(wid, can) \ ! do { if (can) \ ! { GTK_WIDGET_SET_FLAGS(wid, GTK_CAN_FOCUS); } \ ! else \ ! { GTK_WIDGET_UNSET_FLAGS(wid, GTK_CAN_FOCUS); } } while (0) # define gtk_widget_set_visible(wid, vis) \ ! do { if (vis) \ ! { gtk_widget_show(wid); } \ ! else \ ! { gtk_widget_hide(wid); } } while (0) # endif # if !GTK_CHECK_VERSION(2,20,0) # define gtk_widget_get_mapped(wid) GTK_WIDGET_MAPPED(wid) # define gtk_widget_get_realized(wid) GTK_WIDGET_REALIZED(wid) # define gtk_widget_set_mapped(wid, map) \ ! do { if (map) \ ! { GTK_WIDGET_SET_FLAGS(wid, GTK_MAPPED); } \ ! else \ ! { GTK_WIDGET_UNSET_FLAGS(wid, GTK_MAPPED); } } while (0) # define gtk_widget_set_realized(wid, rea) \ ! do { if (rea) \ ! { GTK_WIDGET_SET_FLAGS(wid, GTK_REALIZED); } \ ! else \ ! { GTK_WIDGET_UNSET_FLAGS(wid, GTK_REALIZED); } } while (0) # endif #endif *** ../vim-9.0.1233/src/version.c 2023-01-22 20:14:22.898453926 +0000 --- src/version.c 2023-01-22 21:12:53.333872020 +0000 *************** *** 697,698 **** --- 697,700 ---- { /* Add new patch number below this line */ + /**/ + 1234, /**/ -- You have the right to remain silent. Anything you say will be misquoted, then used against you. /// 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 ///