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 #4840)
diff --git a/src/window.c b/src/window.c
index f4154e7..fabd196 100644
--- a/src/window.c
+++ b/src/window.c
@@ -39,8 +39,11 @@
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 @@
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 @@
}
/*
+ * 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 @@
* 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 @@
* 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 @@
/*
* Append window "wp" in the window list after window "after".
*/
- void
+ static void
win_append(win_T *after, win_T *wp)
{
win_T *before;