Skip to content

Commit bdff012

Browse files
committed
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)
1 parent 5d905c2 commit bdff012

10 files changed

Lines changed: 13 additions & 12 deletions

File tree

src/drawscreen.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ static void redraw_custom_statusline(win_T *wp);
7373
static int did_update_one_window;
7474
#endif
7575

76+
static void win_redr_status(win_T *wp, int ignore_pum);
77+
7678
/*
7779
* Based on the current value of curwin->w_topline, transfer a screenfull
7880
* of stuff from Filemem to ScreenLines[], and update curwin->w_botline.
@@ -382,7 +384,7 @@ update_screen(int type_arg)
382384
* If "ignore_pum" is TRUE, also redraw statusline when the popup menu is
383385
* displayed.
384386
*/
385-
void
387+
static void
386388
win_redr_status(win_T *wp, int ignore_pum UNUSED)
387389
{
388390
int row;

src/evalvars.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2435,7 +2435,7 @@ find_var_in_ht(
24352435
/*
24362436
* Get the script-local hashtab. NULL if not in a script context.
24372437
*/
2438-
hashtab_T *
2438+
static hashtab_T *
24392439
get_script_local_ht(void)
24402440
{
24412441
scid_T sid = current_sctx.sc_sid;

src/getchar.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ static int inchar(char_u *buf, int maxlen, long wait_time);
9999
/*
100100
* Free and clear a buffer.
101101
*/
102-
void
102+
static void
103103
free_buff(buffheader_T *buf)
104104
{
105105
buffblock_T *p, *np;

src/list.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ static char *e_listblobarg = N_("E899: Argument of %s must be a List or Blob");
2020
// List heads for garbage collection.
2121
static list_T *first_list = NULL; // list of all lists
2222

23+
static void list_free_item(list_T *l, listitem_T *item);
24+
2325
/*
2426
* Add a watcher to a list.
2527
*/
@@ -311,7 +313,7 @@ listitem_alloc(void)
311313
* Free a list item, unless it was allocated together with the list itself.
312314
* Does not clear the value. Does not notify watchers.
313315
*/
314-
void
316+
static void
315317
list_free_item(list_T *l, listitem_T *item)
316318
{
317319
if (l->lv_with_items == 0 || item < (listitem_T *)l
@@ -1225,7 +1227,7 @@ f_list2str(typval_T *argvars, typval_T *rettv)
12251227
rettv->vval.v_string = ga.ga_data;
12261228
}
12271229

1228-
void
1230+
static void
12291231
list_remove(typval_T *argvars, typval_T *rettv, char_u *arg_errmsg)
12301232
{
12311233
list_T *l;

src/proto/drawscreen.pro

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/* drawscreen.c */
22
int update_screen(int type_arg);
3-
void win_redr_status(win_T *wp, int ignore_pum);
43
void showruler(int always);
54
void win_redr_ruler(win_T *wp, int always, int ignore_pum);
65
void after_updating_screen(int may_resize_shell);

src/proto/evalvars.pro

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ int get_var_tv(char_u *name, int len, typval_T *rettv, dictitem_T **dip, int ver
5454
void check_vars(char_u *name, int len);
5555
dictitem_T *find_var(char_u *name, hashtab_T **htp, int no_autoload);
5656
dictitem_T *find_var_in_ht(hashtab_T *ht, int htname, char_u *varname, int no_autoload);
57-
hashtab_T *get_script_local_ht(void);
5857
int lookup_scriptvar(char_u *name, size_t len, cctx_T *dummy);
5958
hashtab_T *find_var_ht(char_u *name, char_u **varname);
6059
char_u *get_var_value(char_u *name);

src/proto/getchar.pro

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/* getchar.c */
2-
void free_buff(buffheader_T *buf);
32
char_u *get_recorded(void);
43
char_u *get_inserted(void);
54
int stuff_empty(void);

src/proto/list.pro

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ int list_free_nonref(int copyID);
1313
void list_free_items(int copyID);
1414
void list_free(list_T *l);
1515
listitem_T *listitem_alloc(void);
16-
void list_free_item(list_T *l, listitem_T *item);
1716
void listitem_free(list_T *l, listitem_T *item);
1817
void listitem_remove(list_T *l, listitem_T *item);
1918
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);
4241
int write_list(FILE *fd, list_T *list, int binary);
4342
void init_static_list(staticList10_T *sl);
4443
void f_list2str(typval_T *argvars, typval_T *rettv);
45-
void list_remove(typval_T *argvars, typval_T *rettv, char_u *arg_errmsg);
4644
void f_sort(typval_T *argvars, typval_T *rettv);
4745
void f_uniq(typval_T *argvars, typval_T *rettv);
4846
void f_filter(typval_T *argvars, typval_T *rettv);

src/proto/version.pro

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,5 @@ void ex_version(exarg_T *eap);
66
void list_in_columns(char_u **items, int size, int current);
77
void list_version(void);
88
void maybe_intro_message(void);
9-
void intro_message(int colon);
109
void ex_intro(exarg_T *eap);
1110
/* vim: set ft=c : */

src/version.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -738,6 +738,8 @@ static char *(features[]) =
738738

739739
static int included_patches[] =
740740
{ /* Add new patch number below this line */
741+
/**/
742+
514,
741743
/**/
742744
513,
743745
/**/
@@ -2234,6 +2236,7 @@ list_version(void)
22342236
}
22352237

22362238
static void do_intro_line(int row, char_u *mesg, int add_version, int attr);
2239+
static void intro_message(int colon);
22372240

22382241
/*
22392242
* Show the intro message when not editing a file.
@@ -2253,7 +2256,7 @@ maybe_intro_message(void)
22532256
* Only used when starting Vim on an empty file, without a file name.
22542257
* Or with the ":intro" command (for Sven :-).
22552258
*/
2256-
void
2259+
static void
22572260
intro_message(
22582261
int colon) // TRUE for ":intro"
22592262
{

0 commit comments

Comments
 (0)