From bdff012f4416c75e65950a19688533c4def5abf6 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 5 Apr 2020 18:56:05 +0200 Subject: 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 #5884) --- src/drawscreen.c | 4 +++- src/evalvars.c | 2 +- src/getchar.c | 2 +- src/list.c | 6 ++++-- src/proto/drawscreen.pro | 1 - src/proto/evalvars.pro | 1 - src/proto/getchar.pro | 1 - src/proto/list.pro | 2 -- src/proto/version.pro | 1 - src/version.c | 5 ++++- 10 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/drawscreen.c b/src/drawscreen.c index 17a385c92..c60d75b3c 100644 --- a/src/drawscreen.c +++ b/src/drawscreen.c @@ -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; diff --git a/src/evalvars.c b/src/evalvars.c index c4bc957fc..d434d5878 100644 --- 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; diff --git a/src/getchar.c b/src/getchar.c index 6b1068dda..7bbdf3583 100644 --- a/src/getchar.c +++ b/src/getchar.c @@ -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; diff --git a/src/list.c b/src/list.c index a7f4d40f7..b532e28eb 100644 --- a/src/list.c +++ b/src/list.c @@ -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; diff --git a/src/proto/drawscreen.pro b/src/proto/drawscreen.pro index 8ac12d903..7414fa093 100644 --- 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); diff --git a/src/proto/evalvars.pro b/src/proto/evalvars.pro index ff2f58ff9..4338b20f7 100644 --- a/src/proto/evalvars.pro +++ b/src/proto/evalvars.pro @@ -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); diff --git a/src/proto/getchar.pro b/src/proto/getchar.pro index 0e24bd392..038212229 100644 --- 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); diff --git a/src/proto/list.pro b/src/proto/list.pro index d60463d2d..c2768748a 100644 --- 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 *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); diff --git a/src/proto/version.pro b/src/proto/version.pro index 813977237..417000c38 100644 --- 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 : */ diff --git a/src/version.c b/src/version.c index be99f998d..f881c1fb2 100644 --- a/src/version.c +++ b/src/version.c @@ -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" { -- cgit v1.2.1