]> granicus.if.org Git - vim/commitdiff
patch 8.2.0514: several global functions are used in only one file v8.2.0514
authorBram Moolenaar <Bram@vim.org>
Sun, 5 Apr 2020 16:56:05 +0000 (18:56 +0200)
committerBram Moolenaar <Bram@vim.org>
Sun, 5 Apr 2020 16:56:05 +0000 (18:56 +0200)
Problem:    Several global functions are used in only one file.
Solution:   Make the functions static. (Yegappan Lakshmanan, closes #5884)

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

index 17a385c9244c6b3677d5897545733b9a4cd99629..c60d75b3c36ac28f6f7a9d3ea706ab821db77bed 100644 (file)
@@ -73,6 +73,8 @@ static void redraw_custom_statusline(win_T *wp);
 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;
index c4bc957fcd384b5896292ac2c5f41d8e356e0fb3..d434d58788e853ddd8738ca5edba7b491c6ede18 100644 (file)
@@ -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;
index 6b1068dda8583fcba123a6b60a591a618cdc1617..7bbdf35834f3c62df541f43dadc18f41ab9cc7ea 100644 (file)
@@ -99,7 +99,7 @@ static int    inchar(char_u *buf, int maxlen, long wait_time);
 /*
  * Free and clear a buffer.
  */
-    void
+    static void
 free_buff(buffheader_T *buf)
 {
     buffblock_T        *p, *np;
index a7f4d40f7ea2263786531f06420c5a20422a8a72..b532e28ebca83a61792889fff2402f8ff4d26b89 100644 (file)
@@ -20,6 +20,8 @@ static char *e_listblobarg = N_("E899: Argument of %s must be a List or Blob");
 // 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)
     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;
index 8ac12d90346f04519b66f09d1b3ce4c97414210d..7414fa0936d997111da89133c3ed1b3b2b3605bb 100644 (file)
@@ -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);
index ff2f58ff903987e50e646024457c88a2491889d9..4338b20f73e6c43d5dbd7bafa9bbb717eecf5033 100644 (file)
@@ -54,7 +54,6 @@ int get_var_tv(char_u *name, int len, typval_T *rettv, dictitem_T **dip, int ver
 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);
index 0e24bd392cae0cde29c0e679b704a7dcc85f7488..0382122294ca11a4eb8531ce5d192ce2a6a41f17 100644 (file)
@@ -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);
index d60463d2ddaa379d715633dcef5789690e0134be..c2768748a75938fe8aa804003313909453669b6d 100644 (file)
@@ -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 *rettv, int evaluate, int do_error);
 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);
index 8139772376b1359b411edc003648aa48c4f7273e..417000c38ed455072ec394660d0417d269e5247e 100644 (file)
@@ -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 : */
index be99f998dc2ba85cf981287d08901e5d429cc18d..f881c1fb290d726a4dfc68b8801ccf3113d96791 100644 (file)
@@ -738,6 +738,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    514,
 /**/
     513,
 /**/
@@ -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"
 {