comparison src/option.c @ 17789:0f7ae8010787 v8.1.1891

patch 8.1.1891: functions used in one file are global commit https://github.com/vim/vim/commit/5843f5f37b0632e2d706abc9014bfd7d98f7b02e Author: Bram Moolenaar <Bram@vim.org> Date: Tue Aug 20 20:13:45 2019 +0200 patch 8.1.1891: functions used in one file are global Problem: Functions used in one file are global. Solution: Add "static". (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/4840)
author Bram Moolenaar <Bram@vim.org>
date Tue, 20 Aug 2019 20:15:07 +0200
parents 04245f071792
children 55c167b08c2b
comparison
equal deleted inserted replaced
17788:2cf6b7b53b1d 17789:0f7ae8010787
3275 # define insecure_flag(opt_idx, opt_flags) (&options[opt_idx].flags) 3275 # define insecure_flag(opt_idx, opt_flags) (&options[opt_idx].flags)
3276 #endif 3276 #endif
3277 static void set_string_option_global(int opt_idx, char_u **varp); 3277 static void set_string_option_global(int opt_idx, char_u **varp);
3278 static char *did_set_string_option(int opt_idx, char_u **varp, int new_value_alloced, char_u *oldval, char *errbuf, int opt_flags, int *value_checked); 3278 static char *did_set_string_option(int opt_idx, char_u **varp, int new_value_alloced, char_u *oldval, char *errbuf, int opt_flags, int *value_checked);
3279 static char *set_chars_option(char_u **varp); 3279 static char *set_chars_option(char_u **varp);
3280 #ifdef FEAT_STL_OPT
3281 static char *check_stl_option(char_u *s);
3282 #endif
3280 #ifdef FEAT_CLIPBOARD 3283 #ifdef FEAT_CLIPBOARD
3281 static char *check_clipboard_option(void); 3284 static char *check_clipboard_option(void);
3282 #endif 3285 #endif
3283 #ifdef FEAT_SPELL 3286 #ifdef FEAT_SPELL
3284 static char *did_set_spell_option(int is_spellfile); 3287 static char *did_set_spell_option(int is_spellfile);
3299 static int put_setnum(FILE *fd, char *cmd, char *name, long *valuep); 3302 static int put_setnum(FILE *fd, char *cmd, char *name, long *valuep);
3300 static int put_setbool(FILE *fd, char *cmd, char *name, int value); 3303 static int put_setbool(FILE *fd, char *cmd, char *name, int value);
3301 static int istermoption(struct vimoption *); 3304 static int istermoption(struct vimoption *);
3302 static char_u *get_varp_scope(struct vimoption *p, int opt_flags); 3305 static char_u *get_varp_scope(struct vimoption *p, int opt_flags);
3303 static char_u *get_varp(struct vimoption *); 3306 static char_u *get_varp(struct vimoption *);
3307 static void check_win_options(win_T *win);
3304 static void option_value2string(struct vimoption *, int opt_flags); 3308 static void option_value2string(struct vimoption *, int opt_flags);
3305 static void check_winopt(winopt_T *wop); 3309 static void check_winopt(winopt_T *wop);
3306 static int wc_use_keyname(char_u *varp, long *wcp); 3310 static int wc_use_keyname(char_u *varp, long *wcp);
3307 #ifdef FEAT_LANGMAP 3311 #ifdef FEAT_LANGMAP
3308 static void langmap_init(void); 3312 static void langmap_init(void);
8244 #ifdef FEAT_STL_OPT 8248 #ifdef FEAT_STL_OPT
8245 /* 8249 /*
8246 * Check validity of options with the 'statusline' format. 8250 * Check validity of options with the 'statusline' format.
8247 * Return error message or NULL. 8251 * Return error message or NULL.
8248 */ 8252 */
8249 char * 8253 static char *
8250 check_stl_option(char_u *s) 8254 check_stl_option(char_u *s)
8251 { 8255 {
8252 int itemcnt = 0; 8256 int itemcnt = 0;
8253 int groupdepth = 0; 8257 int groupdepth = 0;
8254 static char errbuf[80]; 8258 static char errbuf[80];
11428 } 11432 }
11429 11433
11430 /* 11434 /*
11431 * Check string options in a window for a NULL value. 11435 * Check string options in a window for a NULL value.
11432 */ 11436 */
11433 void 11437 static void
11434 check_win_options(win_T *win) 11438 check_win_options(win_T *win)
11435 { 11439 {
11436 check_winopt(&win->w_onebuf_opt); 11440 check_winopt(&win->w_onebuf_opt);
11437 check_winopt(&win->w_allbuf_opt); 11441 check_winopt(&win->w_allbuf_opt);
11438 } 11442 }
13339 { 13343 {
13340 return get_sw_value_col(buf, 0); 13344 return get_sw_value_col(buf, 0);
13341 } 13345 }
13342 13346
13343 /* 13347 /*
13348 * Idem, using "pos".
13349 */
13350 static long
13351 get_sw_value_pos(buf_T *buf, pos_T *pos)
13352 {
13353 pos_T save_cursor = curwin->w_cursor;
13354 long sw_value;
13355
13356 curwin->w_cursor = *pos;
13357 sw_value = get_sw_value_col(buf, get_nolist_virtcol());
13358 curwin->w_cursor = save_cursor;
13359 return sw_value;
13360 }
13361
13362 /*
13344 * Idem, using the first non-black in the current line. 13363 * Idem, using the first non-black in the current line.
13345 */ 13364 */
13346 long 13365 long
13347 get_sw_value_indent(buf_T *buf) 13366 get_sw_value_indent(buf_T *buf)
13348 { 13367 {
13349 pos_T pos = curwin->w_cursor; 13368 pos_T pos = curwin->w_cursor;
13350 13369
13351 pos.col = getwhitecols_curline(); 13370 pos.col = getwhitecols_curline();
13352 return get_sw_value_pos(buf, &pos); 13371 return get_sw_value_pos(buf, &pos);
13353 }
13354
13355 /*
13356 * Idem, using "pos".
13357 */
13358 long
13359 get_sw_value_pos(buf_T *buf, pos_T *pos)
13360 {
13361 pos_T save_cursor = curwin->w_cursor;
13362 long sw_value;
13363
13364 curwin->w_cursor = *pos;
13365 sw_value = get_sw_value_col(buf, get_nolist_virtcol());
13366 curwin->w_cursor = save_cursor;
13367 return sw_value;
13368 } 13372 }
13369 13373
13370 /* 13374 /*
13371 * Idem, using virtual column "col". 13375 * Idem, using virtual column "col".
13372 */ 13376 */