changeset 19916:dcec86d796bc v8.2.0514

patch 8.2.0514: several global functions are used in only one file Commit: https://github.com/vim/vim/commit/bdff012f4416c75e65950a19688533c4def5abf6 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Apr 5 18:56:05 2020 +0200 patch 8.2.0514: several global functions are used in only one file Problem: Several global functions are used in only one file. Solution: Make the functions static. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/5884)
author Bram Moolenaar <Bram@vim.org>
date Sun, 05 Apr 2020 19:00:37 +0200
parents 882299cf6a38
children 94b3ff2cc739
files src/drawscreen.c src/evalvars.c src/getchar.c src/list.c src/proto/drawscreen.pro src/proto/evalvars.pro src/proto/getchar.pro src/proto/list.pro src/proto/version.pro src/version.c
diffstat 10 files changed, 13 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/src/drawscreen.c
+++ b/src/drawscreen.c
@@ -73,6 +73,8 @@ static void redraw_custom_statusline(win
 static int  did_update_one_window;
 #endif
 
+static void win_redr_status(win_T *wp, int ignore_pum);
+
 /*
  * Based on the current value of curwin->w_topline, transfer a screenfull
  * of stuff from Filemem to ScreenLines[], and update curwin->w_botline.
@@ -382,7 +384,7 @@ update_screen(int type_arg)
  * If "ignore_pum" is TRUE, also redraw statusline when the popup menu is
  * displayed.
  */
-    void
+    static void
 win_redr_status(win_T *wp, int ignore_pum UNUSED)
 {
     int		row;
--- a/src/evalvars.c
+++ b/src/evalvars.c
@@ -2435,7 +2435,7 @@ find_var_in_ht(
 /*
  * Get the script-local hashtab.  NULL if not in a script context.
  */
-    hashtab_T *
+    static hashtab_T *
 get_script_local_ht(void)
 {
     scid_T sid = current_sctx.sc_sid;
--- a/src/getchar.c
+++ b/src/getchar.c
@@ -99,7 +99,7 @@ static int	inchar(char_u *buf, int maxle
 /*
  * Free and clear a buffer.
  */
-    void
+    static void
 free_buff(buffheader_T *buf)
 {
     buffblock_T	*p, *np;
--- a/src/list.c
+++ b/src/list.c
@@ -20,6 +20,8 @@ static char *e_listblobarg = N_("E899: A
 // List heads for garbage collection.
 static list_T		*first_list = NULL;	// list of all lists
 
+static void list_free_item(list_T *l, listitem_T *item);
+
 /*
  * Add a watcher to a list.
  */
@@ -311,7 +313,7 @@ listitem_alloc(void)
  * Free a list item, unless it was allocated together with the list itself.
  * Does not clear the value.  Does not notify watchers.
  */
-    void
+    static void
 list_free_item(list_T *l, listitem_T *item)
 {
     if (l->lv_with_items == 0 || item < (listitem_T *)l
@@ -1225,7 +1227,7 @@ f_list2str(typval_T *argvars, typval_T *
     rettv->vval.v_string = ga.ga_data;
 }
 
-    void
+    static void
 list_remove(typval_T *argvars, typval_T *rettv, char_u *arg_errmsg)
 {
     list_T	*l;
--- a/src/proto/drawscreen.pro
+++ b/src/proto/drawscreen.pro
@@ -1,6 +1,5 @@
 /* drawscreen.c */
 int update_screen(int type_arg);
-void win_redr_status(win_T *wp, int ignore_pum);
 void showruler(int always);
 void win_redr_ruler(win_T *wp, int always, int ignore_pum);
 void after_updating_screen(int may_resize_shell);
--- a/src/proto/evalvars.pro
+++ b/src/proto/evalvars.pro
@@ -54,7 +54,6 @@ int get_var_tv(char_u *name, int len, ty
 void check_vars(char_u *name, int len);
 dictitem_T *find_var(char_u *name, hashtab_T **htp, int no_autoload);
 dictitem_T *find_var_in_ht(hashtab_T *ht, int htname, char_u *varname, int no_autoload);
-hashtab_T *get_script_local_ht(void);
 int lookup_scriptvar(char_u *name, size_t len, cctx_T *dummy);
 hashtab_T *find_var_ht(char_u *name, char_u **varname);
 char_u *get_var_value(char_u *name);
--- a/src/proto/getchar.pro
+++ b/src/proto/getchar.pro
@@ -1,5 +1,4 @@
 /* getchar.c */
-void free_buff(buffheader_T *buf);
 char_u *get_recorded(void);
 char_u *get_inserted(void);
 int stuff_empty(void);
--- a/src/proto/list.pro
+++ b/src/proto/list.pro
@@ -13,7 +13,6 @@ int list_free_nonref(int copyID);
 void list_free_items(int copyID);
 void list_free(list_T *l);
 listitem_T *listitem_alloc(void);
-void list_free_item(list_T *l, listitem_T *item);
 void listitem_free(list_T *l, listitem_T *item);
 void listitem_remove(list_T *l, listitem_T *item);
 long list_len(list_T *l);
@@ -42,7 +41,6 @@ int get_list_tv(char_u **arg, typval_T *
 int write_list(FILE *fd, list_T *list, int binary);
 void init_static_list(staticList10_T *sl);
 void f_list2str(typval_T *argvars, typval_T *rettv);
-void list_remove(typval_T *argvars, typval_T *rettv, char_u *arg_errmsg);
 void f_sort(typval_T *argvars, typval_T *rettv);
 void f_uniq(typval_T *argvars, typval_T *rettv);
 void f_filter(typval_T *argvars, typval_T *rettv);
--- a/src/proto/version.pro
+++ b/src/proto/version.pro
@@ -6,6 +6,5 @@ void ex_version(exarg_T *eap);
 void list_in_columns(char_u **items, int size, int current);
 void list_version(void);
 void maybe_intro_message(void);
-void intro_message(int colon);
 void ex_intro(exarg_T *eap);
 /* vim: set ft=c : */
--- a/src/version.c
+++ b/src/version.c
@@ -739,6 +739,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    514,
+/**/
     513,
 /**/
     512,
@@ -2234,6 +2236,7 @@ list_version(void)
 }
 
 static void do_intro_line(int row, char_u *mesg, int add_version, int attr);
+static void intro_message(int colon);
 
 /*
  * Show the intro message when not editing a file.
@@ -2253,7 +2256,7 @@ maybe_intro_message(void)
  * Only used when starting Vim on an empty file, without a file name.
  * Or with the ":intro" command (for Sven :-).
  */
-    void
+    static void
 intro_message(
     int		colon)		// TRUE for ":intro"
 {