summaryrefslogtreecommitdiff
path: root/src/option.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-01-30 19:39:49 +0100
committerBram Moolenaar <Bram@vim.org>2016-01-30 19:39:49 +0100
commit9b57814db13c29ecb08260b36923c0e1c8a373a9 (patch)
tree518df78530838cc70b222930955e2c0522ddd393 /src/option.c
parent52ea13da0fe86df1abf34de52841e367035170c0 (diff)
downloadvim-git-9b57814db13c29ecb08260b36923c0e1c8a373a9.tar.gz
patch 7.4.1211v7.4.1211
Problem: Using old style function declarations. Solution: Change to new style function declarations. (script by Hirohito Higashi)
Diffstat (limited to 'src/option.c')
-rw-r--r--src/option.c491
1 files changed, 205 insertions, 286 deletions
diff --git a/src/option.c b/src/option.c
index 4b6969037..72d8cf7a6 100644
--- a/src/option.c
+++ b/src/option.c
@@ -3165,7 +3165,7 @@ static int briopt_check(win_T *wp);
* Called only once from main(), just after creating the first buffer.
*/
void
-set_init_1()
+set_init_1(void)
{
char_u *p;
int opt_idx;
@@ -3589,10 +3589,10 @@ set_init_1()
* This does not take care of side effects!
*/
static void
-set_option_default(opt_idx, opt_flags, compatible)
- int opt_idx;
- int opt_flags; /* OPT_FREE, OPT_LOCAL and/or OPT_GLOBAL */
- int compatible; /* use Vi default value */
+set_option_default(
+ int opt_idx,
+ int opt_flags, /* OPT_FREE, OPT_LOCAL and/or OPT_GLOBAL */
+ int compatible) /* use Vi default value */
{
char_u *varp; /* pointer to variable for current option */
int dvi; /* index in def_val[] */
@@ -3664,8 +3664,8 @@ set_option_default(opt_idx, opt_flags, compatible)
* When "opt_flags" is non-zero skip 'encoding'.
*/
static void
-set_options_default(opt_flags)
- int opt_flags; /* OPT_FREE, OPT_LOCAL and/or OPT_GLOBAL */
+set_options_default(
+ int opt_flags) /* OPT_FREE, OPT_LOCAL and/or OPT_GLOBAL */
{
int i;
#ifdef FEAT_WINDOWS
@@ -3707,9 +3707,7 @@ set_options_default(opt_flags)
* Used for 'sh', 'backupskip' and 'term'.
*/
void
-set_string_default(name, val)
- char *name;
- char_u *val;
+set_string_default(char *name, char_u *val)
{
char_u *p;
int opt_idx;
@@ -3733,9 +3731,7 @@ set_string_default(name, val)
* Used for 'lines' and 'columns'.
*/
void
-set_number_default(name, val)
- char *name;
- long val;
+set_number_default(char *name, long val)
{
int opt_idx;
@@ -3749,7 +3745,7 @@ set_number_default(name, val)
* Free all options.
*/
void
-free_all_options()
+free_all_options(void)
{
int i;
@@ -3777,7 +3773,7 @@ free_all_options()
* setting 'term'.
*/
void
-set_init_2()
+set_init_2(void)
{
int idx;
@@ -3841,7 +3837,7 @@ set_init_2()
* case. If this value is 0-6 or 8, our background is dark.
*/
static char_u *
-term_bg_default()
+term_bg_default(void)
{
#if defined(MSDOS) || defined(WIN3264)
/* DOS console nearly always black */
@@ -3866,7 +3862,7 @@ term_bg_default()
* Initialize the options, part three: After reading the .vimrc
*/
void
-set_init_3()
+set_init_3(void)
{
#if defined(UNIX) || defined(WIN3264)
/*
@@ -4054,8 +4050,7 @@ set_init_3()
* Only the first two characters of "lang" are used.
*/
void
-set_helplang_default(lang)
- char_u *lang;
+set_helplang_default(char_u *lang)
{
int idx;
@@ -4088,7 +4083,7 @@ set_helplang_default(lang)
static char_u *gui_bg_default(void);
static char_u *
-gui_bg_default()
+gui_bg_default(void)
{
if (gui_get_lightness(gui.back_pixel) < 127)
return (char_u *)"dark";
@@ -4099,7 +4094,7 @@ gui_bg_default()
* Option initializations that can only be done after opening the GUI window.
*/
void
-init_gui_options()
+init_gui_options(void)
{
/* Set the 'background' option according to the lightness of the
* background color, unless the user has set it already. */
@@ -4120,7 +4115,7 @@ init_gui_options()
* machine.
*/
void
-set_title_defaults()
+set_title_defaults(void)
{
int idx1;
long val;
@@ -4173,9 +4168,9 @@ set_title_defaults()
* returns FAIL if an error is detected, OK otherwise
*/
int
-do_set(arg, opt_flags)
- char_u *arg; /* option string (may be written to!) */
- int opt_flags;
+do_set(
+ char_u *arg, /* option string (may be written to!) */
+ int opt_flags)
{
int opt_idx;
char_u *errmsg;
@@ -5087,10 +5082,10 @@ theend:
* Sets the P_WAS_SET flag and takes care of the P_INSECURE flag.
*/
static void
-did_set_option(opt_idx, opt_flags, new_value)
- int opt_idx;
- int opt_flags; /* possibly with OPT_MODELINE */
- int new_value; /* value was replaced completely */
+did_set_option(
+ int opt_idx,
+ int opt_flags, /* possibly with OPT_MODELINE */
+ int new_value) /* value was replaced completely */
{
long_u *p;
@@ -5111,9 +5106,7 @@ did_set_option(opt_idx, opt_flags, new_value)
}
static char_u *
-illegal_char(errbuf, c)
- char_u *errbuf;
- int c;
+illegal_char(char_u *errbuf, int c)
{
if (errbuf == NULL)
return (char_u *)"";
@@ -5127,8 +5120,7 @@ illegal_char(errbuf, c)
* Used for 'wildchar' and 'cedit' options.
*/
static int
-string_to_key(arg)
- char_u *arg;
+string_to_key(char_u *arg)
{
if (*arg == '<')
return find_key_option(arg + 1);
@@ -5143,7 +5135,7 @@ string_to_key(arg)
* Returns NULL if value is OK, error message otherwise.
*/
static char_u *
-check_cedit()
+check_cedit(void)
{
int n;
@@ -5168,8 +5160,8 @@ check_cedit()
* the old value back.
*/
static void
-did_set_title(icon)
- int icon; /* Did set icon instead of title */
+did_set_title(
+ int icon) /* Did set icon instead of title */
{
if (starting != NO_SCREEN
#ifdef FEAT_GUI
@@ -5196,10 +5188,10 @@ did_set_title(icon)
* set_options_bin - called when 'bin' changes value.
*/
void
-set_options_bin(oldval, newval, opt_flags)
- int oldval;
- int newval;
- int opt_flags; /* OPT_LOCAL and/or OPT_GLOBAL */
+set_options_bin(
+ int oldval,
+ int newval,
+ int opt_flags) /* OPT_LOCAL and/or OPT_GLOBAL */
{
/*
* The option values that are changed when 'bin' changes are
@@ -5269,8 +5261,7 @@ set_options_bin(oldval, newval, opt_flags)
* number, return -1.
*/
int
-get_viminfo_parameter(type)
- int type;
+get_viminfo_parameter(int type)
{
char_u *p;
@@ -5286,8 +5277,7 @@ get_viminfo_parameter(type)
* Return NULL if the parameter is not specified in the string.
*/
char_u *
-find_viminfo_parameter(type)
- int type;
+find_viminfo_parameter(int type)
{
char_u *p;
@@ -5312,9 +5302,7 @@ find_viminfo_parameter(type)
* Return pointer to NameBuff, or NULL when not expanded.
*/
static char_u *
-option_expand(opt_idx, val)
- int opt_idx;
- char_u *val;
+option_expand(int opt_idx, char_u *val)
{
/* if option doesn't need expansion nothing to do */
if (!(options[opt_idx].flags & P_EXPAND) || options[opt_idx].var == NULL)
@@ -5351,7 +5339,7 @@ option_expand(opt_idx, val)
* option values.
*/
static void
-didset_options()
+didset_options(void)
{
/* initialize the table for 'iskeyword' et.al. */
(void)init_chartab();
@@ -5406,7 +5394,7 @@ didset_options()
* More side effects of setting options.
*/
static void
-didset_options2()
+didset_options2(void)
{
/* Initialize the highlight_attr[] table. */
(void)highlight_changed();
@@ -5430,7 +5418,7 @@ didset_options2()
* Check for string options that are NULL (normally only termcap options).
*/
void
-check_options()
+check_options(void)
{
int opt_idx;
@@ -5443,8 +5431,7 @@ check_options()
* Check string options in a buffer for NULL value.
*/
void
-check_buf_options(buf)
- buf_T *buf;
+check_buf_options(buf_T *buf)
{
#if defined(FEAT_QUICKFIX)
check_string_option(&buf->b_p_bh);
@@ -5552,16 +5539,14 @@ check_buf_options(buf)
* Does NOT check for P_ALLOCED flag!
*/
void
-free_string_option(p)
- char_u *p;
+free_string_option(char_u *p)
{
if (p != empty_option)
vim_free(p);
}
void
-clear_string_option(pp)
- char_u **pp;
+clear_string_option(char_u **pp)
{
if (*pp != empty_option)
vim_free(*pp);
@@ -5569,8 +5554,7 @@ clear_string_option(pp)
}
static void
-check_string_option(pp)
- char_u **pp;
+check_string_option(char_u **pp)
{
if (*pp == NULL)
*pp = empty_option;
@@ -5580,8 +5564,7 @@ check_string_option(pp)
* Mark a terminal option as allocated, found by a pointer into term_strings[].
*/
void
-set_term_option_alloced(p)
- char_u **p;
+set_term_option_alloced(char_u **p)
{
int opt_idx;
@@ -5601,9 +5584,7 @@ set_term_option_alloced(p)
* Return -1 for an unknown option.
*/
int
-was_set_insecurely(opt, opt_flags)
- char_u *opt;
- int opt_flags;
+was_set_insecurely(char_u *opt, int opt_flags)
{
int idx = findoption(opt);
long_u *flagp;
@@ -5622,9 +5603,7 @@ was_set_insecurely(opt, opt_flags)
* "opt_idx". For some local options a local flags field is used.
*/
static long_u *
-insecure_flag(opt_idx, opt_flags)
- int opt_idx;
- int opt_flags;
+insecure_flag(int opt_idx, int opt_flags)
{
if (opt_flags & OPT_LOCAL)
switch ((int)options[opt_idx].indir)
@@ -5661,7 +5640,7 @@ static void redraw_titles(void);
/*
* Redraw the window title and/or tab page text later.
*/
-static void redraw_titles()
+static void redraw_titles(void)
{
need_maketitle = TRUE;
# ifdef FEAT_WINDOWS
@@ -5678,12 +5657,12 @@ static void redraw_titles()
* SID_NONE don't set the scriptID. Otherwise set the scriptID to "set_sid".
*/
void
-set_string_option_direct(name, opt_idx, val, opt_flags, set_sid)
- char_u *name;
- int opt_idx;
- char_u *val;
- int opt_flags; /* OPT_FREE, OPT_LOCAL and/or OPT_GLOBAL */
- int set_sid UNUSED;
+set_string_option_direct(
+ char_u *name,
+ int opt_idx,
+ char_u *val,
+ int opt_flags, /* OPT_FREE, OPT_LOCAL and/or OPT_GLOBAL */
+ int set_sid UNUSED)
{
char_u *s;
char_u **varp;
@@ -5738,9 +5717,9 @@ set_string_option_direct(name, opt_idx, val, opt_flags, set_sid)
* Set global value for string option when it's a local option.
*/
static void
-set_string_option_global(opt_idx, varp)
- int opt_idx; /* option index */
- char_u **varp; /* pointer to option variable */
+set_string_option_global(
+ int opt_idx, /* option index */
+ char_u **varp) /* pointer to option variable */
{
char_u **p, *s;
@@ -5764,10 +5743,10 @@ set_string_option_global(opt_idx, varp)
* Returns NULL on success or error message on error.
*/
static char_u *
-set_string_option(opt_idx, value, opt_flags)
- int opt_idx;
- char_u *value;
- int opt_flags; /* OPT_LOCAL and/or OPT_GLOBAL */
+set_string_option(
+ int opt_idx,
+ char_u *value,
+ int opt_flags) /* OPT_LOCAL and/or OPT_GLOBAL */
{
char_u *s;
char_u **varp;
@@ -5827,14 +5806,13 @@ set_string_option(opt_idx, value, opt_flags)
* Returns NULL for success, or an error message for an error.
*/
static char_u *
-did_set_string_option(opt_idx, varp, new_value_alloced, oldval, errbuf,
- opt_flags)
- int opt_idx; /* index in options[] table */
- char_u **varp; /* pointer to the option variable */
- int new_value_alloced; /* new value was allocated */
- char_u *oldval; /* previous value of the option */
- char_u *errbuf; /* buffer for errors, or NULL */
- int opt_flags; /* OPT_LOCAL and/or OPT_GLOBAL */
+did_set_string_option(
+ int opt_idx, /* index in options[] table */
+ char_u **varp, /* pointer to the option variable */
+ int new_value_alloced, /* new value was allocated */
+ char_u *oldval, /* previous value of the option */
+ char_u *errbuf, /* buffer for errors, or NULL */
+ int opt_flags) /* OPT_LOCAL and/or OPT_GLOBAL */
{
char_u *errmsg = NULL;
char_u *s, *p;
@@ -7375,9 +7353,7 @@ did_set_string_option(opt_idx, varp, new_value_alloced, oldval, errbuf,
* Simple int comparison function for use with qsort()
*/
static int
-int_cmp(a, b)
- const void *a;
- const void *b;
+int_cmp(const void *a, const void *b)
{
return *(const int *)a - *(const int *)b;
}
@@ -7387,8 +7363,7 @@ int_cmp(a, b)
* Returns error message, NULL if it's OK.
*/
char_u *
-check_colorcolumn(wp)
- win_T *wp;
+check_colorcolumn(win_T *wp)
{
char_u *s;
int col;
@@ -7459,8 +7434,7 @@ skip:
* Returns error message, NULL if it's OK.
*/
static char_u *
-set_chars_option(varp)
- char_u **varp;
+set_chars_option(char_u **varp)
{
int round, i, len, entries;
char_u *p, *s;
@@ -7594,8 +7568,7 @@ set_chars_option(varp)
* Return error message or NULL.
*/
char_u *
-check_stl_option(s)
- char_u *s;
+check_stl_option(char_u *s)
{
int itemcnt = 0;
int groupdepth = 0;
@@ -7666,7 +7639,7 @@ check_stl_option(s)
* Extract the items in the 'clipboard' option and set global values.
*/
static char_u *
-check_clipboard_option()
+check_clipboard_option(void)
{
int new_unnamed = 0;
int new_autoselect_star = FALSE;
@@ -7755,8 +7728,7 @@ check_clipboard_option()
#ifdef FEAT_SPELL
static char_u *
-did_set_spell_option(is_spellfile)
- int is_spellfile;
+did_set_spell_option(int is_spellfile)
{
char_u *errmsg = NULL;
win_T *wp;
@@ -7789,8 +7761,7 @@ did_set_spell_option(is_spellfile)
* Return error message when failed, NULL when OK.
*/
static char_u *
-compile_cap_prog(synblock)
- synblock_T *synblock;
+compile_cap_prog(synblock_T *synblock)
{
regprog_T *rp = synblock->b_cap_prog;
char_u *re;
@@ -7824,10 +7795,7 @@ compile_cap_prog(synblock)
* window-local value.
*/
static void
-set_option_scriptID_idx(opt_idx, opt_flags, id)
- int opt_idx;
- int opt_flags;
- int id;
+set_option_scriptID_idx(int opt_idx, int opt_flags, int id)
{
int both = (opt_flags & (OPT_LOCAL | OPT_GLOBAL)) == 0;
int indir = (int)options[opt_idx].indir;
@@ -7851,11 +7819,11 @@ set_option_scriptID_idx(opt_idx, opt_flags, id)
* Returns NULL for success, or an error message for an error.
*/
static char_u *
-set_bool_option(opt_idx, varp, value, opt_flags)
- int opt_idx; /* index in options[] table */
- char_u *varp; /* pointer to the option variable */
- int value; /* new value */
- int opt_flags; /* OPT_LOCAL and/or OPT_GLOBAL */
+set_bool_option(
+ int opt_idx, /* index in options[] table */
+ char_u *varp, /* pointer to the option variable */
+ int value, /* new value */
+ int opt_flags) /* OPT_LOCAL and/or OPT_GLOBAL */
{
int old_value = *(int *)varp;
@@ -8433,13 +8401,13 @@ set_bool_option(opt_idx, varp, value, opt_flags)
* Returns NULL for success, or an error message for an error.
*/
static char_u *
-set_num_option(opt_idx, varp, value, errbuf, errbuflen, opt_flags)
- int opt_idx; /* index in options[] table */
- char_u *varp; /* pointer to the option variable */
- long value; /* new value */
- char_u *errbuf; /* buffer for error messages */
- size_t errbuflen; /* length of "errbuf" */
- int opt_flags; /* OPT_LOCAL, OPT_GLOBAL and
+set_num_option(
+ int opt_idx, /* index in options[] table */
+ char_u *varp, /* pointer to the option variable */
+ long value, /* new value */
+ char_u *errbuf, /* buffer for error messages */
+ size_t errbuflen, /* length of "errbuf" */
+ int opt_flags) /* OPT_LOCAL, OPT_GLOBAL and
OPT_MODELINE */
{
char_u *errmsg = NULL;
@@ -8982,8 +8950,7 @@ set_num_option(opt_idx, varp, value, errbuf, errbuflen, opt_flags)
* Called after an option changed: check if something needs to be redrawn.
*/
static void
-check_redraw(flags)
- long_u flags;
+check_redraw(long_u flags)
{
/* Careful: P_RCLR and P_RALL are a combination of other P_ flags */
int doclear = (flags & P_RCLR) == P_RCLR;
@@ -9009,8 +8976,7 @@ check_redraw(flags)
* Return -1 if not found.
*/
static int
-findoption(arg)
- char_u *arg;
+findoption(char_u *arg)
{
int opt_idx;
char *s, *p;
@@ -9086,11 +9052,11 @@ findoption(arg)
* unknown option: -3.
*/
int
-get_option_value(name, numval, stringval, opt_flags)
- char_u *name;
- long *numval;
- char_u **stringval; /* NULL when only checking existence */
- int opt_flags;
+get_option_value(
+ char_u *name,
+ long *numval,
+ char_u **stringval, /* NULL when only checking existence */
+ int opt_flags)
{
int opt_idx;
char_u *varp;
@@ -9156,12 +9122,12 @@ get_option_value(name, numval, stringval, opt_flags)
* Possible opt_type values: see SREQ_* in vim.h
*/
int
-get_option_value_strict(name, numval, stringval, opt_type, from)
- char_u *name;
- long *numval;
- char_u **stringval; /* NULL when only obtaining attributes */
- int opt_type;
- void *from;
+get_option_value_strict(
+ char_u *name,
+ long *numval,
+ char_u **stringval, /* NULL when only obtaining attributes */
+ int opt_type,
+ void *from)
{
int opt_idx;
char_u *varp = NULL;
@@ -9287,9 +9253,7 @@ get_option_value_strict(name, numval, stringval, opt_type, from)
* Returns full option name for current option on each call.
*/
char_u *
-option_iter_next(option, opt_type)
- void **option;
- int opt_type;
+option_iter_next(void **option, int opt_type)
{
struct vimoption *ret = NULL;
do
@@ -9345,11 +9309,11 @@ option_iter_next(option, opt_type)
* Returns NULL on success or error message on error.
*/
char_u *
-set_option_value(name, number, string, opt_flags)
- char_u *name;
- long number;
- char_u *string;
- int opt_flags; /* OPT_LOCAL or 0 (both) */
+set_option_value(
+ char_u *name,
+ long number,
+ char_u *string,
+ int opt_flags) /* OPT_LOCAL or 0 (both) */
{
int opt_idx;
char_u *varp;
@@ -9412,8 +9376,7 @@ set_option_value(name, number, string, opt_flags)
* Returns NULL when not found.
*/
char_u *
-get_term_code(tname)
- char_u *tname;
+get_term_code(char_u *tname)
{
int opt_idx;
char_u *varp;
@@ -9432,7 +9395,7 @@ get_term_code(tname)
}
char_u *
-get_highlight_default()
+get_highlight_default(void)
{
int i;
@@ -9444,7 +9407,7 @@ get_highlight_default()
#if defined(FEAT_MBYTE) || defined(PROTO)
char_u *
-get_encoding_default()
+get_encoding_default(void)
{
int i;
@@ -9459,8 +9422,7 @@ get_encoding_default()
* Translate a string like "t_xx", "<t_xx>" or "<S-Tab>" to a key number.
*/
static int
-find_key_option(arg)
- char_u *arg;
+find_key_option(char_u *arg)
{
int key;
int modifiers;
@@ -9488,9 +9450,9 @@ find_key_option(arg)
* if 'all' == 2: show all terminal options
*/
static void
-showoptions(all, opt_flags)
- int all;
- int opt_flags; /* OPT_LOCAL and/or OPT_GLOBAL */
+showoptions(
+ int all,
+ int opt_flags) /* OPT_LOCAL and/or OPT_GLOBAL */
{
struct vimoption *p;
int col;
@@ -9597,9 +9559,7 @@ showoptions(all, opt_flags)
* Return TRUE if option "p" has its default value.
*/
static int
-optval_default(p, varp)
- struct vimoption *p;
- char_u *varp;
+optval_default(struct vimoption *p, char_u *varp)
{
int dvi;
@@ -9621,9 +9581,9 @@ optval_default(p, varp)
* must not be called with a hidden option!
*/
static void
-showoneopt(p, opt_flags)
- struct vimoption *p;
- int opt_flags; /* OPT_LOCAL or OPT_GLOBAL */
+showoneopt(
+ struct vimoption *p,
+ int opt_flags) /* OPT_LOCAL or OPT_GLOBAL */
{
char_u *varp;
int save_silent = silent_mode;
@@ -9677,10 +9637,7 @@ showoneopt(p, opt_flags)
* Return FAIL on error, OK otherwise.
*/
int
-makeset(fd, opt_flags, local_only)
- FILE *fd;
- int opt_flags;
- int local_only;
+makeset(FILE *fd, int opt_flags, int local_only)
{
struct vimoption *p;
char_u *varp; /* currently used value */
@@ -9808,8 +9765,7 @@ makeset(fd, opt_flags, local_only)
* 'sessionoptions' or 'viewoptions' contains "folds" but not "options".
*/
int
-makefoldset(fd)
- FILE *fd;
+makefoldset(FILE *fd)
{
if (put_setstring(fd, "setlocal", "fdm", &curwin->w_p_fdm, FALSE) == FAIL
# ifdef FEAT_EVAL
@@ -9832,12 +9788,12 @@ makefoldset(fd)
#endif
static int
-put_setstring(fd, cmd, name, valuep, expand)
- FILE *fd;
- char *cmd;
- char *name;
- char_u **valuep;
- int expand;
+put_setstring(
+ FILE *fd,
+ char *cmd,
+ char *name,
+ char_u **valuep,
+ int expand)
{
char_u *s;
char_u *buf;
@@ -9878,11 +9834,11 @@ put_setstring(fd, cmd, name, valuep, expand)
}
static int
-put_setnum(fd, cmd, name, valuep)
- FILE *fd;
- char *cmd;
- char *name;
- long *valuep;
+put_setnum(
+ FILE *fd,
+ char *cmd,
+ char *name,
+ long *valuep)
{
long wc;
@@ -9902,11 +9858,11 @@ put_setnum(fd, cmd, name, valuep)
}
static int
-put_setbool(fd, cmd, name, value)
- FILE *fd;
- char *cmd;
- char *name;
- int value;
+put_setbool(
+ FILE *fd,
+ char *cmd,
+ char *name,
+ int value)
{
if (value < 0) /* global/local option using global value */
return OK;
@@ -9922,7 +9878,7 @@ put_setbool(fd, cmd, name, value)
* Terminal options are never hidden or indirect.
*/
void
-clear_termoptions()
+clear_termoptions(void)
{
/*
* Reset a few things before clearing the old options. This may cause
@@ -9953,7 +9909,7 @@ clear_termoptions()
}
void
-free_termoptions()
+free_termoptions(void)
{
struct vimoption *p;
@@ -9977,8 +9933,7 @@ free_termoptions()
* "var" points to the option value.
*/
void
-free_one_termoption(var)
- char_u *var;
+free_one_termoption(char_u *var)
{
struct vimoption *p;
@@ -9998,7 +9953,7 @@ free_one_termoption(var)
* Used after setting the terminal name.
*/
void
-set_term_defaults()
+set_term_defaults(void)
{
struct vimoption *p;
@@ -10025,8 +9980,7 @@ set_term_defaults()
* return TRUE if 'p' starts with 't_'
*/
static int
-istermoption(p)
- struct vimoption *p;
+istermoption(struct vimoption *p)
{
return (p->fullname[0] == 't' && p->fullname[1] == '_');
}
@@ -10041,7 +9995,7 @@ istermoption(p)
#define COL_RULER 17 /* columns needed by standard ruler */
void
-comp_col()
+comp_col(void)
{
#if defined(FEAT_CMDL_INFO) && defined(FEAT_WINDOWS)
int last_has_status = (p_ls == 2 || (p_ls == 1 && firstwin != lastwin));
@@ -10081,9 +10035,7 @@ comp_col()
* Unset local option value, similar to ":set opt<".
*/
void
-unset_global_local_option(name, from)
- char_u *name;
- void *from;
+unset_global_local_option(char_u *name, void *from)
{
struct vimoption *p;
int opt_idx;
@@ -10177,9 +10129,7 @@ unset_global_local_option(name, from)
* Get pointer to option variable, depending on local or global scope.
*/
static char_u *
-get_varp_scope(p, opt_flags)
- struct vimoption *p;
- int opt_flags;
+get_varp_scope(struct vimoption *p, int opt_flags)
{
if ((opt_flags & OPT_GLOBAL) && p->indir != PV_NONE)
{
@@ -10234,8 +10184,7 @@ get_varp_scope(p, opt_flags)
* Get pointer to option variable.
*/
static char_u *
-get_varp(p)
- struct vimoption *p;
+get_varp(struct vimoption *p)
{
/* hidden option, always return NULL */
if (p->var == NULL)
@@ -10481,7 +10430,7 @@ get_varp(p)
* Get the value of 'equalprg', either the buffer-local one or the global one.
*/
char_u *
-get_equalprg()
+get_equalprg(void)
{
if (*curbuf->b_p_ep == NUL)
return p_ep;
@@ -10494,9 +10443,7 @@ get_equalprg()
* Used when splitting a window.
*/
void
-win_copy_options(wp_from, wp_to)
- win_T *wp_from;
- win_T *wp_to;
+win_copy_options(win_T *wp_from, win_T *wp_to)
{
copy_winopt(&wp_from->w_onebuf_opt, &wp_to->w_onebuf_opt);
copy_winopt(&wp_from->w_allbuf_opt, &wp_to->w_allbuf_opt);
@@ -10519,9 +10466,7 @@ win_copy_options(wp_from, wp_to)
* The 'previewwindow' option is reset, there can be only one preview window.
*/
void
-copy_winopt(from, to)
- winopt_T *from;
- winopt_T *to;
+copy_winopt(winopt_T *from, winopt_T *to)
{
#ifdef FEAT_ARABIC
to->wo_arab = from->wo_arab;
@@ -10598,8 +10543,7 @@ copy_winopt(from, to)
* Check string options in a window for a NULL value.
*/
void
-check_win_options(win)
- win_T *win;
+check_win_options(win_T *win)
{
check_winopt(&win->w_onebuf_opt);
check_winopt(&win->w_allbuf_opt);
@@ -10609,8 +10553,7 @@ check_win_options(win)
* Check for NULL pointers in a winopt_T and replace them with empty_option.
*/
static void
-check_winopt(wop)
- winopt_T *wop UNUSED;
+check_winopt(winopt_T *wop UNUSED)
{
#ifdef FEAT_FOLDING
check_string_option(&wop->wo_fdi);
@@ -10643,8 +10586,7 @@ check_winopt(wop)
* Free the allocated memory inside a winopt_T.
*/
void
-clear_winopt(wop)
- winopt_T *wop UNUSED;
+clear_winopt(winopt_T *wop UNUSED)
{
#ifdef FEAT_FOLDING
clear_string_option(&wop->wo_fdi);
@@ -10683,9 +10625,7 @@ clear_winopt(wop)
* BCO_NOHELP Don't copy the values to a help buffer.
*/
void
-buf_copy_options(buf, flags)
- buf_T *buf;
- int flags;
+buf_copy_options(buf_T *buf, int flags)
{
int should_copy = TRUE;
char_u *save_p_isk = NULL; /* init for GCC */
@@ -10935,7 +10875,7 @@ buf_copy_options(buf, flags)
* Reset the 'modifiable' option and its default value.
*/
void
-reset_modifiable()
+reset_modifiable(void)
{
int opt_idx;
@@ -10950,7 +10890,7 @@ reset_modifiable()
* Set the global value for 'iminsert' to the local value.
*/
void
-set_iminsert_global()
+set_iminsert_global(void)
{
p_iminsert = curbuf->b_p_iminsert;
}
@@ -10959,7 +10899,7 @@ set_iminsert_global()
* Set the global value for 'imsearch' to the local value.
*/
void
-set_imsearch_global()
+set_imsearch_global(void)
{
p_imsearch = curbuf->b_p_imsearch;
}
@@ -10970,10 +10910,10 @@ static char_u expand_option_name[5] = {'t', '_', NUL, NUL, NUL};
static int expand_option_flags = 0;
void
-set_context_in_set_cmd(xp, arg, opt_flags)
- expand_T *xp;
- char_u *arg;
- int opt_flags; /* OPT_GLOBAL and/or OPT_LOCAL */
+set_context_in_set_cmd(
+ expand_T *xp,
+ char_u *arg,
+ int opt_flags) /* OPT_GLOBAL and/or OPT_LOCAL */
{
int nextchar;
long_u flags = 0; /* init for GCC */
@@ -11176,11 +11116,11 @@ set_context_in_set_cmd(xp, arg, opt_flags)
}
int
-ExpandSettings(xp, regmatch, num_file, file)
- expand_T *xp;
- regmatch_T *regmatch;
- int *num_file;
- char_u ***file;
+ExpandSettings(
+ expand_T *xp,
+ regmatch_T *regmatch,
+ int *num_file,
+ char_u ***file)
{
int num_normal = 0; /* Nr of matching non-term-code settings */
int num_term = 0; /* Nr of matching terminal code settings */
@@ -11338,9 +11278,7 @@ ExpandSettings(xp, regmatch, num_file, file)
}
int
-ExpandOldSetting(num_file, file)
- int *num_file;
- char_u ***file;
+ExpandOldSetting(int *num_file, char_u ***file)
{
char_u *var = NULL; /* init for GCC */
char_u *buf;
@@ -11403,9 +11341,9 @@ ExpandOldSetting(num_file, file)
* NameBuff[]. Must not be called with a hidden option!
*/
static void
-option_value2string(opp, opt_flags)
- struct vimoption *opp;
- int opt_flags; /* OPT_GLOBAL and/or OPT_LOCAL */
+option_value2string(
+ struct vimoption *opp,
+ int opt_flags) /* OPT_GLOBAL and/or OPT_LOCAL */
{
char_u *varp;
@@ -11448,9 +11386,7 @@ option_value2string(opp, opt_flags)
* "*wcp" is set to the value of the option if it's 'wildchar' or 'wildcharm'.
*/
static int
-wc_use_keyname(varp, wcp)
- char_u *varp;
- long *wcp;
+wc_use_keyname(char_u *varp, long *wcp)
{
if (((long *)varp == &p_wc) || ((long *)varp == &p_wcm))
{
@@ -11493,9 +11429,7 @@ static void langmap_set_entry(int from, int to);
* field. If not found insert a new entry at the appropriate location.
*/
static void
-langmap_set_entry(from, to)
- int from;
- int to;
+langmap_set_entry(int from, int to)
{
langmap_entry_T *entries = (langmap_entry_T *)(langmap_mapga.ga_data);
int a = 0;
@@ -11534,8 +11468,7 @@ langmap_set_entry(from, to)
* Apply 'langmap' to multi-byte character "c" and return the result.
*/
int
-langmap_adjust_mb(c)
- int c;
+langmap_adjust_mb(int c)
{
langmap_entry_T *entries = (langmap_entry_T *)(langmap_mapga.ga_data);
int a = 0;
@@ -11558,7 +11491,7 @@ langmap_adjust_mb(c)
# endif
static void
-langmap_init()
+langmap_init(void)
{
int i;
@@ -11574,7 +11507,7 @@ langmap_init()
* changed at any time!
*/
static void
-langmap_set()
+langmap_set(void)
{
char_u *p;
char_u *p2;
@@ -11683,8 +11616,7 @@ langmap_set()
* Take care of no formatting when 'paste' is set.
*/
int
-has_format_option(x)
- int x;
+has_format_option(int x)
{
if (p_paste)
return FALSE;
@@ -11696,8 +11628,7 @@ has_format_option(x)
* 'shortmess' contains 'a' and "x" is present in SHM_A.
*/
int
-shortmess(x)
- int x;
+shortmess(int x)
{
return p_shm != NULL &&
( vim_strchr(p_shm, x) != NULL
@@ -11709,7 +11640,7 @@ shortmess(x)
* paste_option_changed() - Called after p_paste was set or reset.
*/
static void
-paste_option_changed()
+paste_option_changed(void)
{
static int old_p_paste = FALSE;
static int save_sm = 0;
@@ -11843,9 +11774,7 @@ paste_option_changed()
* When "fname" is not NULL, use it to set $"envname" when it wasn't set yet.
*/
void
-vimrc_found(fname, envname)
- char_u *fname;
- char_u *envname;
+vimrc_found(char_u *fname, char_u *envname)
{
int opt_idx;
int dofree = FALSE;
@@ -11883,8 +11812,7 @@ vimrc_found(fname, envname)
* Set 'compatible' on or off. Called for "-C" and "-N" command line arg.
*/
void
-change_compatible(on)
- int on;
+change_compatible(int on)
{
int opt_idx;
@@ -11903,8 +11831,7 @@ change_compatible(on)
* Only works correctly for global options.
*/
int
-option_was_set(name)
- char_u *name;
+option_was_set(char_u *name)
{
int idx;
@@ -11920,8 +11847,7 @@ option_was_set(name)
* Reset the flag indicating option "name" was set.
*/
void
-reset_option_was_set(name)
- char_u *name;
+reset_option_was_set(char_u *name)
{
int idx = findoption(name);
@@ -11938,7 +11864,7 @@ reset_option_was_set(name)
* for Vim (without the P_VI_DEF flag) to that default.
*/
static void
-compatible_set()
+compatible_set(void)
{
int opt_idx;
@@ -11961,7 +11887,7 @@ compatible_set()
* fill_breakat_flags() -- called when 'breakat' changes value.
*/
static void
-fill_breakat_flags()
+fill_breakat_flags(void)
{
char_u *p;
int i;
@@ -11987,10 +11913,10 @@ fill_breakat_flags()
* Empty is always OK.
*/
static int
-check_opt_strings(val, values, list)
- char_u *val;
- char **values;
- int list; /* when TRUE: accept a list of values */
+check_opt_strings(
+ char_u *val,
+ char **values,
+ int list) /* when TRUE: accept a list of values */
{
return opt_strings_flags(val, values, NULL, list);
}
@@ -12003,11 +11929,11 @@ check_opt_strings(val, values, list)
* Empty is always OK.
*/
static int
-opt_strings_flags(val, values, flagp, list)
- char_u *val; /* new value */
- char **values; /* array of valid string values */
- unsigned *flagp;
- int list; /* when TRUE: accept a list of values */
+opt_strings_flags(
+ char_u *val, /* new value */
+ char **values, /* array of valid string values */
+ unsigned *flagp,
+ int list) /* when TRUE: accept a list of values */
{
int i;
int len;
@@ -12040,7 +11966,7 @@ opt_strings_flags(val, values, flagp, list)
* Read the 'wildmode' option, fill wim_flags[].
*/
static int
-check_opt_wim()
+check_opt_wim(void)
{
char_u new_wim_flags[4];
char_u *p;
@@ -12092,8 +12018,8 @@ check_opt_wim()
* Check if backspacing over something is allowed.
*/
int
-can_bs(what)
- int what; /* BS_INDENT, BS_EOL or BS_START */
+can_bs(
+ int what) /* BS_INDENT, BS_EOL or BS_START */
{
switch (*p_bs)
{
@@ -12109,8 +12035,7 @@ can_bs(what)
* the file must be considered changed when the value is different.
*/
void
-save_file_ff(buf)
- buf_T *buf;
+save_file_ff(buf_T *buf)
{
buf->b_start_ffc = *buf->b_p_ff;
buf->b_start_eol = buf->b_p_eol;
@@ -12137,9 +12062,7 @@ save_file_ff(buf)
* changed.
*/
int
-file_ff_differs(buf, ignore_empty)
- buf_T *buf;
- int ignore_empty;
+file_ff_differs(buf_T *buf, int ignore_empty)
{
/* In a buffer that was never loaded the options are not valid. */
if (buf->b_flags & BF_NEVERLOADED)
@@ -12168,8 +12091,7 @@ file_ff_differs(buf, ignore_empty)
* return OK if "p" is a valid fileformat name, FAIL otherwise.
*/
int
-check_ff_value(p)
- char_u *p;
+check_ff_value(char_u *p)
{
return check_opt_strings(p, p_ff_values, FALSE);
}
@@ -12179,8 +12101,7 @@ check_ff_value(p)
* 'tabstop' value when 'shiftwidth' is zero.
*/
long
-get_sw_value(buf)
- buf_T *buf;
+get_sw_value(buf_T *buf)
{
return buf->b_p_sw ? buf->b_p_sw : buf->b_p_ts;
}
@@ -12190,7 +12111,7 @@ get_sw_value(buf)
* 'tabstop' value when 'softtabstop' is negative.
*/
long
-get_sts_value()
+get_sts_value(void)
{
return curbuf->b_p_sts < 0 ? get_sw_value(curbuf) : curbuf->b_p_sts;
}
@@ -12202,11 +12123,11 @@ get_sts_value()
* When "switchit" is TRUE swap the direction.
*/
void
-find_mps_values(initc, findc, backwards, switchit)
- int *initc;
- int *findc;
- int *backwards;
- int switchit;
+find_mps_values(
+ int *initc,
+ int *findc,
+ int *backwards,
+ int switchit)
{
char_u *ptr;
@@ -12299,8 +12220,7 @@ find_mps_values(initc, findc, backwards, switchit)
* initialized.
*/
static int
-briopt_check(wp)
- win_T *wp;
+briopt_check(win_T *wp)
{
char_u *p;
int bri_shift = 0;
@@ -12344,8 +12264,7 @@ briopt_check(wp)
* Get the local or global value of 'backupcopy'.
*/
unsigned int
-get_bkc_value(buf)
- buf_T *buf;
+get_bkc_value(buf_T *buf)
{
return buf->b_bkc_flags ? buf->b_bkc_flags : bkc_flags;
}