Mercurial > vim
diff src/window.c @ 17789:0f7ae8010787 v8.1.1891
patch 8.1.1891: functions used in one file are global
commit https://github.com/vim/vim/commit/5843f5f37b0632e2d706abc9014bfd7d98f7b02e
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Aug 20 20:13:45 2019 +0200
patch 8.1.1891: functions used in one file are global
Problem: Functions used in one file are global.
Solution: Add "static". (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/4840)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 20 Aug 2019 20:15:07 +0200 |
parents | 1be29c149103 |
children | 7e6b7a4f13bc |
line wrap: on
line diff
--- a/src/window.c +++ b/src/window.c @@ -39,8 +39,11 @@ static int leave_tabpage(buf_T *new_curb static void enter_tabpage(tabpage_T *tp, buf_T *old_curbuf, int trigger_enter_autocmds, int trigger_leave_autocmds); static void frame_fix_height(win_T *wp); static int frame_minheight(frame_T *topfrp, win_T *next_curwin); +static int may_open_tabpage(void); static void win_enter_ext(win_T *wp, int undo_sync, int no_curwin, int trigger_new_autocmds, int trigger_enter_autocmds, int trigger_leave_autocmds); static void win_free(win_T *wp, tabpage_T *tp); +static int win_unlisted(win_T *wp); +static void win_append(win_T *after, win_T *wp); static void frame_append(frame_T *after, frame_T *frp); static void frame_insert(frame_T *before, frame_T *frp); static void frame_remove(frame_T *frp); @@ -3541,17 +3544,7 @@ close_others( emsg(_("E445: Other window contains changes")); } -/* - * Init the current window "curwin". - * Called when a new file is being edited. - */ - void -curwin_init(void) -{ - win_init_empty(curwin); -} - - void + static void win_init_empty(win_T *wp) { redraw_win_later(wp, NOT_VALID); @@ -3574,6 +3567,16 @@ win_init_empty(win_T *wp) } /* + * Init the current window "curwin". + * Called when a new file is being edited. + */ + void +curwin_init(void) +{ + win_init_empty(curwin); +} + +/* * Allocate the first window and put an empty buffer in it. * Called from main(). * Return FAIL when something goes wrong (out of memory). @@ -3861,7 +3864,7 @@ win_new_tabpage(int after) * like with ":split". * Returns OK if a new tab page was created, FAIL otherwise. */ - int + static int may_open_tabpage(void) { int n = (cmdmod.tab == 0) ? postponed_split_tab : cmdmod.tab; @@ -4952,7 +4955,7 @@ win_free( * Return TRUE if "wp" is not in the list of windows: the autocmd window or a * popup window. */ - int + static int win_unlisted(win_T *wp) { return wp == aucmd_win || WIN_IS_POPUP(wp); @@ -4982,7 +4985,7 @@ win_free_popup(win_T *win) /* * Append window "wp" in the window list after window "after". */ - void + static void win_append(win_T *after, win_T *wp) { win_T *before;