comparison src/list.c @ 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 435726a03481
children 3ff714d765ba
comparison
equal deleted inserted replaced
19915:882299cf6a38 19916:dcec86d796bc
17 17
18 static char *e_listblobarg = N_("E899: Argument of %s must be a List or Blob"); 18 static char *e_listblobarg = N_("E899: Argument of %s must be a List or Blob");
19 19
20 // List heads for garbage collection. 20 // List heads for garbage collection.
21 static list_T *first_list = NULL; // list of all lists 21 static list_T *first_list = NULL; // list of all lists
22
23 static void list_free_item(list_T *l, listitem_T *item);
22 24
23 /* 25 /*
24 * Add a watcher to a list. 26 * Add a watcher to a list.
25 */ 27 */
26 void 28 void
309 311
310 /* 312 /*
311 * Free a list item, unless it was allocated together with the list itself. 313 * Free a list item, unless it was allocated together with the list itself.
312 * Does not clear the value. Does not notify watchers. 314 * Does not clear the value. Does not notify watchers.
313 */ 315 */
314 void 316 static void
315 list_free_item(list_T *l, listitem_T *item) 317 list_free_item(list_T *l, listitem_T *item)
316 { 318 {
317 if (l->lv_with_items == 0 || item < (listitem_T *)l 319 if (l->lv_with_items == 0 || item < (listitem_T *)l
318 || item >= (listitem_T *)(l + 1) + l->lv_with_items) 320 || item >= (listitem_T *)(l + 1) + l->lv_with_items)
319 vim_free(item); 321 vim_free(item);
1223 1225
1224 rettv->v_type = VAR_STRING; 1226 rettv->v_type = VAR_STRING;
1225 rettv->vval.v_string = ga.ga_data; 1227 rettv->vval.v_string = ga.ga_data;
1226 } 1228 }
1227 1229
1228 void 1230 static void
1229 list_remove(typval_T *argvars, typval_T *rettv, char_u *arg_errmsg) 1231 list_remove(typval_T *argvars, typval_T *rettv, char_u *arg_errmsg)
1230 { 1232 {
1231 list_T *l; 1233 list_T *l;
1232 listitem_T *item, *item2; 1234 listitem_T *item, *item2;
1233 listitem_T *li; 1235 listitem_T *li;