summaryrefslogtreecommitdiff
path: root/src/eval.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-01-30 15:14:10 +0100
committerBram Moolenaar <Bram@vim.org>2016-01-30 15:14:10 +0100
commit7454a06e2642d2b37afad1c5e71cec68081ca4ff (patch)
tree8b38e652321d9591a2f57e44b9bdc1f590837f7b /src/eval.c
parent305598b71261265994e2846b4ff4a4d8efade280 (diff)
downloadvim-git-7454a06e2642d2b37afad1c5e71cec68081ca4ff.tar.gz
patch 7.4.1205v7.4.1205
Problem: Using old style function declarations. Solution: Change to new style function declarations. (script by Hirohito Higashi)
Diffstat (limited to 'src/eval.c')
-rw-r--r--src/eval.c2773
1 files changed, 915 insertions, 1858 deletions
diff --git a/src/eval.c b/src/eval.c
index 9a8201eb5..fc512aba9 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -890,7 +890,7 @@ static void sortFunctions();
* Initialize the global and v: variables.
*/
void
-eval_init()
+eval_init(void)
{
int i;
struct vimvar *p;
@@ -941,7 +941,7 @@ eval_init()
#if defined(EXITFREE) || defined(PROTO)
void
-eval_clear()
+eval_clear(void)
{
int i;
struct vimvar *p;
@@ -1006,8 +1006,7 @@ func_name(void *cookie)
* Return the address holding the next breakpoint line for a funccall cookie.
*/
linenr_T *
-func_breakpoint(cookie)
- void *cookie;
+func_breakpoint(void *cookie)
{
return &((funccall_T *)cookie)->breakpoint;
}
@@ -1041,7 +1040,7 @@ funccall_T *previous_funccal = NULL;
* Return TRUE when a function was ended by a ":return" command.
*/
int
-current_func_returned()
+current_func_returned(void)
{
return current_funccal->returned;
}
@@ -1183,7 +1182,7 @@ var_redir_str(char_u *value, int value_len)
* Frees the allocated memory.
*/
void
-var_redir_stop()
+var_redir_stop(void)
{
typval_T tv;
@@ -1244,9 +1243,7 @@ eval_charconvert(
# if defined(FEAT_POSTSCRIPT) || defined(PROTO)
int
-eval_printexpr(fname, args)
- char_u *fname;
- char_u *args;
+eval_printexpr(char_u *fname, char_u *args)
{
int err = FALSE;
@@ -1268,10 +1265,10 @@ eval_printexpr(fname, args)
# if defined(FEAT_DIFF) || defined(PROTO)
void
-eval_diff(origfile, newfile, outfile)
- char_u *origfile;
- char_u *newfile;
- char_u *outfile;
+eval_diff(
+ char_u *origfile,
+ char_u *newfile,
+ char_u *outfile)
{
int err = FALSE;
@@ -1285,10 +1282,10 @@ eval_diff(origfile, newfile, outfile)
}
void
-eval_patch(origfile, difffile, outfile)
- char_u *origfile;
- char_u *difffile;
- char_u *outfile;
+eval_patch(
+ char_u *origfile,
+ char_u *difffile,
+ char_u *outfile)
{
int err;
@@ -1308,11 +1305,11 @@ eval_patch(origfile, difffile, outfile)
* Return TRUE or FALSE.
*/
int
-eval_to_bool(arg, error, nextcmd, skip)
- char_u *arg;
- int *error;
- char_u **nextcmd;
- int skip; /* only parse, don't execute */
+eval_to_bool(
+ char_u *arg,
+ int *error,
+ char_u **nextcmd,
+ int skip) /* only parse, don't execute */
{
typval_T tv;
int retval = FALSE;
@@ -1342,10 +1339,10 @@ eval_to_bool(arg, error, nextcmd, skip)
* pointer to allocated memory, or NULL for failure or when "skip" is TRUE.
*/
char_u *
-eval_to_string_skip(arg, nextcmd, skip)
- char_u *arg;
- char_u **nextcmd;
- int skip; /* only parse, don't execute */
+eval_to_string_skip(
+ char_u *arg,
+ char_u **nextcmd,
+ int skip) /* only parse, don't execute */
{
typval_T tv;
char_u *retval;
@@ -1370,8 +1367,7 @@ eval_to_string_skip(arg, nextcmd, skip)
* Return FAIL for an error, OK otherwise.
*/
int
-skip_expr(pp)
- char_u **pp;
+skip_expr(char_u **pp)
{
typval_T rettv;
@@ -1386,10 +1382,10 @@ skip_expr(pp)
* Return pointer to allocated memory, or NULL for failure.
*/
char_u *
-eval_to_string(arg, nextcmd, convert)
- char_u *arg;
- char_u **nextcmd;
- int convert;
+eval_to_string(
+ char_u *arg,
+ char_u **nextcmd,
+ int convert)
{
typval_T tv;
char_u *retval;
@@ -1434,10 +1430,10 @@ eval_to_string(arg, nextcmd, convert)
* textlock. When "use_sandbox" is TRUE use the sandbox.
*/
char_u *
-eval_to_string_safe(arg, nextcmd, use_sandbox)
- char_u *arg;
- char_u **nextcmd;
- int use_sandbox;
+eval_to_string_safe(
+ char_u *arg,
+ char_u **nextcmd,
+ int use_sandbox)
{
char_u *retval;
void *save_funccalp;
@@ -1460,8 +1456,7 @@ eval_to_string_safe(arg, nextcmd, use_sandbox)
* Returns -1 for an error.
*/
int
-eval_to_number(expr)
- char_u *expr;
+eval_to_number(char_u *expr)
{
typval_T rettv;
int retval;
@@ -1487,9 +1482,7 @@ eval_to_number(expr)
* When not used yet add the variable to the v: hashtable.
*/
static void
-prepare_vimvar(idx, save_tv)
- int idx;
- typval_T *save_tv;
+prepare_vimvar(int idx, typval_T *save_tv)
{
*save_tv = vimvars[idx].vv_tv;
if (vimvars[idx].vv_type == VAR_UNKNOWN)
@@ -1501,9 +1494,7 @@ prepare_vimvar(idx, save_tv)
* When no longer defined, remove the variable from the v: hashtable.
*/
static void
-restore_vimvar(idx, save_tv)
- int idx;
- typval_T *save_tv;
+restore_vimvar(int idx, typval_T *save_tv)
{
hashitem_T *hi;
@@ -1525,9 +1516,7 @@ restore_vimvar(idx, save_tv)
* Returns NULL when there is an error.
*/
list_T *
-eval_spell_expr(badword, expr)
- char_u *badword;
- char_u *expr;
+eval_spell_expr(char_u *badword, char_u *expr)
{
typval_T save_val;
typval_T rettv;
@@ -1563,9 +1552,7 @@ eval_spell_expr(badword, expr)
* Used to get the good word and score from the eval_spell_expr() result.
*/
int
-get_spellword(list, pp)
- list_T *list;
- char_u **pp;
+get_spellword(list_T *list, char_u **pp)
{
listitem_T *li;
@@ -1587,9 +1574,7 @@ get_spellword(list, pp)
* Returns NULL when there is an error.
*/
typval_T *
-eval_expr(arg, nextcmd)
- char_u *arg;
- char_u **nextcmd;
+eval_expr(char_u *arg, char_u **nextcmd)
{
typval_T *tv;
@@ -1611,13 +1596,13 @@ eval_expr(arg, nextcmd)
* Returns OK or FAIL.
*/
int
-call_vim_function(func, argc, argv, safe, str_arg_only, rettv)
- char_u *func;
- int argc;
- char_u **argv;
- int safe; /* use the sandbox */
- int str_arg_only; /* all arguments are strings */
- typval_T *rettv;
+call_vim_function(
+ char_u *func,
+ int argc,
+ char_u **argv,
+ int safe, /* use the sandbox */
+ int str_arg_only, /* all arguments are strings */
+ typval_T *rettv)
{
typval_T *argvars;
long n;
@@ -1687,11 +1672,11 @@ call_vim_function(func, argc, argv, safe, str_arg_only, rettv)
* Uses argv[argc] for the function arguments.
*/
long
-call_func_retnr(func, argc, argv, safe)
- char_u *func;
- int argc;
- char_u **argv;
- int safe; /* use the sandbox */
+call_func_retnr(
+ char_u *func,
+ int argc,
+ char_u **argv,
+ int safe) /* use the sandbox */
{
typval_T rettv;
long retval;
@@ -1715,11 +1700,11 @@ call_func_retnr(func, argc, argv, safe)
* Uses argv[argc] for the function arguments.
*/
void *
-call_func_retstr(func, argc, argv, safe)
- char_u *func;
- int argc;
- char_u **argv;
- int safe; /* use the sandbox */
+call_func_retstr(
+ char_u *func,
+ int argc,
+ char_u **argv,
+ int safe) /* use the sandbox */
{
typval_T rettv;
char_u *retval;
@@ -1740,11 +1725,11 @@ call_func_retstr(func, argc, argv, safe)
* Returns NULL when there is something wrong.
*/
void *
-call_func_retlist(func, argc, argv, safe)
- char_u *func;
- int argc;
- char_u **argv;
- int safe; /* use the sandbox */
+call_func_retlist(
+ char_u *func,
+ int argc,
+ char_u **argv,
+ int safe) /* use the sandbox */
{
typval_T rettv;
@@ -1767,7 +1752,7 @@ call_func_retlist(func, argc, argv, safe)
* Used when executing autocommands and for ":source".
*/
void *
-save_funccal()
+save_funccal(void)
{
funccall_T *fc = current_funccal;
@@ -1776,8 +1761,7 @@ save_funccal()
}
void
-restore_funccal(vfc)
- void *vfc;
+restore_funccal(void *vfc)
{
funccall_T *fc = (funccall_T *)vfc;
@@ -1791,8 +1775,8 @@ restore_funccal(vfc)
* Should always be called in pair with prof_child_exit().
*/
void
-prof_child_enter(tm)
- proftime_T *tm; /* place to store waittime */
+prof_child_enter(
+ proftime_T *tm) /* place to store waittime */
{
funccall_T *fc = current_funccal;
@@ -1806,8 +1790,8 @@ prof_child_enter(tm)
* Should always be called after prof_child_enter().
*/
void
-prof_child_exit(tm)
- proftime_T *tm; /* where waittime was stored */
+prof_child_exit(
+ proftime_T *tm) /* where waittime was stored */
{
funccall_T *fc = current_funccal;
@@ -1829,9 +1813,7 @@ prof_child_exit(tm)
* it in "*cp". Doesn't give error messages.
*/
int
-eval_foldexpr(arg, cp)
- char_u *arg;
- int *cp;
+eval_foldexpr(char_u *arg, int *cp)
{
typval_T tv;
int retval;
@@ -1883,8 +1865,7 @@ eval_foldexpr(arg, cp)
* ":let [var1, var2] = expr" unpack list.
*/
void
-ex_let(eap)
- exarg_T *eap;
+ex_let(exarg_T *eap)
{
char_u *arg = eap->arg;
char_u *expr = NULL;
@@ -1968,13 +1949,13 @@ ex_let(eap)
* Returns OK or FAIL;
*/
static int
-ex_let_vars(arg_start, tv, copy, semicolon, var_count, nextchars)
- char_u *arg_start;
- typval_T *tv;
- int copy; /* copy values from "tv", don't move */
- int semicolon; /* from skip_var_list() */
- int var_count; /* from skip_var_list() */
- char_u *nextchars;
+ex_let_vars(
+ char_u *arg_start,
+ typval_T *tv,
+ int copy, /* copy values from "tv", don't move */
+ int semicolon, /* from skip_var_list() */
+ int var_count, /* from skip_var_list() */
+ char_u *nextchars)
{
char_u *arg = arg_start;
list_T *l;
@@ -2066,10 +2047,10 @@ ex_let_vars(arg_start, tv, copy, semicolon, var_count, nextchars)
* Return NULL for an error.
*/
static char_u *
-skip_var_list(arg, var_count, semicolon)
- char_u *arg;
- int *var_count;
- int *semicolon;
+skip_var_list(
+ char_u *arg,
+ int *var_count,
+ int *semicolon)
{
char_u *p, *s;
@@ -2117,8 +2098,7 @@ skip_var_list(arg, var_count, semicolon)
* l[idx].
*/
static char_u *
-skip_var_one(arg)
- char_u *arg;
+skip_var_one(char_u *arg)
{
if (*arg == '@' && arg[1] != NUL)
return arg + 2;
@@ -2131,11 +2111,11 @@ skip_var_one(arg)
* If "empty" is TRUE also list NULL strings as empty strings.
*/
static void
-list_hashtable_vars(ht, prefix, empty, first)
- hashtab_T *ht;
- char_u *prefix;
- int empty;
- int *first;
+list_hashtable_vars(
+ hashtab_T *ht,
+ char_u *prefix,
+ int empty,
+ int *first)
{
hashitem_T *hi;
dictitem_T *di;
@@ -2159,8 +2139,7 @@ list_hashtable_vars(ht, prefix, empty, first)
* List global variables.
*/
static void
-list_glob_vars(first)
- int *first;
+list_glob_vars(int *first)
{
list_hashtable_vars(&globvarht, (char_u *)"", TRUE, first);
}
@@ -2169,8 +2148,7 @@ list_glob_vars(first)
* List buffer variables.
*/
static void
-list_buf_vars(first)
- int *first;
+list_buf_vars(int *first)
{
char_u numbuf[NUMBUFLEN];
@@ -2186,8 +2164,7 @@ list_buf_vars(first)
* List window variables.
*/
static void
-list_win_vars(first)
- int *first;
+list_win_vars(int *first)
{
list_hashtable_vars(&curwin->w_vars->dv_hashtab,
(char_u *)"w:", TRUE, first);
@@ -2198,8 +2175,7 @@ list_win_vars(first)
* List tab page variables.
*/
static void
-list_tab_vars(first)
- int *first;
+list_tab_vars(int *first)
{
list_hashtable_vars(&curtab->tp_vars->dv_hashtab,
(char_u *)"t:", TRUE, first);
@@ -2210,8 +2186,7 @@ list_tab_vars(first)
* List Vim variables.
*/
static void
-list_vim_vars(first)
- int *first;
+list_vim_vars(int *first)
{
list_hashtable_vars(&vimvarht, (char_u *)"v:", FALSE, first);
}
@@ -2220,8 +2195,7 @@ list_vim_vars(first)
* List script-local variables, if there is a script.
*/
static void
-list_script_vars(first)
- int *first;
+list_script_vars(int *first)
{
if (current_SID > 0 && current_SID <= ga_scripts.ga_len)
list_hashtable_vars(&SCRIPT_VARS(current_SID),
@@ -2232,8 +2206,7 @@ list_script_vars(first)
* List function variables, if there is a function.
*/
static void
-list_func_vars(first)
- int *first;
+list_func_vars(int *first)
{
if (current_funccal != NULL)
list_hashtable_vars(&current_funccal->l_vars.dv_hashtab,
@@ -2244,10 +2217,7 @@ list_func_vars(first)
* List variables in "arg".
*/
static char_u *
-list_arg_vars(eap, arg, first)
- exarg_T *eap;
- char_u *arg;
- int *first;
+list_arg_vars(exarg_T *eap, char_u *arg, int *first)
{
int error = FALSE;
int len;
@@ -2355,12 +2325,12 @@ list_arg_vars(eap, arg, first)
* Returns NULL if there is an error.
*/
static char_u *
-ex_let_one(arg, tv, copy, endchars, op)
- char_u *arg; /* points to variable name */
- typval_T *tv; /* value to assign to variable */
- int copy; /* copy value from "tv" */
- char_u *endchars; /* valid chars after variable name or NULL */
- char_u *op; /* "+", "-", "." or NULL*/
+ex_let_one(
+ char_u *arg, /* points to variable name */
+ typval_T *tv, /* value to assign to variable */
+ int copy, /* copy value from "tv" */
+ char_u *endchars, /* valid chars after variable name or NULL */
+ char_u *op) /* "+", "-", "." or NULL*/
{
int c1;
char_u *name;
@@ -2549,8 +2519,7 @@ ex_let_one(arg, tv, copy, endchars, op)
* If "arg" is equal to "b:changedtick" give an error and return TRUE.
*/
static int
-check_changedtick(arg)
- char_u *arg;
+check_changedtick(char_u *arg)
{
if (STRNCMP(arg, "b:changedtick", 13) == 0 && !eval_isnamec(arg[13]))
{
@@ -2579,14 +2548,14 @@ check_changedtick(arg)
* Returns NULL for a parsing error. Still need to free items in "lp"!
*/
static char_u *
-get_lval(name, rettv, lp, unlet, skip, flags, fne_flags)
- char_u *name;
- typval_T *rettv;
- lval_T *lp;
- int unlet;
- int skip;
- int flags; /* GLV_ values */
- int fne_flags; /* flags for find_name_end() */
+get_lval(
+ char_u *name,
+ typval_T *rettv,
+ lval_T *lp,
+ int unlet,
+ int skip,
+ int flags, /* GLV_ values */
+ int fne_flags) /* flags for find_name_end() */
{
char_u *p;
char_u *expr_start, *expr_end;
@@ -2924,8 +2893,7 @@ get_lval(name, rettv, lp, unlet, skip, flags, fne_flags)
* Clear lval "lp" that was filled by get_lval().
*/
static void
-clear_lval(lp)
- lval_T *lp;
+clear_lval(lval_T *lp)
{
vim_free(lp->ll_exp_name);
vim_free(lp->ll_newkey);
@@ -2937,12 +2905,12 @@ clear_lval(lp)
* "op" is NULL, "+" for "+=", "-" for "-=", "." for ".=" or "=" for "=".
*/
static void
-set_var_lval(lp, endp, rettv, copy, op)
- lval_T *lp;
- char_u *endp;
- typval_T *rettv;
- int copy;
- char_u *op;
+set_var_lval(
+ lval_T *lp,
+ char_u *endp,
+ typval_T *rettv,
+ int copy,
+ char_u *op)
{
int cc;
listitem_T *ri;
@@ -3085,10 +3053,7 @@ set_var_lval(lp, endp, rettv, copy, op)
* Returns OK or FAIL.
*/
static int
-tv_op(tv1, tv2, op)
- typval_T *tv1;
- typval_T *tv2;
- char_u *op;
+tv_op(typval_T *tv1, typval_T *tv2, char_u *op)
{
long n;
char_u numbuf[NUMBUFLEN];
@@ -3191,9 +3156,7 @@ tv_op(tv1, tv2, op)
* Add a watcher to a list.
*/
void
-list_add_watch(l, lw)
- list_T *l;
- listwatch_T *lw;
+list_add_watch(list_T *l, listwatch_T *lw)
{
lw->lw_next = l->lv_watch;
l->lv_watch = lw;
@@ -3204,9 +3167,7 @@ list_add_watch(l, lw)
* No warning when it isn't found...
*/
void
-list_rem_watch(l, lwrem)
- list_T *l;
- listwatch_T *lwrem;
+list_rem_watch(list_T *l, listwatch_T *lwrem)
{
listwatch_T *lw, **lwp;
@@ -3227,9 +3188,7 @@ list_rem_watch(l, lwrem)
* item.
*/
static void
-list_fix_watch(l, item)
- list_T *l;
- listitem_T *item;
+list_fix_watch(list_T *l, listitem_T *item)
{
listwatch_T *lw;
@@ -3245,11 +3204,11 @@ list_fix_watch(l, item)
* Return a pointer that holds the info. Null when there is an error.
*/
void *
-eval_for_line(arg, errp, nextcmdp, skip)
- char_u *arg;
- int *errp;
- char_u **nextcmdp;
- int skip;
+eval_for_line(
+ char_u *arg,
+ int *errp,
+ char_u **nextcmdp,
+ int skip)
{
forinfo_T *fi;
char_u *expr;
@@ -3309,9 +3268,7 @@ eval_for_line(arg, errp, nextcmdp, skip)
* something wrong.
*/
int
-next_for_item(fi_void, arg)
- void *fi_void;
- char_u *arg;
+next_for_item(void *fi_void, char_u *arg)
{
forinfo_T *fi = (forinfo_T *)fi_void;
int result;
@@ -3333,8 +3290,7 @@ next_for_item(fi_void, arg)
* Free the structure used to store info used by ":for".
*/
void
-free_for_info(fi_void)
- void *fi_void;
+free_for_info(void *fi_void)
{
forinfo_T *fi = (forinfo_T *)fi_void;
@@ -3349,10 +3305,10 @@ free_for_info(fi_void)
#if defined(FEAT_CMDL_COMPL) || defined(PROTO)
void
-set_context_for_expression(xp, arg, cmdidx)
- expand_T *xp;
- char_u *arg;
- cmdidx_T cmdidx;
+set_context_for_expression(
+ expand_T *xp,
+ char_u *arg,
+ cmdidx_T cmdidx)
{
int got_eq = FALSE;
int c;
@@ -3462,8 +3418,7 @@ set_context_for_expression(xp, arg, cmdidx)
* ":1,25call func(arg1, arg2)" function call.
*/
void
-ex_call(eap)
- exarg_T *eap;
+ex_call(exarg_T *eap)
{
char_u *arg = eap->arg;
char_u *startarg;
@@ -3592,8 +3547,7 @@ end:
* ":unlet[!] var1 ... " command.
*/
void
-ex_unlet(eap)
- exarg_T *eap;
+ex_unlet(exarg_T *eap)
{
ex_unletlock(eap, eap->arg, 0);
}
@@ -3602,8 +3556,7 @@ ex_unlet(eap)
* ":lockvar" and ":unlockvar" commands
*/
void
-ex_lockvar(eap)
- exarg_T *eap;
+ex_lockvar(exarg_T *eap)
{
char_u *arg = eap->arg;
int deep = 2;
@@ -3623,10 +3576,10 @@ ex_lockvar(eap)
* ":unlet", ":lockvar" and ":unlockvar" are quite similar.
*/
static void
-ex_unletlock(eap, argstart, deep)
- exarg_T *eap;
- char_u *argstart;
- int deep;
+ex_unletlock(
+ exarg_T *eap,
+ char_u *argstart,
+ int deep)
{
char_u *arg = argstart;
char_u *name_end;
@@ -3678,10 +3631,10 @@ ex_unletlock(eap, argstart, deep)
}
static int
-do_unlet_var(lp, name_end, forceit)
- lval_T *lp;
- char_u *name_end;
- int forceit;
+do_unlet_var(
+ lval_T *lp,
+ char_u *name_end,
+ int forceit)
{
int ret = OK;
int cc;
@@ -3745,9 +3698,7 @@ do_unlet_var(lp, name_end, forceit)
* When "forceit" is TRUE don't complain if the variable doesn't exist.
*/
int
-do_unlet(name, forceit)
- char_u *name;
- int forceit;
+do_unlet(char_u *name, int forceit)
{
hashtab_T *ht;
hashitem_T *hi;
@@ -3800,11 +3751,11 @@ do_unlet(name, forceit)
* "lock" is TRUE for ":lockvar", FALSE for ":unlockvar".
*/
static int
-do_lock_var(lp, name_end, deep, lock)
- lval_T *lp;
- char_u *name_end;
- int deep;
- int lock;
+do_lock_var(
+ lval_T *lp,
+ char_u *name_end,
+ int deep,
+ int lock)
{
int ret = OK;
int cc;
@@ -3863,10 +3814,7 @@ do_lock_var(lp, name_end, deep, lock)
* Lock or unlock an item. "deep" is nr of levels to go.
*/
static void
-item_lock(tv, deep, lock)
- typval_T *tv;
- int deep;
- int lock;
+item_lock(typval_T *tv, int deep, int lock)
{
static int recurse = 0;
list_T *l;
@@ -3935,8 +3883,7 @@ item_lock(tv, deep, lock)
* or it refers to a List or Dictionary that is locked.
*/
static int
-tv_islocked(tv)
- typval_T *tv;
+tv_islocked(typval_T *tv)
{
return (tv->v_lock & VAR_LOCKED)
|| (tv->v_type == VAR_LIST
@@ -3952,7 +3899,7 @@ tv_islocked(tv)
* Delete all "menutrans_" variables.
*/
void
-del_menutrans_vars()
+del_menutrans_vars(void)
{
hashitem_T *hi;
int todo;
@@ -3989,9 +3936,7 @@ static int varnamebuflen = 0;
* Function to concatenate a prefix and a variable name.
*/
static char_u *
-cat_prefix_varname(prefix, name)
- int prefix;
- char_u *name;
+cat_prefix_varname(int prefix, char_u *name)
{
int len;
@@ -4019,9 +3964,7 @@ cat_prefix_varname(prefix, name)
* (global/buffer/window/built-in) variable names.
*/
char_u *
-get_user_var_name(xp, idx)
- expand_T *xp;
- int idx;
+get_user_var_name(expand_T *xp, int idx)
{
static long_u gdone;
static long_u bdone;
@@ -4143,11 +4086,11 @@ typedef enum
* Return OK or FAIL.
*/
static int
-eval0(arg, rettv, nextcmd, evaluate)
- char_u *arg;
- typval_T *rettv;
- char_u **nextcmd;
- int evaluate;
+eval0(
+ char_u *arg,
+ typval_T *rettv,
+ char_u **nextcmd,
+ int evaluate)
{
int ret;
char_u *p;
@@ -4185,10 +4128,7 @@ eval0(arg, rettv, nextcmd, evaluate)
* Return OK or FAIL.
*/
static int
-eval1(arg, rettv, evaluate)
- char_u **arg;
- typval_T *rettv;
- int evaluate;
+eval1(char_u **arg, typval_T *rettv, int evaluate)
{
int result;
typval_T var2;
@@ -4258,10 +4198,7 @@ eval1(arg, rettv, evaluate)
* Return OK or FAIL.
*/
static int
-eval2(arg, rettv, evaluate)
- char_u **arg;
- typval_T *rettv;
- int evaluate;
+eval2(char_u **arg, typval_T *rettv, int evaluate)
{
typval_T var2;
long result;
@@ -4329,10 +4266,7 @@ eval2(arg, rettv, evaluate)
* Return OK or FAIL.
*/
static int
-eval3(arg, rettv, evaluate)
- char_u **arg;
- typval_T *rettv;
- int evaluate;
+eval3(char_u **arg, typval_T *rettv, int evaluate)
{
typval_T var2;
long result;
@@ -4409,10 +4343,7 @@ eval3(arg, rettv, evaluate)
* Return OK or FAIL.
*/
static int
-eval4(arg, rettv, evaluate)
- char_u **arg;
- typval_T *rettv;
- int evaluate;
+eval4(char_u **arg, typval_T *rettv, int evaluate)
{
typval_T var2;
char_u *p;
@@ -4719,10 +4650,7 @@ eval4(arg, rettv, evaluate)
* Return OK or FAIL.
*/
static int
-eval5(arg, rettv, evaluate)
- char_u **arg;
- typval_T *rettv;
- int evaluate;
+eval5(char_u **arg, typval_T *rettv, int evaluate)
{
typval_T var2;
typval_T var3;
@@ -4904,11 +4832,11 @@ eval5(arg, rettv, evaluate)
* Return OK or FAIL.
*/
static int
-eval6(arg, rettv, evaluate, want_string)
- char_u **arg;
- typval_T *rettv;
- int evaluate;
- int want_string; /* after "." operator */
+eval6(
+ char_u **arg,
+ typval_T *rettv,
+ int evaluate,
+ int want_string) /* after "." operator */
{
typval_T var2;
int op;
@@ -5086,11 +5014,11 @@ eval6(arg, rettv, evaluate, want_string)
* Return OK or FAIL.
*/
static int
-eval7(arg, rettv, evaluate, want_string)
- char_u **arg;
- typval_T *rettv;
- int evaluate;
- int want_string UNUSED; /* after "." operator */
+eval7(
+ char_u **arg,
+ typval_T *rettv,
+ int evaluate,
+ int want_string UNUSED) /* after "." operator */
{
long n;
int len;
@@ -5378,11 +5306,11 @@ eval7(arg, rettv, evaluate, want_string)
* Returns FAIL or OK. "*arg" is advanced to after the ']'.
*/
static int
-eval_index(arg, rettv, evaluate, verbose)
- char_u **arg;
- typval_T *rettv;
- int evaluate;
- int verbose; /* give error messages */
+eval_index(
+ char_u **arg,
+ typval_T *rettv,
+ int evaluate,
+ int verbose) /* give error messages */
{
int empty1 = FALSE, empty2 = FALSE;
typval_T var1, var2;
@@ -5645,10 +5573,10 @@ eval_index(arg, rettv, evaluate, verbose)
* Return OK or FAIL.
*/
static int
-get_option_tv(arg, rettv, evaluate)
- char_u **arg;
- typval_T *rettv; /* when NULL, only check if option exists */
- int evaluate;
+get_option_tv(
+ char_u **arg,
+ typval_T *rettv, /* when NULL, only check if option exists */
+ int evaluate)
{
char_u *option_end;
long numval;
@@ -5724,10 +5652,7 @@ get_option_tv(arg, rettv, evaluate)
* Return OK or FAIL.
*/
static int
-get_string_tv(arg, rettv, evaluate)
- char_u **arg;
- typval_T *rettv;
- int evaluate;
+get_string_tv(char_u **arg, typval_T *rettv, int evaluate)
{
char_u *p;
char_u *name;
@@ -5863,10 +5788,7 @@ get_string_tv(arg, rettv, evaluate)
* Return OK or FAIL.
*/
static int
-get_lit_string_tv(arg, rettv, evaluate)
- char_u **arg;
- typval_T *rettv;
- int evaluate;
+get_lit_string_tv(char_u **arg, typval_T *rettv, int evaluate)
{
char_u *p;
char_u *str;
@@ -5929,10 +5851,7 @@ get_lit_string_tv(arg, rettv, evaluate)
* Return OK or FAIL.
*/
static int
-get_list_tv(arg, rettv, evaluate)
- char_u **arg;
- typval_T *rettv;
- int evaluate;
+get_list_tv(char_u **arg, typval_T *rettv, int evaluate)
{
list_T *l = NULL;
typval_T tv;
@@ -5998,7 +5917,7 @@ failret:
* Caller should take care of the reference count.
*/
list_T *
-list_alloc()
+list_alloc(void)
{
list_T *l;
@@ -6020,8 +5939,7 @@ list_alloc()
* Returns OK or FAIL.
*/
int
-rettv_list_alloc(rettv)
- typval_T *rettv;
+rettv_list_alloc(typval_T *rettv)
{
list_T *l = list_alloc();
@@ -6039,8 +5957,7 @@ rettv_list_alloc(rettv)
* becomes zero.
*/
void
-list_unref(l)
- list_T *l;
+list_unref(list_T *l)
{
if (l != NULL && --l->lv_refcount <= 0)
list_free(l, TRUE);
@@ -6051,9 +5968,9 @@ list_unref(l)
* Ignores the reference count.
*/
void
-list_free(l, recurse)
- list_T *l;
- int recurse; /* Free Lists and Dictionaries recursively. */
+list_free(
+ list_T *l,
+ int recurse) /* Free Lists and Dictionaries recursively. */
{
listitem_T *item;
@@ -6091,8 +6008,7 @@ listitem_alloc()
* Free a list item. Also clears the value. Does not notify watchers.
*/
void
-listitem_free(item)
- listitem_T *item;
+listitem_free(listitem_T *item)
{
clear_tv(&item->li_tv);
vim_free(item);
@@ -6102,9 +6018,7 @@ listitem_free(item)
* Remove a list item from a List and free it. Also clears the value.
*/
void
-listitem_remove(l, item)
- list_T *l;
- listitem_T *item;
+listitem_remove(list_T *l, listitem_T *item)
{
vimlist_remove(l, item, item);
listitem_free(item);
@@ -6114,8 +6028,7 @@ listitem_remove(l, item)
* Get the number of items in a list.
*/
static long
-list_len(l)
- list_T *l;
+list_len(list_T *l)
{
if (l == NULL)
return 0L;
@@ -6126,11 +6039,11 @@ list_len(l)
* Return TRUE when two lists have exactly the same values.
*/
static int
-list_equal(l1, l2, ic, recursive)
- list_T *l1;
- list_T *l2;
- int ic; /* ignore case for strings */
- int recursive; /* TRUE when used recursively */
+list_equal(
+ list_T *l1,
+ list_T *l2,
+ int ic, /* ignore case for strings */
+ int recursive) /* TRUE when used recursively */
{
listitem_T *item1, *item2;
@@ -6153,8 +6066,7 @@ list_equal(l1, l2, ic, recursive)
* Return the dictitem that an entry in a hashtable points to.
*/
dictitem_T *
-dict_lookup(hi)
- hashitem_T *hi;
+dict_lookup(hashitem_T *hi)
{
return HI2DI(hi);
}
@@ -6163,11 +6075,11 @@ dict_lookup(hi)
* Return TRUE when two dictionaries have exactly the same key/values.
*/
static int
-dict_equal(d1, d2, ic, recursive)
- dict_T *d1;
- dict_T *d2;
- int ic; /* ignore case for strings */
- int recursive; /* TRUE when used recursively */
+dict_equal(
+ dict_T *d1,
+ dict_T *d2,
+ int ic, /* ignore case for strings */
+ int recursive) /* TRUE when used recursively */
{
hashitem_T *hi;
dictitem_T *item2;
@@ -6204,11 +6116,11 @@ static int tv_equal_recurse_limit;
* numbers are different. Floats and numbers are also different.
*/
static int
-tv_equal(tv1, tv2, ic, recursive)
- typval_T *tv1;
- typval_T *tv2;
- int ic; /* ignore case */
- int recursive; /* TRUE when used recursively */
+tv_equal(
+ typval_T *tv1,
+ typval_T *tv2,
+ int ic, /* ignore case */
+ int recursive) /* TRUE when used recursively */
{
char_u buf1[NUMBUFLEN], buf2[NUMBUFLEN];
char_u *s1, *s2;
@@ -6278,9 +6190,7 @@ tv_equal(tv1, tv2, ic, recursive)
* Returns NULL when "n" is out of range.
*/
listitem_T *
-list_find(l, n)
- list_T *l;
- long n;
+list_find(list_T *l, long n)
{
listitem_T *item;
long idx;
@@ -6358,10 +6268,10 @@ list_find(l, n)
* Get list item "l[idx]" as a number.
*/
static long
-list_find_nr(l, idx, errorp)
- list_T *l;
- long idx;
- int *errorp; /* set to TRUE when something wrong */
+list_find_nr(
+ list_T *l,
+ long idx,
+ int *errorp) /* set to TRUE when something wrong */
{
listitem_T *li;
@@ -6379,9 +6289,7 @@ list_find_nr(l, idx, errorp)
* Get list item "l[idx - 1]" as a string. Returns NULL for failure.
*/
char_u *
-list_find_str(l, idx)
- list_T *l;
- long idx;
+list_find_str(list_T *l, long idx)
{
listitem_T *li;
@@ -6399,9 +6307,7 @@ list_find_str(l, idx)
* Returns -1 when "item" is not in the list.
*/
static long
-list_idx_of_item(l, item)
- list_T *l;
- listitem_T *item;
+list_idx_of_item(list_T *l, listitem_T *item)
{
long idx = 0;
listitem_T *li;
@@ -6420,9 +6326,7 @@ list_idx_of_item(l, item)
* Append item "item" to the end of list "l".
*/
void
-list_append(l, item)
- list_T *l;
- listitem_T *item;
+list_append(list_T *l, listitem_T *item)
{
if (l->lv_last == NULL)
{
@@ -6446,9 +6350,7 @@ list_append(l, item)
* Return FAIL when out of memory.
*/
int
-list_append_tv(l, tv)
- list_T *l;
- typval_T *tv;
+list_append_tv(list_T *l, typval_T *tv)
{
listitem_T *li = listitem_alloc();
@@ -6464,9 +6366,7 @@ list_append_tv(l, tv)
* Return FAIL when out of memory.
*/
int
-list_append_dict(list, dict)
- list_T *list;
- dict_T *dict;
+list_append_dict(list_T *list, dict_T *dict)
{
listitem_T *li = listitem_alloc();
@@ -6486,10 +6386,7 @@ list_append_dict(list, dict)
* Returns FAIL when out of memory.
*/
int
-list_append_string(l, str, len)
- list_T *l;
- char_u *str;
- int len;
+list_append_string(list_T *l, char_u *str, int len)
{
listitem_T *li = listitem_alloc();
@@ -6511,9 +6408,7 @@ list_append_string(l, str, len)
* Returns FAIL when out of memory.
*/
static int
-list_append_number(l, n)
- list_T *l;
- varnumber_T n;
+list_append_number(list_T *l, varnumber_T n)
{
listitem_T *li;
@@ -6533,10 +6428,7 @@ list_append_number(l, n)
* Return FAIL when out of memory.
*/
int
-list_insert_tv(l, tv, item)
- list_T *l;
- typval_T *tv;
- listitem_T *item;
+list_insert_tv(list_T *l, typval_T *tv, listitem_T *item)
{
listitem_T *ni = listitem_alloc();
@@ -6548,10 +6440,7 @@ list_insert_tv(l, tv, item)
}
void
-list_insert(l, ni, item)
- list_T *l;
- listitem_T *ni;
- listitem_T *item;
+list_insert(list_T *l, listitem_T *ni, listitem_T *item)
{
if (item == NULL)
/* Append new item at end of list. */
@@ -6582,10 +6471,7 @@ list_insert(l, ni, item)
* Returns FAIL when out of memory.
*/
static int
-list_extend(l1, l2, bef)
- list_T *l1;
- list_T *l2;
- listitem_T *bef;
+list_extend(list_T *l1, list_T *l2, listitem_T *bef)
{
listitem_T *item;
int todo = l2->lv_len;
@@ -6603,10 +6489,7 @@ list_extend(l1, l2, bef)
* Return FAIL when out of memory.
*/
static int
-list_concat(l1, l2, tv)
- list_T *l1;
- list_T *l2;
- typval_T *tv;
+list_concat(list_T *l1, list_T *l2, typval_T *tv)
{
list_T *l;
@@ -6631,10 +6514,7 @@ list_concat(l1, l2, tv)
* Returns NULL when out of memory.
*/
static list_T *
-list_copy(orig, deep, copyID)
- list_T *orig;
- int deep;
- int copyID;
+list_copy(list_T *orig, int deep, int copyID)
{
list_T *copy;
listitem_T *item;
@@ -6689,10 +6569,7 @@ list_copy(orig, deep, copyID)
* file.
*/
void
-vimlist_remove(l, item, item2)
- list_T *l;
- listitem_T *item;
- listitem_T *item2;
+vimlist_remove(list_T *l, listitem_T *item, listitem_T *item2)
{
listitem_T *ip;
@@ -6721,9 +6598,7 @@ vimlist_remove(l, item, item2)
* May return NULL.
*/
static char_u *
-list2string(tv, copyID)
- typval_T *tv;
- int copyID;
+list2string(typval_T *tv, int copyID)
{
garray_T ga;
@@ -6747,13 +6622,13 @@ typedef struct join_S {
} join_T;
static int
-list_join_inner(gap, l, sep, echo_style, copyID, join_gap)
- garray_T *gap; /* to store the result in */
- list_T *l;
- char_u *sep;
- int echo_style;
- int copyID;
- garray_T *join_gap; /* to keep each list item string */
+list_join_inner(
+ garray_T *gap, /* to store the result in */
+ list_T *l,
+ char_u *sep,
+ int echo_style,
+ int copyID,
+ garray_T *join_gap) /* to keep each list item string */
{
int i;
join_T *p;
@@ -6825,12 +6700,12 @@ list_join_inner(gap, l, sep, echo_style, copyID, join_gap)
* Return FAIL or OK.
*/
static int
-list_join(gap, l, sep, echo_style, copyID)
- garray_T *gap;
- list_T *l;
- char_u *sep;
- int echo_style;
- int copyID;
+list_join(
+ garray_T *gap,
+ list_T *l,
+ char_u *sep,
+ int echo_style,
+ int copyID)
{
garray_T join_ga;
int retval;
@@ -6862,7 +6737,7 @@ list_join(gap, l, sep, echo_style, copyID)
* Used for serializing nested structures.
*/
int
-get_copyID()
+get_copyID(void)
{
current_copyID += COPYID_INC;
return current_copyID;
@@ -6893,7 +6768,7 @@ get_copyID()
* Return TRUE if some memory was freed.
*/
int
-garbage_collect()
+garbage_collect(void)
{
int copyID;
int abort = FALSE;
@@ -7023,8 +6898,7 @@ garbage_collect()
* Free lists and dictionaries that are no longer referenced.
*/
static int
-free_unref_items(copyID)
- int copyID;
+free_unref_items(int copyID)
{
dict_T *dd, *dd_next;
list_T *ll, *ll_next;
@@ -7076,10 +6950,7 @@ free_unref_items(copyID)
* Returns TRUE if setting references failed somehow.
*/
int
-set_ref_in_ht(ht, copyID, list_stack)
- hashtab_T *ht;
- int copyID;
- list_stack_T **list_stack;
+set_ref_in_ht(hashtab_T *ht, int copyID, list_stack_T **list_stack)
{
int todo;
int abort = FALSE;
@@ -7126,10 +6997,7 @@ set_ref_in_ht(ht, copyID, list_stack)
* Returns TRUE if setting references failed somehow.
*/
int
-set_ref_in_list(l, copyID, ht_stack)
- list_T *l;
- int copyID;
- ht_stack_T **ht_stack;
+set_ref_in_list(list_T *l, int copyID, ht_stack_T **ht_stack)
{
listitem_T *li;
int abort = FALSE;
@@ -7168,11 +7036,11 @@ set_ref_in_list(l, copyID, ht_stack)
* Returns TRUE if setting references failed somehow.
*/
int
-set_ref_in_item(tv, copyID, ht_stack, list_stack)
- typval_T *tv;
- int copyID;
- ht_stack_T **ht_stack;
- list_stack_T **list_stack;
+set_ref_in_item(
+ typval_T *tv,
+ int copyID,
+ ht_stack_T **ht_stack,
+ list_stack_T **list_stack)
{
dict_T *dd;
list_T *ll;
@@ -7239,7 +7107,7 @@ set_ref_in_item(tv, copyID, ht_stack, list_stack)
* Allocate an empty header for a dictionary.
*/
dict_T *
-dict_alloc()
+dict_alloc(void)
{
dict_T *d;
@@ -7267,8 +7135,7 @@ dict_alloc()
* Returns OK or FAIL.
*/
int
-rettv_dict_alloc(rettv)
- typval_T *rettv;
+rettv_dict_alloc(typval_T *rettv)
{
dict_T *d = dict_alloc();
@@ -7287,8 +7154,7 @@ rettv_dict_alloc(rettv)
* becomes zero.
*/
void
-dict_unref(d)
- dict_T *d;
+dict_unref(dict_T *d)
{
if (d != NULL && --d->dv_refcount <= 0)
dict_free(d, TRUE);
@@ -7299,9 +7165,9 @@ dict_unref(d)
* Ignores the reference count.
*/
void
-dict_free(d, recurse)
- dict_T *d;
- int recurse; /* Free Lists and Dictionaries recursively. */
+dict_free(
+ dict_T *d,
+ int recurse) /* Free Lists and Dictionaries recursively. */
{
int todo;
hashitem_T *hi;
@@ -7344,8 +7210,7 @@ dict_free(d, recurse)
* Returns NULL when out of memory.
*/
dictitem_T *
-dictitem_alloc(key)
- char_u *key;
+dictitem_alloc(char_u *key)
{
dictitem_T *di;
@@ -7362,8 +7227,7 @@ dictitem_alloc(key)
* Make a copy of a Dictionary item.
*/
static dictitem_T *
-dictitem_copy(org)
- dictitem_T *org;
+dictitem_copy(dictitem_T *org)
{
dictitem_T *di;
@@ -7382,9 +7246,7 @@ dictitem_copy(org)
* Remove item "item" from Dictionary "dict" and free it.
*/
static void
-dictitem_remove(dict, item)
- dict_T *dict;
- dictitem_T *item;
+dictitem_remove(dict_T *dict, dictitem_T *item)
{
hashitem_T *hi;
@@ -7400,8 +7262,7 @@ dictitem_remove(dict, item)
* Free a dict item. Also clears the value.
*/
void
-dictitem_free(item)
- dictitem_T *item;
+dictitem_free(dictitem_T *item)
{
clear_tv(&item->di_tv);
if (item->di_flags & DI_FLAGS_ALLOC)
@@ -7415,10 +7276,7 @@ dictitem_free(item)
* Returns NULL when out of memory.
*/
static dict_T *
-dict_copy(orig, deep, copyID)
- dict_T *orig;
- int deep;
- int copyID;
+dict_copy(dict_T *orig, int deep, int copyID)
{
dict_T *copy;
dictitem_T *di;
@@ -7481,9 +7339,7 @@ dict_copy(orig, deep, copyID)
* Returns FAIL when out of memory and when key already exists.
*/
int
-dict_add(d, item)
- dict_T *d;
- dictitem_T *item;
+dict_add(dict_T *d, dictitem_T *item)
{
return hash_add(&d->dv_hashtab, item->di_key);
}
@@ -7494,11 +7350,11 @@ dict_add(d, item)
* Returns FAIL when out of memory and when key already exists.
*/
int
-dict_add_nr_str(d, key, nr, str)
- dict_T *d;
- char *key;
- long nr;
- char_u *str;
+dict_add_nr_str(
+ dict_T *d,
+ char *key,
+ long nr,
+ char_u *str)
{
dictitem_T *item;
@@ -7529,10 +7385,7 @@ dict_add_nr_str(d, key, nr, str)
* Returns FAIL when out of memory and when key already exists.
*/
int
-dict_add_list(d, key, list)
- dict_T *d;
- char *key;
- list_T *list;
+dict_add_list(dict_T *d, char *key, list_T *list)
{
dictitem_T *item;
@@ -7555,8 +7408,7 @@ dict_add_list(d, key, list)
* Get the number of items in a Dictionary.
*/
static long
-dict_len(d)
- dict_T *d;
+dict_len(dict_T *d)
{
if (d == NULL)
return 0L;
@@ -7569,10 +7421,7 @@ dict_len(d)
* Returns NULL when not found.
*/
dictitem_T *
-dict_find(d, key, len)
- dict_T *d;
- char_u *key;
- int len;
+dict_find(dict_T *d, char_u *key, int len)
{
#define AKEYLEN 200
char_u buf[AKEYLEN];
@@ -7608,10 +7457,7 @@ dict_find(d, key, len)
* Returns NULL if the entry doesn't exist or out of memory.
*/
char_u *
-get_dict_string(d, key, save)
- dict_T *d;
- char_u *key;
- int save;
+get_dict_string(dict_T *d, char_u *key, int save)
{
dictitem_T *di;
char_u *s;
@@ -7630,9 +7476,7 @@ get_dict_string(d, key, save)
* Returns 0 if the entry doesn't exist or out of memory.
*/
long
-get_dict_number(d, key)
- dict_T *d;
- char_u *key;
+get_dict_number(dict_T *d, char_u *key)
{
dictitem_T *di;
@@ -7647,9 +7491,7 @@ get_dict_number(d, key)
* May return NULL.
*/
static char_u *
-dict2string(tv, copyID)
- typval_T *tv;
- int copyID;
+dict2string(typval_T *tv, int copyID)
{
garray_T ga;
int first = TRUE;
@@ -7710,10 +7552,7 @@ dict2string(tv, copyID)
* Return OK or FAIL. Returns NOTDONE for {expr}.
*/
static int
-get_dict_tv(arg, rettv, evaluate)
- char_u **arg;
- typval_T *rettv;
- int evaluate;
+get_dict_tv(char_u **arg, typval_T *rettv, int evaluate)
{
dict_T *d = NULL;
typval_T tvkey;
@@ -7852,11 +7691,11 @@ get_var_special_name(int nr)
* May return NULL.
*/
static char_u *
-echo_string(tv, tofree, numbuf, copyID)
- typval_T *tv;
- char_u **tofree;
- char_u *numbuf;
- int copyID;
+echo_string(
+ typval_T *tv,
+ char_u **tofree,
+ char_u *numbuf,
+ int copyID)
{
static int recurse = 0;
char_u *r = NULL;
@@ -7958,11 +7797,11 @@ echo_string(tv, tofree, numbuf, copyID)
* May return NULL.
*/
static char_u *
-tv2string(tv, tofree, numbuf, copyID)
- typval_T *tv;
- char_u **tofree;
- char_u *numbuf;
- int copyID;
+tv2string(
+ typval_T *tv,
+ char_u **tofree,
+ char_u *numbuf,
+ int copyID)
{
switch (tv->v_type)
{
@@ -7995,9 +7834,7 @@ tv2string(tv, tofree, numbuf, copyID)
* If "function" is TRUE make it function('string').
*/
static char_u *
-string_quote(str, function)
- char_u *str;
- int function;
+string_quote(char_u *str, int function)
{
unsigned len;
char_u *p, *r, *s;
@@ -8043,9 +7880,9 @@ string_quote(str, function)
* Returns the length of the text that was consumed.
*/
int
-string2float(text, value)
- char_u *text;
- float_T *value; /* result stored here */
+string2float(
+ char_u *text,
+ float_T *value) /* result stored here */
{
char *s = (char *)text;
float_T f;
@@ -8063,10 +7900,7 @@ string2float(text, value)
* Return FAIL if the name is invalid.
*/
static int
-get_env_tv(arg, rettv, evaluate)
- char_u **arg;
- typval_T *rettv;
- int evaluate;
+get_env_tv(char_u **arg, typval_T *rettv, int evaluate)
{
char_u *string = NULL;
int len;
@@ -8481,9 +8315,7 @@ static struct fst
* or user defined function names.
*/
char_u *
-get_function_name(xp, idx)
- expand_T *xp;
- int idx;
+get_function_name(expand_T *xp, int idx)
{
static int intidx = -1;
char_u *name;
@@ -8513,9 +8345,7 @@ get_function_name(xp, idx)
* user defined variable or function names.
*/
char_u *
-get_expr_name(xp, idx)
- expand_T *xp;
- int idx;
+get_expr_name(expand_T *xp, int idx)
{
static int intidx = -1;
char_u *name;
@@ -8538,9 +8368,7 @@ get_expr_name(xp, idx)
* Compare struct fst by function name.
*/
static int
-compare_func_name(s1, s2)
- const void *s1;
- const void *s2;
+compare_func_name(const void *s1, const void *s2)
{
struct fst *p1 = (struct fst *)s1;
struct fst *p2 = (struct fst *)s2;
@@ -8554,7 +8382,7 @@ compare_func_name(s1, s2)
* On machines using EBCDIC we have to sort it.
*/
static void
-sortFunctions()
+sortFunctions(void)
{
int funcCnt = (int)(sizeof(functions) / sizeof(struct fst)) - 1;
@@ -8568,8 +8396,8 @@ sortFunctions()
* Return index, or -1 if not found
*/
static int
-find_internal_func(name)
- char_u *name; /* name of the function */
+find_internal_func(
+ char_u *name) /* name of the function */
{
int first = 0;
int last = (int)(sizeof(functions) / sizeof(struct fst)) - 1;
@@ -8598,10 +8426,7 @@ find_internal_func(name)
* name it contains, otherwise return "name".
*/
static char_u *
-deref_func_name(name, lenp, no_autoload)
- char_u *name;
- int *lenp;
- int no_autoload;
+deref_func_name(char_u *name, int *lenp, int no_autoload)
{
dictitem_T *v;
int cc;
@@ -8629,17 +8454,16 @@ deref_func_name(name, lenp, no_autoload)
* Return OK or FAIL.
*/
static int
-get_func_tv(name, len, rettv, arg, firstline, lastline, doesrange,
- evaluate, selfdict)
- char_u *name; /* name of the function */
- int len; /* length of "name" */
- typval_T *rettv;
- char_u **arg; /* argument, pointing to the '(' */
- linenr_T firstline; /* first line of range */
- linenr_T lastline; /* last line of range */
- int *doesrange; /* return: function handled range */
- int evaluate;
- dict_T *selfdict; /* Dictionary for "self" */
+get_func_tv(
+ char_u *name, /* name of the function */
+ int len, /* length of "name" */
+ typval_T *rettv,
+ char_u **arg, /* argument, pointing to the '(' */
+ linenr_T firstline, /* first line of range */
+ linenr_T lastline, /* last line of range */
+ int *doesrange, /* return: function handled range */
+ int evaluate,
+ dict_T *selfdict) /* Dictionary for "self" */
{
char_u *argp;
int ret = OK;
@@ -8694,19 +8518,18 @@ get_func_tv(name, len, rettv, arg, firstline, lastline, doesrange,
* Also returns OK when an error was encountered while executing the function.
*/
int
-call_func(funcname, len, rettv, argcount, argvars, firstline, lastline,
- doesrange, evaluate, selfdict)
- char_u *funcname; /* name of the function */
- int len; /* length of "name" */
- typval_T *rettv; /* return value goes here */
- int argcount; /* number of "argvars" */
- typval_T *argvars; /* vars for arguments, must have "argcount"
+call_func(
+ char_u *funcname, /* name of the function */
+ int len, /* length of "name" */
+ typval_T *rettv, /* return value goes here */
+ int argcount, /* number of "argvars" */
+ typval_T *argvars, /* vars for arguments, must have "argcount"
PLUS ONE elements! */
- linenr_T firstline; /* first line of range */
- linenr_T lastline; /* last line of range */
- int *doesrange; /* return: function handled range */
- int evaluate;
- dict_T *selfdict; /* Dictionary for "self" */
+ linenr_T firstline, /* first line of range */
+ linenr_T lastline, /* last line of range */
+ int *doesrange, /* return: function handled range */
+ int evaluate,
+ dict_T *selfdict) /* Dictionary for "self" */
{
int ret = FAIL;
#define ERROR_UNKNOWN 0
@@ -8933,9 +8756,7 @@ call_func(funcname, len, rettv, argcount, argvars, firstline, lastline,
* "ermsg" is to be passed without translation, use N_() instead of _().
*/
static void
-emsg_funcname(ermsg, name)
- char *ermsg;
- char_u *name;
+emsg_funcname(char *ermsg, char_u *name)
{
char_u *p;
@@ -8952,8 +8773,7 @@ emsg_funcname(ermsg, name)
* Return TRUE for a non-zero Number and a non-empty String.
*/
static int
-non_zero_arg(argvars)
- typval_T *argvars;
+non_zero_arg(typval_T *argvars)
{
return ((argvars[0].v_type == VAR_NUMBER
&& argvars[0].vval.v_number != 0)
@@ -8974,9 +8794,7 @@ static int get_float_arg(typval_T *argvars, float_T *f);
* Returns FAIL when the argument is not a Number or Float.
*/
static int
-get_float_arg(argvars, f)
- typval_T *argvars;
- float_T *f;
+get_float_arg(typval_T *argvars, float_T *f)
{
if (argvars[0].v_type == VAR_FLOAT)
{
@@ -8996,9 +8814,7 @@ get_float_arg(argvars, f)
* "abs(expr)" function
*/
static void
-f_abs(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_abs(typval_T *argvars, typval_T *rettv)
{
if (argvars[0].v_type == VAR_FLOAT)
{
@@ -9024,9 +8840,7 @@ f_abs(argvars, rettv)
* "acos()" function
*/
static void
-f_acos(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_acos(typval_T *argvars, typval_T *rettv)
{
float_T f;
@@ -9042,9 +8856,7 @@ f_acos(argvars, rettv)
* "add(list, item)" function
*/
static void
-f_add(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_add(typval_T *argvars, typval_T *rettv)
{
list_T *l;
@@ -9065,9 +8877,7 @@ f_add(argvars, rettv)
* "alloc_fail(id, countdown, repeat)" function
*/
static void
-f_alloc_fail(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv UNUSED;
+f_alloc_fail(typval_T *argvars, typval_T *rettv UNUSED)
{
if (argvars[0].v_type != VAR_NUMBER
|| argvars[0].vval.v_number <= 0
@@ -9090,9 +8900,7 @@ f_alloc_fail(argvars, rettv)
* "and(expr, expr)" function
*/
static void
-f_and(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_and(typval_T *argvars, typval_T *rettv)
{
rettv->vval.v_number = get_tv_number_chk(&argvars[0], NULL)
& get_tv_number_chk(&argvars[1], NULL);
@@ -9102,9 +8910,7 @@ f_and(argvars, rettv)
* "append(lnum, string/list)" function
*/
static void
-f_append(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_append(typval_T *argvars, typval_T *rettv)
{
long lnum;
char_u *line;
@@ -9166,9 +8972,7 @@ f_append(argvars, rettv)
* "argc()" function
*/
static void
-f_argc(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv;
+f_argc(typval_T *argvars UNUSED, typval_T *rettv)
{
rettv->vval.v_number = ARGCOUNT;
}
@@ -9177,9 +8981,7 @@ f_argc(argvars, rettv)
* "argidx()" function
*/
static void
-f_argidx(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv;
+f_argidx(typval_T *argvars UNUSED, typval_T *rettv)
{
rettv->vval.v_number = curwin->w_arg_idx;
}
@@ -9188,9 +8990,7 @@ f_argidx(argvars, rettv)
* "arglistid()" function
*/
static void
-f_arglistid(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv;
+f_arglistid(typval_T *argvars UNUSED, typval_T *rettv)
{
win_T *wp;
@@ -9204,9 +9004,7 @@ f_arglistid(argvars, rettv)
* "argv(nr)" function
*/
static void
-f_argv(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_argv(typval_T *argvars, typval_T *rettv)
{
int idx;
@@ -9234,8 +9032,7 @@ static void assert_bool(typval_T *argvars, int isTrue);
* Prepare "gap" for an assert error and add the sourcing position.
*/
static void
-prepare_assert_error(gap)
- garray_T *gap;
+prepare_assert_error(garray_T *gap)
{
char buf[NUMBUFLEN];
@@ -9259,12 +9056,12 @@ prepare_assert_error(gap)
* Fill "gap" with information about an assert error.
*/
static void
-fill_assert_error(gap, opt_msg_tv, exp_str, exp_tv, got_tv)
- garray_T *gap;
- typval_T *opt_msg_tv;
- char_u *exp_str;
- typval_T *exp_tv;
- typval_T *got_tv;
+fill_assert_error(
+ garray_T *gap,
+ typval_T *opt_msg_tv,
+ char_u *exp_str,
+ typval_T *exp_tv,
+ typval_T *got_tv)
{
char_u numbuf[NUMBUFLEN];
char_u *tofree;
@@ -9294,8 +9091,7 @@ fill_assert_error(gap, opt_msg_tv, exp_str, exp_tv, got_tv)
* Add an assert error to v:errors.
*/
static void
-assert_error(gap)
- garray_T *gap;
+assert_error(garray_T *gap)
{
struct vimvar *vp = &vimvars[VV_ERRORS];
@@ -9309,9 +9105,7 @@ assert_error(gap)
* "assert_equal(expected, actual[, msg])" function
*/
static void
-f_assert_equal(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv UNUSED;
+f_assert_equal(typval_T *argvars, typval_T *rettv UNUSED)
{
garray_T ga;
@@ -9328,9 +9122,7 @@ f_assert_equal(argvars, rettv)
* "assert_exception(string[, msg])" function
*/
static void
-f_assert_exception(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv UNUSED;
+f_assert_exception(typval_T *argvars, typval_T *rettv UNUSED)
{
garray_T ga;
char *error;
@@ -9358,9 +9150,7 @@ f_assert_exception(argvars, rettv)
* "assert_fails(cmd [, error])" function
*/
static void
-f_assert_fails(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv UNUSED;
+f_assert_fails(typval_T *argvars, typval_T *rettv UNUSED)
{
char_u *cmd = get_tv_string_chk(&argvars[0]);
garray_T ga;
@@ -9403,9 +9193,7 @@ f_assert_fails(argvars, rettv)
* Common for assert_true() and assert_false().
*/
static void
-assert_bool(argvars, isTrue)
- typval_T *argvars;
- int isTrue;
+assert_bool(typval_T *argvars, int isTrue)
{
int error = FALSE;
garray_T ga;
@@ -9427,9 +9215,7 @@ assert_bool(argvars, isTrue)
* "assert_false(actual[, msg])" function
*/
static void
-f_assert_false(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv UNUSED;
+f_assert_false(typval_T *argvars, typval_T *rettv UNUSED)
{
assert_bool(argvars, FALSE);
}
@@ -9438,9 +9224,7 @@ f_assert_false(argvars, rettv)
* "assert_true(actual[, msg])" function
*/
static void
-f_assert_true(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv UNUSED;
+f_assert_true(typval_T *argvars, typval_T *rettv UNUSED)
{
assert_bool(argvars, TRUE);
}
@@ -9450,9 +9234,7 @@ f_assert_true(argvars, rettv)
* "asin()" function
*/
static void
-f_asin(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_asin(typval_T *argvars, typval_T *rettv)
{
float_T f;
@@ -9467,9 +9249,7 @@ f_asin(argvars, rettv)
* "atan()" function
*/
static void
-f_atan(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_atan(typval_T *argvars, typval_T *rettv)
{
float_T f;
@@ -9484,9 +9264,7 @@ f_atan(argvars, rettv)
* "atan2()" function
*/
static void
-f_atan2(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_atan2(typval_T *argvars, typval_T *rettv)
{
float_T fx, fy;
@@ -9503,9 +9281,7 @@ f_atan2(argvars, rettv)
* "browse(save, title, initdir, default)" function
*/
static void
-f_browse(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv;
+f_browse(typval_T *argvars UNUSED, typval_T *rettv)
{
#ifdef FEAT_BROWSE
int save;
@@ -9537,9 +9313,7 @@ f_browse(argvars, rettv)
* "browsedir(title, initdir)" function
*/
static void
-f_browsedir(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv;
+f_browsedir(typval_T *argvars UNUSED, typval_T *rettv)
{
#ifdef FEAT_BROWSE
char_u *title;
@@ -9566,8 +9340,7 @@ static buf_T *find_buffer(typval_T *avar);
* Find a buffer by number or exact name.
*/
static buf_T *
-find_buffer(avar)
- typval_T *avar;
+find_buffer(typval_T *avar)
{
buf_T *buf = NULL;
@@ -9598,9 +9371,7 @@ find_buffer(avar)
* "bufexists(expr)" function
*/
static void
-f_bufexists(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_bufexists(typval_T *argvars, typval_T *rettv)
{
rettv->vval.v_number = (find_buffer(&argvars[0]) != NULL);
}
@@ -9609,9 +9380,7 @@ f_bufexists(argvars, rettv)
* "buflisted(expr)" function
*/
static void
-f_buflisted(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_buflisted(typval_T *argvars, typval_T *rettv)
{
buf_T *buf;
@@ -9623,9 +9392,7 @@ f_buflisted(argvars, rettv)
* "bufloaded(expr)" function
*/
static void
-f_bufloaded(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_bufloaded(typval_T *argvars, typval_T *rettv)
{
buf_T *buf;
@@ -9639,9 +9406,7 @@ static buf_T *get_buf_tv(typval_T *tv, int curtab_only);
* Get buffer by number or pattern.
*/
static buf_T *
-get_buf_tv(tv, curtab_only)
- typval_T *tv;
- int curtab_only;
+get_buf_tv(typval_T *tv, int curtab_only)
{
char_u *name = tv->vval.v_string;
int save_magic;
@@ -9680,9 +9445,7 @@ get_buf_tv(tv, curtab_only)
* "bufname(expr)" function
*/
static void
-f_bufname(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_bufname(typval_T *argvars, typval_T *rettv)
{
buf_T *buf;
@@ -9701,9 +9464,7 @@ f_bufname(argvars, rettv)
* "bufnr(expr)" function
*/
static void
-f_bufnr(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_bufnr(typval_T *argvars, typval_T *rettv)
{
buf_T *buf;
int error = FALSE;
@@ -9734,9 +9495,7 @@ f_bufnr(argvars, rettv)
* "bufwinnr(nr)" function
*/
static void
-f_bufwinnr(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_bufwinnr(typval_T *argvars, typval_T *rettv)
{
#ifdef FEAT_WINDOWS
win_T *wp;
@@ -9765,9 +9524,7 @@ f_bufwinnr(argvars, rettv)
* "byte2line(byte)" function
*/
static void
-f_byte2line(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv;
+f_byte2line(typval_T *argvars UNUSED, typval_T *rettv)
{
#ifndef FEAT_BYTEOFF
rettv->vval.v_number = -1;
@@ -9784,10 +9541,7 @@ f_byte2line(argvars, rettv)
}
static void
-byteidx(argvars, rettv, comp)
- typval_T *argvars;
- typval_T *rettv;
- int comp UNUSED;
+byteidx(typval_T *argvars, typval_T *rettv, int comp UNUSED)
{
#ifdef FEAT_MBYTE
char_u *t;
@@ -9823,9 +9577,7 @@ byteidx(argvars, rettv, comp)
* "byteidx()" function
*/
static void
-f_byteidx(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_byteidx(typval_T *argvars, typval_T *rettv)
{
byteidx(argvars, rettv, FALSE);
}
@@ -9834,19 +9586,17 @@ f_byteidx(argvars, rettv)
* "byteidxcomp()" function
*/
static void
-f_byteidxcomp(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_byteidxcomp(typval_T *argvars, typval_T *rettv)
{
byteidx(argvars, rettv, TRUE);
}
int
-func_call(name, args, selfdict, rettv)
- char_u *name;
- typval_T *args;
- dict_T *selfdict;
- typval_T *rettv;
+func_call(
+ char_u *name,
+ typval_T *args,
+ dict_T *selfdict,
+ typval_T *rettv)
{
listitem_T *item;
typval_T argv[MAX_FUNC_ARGS + 1];
@@ -9884,9 +9634,7 @@ func_call(name, args, selfdict, rettv)
* "call(func, arglist)" function
*/
static void
-f_call(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_call(typval_T *argvars, typval_T *rettv)
{
char_u *func;
dict_T *selfdict = NULL;
@@ -9924,9 +9672,7 @@ f_call(argvars, rettv)
* "ceil({float})" function
*/
static void
-f_ceil(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_ceil(typval_T *argvars, typval_T *rettv)
{
float_T f;
@@ -9942,9 +9688,7 @@ f_ceil(argvars, rettv)
* "changenr()" function
*/
static void
-f_changenr(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv;
+f_changenr(typval_T *argvars UNUSED, typval_T *rettv)
{
rettv->vval.v_number = curbuf->b_u_seq_cur;
}
@@ -9953,9 +9697,7 @@ f_changenr(argvars, rettv)
* "char2nr(string)" function
*/
static void
-f_char2nr(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_char2nr(typval_T *argvars, typval_T *rettv)
{
#ifdef FEAT_MBYTE
if (has_mbyte)
@@ -9979,9 +9721,7 @@ f_char2nr(argvars, rettv)
* "cindent(lnum)" function
*/
static void
-f_cindent(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv;
+f_cindent(typval_T *argvars UNUSED, typval_T *rettv)
{
#ifdef FEAT_CINDENT
pos_T pos;
@@ -10004,9 +9744,7 @@ f_cindent(argvars, rettv)
* "clearmatches()" function
*/
static void
-f_clearmatches(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv UNUSED;
+f_clearmatches(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
{
#ifdef FEAT_SEARCH_EXTRA
clear_matches(curwin);
@@ -10017,9 +9755,7 @@ f_clearmatches(argvars, rettv)
* "col(string)" function
*/
static void
-f_col(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_col(typval_T *argvars, typval_T *rettv)
{
colnr_T col = 0;
pos_T *fp;
@@ -10071,9 +9807,7 @@ f_col(argvars, rettv)
* "complete()" function
*/
static void
-f_complete(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv UNUSED;
+f_complete(typval_T *argvars, typval_T *rettv UNUSED)
{
int startcol;
@@ -10105,9 +9839,7 @@ f_complete(argvars, rettv)
* "complete_add()" function
*/
static void
-f_complete_add(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_complete_add(typval_T *argvars, typval_T *rettv)
{
rettv->vval.v_number = ins_compl_add_tv(&argvars[0], 0);
}
@@ -10116,9 +9848,7 @@ f_complete_add(argvars, rettv)
* "complete_check()" function
*/
static void
-f_complete_check(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv;
+f_complete_check(typval_T *argvars UNUSED, typval_T *rettv)
{
int saved = RedrawingDisabled;
@@ -10133,9 +9863,7 @@ f_complete_check(argvars, rettv)
* "confirm(message, buttons[, default [, type]])" function
*/
static void
-f_confirm(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv UNUSED;
+f_confirm(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
{
#if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
char_u *message;
@@ -10191,9 +9919,7 @@ f_confirm(argvars, rettv)
* "copy()" function
*/
static void
-f_copy(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_copy(typval_T *argvars, typval_T *rettv)
{
item_copy(&argvars[0], rettv, FALSE, 0);
}
@@ -10203,9 +9929,7 @@ f_copy(argvars, rettv)
* "cos()" function
*/
static void
-f_cos(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_cos(typval_T *argvars, typval_T *rettv)
{
float_T f;
@@ -10220,9 +9944,7 @@ f_cos(argvars, rettv)
* "cosh()" function
*/
static void
-f_cosh(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_cosh(typval_T *argvars, typval_T *rettv)
{
float_T f;
@@ -10238,9 +9960,7 @@ f_cosh(argvars, rettv)
* "count()" function
*/
static void
-f_count(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_count(typval_T *argvars, typval_T *rettv)
{
long n = 0;
int ic = FALSE;
@@ -10333,9 +10053,7 @@ get_callback(typval_T *arg)
* "connect()" function
*/
static void
-f_connect(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_connect(typval_T *argvars, typval_T *rettv)
{
char_u *address;
char_u *mode;
@@ -10395,9 +10113,7 @@ f_connect(argvars, rettv)
* Checks the existence of a cscope connection.
*/
static void
-f_cscope_connection(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv UNUSED;
+f_cscope_connection(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
{
#ifdef FEAT_CSCOPE
int num = 0;
@@ -10426,9 +10142,7 @@ f_cscope_connection(argvars, rettv)
* Returns 0 when the position could be set, -1 otherwise.
*/
static void
-f_cursor(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_cursor(typval_T *argvars, typval_T *rettv)
{
long line, col;
#ifdef FEAT_VIRTUALEDIT
@@ -10497,9 +10211,7 @@ f_cursor(argvars, rettv)
* "deepcopy()" function
*/
static void
-f_deepcopy(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_deepcopy(typval_T *argvars, typval_T *rettv)
{
int noref = 0;
@@ -10518,9 +10230,7 @@ f_deepcopy(argvars, rettv)
* "delete()" function
*/
static void
-f_delete(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_delete(typval_T *argvars, typval_T *rettv)
{
char_u nbuf[NUMBUFLEN];
char_u *name;
@@ -10559,9 +10269,7 @@ f_delete(argvars, rettv)
* "did_filetype()" function
*/
static void
-f_did_filetype(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv UNUSED;
+f_did_filetype(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
{
#ifdef FEAT_AUTOCMD
rettv->vval.v_number = did_filetype;
@@ -10572,9 +10280,7 @@ f_did_filetype(argvars, rettv)
* "diff_filler()" function
*/
static void
-f_diff_filler(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv UNUSED;
+f_diff_filler(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
{
#ifdef FEAT_DIFF
rettv->vval.v_number = diff_check_fill(curwin, get_tv_lnum(argvars));
@@ -10585,9 +10291,7 @@ f_diff_filler(argvars, rettv)
* "diff_hlID()" function
*/
static void
-f_diff_hlID(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv UNUSED;
+f_diff_hlID(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
{
#ifdef FEAT_DIFF
linenr_T lnum = get_tv_lnum(argvars);
@@ -10670,9 +10374,7 @@ get_channel_arg(typval_T *tv)
* "disconnect()" function
*/
static void
-f_disconnect(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv UNUSED;
+f_disconnect(typval_T *argvars, typval_T *rettv UNUSED)
{
int ch_idx = get_channel_arg(&argvars[0]);
@@ -10685,9 +10387,7 @@ f_disconnect(argvars, rettv)
* "empty({expr})" function
*/
static void
-f_empty(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_empty(typval_T *argvars, typval_T *rettv)
{
int n;
@@ -10730,9 +10430,7 @@ f_empty(argvars, rettv)
* "escape({string}, {chars})" function
*/
static void
-f_escape(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_escape(typval_T *argvars, typval_T *rettv)
{
char_u buf[NUMBUFLEN];
@@ -10745,9 +10443,7 @@ f_escape(argvars, rettv)
* "eval()" function
*/
static void
-f_eval(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_eval(typval_T *argvars, typval_T *rettv)
{
char_u *s, *p;
@@ -10772,9 +10468,7 @@ f_eval(argvars, rettv)
* "eventhandler()" function
*/
static void
-f_eventhandler(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv;
+f_eventhandler(typval_T *argvars UNUSED, typval_T *rettv)
{
rettv->vval.v_number = vgetc_busy;
}
@@ -10783,9 +10477,7 @@ f_eventhandler(argvars, rettv)
* "executable()" function
*/
static void
-f_executable(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_executable(typval_T *argvars, typval_T *rettv)
{
char_u *name = get_tv_string(&argvars[0]);
@@ -10798,9 +10490,7 @@ f_executable(argvars, rettv)
* "exepath()" function
*/
static void
-f_exepath(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_exepath(typval_T *argvars, typval_T *rettv)
{
char_u *p = NULL;
@@ -10813,9 +10503,7 @@ f_exepath(argvars, rettv)
* "exists()" function
*/
static void
-f_exists(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_exists(typval_T *argvars, typval_T *rettv)
{
char_u *p;
char_u *name;
@@ -10895,9 +10583,7 @@ f_exists(argvars, rettv)
* "exp()" function
*/
static void
-f_exp(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_exp(typval_T *argvars, typval_T *rettv)
{
float_T f;
@@ -10913,9 +10599,7 @@ f_exp(argvars, rettv)
* "expand()" function
*/
static void
-f_expand(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_expand(typval_T *argvars, typval_T *rettv)
{
char_u *s;
int len;
@@ -10989,10 +10673,7 @@ f_expand(argvars, rettv)
* Otherwise duplicate keys are ignored ("action" is "keep").
*/
void
-dict_extend(d1, d2, action)
- dict_T *d1;
- dict_T *d2;
- char_u *action;
+dict_extend(dict_T *d1, dict_T *d2, char_u *action)
{
dictitem_T *di1;
hashitem_T *hi2;
@@ -11047,9 +10728,7 @@ dict_extend(d1, d2, action)
* "extend(dict, dict [, action])" function
*/
static void
-f_extend(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_extend(typval_T *argvars, typval_T *rettv)
{
char_u *arg_errmsg = (char_u *)N_("extend() argument");
@@ -11134,9 +10813,7 @@ f_extend(argvars, rettv)
* "feedkeys()" function
*/
static void
-f_feedkeys(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv UNUSED;
+f_feedkeys(typval_T *argvars, typval_T *rettv UNUSED)
{
int remap = TRUE;
int insert = FALSE;
@@ -11191,9 +10868,7 @@ f_feedkeys(argvars, rettv)
* "filereadable()" function
*/
static void
-f_filereadable(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_filereadable(typval_T *argvars, typval_T *rettv)
{
int fd;
char_u *p;
@@ -11220,9 +10895,7 @@ f_filereadable(argvars, rettv)
* rights to write into.
*/
static void
-f_filewritable(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_filewritable(typval_T *argvars, typval_T *rettv)
{
rettv->vval.v_number = filewritable(get_tv_string(&argvars[0]));
}
@@ -11303,10 +10976,7 @@ static int filter_map_one(typval_T *tv, char_u *expr, int map, int *remp);
* Implementation of map() and filter().
*/
static void
-filter_map(argvars, rettv, map)
- typval_T *argvars;
- typval_T *rettv;
- int map;
+filter_map(typval_T *argvars, typval_T *rettv, int map)
{
char_u buf[NUMBUFLEN];
char_u *expr;
@@ -11423,11 +11093,7 @@ filter_map(argvars, rettv, map)
}
static int
-filter_map_one(tv, expr, map, remp)
- typval_T *tv;
- char_u *expr;
- int map;
- int *remp;
+filter_map_one(typval_T *tv, char_u *expr, int map, int *remp)
{
typval_T rettv;
char_u *s;
@@ -11472,9 +11138,7 @@ theend:
* "filter()" function
*/
static void
-f_filter(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_filter(typval_T *argvars, typval_T *rettv)
{
filter_map(argvars, rettv, FALSE);
}
@@ -11483,9 +11147,7 @@ f_filter(argvars, rettv)
* "finddir({fname}[, {path}[, {count}]])" function
*/
static void
-f_finddir(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_finddir(typval_T *argvars, typval_T *rettv)
{
findfilendir(argvars, rettv, FINDFILE_DIR);
}
@@ -11494,9 +11156,7 @@ f_finddir(argvars, rettv)
* "findfile({fname}[, {path}[, {count}]])" function
*/
static void
-f_findfile(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_findfile(typval_T *argvars, typval_T *rettv)
{
findfilendir(argvars, rettv, FINDFILE_FILE);
}
@@ -11506,9 +11166,7 @@ f_findfile(argvars, rettv)
* "float2nr({float})" function
*/
static void
-f_float2nr(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_float2nr(typval_T *argvars, typval_T *rettv)
{
float_T f;
@@ -11527,9 +11185,7 @@ f_float2nr(argvars, rettv)
* "floor({float})" function
*/
static void
-f_floor(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_floor(typval_T *argvars, typval_T *rettv)
{
float_T f;
@@ -11544,9 +11200,7 @@ f_floor(argvars, rettv)
* "fmod()" function
*/
static void
-f_fmod(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_fmod(typval_T *argvars, typval_T *rettv)
{
float_T fx, fy;
@@ -11563,9 +11217,7 @@ f_fmod(argvars, rettv)
* "fnameescape({string})" function
*/
static void
-f_fnameescape(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_fnameescape(typval_T *argvars, typval_T *rettv)
{
rettv->vval.v_string = vim_strsave_fnameescape(
get_tv_string(&argvars[0]), FALSE);
@@ -11576,9 +11228,7 @@ f_fnameescape(argvars, rettv)
* "fnamemodify({fname}, {mods})" function
*/
static void
-f_fnamemodify(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_fnamemodify(typval_T *argvars, typval_T *rettv)
{
char_u *fname;
char_u *mods;
@@ -11611,10 +11261,10 @@ static void foldclosed_both(typval_T *argvars, typval_T *rettv, int end);
* "foldclosed()" function
*/
static void
-foldclosed_both(argvars, rettv, end)
- typval_T *argvars UNUSED;
- typval_T *rettv;
- int end UNUSED;
+foldclosed_both(
+ typval_T *argvars UNUSED,
+ typval_T *rettv,
+ int end UNUSED)
{
#ifdef FEAT_FOLDING
linenr_T lnum;
@@ -11640,9 +11290,7 @@ foldclosed_both(argvars, rettv, end)
* "foldclosed()" function
*/
static void
-f_foldclosed(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_foldclosed(typval_T *argvars, typval_T *rettv)
{
foldclosed_both(argvars, rettv, FALSE);
}
@@ -11651,9 +11299,7 @@ f_foldclosed(argvars, rettv)
* "foldclosedend()" function
*/
static void
-f_foldclosedend(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_foldclosedend(typval_T *argvars, typval_T *rettv)
{
foldclosed_both(argvars, rettv, TRUE);
}
@@ -11662,9 +11308,7 @@ f_foldclosedend(argvars, rettv)
* "foldlevel()" function
*/
static void
-f_foldlevel(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv UNUSED;
+f_foldlevel(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
{
#ifdef FEAT_FOLDING
linenr_T lnum;
@@ -11679,9 +11323,7 @@ f_foldlevel(argvars, rettv)
* "foldtext()" function
*/
static void
-f_foldtext(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv;
+f_foldtext(typval_T *argvars UNUSED, typval_T *rettv)
{
#ifdef FEAT_FOLDING
linenr_T lnum;
@@ -11746,9 +11388,7 @@ f_foldtext(argvars, rettv)
* "foldtextresult(lnum)" function
*/
static void
-f_foldtextresult(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv;
+f_foldtextresult(typval_T *argvars UNUSED, typval_T *rettv)
{
#ifdef FEAT_FOLDING
linenr_T lnum;
@@ -11781,9 +11421,7 @@ f_foldtextresult(argvars, rettv)
* "foreground()" function
*/
static void
-f_foreground(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv UNUSED;
+f_foreground(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
{
#ifdef FEAT_GUI
if (gui.in_use)
@@ -11799,9 +11437,7 @@ f_foreground(argvars, rettv)
* "function()" function
*/
static void
-f_function(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_function(typval_T *argvars, typval_T *rettv)
{
char_u *s;
@@ -11841,9 +11477,7 @@ f_function(argvars, rettv)
* "garbagecollect()" function
*/
static void
-f_garbagecollect(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv UNUSED;
+f_garbagecollect(typval_T *argvars, typval_T *rettv UNUSED)
{
/* This is postponed until we are back at the toplevel, because we may be
* using Lists and Dicts internally. E.g.: ":echo [garbagecollect()]". */
@@ -11857,9 +11491,7 @@ f_garbagecollect(argvars, rettv)
* "get()" function
*/
static void
-f_get(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_get(typval_T *argvars, typval_T *rettv)
{
listitem_T *li;
list_T *l;
@@ -11908,12 +11540,12 @@ static void get_buffer_lines(buf_T *buf, linenr_T start, linenr_T end, int retli
* If 'retlist' is TRUE, then the lines are returned as a Vim List.
*/
static void
-get_buffer_lines(buf, start, end, retlist, rettv)
- buf_T *buf;
- linenr_T start;
- linenr_T end;
- int retlist;
- typval_T *rettv;
+get_buffer_lines(
+ buf_T *buf,
+ linenr_T start,
+ linenr_T end,
+ int retlist,
+ typval_T *rettv)
{
char_u *p;
@@ -11953,9 +11585,7 @@ get_buffer_lines(buf, start, end, retlist, rettv)
* "getbufline()" function
*/
static void
-f_getbufline(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_getbufline(typval_T *argvars, typval_T *rettv)
{
linenr_T lnum;
linenr_T end;
@@ -11979,9 +11609,7 @@ f_getbufline(argvars, rettv)
* "getbufvar()" function
*/
static void
-f_getbufvar(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_getbufvar(typval_T *argvars, typval_T *rettv)
{
buf_T *buf;
buf_T *save_curbuf;
@@ -12042,9 +11670,7 @@ f_getbufvar(argvars, rettv)
* "getchar()" function
*/
static void
-f_getchar(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_getchar(typval_T *argvars, typval_T *rettv)
{
varnumber_T n;
int error = FALSE;
@@ -12144,9 +11770,7 @@ f_getchar(argvars, rettv)
* "getcharmod()" function
*/
static void
-f_getcharmod(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv;
+f_getcharmod(typval_T *argvars UNUSED, typval_T *rettv)
{
rettv->vval.v_number = mod_mask;
}
@@ -12155,9 +11779,7 @@ f_getcharmod(argvars, rettv)
* "getcharsearch()" function
*/
static void
-f_getcharsearch(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv;
+f_getcharsearch(typval_T *argvars UNUSED, typval_T *rettv)
{
if (rettv_dict_alloc(rettv) != FAIL)
{
@@ -12173,9 +11795,7 @@ f_getcharsearch(argvars, rettv)
* "getcmdline()" function
*/
static void
-f_getcmdline(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv;
+f_getcmdline(typval_T *argvars UNUSED, typval_T *rettv)
{
rettv->v_type = VAR_STRING;
rettv->vval.v_string = get_cmdline_str();
@@ -12185,9 +11805,7 @@ f_getcmdline(argvars, rettv)
* "getcmdpos()" function
*/
static void
-f_getcmdpos(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv;
+f_getcmdpos(typval_T *argvars UNUSED, typval_T *rettv)
{
rettv->vval.v_number = get_cmdline_pos() + 1;
}
@@ -12196,9 +11814,7 @@ f_getcmdpos(argvars, rettv)
* "getcmdtype()" function
*/
static void
-f_getcmdtype(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv;
+f_getcmdtype(typval_T *argvars UNUSED, typval_T *rettv)
{
rettv->v_type = VAR_STRING;
rettv->vval.v_string = alloc(2);
@@ -12213,9 +11829,7 @@ f_getcmdtype(argvars, rettv)
* "getcmdwintype()" function
*/
static void
-f_getcmdwintype(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv;
+f_getcmdwintype(typval_T *argvars UNUSED, typval_T *rettv)
{
rettv->v_type = VAR_STRING;
rettv->vval.v_string = NULL;
@@ -12233,9 +11847,7 @@ f_getcmdwintype(argvars, rettv)
* "getcwd()" function
*/
static void
-f_getcwd(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_getcwd(typval_T *argvars, typval_T *rettv)
{
win_T *wp = NULL;
char_u *cwd;
@@ -12271,9 +11883,7 @@ f_getcwd(argvars, rettv)
* "getfontname()" function
*/
static void
-f_getfontname(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv;
+f_getfontname(typval_T *argvars UNUSED, typval_T *rettv)
{
rettv->v_type = VAR_STRING;
rettv->vval.v_string = NULL;
@@ -12310,9 +11920,7 @@ f_getfontname(argvars, rettv)
* "getfperm({fname})" function
*/
static void
-f_getfperm(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_getfperm(typval_T *argvars, typval_T *rettv)
{
char_u *fname;
struct stat st;
@@ -12342,9 +11950,7 @@ f_getfperm(argvars, rettv)
* "getfsize({fname})" function
*/
static void
-f_getfsize(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_getfsize(typval_T *argvars, typval_T *rettv)
{
char_u *fname;
struct stat st;
@@ -12374,9 +11980,7 @@ f_getfsize(argvars, rettv)
* "getftime({fname})" function
*/
static void
-f_getftime(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_getftime(typval_T *argvars, typval_T *rettv)
{
char_u *fname;
struct stat st;
@@ -12393,9 +11997,7 @@ f_getftime(argvars, rettv)
* "getftype({fname})" function
*/
static void
-f_getftype(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_getftype(typval_T *argvars, typval_T *rettv)
{
char_u *fname;
struct stat st;
@@ -12473,9 +12075,7 @@ f_getftype(argvars, rettv)
* "getline(lnum, [end])" function
*/
static void
-f_getline(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_getline(typval_T *argvars, typval_T *rettv)
{
linenr_T lnum;
linenr_T end;
@@ -12500,9 +12100,7 @@ f_getline(argvars, rettv)
* "getmatches()" function
*/
static void
-f_getmatches(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv UNUSED;
+f_getmatches(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
{
#ifdef FEAT_SEARCH_EXTRA
dict_T *dict;
@@ -12568,9 +12166,7 @@ f_getmatches(argvars, rettv)
* "getpid()" function
*/
static void
-f_getpid(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv;
+f_getpid(typval_T *argvars UNUSED, typval_T *rettv)
{
rettv->vval.v_number = mch_get_pid();
}
@@ -12581,9 +12177,7 @@ static void getpos_both(typval_T *argvars, typval_T *rettv, int getcurpos);
* "getcurpos()" function
*/
static void
-f_getcurpos(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_getcurpos(typval_T *argvars, typval_T *rettv)
{
getpos_both(argvars, rettv, TRUE);
}
@@ -12592,18 +12186,16 @@ f_getcurpos(argvars, rettv)
* "getpos(string)" function
*/
static void
-f_getpos(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_getpos(typval_T *argvars, typval_T *rettv)
{
getpos_both(argvars, rettv, FALSE);
}
static void
-getpos_both(argvars, rettv, getcurpos)
- typval_T *argvars;
- typval_T *rettv;
- int getcurpos;
+getpos_both(
+ typval_T *argvars,
+ typval_T *rettv,
+ int getcurpos)
{
pos_T *fp;
list_T *l;
@@ -12642,9 +12234,7 @@ getpos_both(argvars, rettv, getcurpos)
* "getqflist()" and "getloclist()" functions
*/
static void
-f_getqflist(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv UNUSED;
+f_getqflist(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
{
#ifdef FEAT_QUICKFIX
win_T *wp;
@@ -12670,9 +12260,7 @@ f_getqflist(argvars, rettv)
* "getreg()" function
*/
static void
-f_getreg(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_getreg(typval_T *argvars, typval_T *rettv)
{
char_u *strregname;
int regname;
@@ -12721,9 +12309,7 @@ f_getreg(argvars, rettv)
* "getregtype()" function
*/
static void
-f_getregtype(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_getregtype(typval_T *argvars, typval_T *rettv)
{
char_u *strregname;
int regname;
@@ -12767,9 +12353,7 @@ f_getregtype(argvars, rettv)
* "gettabvar()" function
*/
static void
-f_gettabvar(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_gettabvar(typval_T *argvars, typval_T *rettv)
{
win_T *oldcurwin;
tabpage_T *tp, *oldtabpage;
@@ -12812,9 +12396,7 @@ f_gettabvar(argvars, rettv)
* "gettabwinvar()" function
*/
static void
-f_gettabwinvar(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_gettabwinvar(typval_T *argvars, typval_T *rettv)
{
getwinvar(argvars, rettv, 1);
}
@@ -12823,9 +12405,7 @@ f_gettabwinvar(argvars, rettv)
* "getwinposx()" function
*/
static void
-f_getwinposx(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv;
+f_getwinposx(typval_T *argvars UNUSED, typval_T *rettv)
{
rettv->vval.v_number = -1;
#ifdef FEAT_GUI
@@ -12843,9 +12423,7 @@ f_getwinposx(argvars, rettv)
* "getwinposy()" function
*/
static void
-f_getwinposy(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv;
+f_getwinposy(typval_T *argvars UNUSED, typval_T *rettv)
{
rettv->vval.v_number = -1;
#ifdef FEAT_GUI
@@ -12863,9 +12441,9 @@ f_getwinposy(argvars, rettv)
* Find window specified by "vp" in tabpage "tp".
*/
static win_T *
-find_win_by_nr(vp, tp)
- typval_T *vp;
- tabpage_T *tp UNUSED; /* NULL for current tab page */
+find_win_by_nr(
+ typval_T *vp,
+ tabpage_T *tp UNUSED) /* NULL for current tab page */
{
#ifdef FEAT_WINDOWS
win_T *wp;
@@ -12896,9 +12474,9 @@ find_win_by_nr(vp, tp)
* Find window specified by "wvp" in tabpage "tvp".
*/
static win_T *
-find_tabwin(wvp, tvp)
- typval_T *wvp; /* VAR_UNKNOWN for current window */
- typval_T *tvp; /* VAR_UNKNOWN for current tab page */
+find_tabwin(
+ typval_T *wvp, /* VAR_UNKNOWN for current window */
+ typval_T *tvp) /* VAR_UNKNOWN for current tab page */
{
win_T *wp = NULL;
tabpage_T *tp = NULL;
@@ -12928,9 +12506,7 @@ find_tabwin(wvp, tvp)
* "getwinvar()" function
*/
static void
-f_getwinvar(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_getwinvar(typval_T *argvars, typval_T *rettv)
{
getwinvar(argvars, rettv, 0);
}
@@ -12939,10 +12515,10 @@ f_getwinvar(argvars, rettv)
* getwinvar() and gettabwinvar()
*/
static void
-getwinvar(argvars, rettv, off)
- typval_T *argvars;
- typval_T *rettv;
- int off; /* 1 for gettabwinvar() */
+getwinvar(
+ typval_T *argvars,
+ typval_T *rettv,
+ int off) /* 1 for gettabwinvar() */
{
win_T *win;
char_u *varname;
@@ -13016,9 +12592,7 @@ getwinvar(argvars, rettv, off)
* "glob()" function
*/
static void
-f_glob(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_glob(typval_T *argvars, typval_T *rettv)
{
int options = WILD_SILENT|WILD_USE_NL;
expand_T xpc;
@@ -13072,9 +12646,7 @@ f_glob(argvars, rettv)
* "globpath()" function
*/
static void
-f_globpath(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_globpath(typval_T *argvars, typval_T *rettv)
{
int flags = 0;
char_u buf1[NUMBUFLEN];
@@ -13122,9 +12694,7 @@ f_globpath(argvars, rettv)
* "glob2regpat()" function
*/
static void
-f_glob2regpat(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_glob2regpat(typval_T *argvars, typval_T *rettv)
{
char_u *pat = get_tv_string_chk(&argvars[0]);
@@ -13137,9 +12707,7 @@ f_glob2regpat(argvars, rettv)
* "has()" function
*/
static void
-f_has(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_has(typval_T *argvars, typval_T *rettv)
{
int i;
char_u *name;
@@ -13742,9 +13310,7 @@ f_has(argvars, rettv)
* "has_key()" function
*/
static void
-f_has_key(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_has_key(typval_T *argvars, typval_T *rettv)
{
if (argvars[0].v_type != VAR_DICT)
{
@@ -13762,9 +13328,7 @@ f_has_key(argvars, rettv)
* "haslocaldir()" function
*/
static void
-f_haslocaldir(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_haslocaldir(typval_T *argvars, typval_T *rettv)
{
win_T *wp = NULL;
@@ -13776,9 +13340,7 @@ f_haslocaldir(argvars, rettv)
* "hasmapto()" function
*/
static void
-f_hasmapto(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_hasmapto(typval_T *argvars, typval_T *rettv)
{
char_u *name;
char_u *mode;
@@ -13805,9 +13367,7 @@ f_hasmapto(argvars, rettv)
* "histadd()" function
*/
static void
-f_histadd(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv;
+f_histadd(typval_T *argvars UNUSED, typval_T *rettv)
{
#ifdef FEAT_CMDHIST
int histype;
@@ -13839,9 +13399,7 @@ f_histadd(argvars, rettv)
* "histdel()" function
*/
static void
-f_histdel(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv UNUSED;
+f_histdel(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
{
#ifdef FEAT_CMDHIST
int n;
@@ -13870,9 +13428,7 @@ f_histdel(argvars, rettv)
* "histget()" function
*/
static void
-f_histget(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv;
+f_histget(typval_T *argvars UNUSED, typval_T *rettv)
{
#ifdef FEAT_CMDHIST
int type;
@@ -13902,9 +13458,7 @@ f_histget(argvars, rettv)
* "histnr()" function
*/
static void
-f_histnr(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv;
+f_histnr(typval_T *argvars UNUSED, typval_T *rettv)
{
int i;
@@ -13924,9 +13478,7 @@ f_histnr(argvars, rettv)
* "highlightID(name)" function
*/
static void
-f_hlID(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_hlID(typval_T *argvars, typval_T *rettv)
{
rettv->vval.v_number = syn_name2id(get_tv_string(&argvars[0]));
}
@@ -13935,9 +13487,7 @@ f_hlID(argvars, rettv)
* "highlight_exists()" function
*/
static void
-f_hlexists(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_hlexists(typval_T *argvars, typval_T *rettv)
{
rettv->vval.v_number = highlight_exists(get_tv_string(&argvars[0]));
}
@@ -13946,9 +13496,7 @@ f_hlexists(argvars, rettv)
* "hostname()" function
*/
static void
-f_hostname(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv;
+f_hostname(typval_T *argvars UNUSED, typval_T *rettv)
{
char_u hostname[256];
@@ -13961,9 +13509,7 @@ f_hostname(argvars, rettv)
* iconv() function
*/
static void
-f_iconv(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv;
+f_iconv(typval_T *argvars UNUSED, typval_T *rettv)
{
#ifdef FEAT_MBYTE
char_u buf1[NUMBUFLEN];
@@ -13998,9 +13544,7 @@ f_iconv(argvars, rettv)
* "indent()" function
*/
static void
-f_indent(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_indent(typval_T *argvars, typval_T *rettv)
{
linenr_T lnum;
@@ -14015,9 +13559,7 @@ f_indent(argvars, rettv)
* "index()" function
*/
static void
-f_index(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_index(typval_T *argvars, typval_T *rettv)
{
list_T *l;
listitem_T *item;
@@ -14068,10 +13610,10 @@ static void get_user_input(typval_T *argvars, typval_T *rettv, int inputdialog);
* when the user cancels the prompt.
*/
static void
-get_user_input(argvars, rettv, inputdialog)
- typval_T *argvars;
- typval_T *rettv;
- int inputdialog;
+get_user_input(
+ typval_T *argvars,
+ typval_T *rettv,
+ int inputdialog)
{
char_u *prompt = get_tv_string_chk(&argvars[0]);
char_u *p = NULL;
@@ -14173,9 +13715,7 @@ get_user_input(argvars, rettv, inputdialog)
* Also handles inputsecret() when inputsecret is set.
*/
static void
-f_input(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_input(typval_T *argvars, typval_T *rettv)
{
get_user_input(argvars, rettv, FALSE);
}
@@ -14184,9 +13724,7 @@ f_input(argvars, rettv)
* "inputdialog()" function
*/
static void
-f_inputdialog(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_inputdialog(typval_T *argvars, typval_T *rettv)
{
#if defined(FEAT_GUI_TEXTDIALOG)
/* Use a GUI dialog if the GUI is running and 'c' is not in 'guioptions' */
@@ -14227,9 +13765,7 @@ f_inputdialog(argvars, rettv)
* "inputlist()" function
*/
static void
-f_inputlist(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_inputlist(typval_T *argvars, typval_T *rettv)
{
listitem_T *li;
int selected;
@@ -14273,9 +13809,7 @@ static garray_T ga_userinput = {0, 0, sizeof(tasave_T), 4, NULL};
* "inputrestore()" function
*/
static void
-f_inputrestore(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv;
+f_inputrestore(typval_T *argvars UNUSED, typval_T *rettv)
{
if (ga_userinput.ga_len > 0)
{
@@ -14295,9 +13829,7 @@ f_inputrestore(argvars, rettv)
* "inputsave()" function
*/
static void
-f_inputsave(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv;
+f_inputsave(typval_T *argvars UNUSED, typval_T *rettv)
{
/* Add an entry to the stack of typeahead storage. */
if (ga_grow(&ga_userinput, 1) == OK)
@@ -14315,9 +13847,7 @@ f_inputsave(argvars, rettv)
* "inputsecret()" function
*/
static void
-f_inputsecret(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_inputsecret(typval_T *argvars, typval_T *rettv)
{
++cmdline_star;
++inputsecret_flag;
@@ -14330,9 +13860,7 @@ f_inputsecret(argvars, rettv)
* "insert()" function
*/
static void
-f_insert(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_insert(typval_T *argvars, typval_T *rettv)
{
long before = 0;
listitem_T *item;
@@ -14372,9 +13900,7 @@ f_insert(argvars, rettv)
* "invert(expr)" function
*/
static void
-f_invert(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_invert(typval_T *argvars, typval_T *rettv)
{
rettv->vval.v_number = ~get_tv_number_chk(&argvars[0], NULL);
}
@@ -14383,9 +13909,7 @@ f_invert(argvars, rettv)
* "isdirectory()" function
*/
static void
-f_isdirectory(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_isdirectory(typval_T *argvars, typval_T *rettv)
{
rettv->vval.v_number = mch_isdir(get_tv_string(&argvars[0]));
}
@@ -14394,9 +13918,7 @@ f_isdirectory(argvars, rettv)
* "islocked()" function
*/
static void
-f_islocked(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_islocked(typval_T *argvars, typval_T *rettv)
{
lval_T lv;
char_u *end;
@@ -14455,10 +13977,7 @@ static void dict_list(typval_T *argvars, typval_T *rettv, int what);
* "what" == 2: list of items
*/
static void
-dict_list(argvars, rettv, what)
- typval_T *argvars;
- typval_T *rettv;
- int what;
+dict_list(typval_T *argvars, typval_T *rettv, int what)
{
list_T *l2;
dictitem_T *di;
@@ -14537,9 +14056,7 @@ dict_list(argvars, rettv, what)
* "items(dict)" function
*/
static void
-f_items(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_items(typval_T *argvars, typval_T *rettv)
{
dict_list(argvars, rettv, 2);
}
@@ -14548,9 +14065,7 @@ f_items(argvars, rettv)
* "join()" function
*/
static void
-f_join(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_join(typval_T *argvars, typval_T *rettv)
{
garray_T ga;
char_u *sep;
@@ -14584,9 +14099,7 @@ f_join(argvars, rettv)
* "jsondecode()" function
*/
static void
-f_jsondecode(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_jsondecode(typval_T *argvars, typval_T *rettv)
{
js_read_T reader;
@@ -14600,9 +14113,7 @@ f_jsondecode(argvars, rettv)
* "jsonencode()" function
*/
static void
-f_jsonencode(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_jsonencode(typval_T *argvars, typval_T *rettv)
{
rettv->v_type = VAR_STRING;
rettv->vval.v_string = json_encode(&argvars[0]);
@@ -14612,9 +14123,7 @@ f_jsonencode(argvars, rettv)
* "keys()" function
*/
static void
-f_keys(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_keys(typval_T *argvars, typval_T *rettv)
{
dict_list(argvars, rettv, 0);
}
@@ -14623,9 +14132,7 @@ f_keys(argvars, rettv)
* "last_buffer_nr()" function.
*/
static void
-f_last_buffer_nr(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv;
+f_last_buffer_nr(typval_T *argvars UNUSED, typval_T *rettv)
{
int n = 0;
buf_T *buf;
@@ -14641,9 +14148,7 @@ f_last_buffer_nr(argvars, rettv)
* "len()" function
*/
static void
-f_len(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_len(typval_T *argvars, typval_T *rettv)
{
switch (argvars[0].v_type)
{
@@ -14667,10 +14172,7 @@ f_len(argvars, rettv)
static void libcall_common(typval_T *argvars, typval_T *rettv, int type);
static void
-libcall_common(argvars, rettv, type)
- typval_T *argvars;
- typval_T *rettv;
- int type;
+libcall_common(typval_T *argvars, typval_T *rettv, int type)
{
#ifdef FEAT_LIBCALL
char_u *string_in;
@@ -14712,9 +14214,7 @@ libcall_common(argvars, rettv, type)
* "libcall()" function
*/
static void
-f_libcall(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_libcall(typval_T *argvars, typval_T *rettv)
{
libcall_common(argvars, rettv, VAR_STRING);
}
@@ -14723,9 +14223,7 @@ f_libcall(argvars, rettv)
* "libcallnr()" function
*/
static void
-f_libcallnr(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_libcallnr(typval_T *argvars, typval_T *rettv)
{
libcall_common(argvars, rettv, VAR_NUMBER);
}
@@ -14734,9 +14232,7 @@ f_libcallnr(argvars, rettv)
* "line(string)" function
*/
static void
-f_line(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_line(typval_T *argvars, typval_T *rettv)
{
linenr_T lnum = 0;
pos_T *fp;
@@ -14752,9 +14248,7 @@ f_line(argvars, rettv)
* "line2byte(lnum)" function
*/
static void
-f_line2byte(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv;
+f_line2byte(typval_T *argvars UNUSED, typval_T *rettv)
{
#ifndef FEAT_BYTEOFF
rettv->vval.v_number = -1;
@@ -14775,9 +14269,7 @@ f_line2byte(argvars, rettv)
* "lispindent(lnum)" function
*/
static void
-f_lispindent(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv;
+f_lispindent(typval_T *argvars UNUSED, typval_T *rettv)
{
#ifdef FEAT_LISP
pos_T pos;
@@ -14800,9 +14292,7 @@ f_lispindent(argvars, rettv)
* "localtime()" function
*/
static void
-f_localtime(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv;
+f_localtime(typval_T *argvars UNUSED, typval_T *rettv)
{
rettv->vval.v_number = (varnumber_T)time(NULL);
}
@@ -14810,10 +14300,7 @@ f_localtime(argvars, rettv)
static void get_maparg(typval_T *argvars, typval_T *rettv, int exact);
static void
-get_maparg(argvars, rettv, exact)
- typval_T *argvars;
- typval_T *rettv;
- int exact;
+get_maparg(typval_T *argvars, typval_T *rettv, int exact)
{
char_u *keys;
char_u *which;
@@ -14889,9 +14376,7 @@ get_maparg(argvars, rettv, exact)
* "log()" function
*/
static void
-f_log(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_log(typval_T *argvars, typval_T *rettv)
{
float_T f;
@@ -14906,9 +14391,7 @@ f_log(argvars, rettv)
* "log10()" function
*/
static void
-f_log10(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_log10(typval_T *argvars, typval_T *rettv)
{
float_T f;
@@ -14925,9 +14408,7 @@ f_log10(argvars, rettv)
* "luaeval()" function
*/
static void
-f_luaeval(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_luaeval(typval_T *argvars, typval_T *rettv)
{
char_u *str;
char_u buf[NUMBUFLEN];
@@ -14941,9 +14422,7 @@ f_luaeval(argvars, rettv)
* "map()" function
*/
static void
-f_map(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_map(typval_T *argvars, typval_T *rettv)
{
filter_map(argvars, rettv, TRUE);
}
@@ -14952,9 +14431,7 @@ f_map(argvars, rettv)
* "maparg()" function
*/
static void
-f_maparg(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_maparg(typval_T *argvars, typval_T *rettv)
{
get_maparg(argvars, rettv, TRUE);
}
@@ -14963,9 +14440,7 @@ f_maparg(argvars, rettv)
* "mapcheck()" function
*/
static void
-f_mapcheck(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_mapcheck(typval_T *argvars, typval_T *rettv)
{
get_maparg(argvars, rettv, FALSE);
}
@@ -14973,10 +14448,7 @@ f_mapcheck(argvars, rettv)
static void find_some_match(typval_T *argvars, typval_T *rettv, int start);
static void
-find_some_match(argvars, rettv, type)
- typval_T *argvars;
- typval_T *rettv;
- int type;
+find_some_match(typval_T *argvars, typval_T *rettv, int type)
{
char_u *str = NULL;
long len = 0;
@@ -15172,9 +14644,7 @@ theend:
* "match()" function
*/
static void
-f_match(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_match(typval_T *argvars, typval_T *rettv)
{
find_some_match(argvars, rettv, 1);
}
@@ -15183,9 +14653,7 @@ f_match(argvars, rettv)
* "matchadd()" function
*/
static void
-f_matchadd(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv UNUSED;
+f_matchadd(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
{
#ifdef FEAT_SEARCH_EXTRA
char_u buf[NUMBUFLEN];
@@ -15237,9 +14705,7 @@ f_matchadd(argvars, rettv)
* "matchaddpos()" function
*/
static void
-f_matchaddpos(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv UNUSED;
+f_matchaddpos(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
{
#ifdef FEAT_SEARCH_EXTRA
char_u buf[NUMBUFLEN];
@@ -15304,9 +14770,7 @@ f_matchaddpos(argvars, rettv)
* "matcharg()" function
*/
static void
-f_matcharg(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv;
+f_matcharg(typval_T *argvars UNUSED, typval_T *rettv)
{
if (rettv_list_alloc(rettv) == OK)
{
@@ -15336,9 +14800,7 @@ f_matcharg(argvars, rettv)
* "matchdelete()" function
*/
static void
-f_matchdelete(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv UNUSED;
+f_matchdelete(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
{
#ifdef FEAT_SEARCH_EXTRA
rettv->vval.v_number = match_delete(curwin,
@@ -15350,9 +14812,7 @@ f_matchdelete(argvars, rettv)
* "matchend()" function
*/
static void
-f_matchend(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_matchend(typval_T *argvars, typval_T *rettv)
{
find_some_match(argvars, rettv, 0);
}
@@ -15361,9 +14821,7 @@ f_matchend(argvars, rettv)
* "matchlist()" function
*/
static void
-f_matchlist(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_matchlist(typval_T *argvars, typval_T *rettv)
{
find_some_match(argvars, rettv, 3);
}
@@ -15372,9 +14830,7 @@ f_matchlist(argvars, rettv)
* "matchstr()" function
*/
static void
-f_matchstr(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_matchstr(typval_T *argvars, typval_T *rettv)
{
find_some_match(argvars, rettv, 2);
}
@@ -15382,10 +14838,7 @@ f_matchstr(argvars, rettv)
static void max_min(typval_T *argvars, typval_T *rettv, int domax);
static void
-max_min(argvars, rettv, domax)
- typval_T *argvars;
- typval_T *rettv;
- int domax;
+max_min(typval_T *argvars, typval_T *rettv, int domax)
{
long n = 0;
long i;
@@ -15452,9 +14905,7 @@ max_min(argvars, rettv, domax)
* "max()" function
*/
static void
-f_max(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_max(typval_T *argvars, typval_T *rettv)
{
max_min(argvars, rettv, TRUE);
}
@@ -15463,9 +14914,7 @@ f_max(argvars, rettv)
* "min()" function
*/
static void
-f_min(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_min(typval_T *argvars, typval_T *rettv)
{
max_min(argvars, rettv, FALSE);
}
@@ -15477,9 +14926,7 @@ static int mkdir_recurse(char_u *dir, int prot);
* needed.
*/
static int
-mkdir_recurse(dir, prot)
- char_u *dir;
- int prot;
+mkdir_recurse(char_u *dir, int prot)
{
char_u *p;
char_u *updir;
@@ -15508,9 +14955,7 @@ mkdir_recurse(dir, prot)
* "mkdir()" function
*/
static void
-f_mkdir(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_mkdir(typval_T *argvars, typval_T *rettv)
{
char_u *dir;
char_u buf[NUMBUFLEN];
@@ -15545,9 +14990,7 @@ f_mkdir(argvars, rettv)
* "mode()" function
*/
static void
-f_mode(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_mode(typval_T *argvars, typval_T *rettv)
{
char_u buf[3];
@@ -15619,9 +15062,7 @@ f_mode(argvars, rettv)
* "mzeval()" function
*/
static void
-f_mzeval(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_mzeval(typval_T *argvars, typval_T *rettv)
{
char_u *str;
char_u buf[NUMBUFLEN];
@@ -15631,10 +15072,7 @@ f_mzeval(argvars, rettv)
}
void
-mzscheme_call_vim(name, args, rettv)
- char_u *name;
- typval_T *args;
- typval_T *rettv;
+mzscheme_call_vim(char_u *name, typval_T *args, typval_T *rettv)
{
typval_T argvars[3];
@@ -15651,9 +15089,7 @@ mzscheme_call_vim(name, args, rettv)
* "nextnonblank()" function
*/
static void
-f_nextnonblank(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_nextnonblank(typval_T *argvars, typval_T *rettv)
{
linenr_T lnum;
@@ -15674,9 +15110,7 @@ f_nextnonblank(argvars, rettv)
* "nr2char()" function
*/
static void
-f_nr2char(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_nr2char(typval_T *argvars, typval_T *rettv)
{
char_u buf[NUMBUFLEN];
@@ -15706,9 +15140,7 @@ f_nr2char(argvars, rettv)
* "or(expr, expr)" function
*/
static void
-f_or(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_or(typval_T *argvars, typval_T *rettv)
{
rettv->vval.v_number = get_tv_number_chk(&argvars[0], NULL)
| get_tv_number_chk(&argvars[1], NULL);
@@ -15718,9 +15150,7 @@ f_or(argvars, rettv)
* "pathshorten()" function
*/
static void
-f_pathshorten(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_pathshorten(typval_T *argvars, typval_T *rettv)
{
char_u *p;
@@ -15742,9 +15172,7 @@ f_pathshorten(argvars, rettv)
* "perleval()" function
*/
static void
-f_perleval(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_perleval(typval_T *argvars, typval_T *rettv)
{
char_u *str;
char_u buf[NUMBUFLEN];
@@ -15759,9 +15187,7 @@ f_perleval(argvars, rettv)
* "pow()" function
*/
static void
-f_pow(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_pow(typval_T *argvars, typval_T *rettv)
{
float_T fx, fy;
@@ -15778,9 +15204,7 @@ f_pow(argvars, rettv)
* "prevnonblank()" function
*/
static void
-f_prevnonblank(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_prevnonblank(typval_T *argvars, typval_T *rettv)
{
linenr_T lnum;
@@ -15805,9 +15229,7 @@ static va_list ap;
* "printf()" function
*/
static void
-f_printf(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_printf(typval_T *argvars, typval_T *rettv)
{
rettv->v_type = VAR_STRING;
rettv->vval.v_string = NULL;
@@ -15841,9 +15263,7 @@ f_printf(argvars, rettv)
* "pumvisible()" function
*/
static void
-f_pumvisible(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv UNUSED;
+f_pumvisible(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
{
#ifdef FEAT_INS_EXPAND
if (pum_visible())
@@ -15856,9 +15276,7 @@ f_pumvisible(argvars, rettv)
* "py3eval()" function
*/
static void
-f_py3eval(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_py3eval(typval_T *argvars, typval_T *rettv)
{
char_u *str;
char_u buf[NUMBUFLEN];
@@ -15873,9 +15291,7 @@ f_py3eval(argvars, rettv)
* "pyeval()" function
*/
static void
-f_pyeval(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_pyeval(typval_T *argvars, typval_T *rettv)
{
char_u *str;
char_u buf[NUMBUFLEN];
@@ -15889,9 +15305,7 @@ f_pyeval(argvars, rettv)
* "range()" function
*/
static void
-f_range(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_range(typval_T *argvars, typval_T *rettv)
{
long start;
long end;
@@ -15932,9 +15346,7 @@ f_range(argvars, rettv)
* "readfile()" function
*/
static void
-f_readfile(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_readfile(typval_T *argvars, typval_T *rettv)
{
int binary = FALSE;
int failed = FALSE;
@@ -16150,9 +15562,7 @@ static int list2proftime(typval_T *arg, proftime_T *tm);
* Return FAIL when there is something wrong.
*/
static int
-list2proftime(arg, tm)
- typval_T *arg;
- proftime_T *tm;
+list2proftime(typval_T *arg, proftime_T *tm)
{
long n1, n2;
int error = FALSE;
@@ -16177,9 +15587,7 @@ list2proftime(arg, tm)
* "reltime()" function
*/
static void
-f_reltime(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv UNUSED;
+f_reltime(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
{
#ifdef FEAT_RELTIME
proftime_T res;
@@ -16226,9 +15634,7 @@ f_reltime(argvars, rettv)
* "reltimestr()" function
*/
static void
-f_reltimestr(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv;
+f_reltimestr(typval_T *argvars UNUSED, typval_T *rettv)
{
#ifdef FEAT_RELTIME
proftime_T tm;
@@ -16247,7 +15653,7 @@ static void make_connection(void);
static int check_connection(void);
static void
-make_connection()
+make_connection(void)
{
if (X_DISPLAY == NULL
# ifdef FEAT_GUI
@@ -16262,7 +15668,7 @@ make_connection()
}
static int
-check_connection()
+check_connection(void)
{
make_connection();
if (X_DISPLAY == NULL)
@@ -16278,10 +15684,7 @@ check_connection()
static void remote_common(typval_T *argvars, typval_T *rettv, int expr);
static void
-remote_common(argvars, rettv, expr)
- typval_T *argvars;
- typval_T *rettv;
- int expr;
+remote_common(typval_T *argvars, typval_T *rettv, int expr)
{
char_u *server_name;
char_u *keys;
@@ -16342,9 +15745,7 @@ remote_common(argvars, rettv, expr)
* "remote_expr()" function
*/
static void
-f_remote_expr(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv;
+f_remote_expr(typval_T *argvars UNUSED, typval_T *rettv)
{
rettv->v_type = VAR_STRING;
rettv->vval.v_string = NULL;
@@ -16357,9 +15758,7 @@ f_remote_expr(argvars, rettv)
* "remote_foreground()" function
*/
static void
-f_remote_foreground(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv UNUSED;
+f_remote_foreground(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
{
#ifdef FEAT_CLIENTSERVER
# ifdef WIN32
@@ -16382,9 +15781,7 @@ f_remote_foreground(argvars, rettv)
}
static void
-f_remote_peek(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv;
+f_remote_peek(typval_T *argvars UNUSED, typval_T *rettv)
{
#ifdef FEAT_CLIENTSERVER
dictitem_T v;
@@ -16439,9 +15836,7 @@ f_remote_peek(argvars, rettv)
}
static void
-f_remote_read(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv;
+f_remote_read(typval_T *argvars UNUSED, typval_T *rettv)
{
char_u *r = NULL;
@@ -16473,9 +15868,7 @@ f_remote_read(argvars, rettv)
* "remote_send()" function
*/
static void
-f_remote_send(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv;
+f_remote_send(typval_T *argvars UNUSED, typval_T *rettv)
{
rettv->v_type = VAR_STRING;
rettv->vval.v_string = NULL;
@@ -16488,9 +15881,7 @@ f_remote_send(argvars, rettv)
* "remove()" function
*/
static void
-f_remove(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_remove(typval_T *argvars, typval_T *rettv)
{
list_T *l;
listitem_T *item, *item2;
@@ -16589,9 +15980,7 @@ f_remove(argvars, rettv)
* "rename({from}, {to})" function
*/
static void
-f_rename(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_rename(typval_T *argvars, typval_T *rettv)
{
char_u buf[NUMBUFLEN];
@@ -16606,9 +15995,7 @@ f_rename(argvars, rettv)
* "repeat()" function
*/
static void
-f_repeat(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_repeat(typval_T *argvars, typval_T *rettv)
{
char_u *p;
int n;
@@ -16653,9 +16040,7 @@ f_repeat(argvars, rettv)
* "resolve()" function
*/
static void
-f_resolve(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_resolve(typval_T *argvars, typval_T *rettv)
{
char_u *p;
#ifdef HAVE_READLINK
@@ -16862,9 +16247,7 @@ fail:
* "reverse({list})" function
*/
static void
-f_reverse(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_reverse(typval_T *argvars, typval_T *rettv)
{
list_T *l;
listitem_T *li, *ni;
@@ -16908,9 +16291,7 @@ static int get_search_arg(typval_T *varp, int *flagsp);
* Returns BACKWARD, FORWARD or zero (for an error).
*/
static int
-get_search_arg(varp, flagsp)
- typval_T *varp;
- int *flagsp;
+get_search_arg(typval_T *varp, int *flagsp)
{
int dir = FORWARD;
char_u *flags;
@@ -16962,10 +16343,7 @@ get_search_arg(varp, flagsp)
* Shared by search() and searchpos() functions.
*/
static int
-search_cmn(argvars, match_pos, flagsp)
- typval_T *argvars;
- pos_T *match_pos;
- int *flagsp;
+search_cmn(typval_T *argvars, pos_T *match_pos, int *flagsp)
{
int flags;
char_u *pat;
@@ -17068,8 +16446,7 @@ theend:
* round() is not in C90, use ceil() or floor() instead.
*/
float_T
-vim_round(f)
- float_T f;
+vim_round(float_T f)
{
return f > 0 ? floor(f + 0.5) : ceil(f - 0.5);
}
@@ -17078,9 +16455,7 @@ vim_round(f)
* "round({float})" function
*/
static void
-f_round(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_round(typval_T *argvars, typval_T *rettv)
{
float_T f;
@@ -17096,9 +16471,7 @@ f_round(argvars, rettv)
* "screenattr()" function
*/
static void
-f_screenattr(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv;
+f_screenattr(typval_T *argvars UNUSED, typval_T *rettv)
{
int row;
int col;
@@ -17118,9 +16491,7 @@ f_screenattr(argvars, rettv)
* "screenchar()" function
*/
static void
-f_screenchar(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv;
+f_screenchar(typval_T *argvars UNUSED, typval_T *rettv)
{
int row;
int col;
@@ -17151,9 +16522,7 @@ f_screenchar(argvars, rettv)
* First column is 1 to be consistent with virtcol().
*/
static void
-f_screencol(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv;
+f_screencol(typval_T *argvars UNUSED, typval_T *rettv)
{
rettv->vval.v_number = screen_screencol() + 1;
}
@@ -17162,9 +16531,7 @@ f_screencol(argvars, rettv)
* "screenrow()" function
*/
static void
-f_screenrow(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv;
+f_screenrow(typval_T *argvars UNUSED, typval_T *rettv)
{
rettv->vval.v_number = screen_screenrow() + 1;
}
@@ -17173,9 +16540,7 @@ f_screenrow(argvars, rettv)
* "search()" function
*/
static void
-f_search(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_search(typval_T *argvars, typval_T *rettv)
{
int flags = 0;
@@ -17186,9 +16551,7 @@ f_search(argvars, rettv)
* "searchdecl()" function
*/
static void
-f_searchdecl(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_searchdecl(typval_T *argvars, typval_T *rettv)
{
int locally = 1;
int thisblock = 0;
@@ -17213,9 +16576,7 @@ f_searchdecl(argvars, rettv)
* Used by searchpair() and searchpairpos()
*/
static int
-searchpair_cmn(argvars, match_pos)
- typval_T *argvars;
- pos_T *match_pos;
+searchpair_cmn(typval_T *argvars, pos_T *match_pos)
{
char_u *spat, *mpat, *epat;
char_u *skip;
@@ -17293,9 +16654,7 @@ theend:
* "searchpair()" function
*/
static void
-f_searchpair(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_searchpair(typval_T *argvars, typval_T *rettv)
{
rettv->vval.v_number = searchpair_cmn(argvars, NULL);
}
@@ -17304,9 +16663,7 @@ f_searchpair(argvars, rettv)
* "searchpairpos()" function
*/
static void
-f_searchpairpos(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_searchpairpos(typval_T *argvars, typval_T *rettv)
{
pos_T match_pos;
int lnum = 0;
@@ -17331,17 +16688,16 @@ f_searchpairpos(argvars, rettv)
* Returns 0 or -1 for no match,
*/
long
-do_searchpair(spat, mpat, epat, dir, skip, flags, match_pos,
- lnum_stop, time_limit)
- char_u *spat; /* start pattern */
- char_u *mpat; /* middle pattern */
- char_u *epat; /* end pattern */
- int dir; /* BACKWARD or FORWARD */
- char_u *skip; /* skip expression */
- int flags; /* SP_SETPCMARK and other SP_ values */
- pos_T *match_pos;
- linenr_T lnum_stop; /* stop at this line if not zero */
- long time_limit UNUSED; /* stop after this many msec */
+do_searchpair(
+ char_u *spat, /* start pattern */
+ char_u *mpat, /* middle pattern */
+ char_u *epat, /* end pattern */
+ int dir, /* BACKWARD or FORWARD */
+ char_u *skip, /* skip expression */
+ int flags, /* SP_SETPCMARK and other SP_ values */
+ pos_T *match_pos,
+ linenr_T lnum_stop, /* stop at this line if not zero */
+ long time_limit UNUSED) /* stop after this many msec */
{
char_u *save_cpo;
char_u *pat, *pat2 = NULL, *pat3 = NULL;
@@ -17488,9 +16844,7 @@ theend:
* "searchpos()" function
*/
static void
-f_searchpos(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_searchpos(typval_T *argvars, typval_T *rettv)
{
pos_T match_pos;
int lnum = 0;
@@ -17552,9 +16906,7 @@ send_common(typval_T *argvars, char_u *text, char *fun)
* "sendexpr()" function
*/
static void
-f_sendexpr(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_sendexpr(typval_T *argvars, typval_T *rettv)
{
char_u *text;
char_u *resp;
@@ -17598,9 +16950,7 @@ f_sendexpr(argvars, rettv)
* "sendraw()" function
*/
static void
-f_sendraw(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_sendraw(typval_T *argvars, typval_T *rettv)
{
char_u buf[NUMBUFLEN];
char_u *text;
@@ -17619,9 +16969,7 @@ f_sendraw(argvars, rettv)
static void
-f_server2client(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv;
+f_server2client(typval_T *argvars UNUSED, typval_T *rettv)
{
#ifdef FEAT_CLIENTSERVER
char_u buf[NUMBUFLEN];
@@ -17650,9 +16998,7 @@ f_server2client(argvars, rettv)
}
static void
-f_serverlist(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv;
+f_serverlist(typval_T *argvars UNUSED, typval_T *rettv)
{
char_u *r = NULL;
@@ -17673,9 +17019,7 @@ f_serverlist(argvars, rettv)
* "setbufvar()" function
*/
static void
-f_setbufvar(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv UNUSED;
+f_setbufvar(typval_T *argvars, typval_T *rettv UNUSED)
{
buf_T *buf;
aco_save_T aco;
@@ -17725,9 +17069,7 @@ f_setbufvar(argvars, rettv)
}
static void
-f_setcharsearch(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv UNUSED;
+f_setcharsearch(typval_T *argvars, typval_T *rettv UNUSED)
{
dict_T *d;
dictitem_T *di;
@@ -17773,9 +17115,7 @@ f_setcharsearch(argvars, rettv)
* "setcmdpos()" function
*/
static void
-f_setcmdpos(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_setcmdpos(typval_T *argvars, typval_T *rettv)
{
int pos = (int)get_tv_number(&argvars[0]) - 1;
@@ -17787,9 +17127,7 @@ f_setcmdpos(argvars, rettv)
* "setline()" function
*/
static void
-f_setline(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_setline(typval_T *argvars, typval_T *rettv)
{
linenr_T lnum;
char_u *line = NULL;
@@ -17865,11 +17203,11 @@ static void set_qf_ll_list(win_T *wp, typval_T *list_arg, typval_T *action_arg,
* Used by "setqflist()" and "setloclist()" functions
*/
static void
-set_qf_ll_list(wp, list_arg, action_arg, rettv)
- win_T *wp UNUSED;
- typval_T *list_arg UNUSED;
- typval_T *action_arg UNUSED;
- typval_T *rettv;
+set_qf_ll_list(
+ win_T *wp UNUSED,
+ typval_T *list_arg UNUSED,
+ typval_T *action_arg UNUSED,
+ typval_T *rettv)
{
#ifdef FEAT_QUICKFIX
char_u *act;
@@ -17905,9 +17243,7 @@ set_qf_ll_list(wp, list_arg, action_arg, rettv)
* "setloclist()" function
*/
static void
-f_setloclist(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_setloclist(typval_T *argvars, typval_T *rettv)
{
win_T *win;
@@ -17922,9 +17258,7 @@ f_setloclist(argvars, rettv)
* "setmatches()" function
*/
static void
-f_setmatches(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv UNUSED;
+f_setmatches(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
{
#ifdef FEAT_SEARCH_EXTRA
list_T *l;
@@ -18033,9 +17367,7 @@ f_setmatches(argvars, rettv)
* "setpos()" function
*/
static void
-f_setpos(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_setpos(typval_T *argvars, typval_T *rettv)
{
pos_T pos;
int fnum;
@@ -18083,9 +17415,7 @@ f_setpos(argvars, rettv)
* "setqflist()" function
*/
static void
-f_setqflist(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_setqflist(typval_T *argvars, typval_T *rettv)
{
set_qf_ll_list(NULL, &argvars[0], &argvars[1], rettv);
}
@@ -18094,9 +17424,7 @@ f_setqflist(argvars, rettv)
* "setreg()" function
*/
static void
-f_setreg(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_setreg(typval_T *argvars, typval_T *rettv)
{
int regname;
char_u *strregname;
@@ -18208,9 +17536,7 @@ free_lstval:
* "settabvar()" function
*/
static void
-f_settabvar(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_settabvar(typval_T *argvars, typval_T *rettv)
{
#ifdef FEAT_WINDOWS
tabpage_T *save_curtab;
@@ -18262,9 +17588,7 @@ f_settabvar(argvars, rettv)
* "settabwinvar()" function
*/
static void
-f_settabwinvar(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_settabwinvar(typval_T *argvars, typval_T *rettv)
{
setwinvar(argvars, rettv, 1);
}
@@ -18273,9 +17597,7 @@ f_settabwinvar(argvars, rettv)
* "setwinvar()" function
*/
static void
-f_setwinvar(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_setwinvar(typval_T *argvars, typval_T *rettv)
{
setwinvar(argvars, rettv, 0);
}
@@ -18285,10 +17607,7 @@ f_setwinvar(argvars, rettv)
*/
static void
-setwinvar(argvars, rettv, off)
- typval_T *argvars;
- typval_T *rettv UNUSED;
- int off;
+setwinvar(typval_T *argvars, typval_T *rettv UNUSED, int off)
{
win_T *win;
#ifdef FEAT_WINDOWS
@@ -18358,9 +17677,7 @@ setwinvar(argvars, rettv, off)
* "sha256({string})" function
*/
static void
-f_sha256(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_sha256(typval_T *argvars, typval_T *rettv)
{
char_u *p;
@@ -18375,9 +17692,7 @@ f_sha256(argvars, rettv)
* "shellescape({string})" function
*/
static void
-f_shellescape(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_shellescape(typval_T *argvars, typval_T *rettv)
{
rettv->vval.v_string = vim_strsave_shellescape(
get_tv_string(&argvars[0]), non_zero_arg(&argvars[1]), TRUE);
@@ -18388,9 +17703,7 @@ f_shellescape(argvars, rettv)
* shiftwidth() function
*/
static void
-f_shiftwidth(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv;
+f_shiftwidth(typval_T *argvars UNUSED, typval_T *rettv)
{
rettv->vval.v_number = get_sw_value(curbuf);
}
@@ -18399,9 +17712,7 @@ f_shiftwidth(argvars, rettv)
* "simplify()" function
*/
static void
-f_simplify(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_simplify(typval_T *argvars, typval_T *rettv)
{
char_u *p;
@@ -18416,9 +17727,7 @@ f_simplify(argvars, rettv)
* "sin()" function
*/
static void
-f_sin(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_sin(typval_T *argvars, typval_T *rettv)
{
float_T f;
@@ -18433,9 +17742,7 @@ f_sin(argvars, rettv)
* "sinh()" function
*/
static void
-f_sinh(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_sinh(typval_T *argvars, typval_T *rettv)
{
float_T f;
@@ -18485,9 +17792,7 @@ static void do_sort_uniq(typval_T *argvars, typval_T *rettv, int sort);
#ifdef __BORLANDC__
_RTLENTRYF
#endif
-item_compare(s1, s2)
- const void *s1;
- const void *s2;
+item_compare(const void *s1, const void *s2)
{
sortItem_T *si1, *si2;
typval_T *tv1, *tv2;
@@ -18574,9 +17879,7 @@ item_compare(s1, s2)
#ifdef __BORLANDC__
_RTLENTRYF
#endif
-item_compare2(s1, s2)
- const void *s1;
- const void *s2;
+item_compare2(const void *s1, const void *s2)
{
sortItem_T *si1, *si2;
int res;
@@ -18623,10 +17926,7 @@ item_compare2(s1, s2)
* "sort({list})" function
*/
static void
-do_sort_uniq(argvars, rettv, sort)
- typval_T *argvars;
- typval_T *rettv;
- int sort;
+do_sort_uniq(typval_T *argvars, typval_T *rettv, int sort)
{
list_T *l;
listitem_T *li;
@@ -18801,9 +18101,7 @@ do_sort_uniq(argvars, rettv, sort)
* "sort({list})" function
*/
static void
-f_sort(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_sort(typval_T *argvars, typval_T *rettv)
{
do_sort_uniq(argvars, rettv, TRUE);
}
@@ -18812,9 +18110,7 @@ f_sort(argvars, rettv)
* "uniq({list})" function
*/
static void
-f_uniq(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_uniq(typval_T *argvars, typval_T *rettv)
{
do_sort_uniq(argvars, rettv, FALSE);
}
@@ -18823,9 +18119,7 @@ f_uniq(argvars, rettv)
* "soundfold({word})" function
*/
static void
-f_soundfold(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_soundfold(typval_T *argvars, typval_T *rettv)
{
char_u *s;
@@ -18842,9 +18136,7 @@ f_soundfold(argvars, rettv)
* "spellbadword()" function
*/
static void
-f_spellbadword(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv;
+f_spellbadword(typval_T *argvars UNUSED, typval_T *rettv)
{
char_u *word = (char_u *)"";
hlf_T attr = HLF_COUNT;
@@ -18896,9 +18188,7 @@ f_spellbadword(argvars, rettv)
* "spellsuggest()" function
*/
static void
-f_spellsuggest(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv;
+f_spellsuggest(typval_T *argvars UNUSED, typval_T *rettv)
{
#ifdef FEAT_SPELL
char_u *str;
@@ -18955,9 +18245,7 @@ f_spellsuggest(argvars, rettv)
}
static void
-f_split(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_split(typval_T *argvars, typval_T *rettv)
{
char_u *str;
char_u *end;
@@ -19040,9 +18328,7 @@ f_split(argvars, rettv)
* "sqrt()" function
*/
static void
-f_sqrt(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_sqrt(typval_T *argvars, typval_T *rettv)
{
float_T f;
@@ -19057,9 +18343,7 @@ f_sqrt(argvars, rettv)
* "str2float()" function
*/
static void
-f_str2float(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_str2float(typval_T *argvars, typval_T *rettv)
{
char_u *p = skipwhite(get_tv_string(&argvars[0]));
@@ -19074,9 +18358,7 @@ f_str2float(argvars, rettv)
* "str2nr()" function
*/
static void
-f_str2nr(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_str2nr(typval_T *argvars, typval_T *rettv)
{
int base = 10;
char_u *p;
@@ -19112,9 +18394,7 @@ f_str2nr(argvars, rettv)
* "strftime({format}[, {time}])" function
*/
static void
-f_strftime(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_strftime(typval_T *argvars, typval_T *rettv)
{
char_u result_buf[256];
struct tm *curtime;
@@ -19173,9 +18453,7 @@ f_strftime(argvars, rettv)
* "stridx()" function
*/
static void
-f_stridx(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_stridx(typval_T *argvars, typval_T *rettv)
{
char_u buf[NUMBUFLEN];
char_u *needle;
@@ -19210,9 +18488,7 @@ f_stridx(argvars, rettv)
* "string()" function
*/
static void
-f_string(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_string(typval_T *argvars, typval_T *rettv)
{
char_u *tofree;
char_u numbuf[NUMBUFLEN];
@@ -19228,9 +18504,7 @@ f_string(argvars, rettv)
* "strlen()" function
*/
static void
-f_strlen(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_strlen(typval_T *argvars, typval_T *rettv)
{
rettv->vval.v_number = (varnumber_T)(STRLEN(
get_tv_string(&argvars[0])));
@@ -19240,9 +18514,7 @@ f_strlen(argvars, rettv)
* "strchars()" function
*/
static void
-f_strchars(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_strchars(typval_T *argvars, typval_T *rettv)
{
char_u *s = get_tv_string(&argvars[0]);
int skipcc = 0;
@@ -19275,9 +18547,7 @@ f_strchars(argvars, rettv)
* "strdisplaywidth()" function
*/
static void
-f_strdisplaywidth(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_strdisplaywidth(typval_T *argvars, typval_T *rettv)
{
char_u *s = get_tv_string(&argvars[0]);
int col = 0;
@@ -19292,9 +18562,7 @@ f_strdisplaywidth(argvars, rettv)
* "strwidth()" function
*/
static void
-f_strwidth(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_strwidth(typval_T *argvars, typval_T *rettv)
{
char_u *s = get_tv_string(&argvars[0]);
@@ -19311,9 +18579,7 @@ f_strwidth(argvars, rettv)
* "strpart()" function
*/
static void
-f_strpart(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_strpart(typval_T *argvars, typval_T *rettv)
{
char_u *p;
int n;
@@ -19356,9 +18622,7 @@ f_strpart(argvars, rettv)
* "strridx()" function
*/
static void
-f_strridx(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_strridx(typval_T *argvars, typval_T *rettv)
{
char_u buf[NUMBUFLEN];
char_u *needle;
@@ -19411,9 +18675,7 @@ f_strridx(argvars, rettv)
* "strtrans()" function
*/
static void
-f_strtrans(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_strtrans(typval_T *argvars, typval_T *rettv)
{
rettv->v_type = VAR_STRING;
rettv->vval.v_string = transstr(get_tv_string(&argvars[0]));
@@ -19423,9 +18685,7 @@ f_strtrans(argvars, rettv)
* "submatch()" function
*/
static void
-f_submatch(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_submatch(typval_T *argvars, typval_T *rettv)
{
int error = FALSE;
int no;
@@ -19456,9 +18716,7 @@ f_submatch(argvars, rettv)
* "substitute()" function
*/
static void
-f_substitute(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_substitute(typval_T *argvars, typval_T *rettv)
{
char_u patbuf[NUMBUFLEN];
char_u subbuf[NUMBUFLEN];
@@ -19480,9 +18738,7 @@ f_substitute(argvars, rettv)
* "synID(lnum, col, trans)" function
*/
static void
-f_synID(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv;
+f_synID(typval_T *argvars UNUSED, typval_T *rettv)
{
int id = 0;
#ifdef FEAT_SYN_HL
@@ -19507,9 +18763,7 @@ f_synID(argvars, rettv)
* "synIDattr(id, what [, mode])" function
*/
static void
-f_synIDattr(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv;
+f_synIDattr(typval_T *argvars UNUSED, typval_T *rettv)
{
char_u *p = NULL;
#ifdef FEAT_SYN_HL
@@ -19598,9 +18852,7 @@ f_synIDattr(argvars, rettv)
* "synIDtrans(id)" function
*/
static void
-f_synIDtrans(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv;
+f_synIDtrans(typval_T *argvars UNUSED, typval_T *rettv)
{
int id;
@@ -19620,9 +18872,7 @@ f_synIDtrans(argvars, rettv)
* "synconcealed(lnum, col)" function
*/
static void
-f_synconcealed(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv;
+f_synconcealed(typval_T *argvars UNUSED, typval_T *rettv)
{
#if defined(FEAT_SYN_HL) && defined(FEAT_CONCEAL)
long lnum;
@@ -19682,9 +18932,7 @@ f_synconcealed(argvars, rettv)
* "synstack(lnum, col)" function
*/
static void
-f_synstack(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv;
+f_synstack(typval_T *argvars UNUSED, typval_T *rettv)
{
#ifdef FEAT_SYN_HL
long lnum;
@@ -19718,10 +18966,10 @@ f_synstack(argvars, rettv)
}
static void
-get_cmd_output_as_rettv(argvars, rettv, retlist)
- typval_T *argvars;
- typval_T *rettv;
- int retlist;
+get_cmd_output_as_rettv(
+ typval_T *argvars,
+ typval_T *rettv,
+ int retlist)
{
char_u *res = NULL;
char_u *p;
@@ -19890,9 +19138,7 @@ errret:
* "system()" function
*/
static void
-f_system(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_system(typval_T *argvars, typval_T *rettv)
{
get_cmd_output_as_rettv(argvars, rettv, FALSE);
}
@@ -19901,9 +19147,7 @@ f_system(argvars, rettv)
* "systemlist()" function
*/
static void
-f_systemlist(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_systemlist(typval_T *argvars, typval_T *rettv)
{
get_cmd_output_as_rettv(argvars, rettv, TRUE);
}
@@ -19912,9 +19156,7 @@ f_systemlist(argvars, rettv)
* "tabpagebuflist()" function
*/
static void
-f_tabpagebuflist(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv UNUSED;
+f_tabpagebuflist(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
{
#ifdef FEAT_WINDOWS
tabpage_T *tp;
@@ -19943,9 +19185,7 @@ f_tabpagebuflist(argvars, rettv)
* "tabpagenr()" function
*/
static void
-f_tabpagenr(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv;
+f_tabpagenr(typval_T *argvars UNUSED, typval_T *rettv)
{
int nr = 1;
#ifdef FEAT_WINDOWS
@@ -19977,9 +19217,7 @@ static int get_winnr(tabpage_T *tp, typval_T *argvar);
* Common code for tabpagewinnr() and winnr().
*/
static int
-get_winnr(tp, argvar)
- tabpage_T *tp;
- typval_T *argvar;
+get_winnr(tabpage_T *tp, typval_T *argvar)
{
win_T *twin;
int nr = 1;
@@ -20027,9 +19265,7 @@ get_winnr(tp, argvar)
* "tabpagewinnr()" function
*/
static void
-f_tabpagewinnr(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv;
+f_tabpagewinnr(typval_T *argvars UNUSED, typval_T *rettv)
{
int nr = 1;
#ifdef FEAT_WINDOWS
@@ -20049,9 +19285,7 @@ f_tabpagewinnr(argvars, rettv)
* "tagfiles()" function
*/
static void
-f_tagfiles(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv;
+f_tagfiles(typval_T *argvars UNUSED, typval_T *rettv)
{
char_u *fname;
tagname_T tn;
@@ -20075,9 +19309,7 @@ f_tagfiles(argvars, rettv)
* "taglist()" function
*/
static void
-f_taglist(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_taglist(typval_T *argvars, typval_T *rettv)
{
char_u *tag_pattern;
@@ -20095,9 +19327,7 @@ f_taglist(argvars, rettv)
* "tempname()" function
*/
static void
-f_tempname(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv;
+f_tempname(typval_T *argvars UNUSED, typval_T *rettv)
{
static int x = 'A';
@@ -20130,9 +19360,7 @@ f_tempname(argvars, rettv)
* "test(list)" function: Just checking the walls...
*/
static void
-f_test(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv UNUSED;
+f_test(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
{
/* Used for unit testing. Change the code below to your liking. */
#if 0
@@ -20162,9 +19390,7 @@ f_test(argvars, rettv)
* "tan()" function
*/
static void
-f_tan(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_tan(typval_T *argvars, typval_T *rettv)
{
float_T f;
@@ -20179,9 +19405,7 @@ f_tan(argvars, rettv)
* "tanh()" function
*/
static void
-f_tanh(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_tanh(typval_T *argvars, typval_T *rettv)
{
float_T f;
@@ -20197,9 +19421,7 @@ f_tanh(argvars, rettv)
* "tolower(string)" function
*/
static void
-f_tolower(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_tolower(typval_T *argvars, typval_T *rettv)
{
char_u *p;
@@ -20240,9 +19462,7 @@ f_tolower(argvars, rettv)
* "toupper(string)" function
*/
static void
-f_toupper(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_toupper(typval_T *argvars, typval_T *rettv)
{
rettv->v_type = VAR_STRING;
rettv->vval.v_string = strup_save(get_tv_string(&argvars[0]));
@@ -20252,9 +19472,7 @@ f_toupper(argvars, rettv)
* "tr(string, fromstr, tostr)" function
*/
static void
-f_tr(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_tr(typval_T *argvars, typval_T *rettv)
{
char_u *in_str;
char_u *fromstr;
@@ -20376,9 +19594,7 @@ error:
* "trunc({float})" function
*/
static void
-f_trunc(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_trunc(typval_T *argvars, typval_T *rettv)
{
float_T f;
@@ -20395,9 +19611,7 @@ f_trunc(argvars, rettv)
* "type(expr)" function
*/
static void
-f_type(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_type(typval_T *argvars, typval_T *rettv)
{
int n;
@@ -20427,9 +19641,7 @@ f_type(argvars, rettv)
* "undofile(name)" function
*/
static void
-f_undofile(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv;
+f_undofile(typval_T *argvars UNUSED, typval_T *rettv)
{
rettv->v_type = VAR_STRING;
#ifdef FEAT_PERSISTENT_UNDO
@@ -20459,9 +19671,7 @@ f_undofile(argvars, rettv)
* "undotree()" function
*/
static void
-f_undotree(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv;
+f_undotree(typval_T *argvars UNUSED, typval_T *rettv)
{
if (rettv_dict_alloc(rettv) == OK)
{
@@ -20489,9 +19699,7 @@ f_undotree(argvars, rettv)
* "values(dict)" function
*/
static void
-f_values(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_values(typval_T *argvars, typval_T *rettv)
{
dict_list(argvars, rettv, 1);
}
@@ -20500,9 +19708,7 @@ f_values(argvars, rettv)
* "virtcol(string)" function
*/
static void
-f_virtcol(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_virtcol(typval_T *argvars, typval_T *rettv)
{
colnr_T vcol = 0;
pos_T *fp;
@@ -20523,9 +19729,7 @@ f_virtcol(argvars, rettv)
* "visualmode()" function
*/
static void
-f_visualmode(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv UNUSED;
+f_visualmode(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
{
char_u str[2];
@@ -20543,9 +19747,7 @@ f_visualmode(argvars, rettv)
* "wildmenumode()" function
*/
static void
-f_wildmenumode(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv UNUSED;
+f_wildmenumode(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
{
#ifdef FEAT_WILDMENU
if (wild_menu_showing)
@@ -20557,9 +19759,7 @@ f_wildmenumode(argvars, rettv)
* "winbufnr(nr)" function
*/
static void
-f_winbufnr(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_winbufnr(typval_T *argvars, typval_T *rettv)
{
win_T *wp;
@@ -20574,9 +19774,7 @@ f_winbufnr(argvars, rettv)
* "wincol()" function
*/
static void
-f_wincol(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv;
+f_wincol(typval_T *argvars UNUSED, typval_T *rettv)
{
validate_cursor();
rettv->vval.v_number = curwin->w_wcol + 1;
@@ -20586,9 +19784,7 @@ f_wincol(argvars, rettv)
* "winheight(nr)" function
*/
static void
-f_winheight(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_winheight(typval_T *argvars, typval_T *rettv)
{
win_T *wp;
@@ -20603,9 +19799,7 @@ f_winheight(argvars, rettv)
* "winline()" function
*/
static void
-f_winline(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv;
+f_winline(typval_T *argvars UNUSED, typval_T *rettv)
{
validate_cursor();
rettv->vval.v_number = curwin->w_wrow + 1;
@@ -20615,9 +19809,7 @@ f_winline(argvars, rettv)
* "winnr()" function
*/
static void
-f_winnr(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv;
+f_winnr(typval_T *argvars UNUSED, typval_T *rettv)
{
int nr = 1;
@@ -20631,9 +19823,7 @@ f_winnr(argvars, rettv)
* "winrestcmd()" function
*/
static void
-f_winrestcmd(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv;
+f_winrestcmd(typval_T *argvars UNUSED, typval_T *rettv)
{
#ifdef FEAT_WINDOWS
win_T *wp;
@@ -20665,9 +19855,7 @@ f_winrestcmd(argvars, rettv)
* "winrestview()" function
*/
static void
-f_winrestview(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv UNUSED;
+f_winrestview(typval_T *argvars, typval_T *rettv UNUSED)
{
dict_T *dict;
@@ -20722,9 +19910,7 @@ f_winrestview(argvars, rettv)
* "winsaveview()" function
*/
static void
-f_winsaveview(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv;
+f_winsaveview(typval_T *argvars UNUSED, typval_T *rettv)
{
dict_T *dict;
@@ -20752,9 +19938,7 @@ f_winsaveview(argvars, rettv)
* "winwidth(nr)" function
*/
static void
-f_winwidth(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_winwidth(typval_T *argvars, typval_T *rettv)
{
win_T *wp;
@@ -20773,9 +19957,7 @@ f_winwidth(argvars, rettv)
* "wordcount()" function
*/
static void
-f_wordcount(argvars, rettv)
- typval_T *argvars UNUSED;
- typval_T *rettv;
+f_wordcount(typval_T *argvars UNUSED, typval_T *rettv)
{
if (rettv_dict_alloc(rettv) == FAIL)
return;
@@ -20786,10 +19968,7 @@ f_wordcount(argvars, rettv)
* Write list of strings to file
*/
static int
-write_list(fd, list, binary)
- FILE *fd;
- list_T *list;
- int binary;
+write_list(FILE *fd, list_T *list, int binary)
{
listitem_T *li;
int c;
@@ -20829,9 +20008,7 @@ write_list(fd, list, binary)
* "writefile()" function
*/
static void
-f_writefile(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_writefile(typval_T *argvars, typval_T *rettv)
{
int binary = FALSE;
int append = FALSE;
@@ -20881,9 +20058,7 @@ f_writefile(argvars, rettv)
* "xor(expr, expr)" function
*/
static void
-f_xor(argvars, rettv)
- typval_T *argvars;
- typval_T *rettv;
+f_xor(typval_T *argvars, typval_T *rettv)
{
rettv->vval.v_number = get_tv_number_chk(&argvars[0], NULL)
^ get_tv_number_chk(&argvars[1], NULL);
@@ -20895,10 +20070,10 @@ f_xor(argvars, rettv)
* Returns NULL when there is an error.
*/
static pos_T *
-var2fpos(varp, dollar_lnum, fnum)
- typval_T *varp;
- int dollar_lnum; /* TRUE when $ is last line */
- int *fnum; /* set to fnum for '0, 'A, etc. */
+var2fpos(
+ typval_T *varp,
+ int dollar_lnum, /* TRUE when $ is last line */
+ int *fnum) /* set to fnum for '0, 'A, etc. */
{
char_u *name;
static pos_T pos;
@@ -21014,11 +20189,11 @@ var2fpos(varp, dollar_lnum, fnum)
* validity.
*/
static int
-list2fpos(arg, posp, fnump, curswantp)
- typval_T *arg;
- pos_T *posp;
- int *fnump;
- colnr_T *curswantp;
+list2fpos(
+ typval_T *arg,
+ pos_T *posp,
+ int *fnump,
+ colnr_T *curswantp)
{
list_T *l = arg->vval.v_list;
long i = 0;
@@ -21072,8 +20247,7 @@ list2fpos(arg, posp, fnump, curswantp)
* Return 0 for error.
*/
static int
-get_env_len(arg)
- char_u **arg;
+get_env_len(char_u **arg)
{
char_u *p;
int len;
@@ -21094,8 +20268,7 @@ get_env_len(arg)
* Return 0 if something is wrong.
*/
static int
-get_id_len(arg)
- char_u **arg;
+get_id_len(char_u **arg)
{
char_u *p;
int len;
@@ -21132,11 +20305,11 @@ get_id_len(arg)
* expanded name in an allocated string via 'alias' - caller must free.
*/
static int
-get_name_len(arg, alias, evaluate, verbose)
- char_u **arg;
- char_u **alias;
- int evaluate;
- int verbose;
+get_name_len(
+ char_u **arg,
+ char_u **alias,
+ int evaluate,
+ int verbose)
{
int len;
char_u *p;
@@ -21203,11 +20376,11 @@ get_name_len(arg, alias, evaluate, verbose)
* valid name.
*/
static char_u *
-find_name_end(arg, expr_start, expr_end, flags)
- char_u *arg;
- char_u **expr_start;
- char_u **expr_end;
- int flags;
+find_name_end(
+ char_u *arg,
+ char_u **expr_start,
+ char_u **expr_end,
+ int flags)
{
int mb_nest = 0;
int br_nest = 0;
@@ -21300,11 +20473,11 @@ find_name_end(arg, expr_start, expr_end, flags)
* Returns NULL for failure.
*/
static char_u *
-make_expanded_name(in_start, expr_start, expr_end, in_end)
- char_u *in_start;
- char_u *expr_start;
- char_u *expr_end;
- char_u *in_end;
+make_expanded_name(
+ char_u *in_start,
+ char_u *expr_start,
+ char_u *expr_end,
+ char_u *in_end)
{
char_u c1;
char_u *retval = NULL;
@@ -21357,8 +20530,7 @@ make_expanded_name(in_start, expr_start, expr_end, in_end)
* Does not include '{' or '}' for magic braces.
*/
static int
-eval_isnamec(c)
- int c;
+eval_isnamec(int c)
{
return (ASCII_ISALNUM(c) || c == '_' || c == ':' || c == AUTOLOAD_CHAR);
}
@@ -21368,8 +20540,7 @@ eval_isnamec(c)
* variable or function name (excluding '{' and '}').
*/
static int
-eval_isnamec1(c)
- int c;
+eval_isnamec1(int c)
{
return (ASCII_ISALPHA(c) || c == '_');
}
@@ -21378,9 +20549,7 @@ eval_isnamec1(c)
* Set number v: variable to "val".
*/
void
-set_vim_var_nr(idx, val)
- int idx;
- long val;
+set_vim_var_nr(int idx, long val)
{
vimvars[idx].vv_nr = val;
}
@@ -21389,8 +20558,7 @@ set_vim_var_nr(idx, val)
* Get number v: variable value.
*/
long
-get_vim_var_nr(idx)
- int idx;
+get_vim_var_nr(int idx)
{
return vimvars[idx].vv_nr;
}
@@ -21399,8 +20567,7 @@ get_vim_var_nr(idx)
* Get string v: variable value. Uses a static buffer, can only be used once.
*/
char_u *
-get_vim_var_str(idx)
- int idx;
+get_vim_var_str(int idx)
{
return get_tv_string(&vimvars[idx].vv_tv);
}
@@ -21410,8 +20577,7 @@ get_vim_var_str(idx)
* needed.
*/
list_T *
-get_vim_var_list(idx)
- int idx;
+get_vim_var_list(int idx)
{
return vimvars[idx].vv_list;
}
@@ -21420,8 +20586,7 @@ get_vim_var_list(idx)
* Set v:char to character "c".
*/
void
-set_vim_var_char(c)
- int c;
+set_vim_var_char(int c)
{
char_u buf[MB_MAXBYTES + 1];
@@ -21442,10 +20607,10 @@ set_vim_var_char(c)
* When "set_prevcount" is TRUE first set v:prevcount from v:count.
*/
void
-set_vcount(count, count1, set_prevcount)
- long count;
- long count1;
- int set_prevcount;
+set_vcount(
+ long count,
+ long count1,
+ int set_prevcount)
{
if (set_prevcount)
vimvars[VV_PREVCOUNT].vv_nr = vimvars[VV_COUNT].vv_nr;
@@ -21457,10 +20622,10 @@ set_vcount(count, count1, set_prevcount)
* Set string v: variable to a copy of "val".
*/
void
-set_vim_var_string(idx, val, len)
- int idx;
- char_u *val;
- int len; /* length of "val" to use or -1 (whole string) */
+set_vim_var_string(
+ int idx,
+ char_u *val,
+ int len) /* length of "val" to use or -1 (whole string) */
{
/* Need to do this (at least) once, since we can't initialize a union.
* Will always be invoked when "v:progname" is set. */
@@ -21479,9 +20644,7 @@ set_vim_var_string(idx, val, len)
* Set List v: variable to "val".
*/
void
-set_vim_var_list(idx, val)
- int idx;
- list_T *val;
+set_vim_var_list(int idx, list_T *val)
{
list_unref(vimvars[idx].vv_list);
vimvars[idx].vv_list = val;
@@ -21493,9 +20656,7 @@ set_vim_var_list(idx, val)
* Set Dictionary v: variable to "val".
*/
void
-set_vim_var_dict(idx, val)
- int idx;
- dict_T *val;
+set_vim_var_dict(int idx, dict_T *val)
{
int todo;
hashitem_T *hi;
@@ -21522,8 +20683,7 @@ set_vim_var_dict(idx, val)
* Set v:register if needed.
*/
void
-set_reg_var(c)
- int c;
+set_reg_var(int c)
{
char_u regname;
@@ -21543,8 +20703,7 @@ set_reg_var(c)
* take care of memory allocations.
*/
char_u *
-v_exception(oldval)
- char_u *oldval;
+v_exception(char_u *oldval)
{
if (oldval == NULL)
return vimvars[VV_EXCEPTION].vv_str;
@@ -21560,8 +20719,7 @@ v_exception(oldval)
* take care of memory allocations.
*/
char_u *
-v_throwpoint(oldval)
- char_u *oldval;
+v_throwpoint(char_u *oldval)
{
if (oldval == NULL)
return vimvars[VV_THROWPOINT].vv_str;
@@ -21578,9 +20736,7 @@ v_throwpoint(oldval)
* Must always be called in pairs!
*/
char_u *
-set_cmdarg(eap, oldarg)
- exarg_T *eap;
- char_u *oldarg;
+set_cmdarg(exarg_T *eap, char_u *oldarg)
{
char_u *oldval;
char_u *newval;
@@ -21651,13 +20807,13 @@ set_cmdarg(eap, oldarg)
* Return OK or FAIL.
*/
static int
-get_var_tv(name, len, rettv, dip, verbose, no_autoload)
- char_u *name;
- int len; /* length of "name" */
- typval_T *rettv; /* NULL when only checking existence */
- dictitem_T **dip; /* non-NULL when typval's dict item is needed */
- int verbose; /* may give error message */
- int no_autoload; /* do not use script autoloading */
+get_var_tv(
+ char_u *name,
+ int len, /* length of "name" */
+ typval_T *rettv, /* NULL when only checking existence */
+ dictitem_T **dip, /* non-NULL when typval's dict item is needed */
+ int verbose, /* may give error message */
+ int no_autoload) /* do not use script autoloading */
{
int ret = OK;
typval_T *tv = NULL;
@@ -21713,11 +20869,11 @@ get_var_tv(name, len, rettv, dip, verbose, no_autoload)
* Can all be combined: dict.func(expr)[idx]['func'](expr)
*/
static int
-handle_subscript(arg, rettv, evaluate, verbose)
- char_u **arg;
- typval_T *rettv;
- int evaluate; /* do more than finding the end */
- int verbose; /* give error messages */
+handle_subscript(
+ char_u **arg,
+ typval_T *rettv,
+ int evaluate, /* do more than finding the end */
+ int verbose) /* give error messages */
{
int ret = OK;
dict_T *selfdict = NULL;
@@ -21792,7 +20948,7 @@ handle_subscript(arg, rettv, evaluate, verbose)
* value).
*/
static typval_T *
-alloc_tv()
+alloc_tv(void)
{
return (typval_T *)alloc_clear((unsigned)sizeof(typval_T));
}
@@ -21803,8 +20959,7 @@ alloc_tv()
* Return NULL for out of memory, the variable otherwise.
*/
static typval_T *
-alloc_string_tv(s)
- char_u *s;
+alloc_string_tv(char_u *s)
{
typval_T *rettv;
@@ -21823,8 +20978,7 @@ alloc_string_tv(s)
* Free the memory for a variable type-value.
*/
void
-free_tv(varp)
- typval_T *varp;
+free_tv(typval_T *varp)
{
if (varp != NULL)
{
@@ -21861,8 +21015,7 @@ free_tv(varp)
* Free the memory for a variable value and set the value to NULL or 0.
*/
void
-clear_tv(varp)
- typval_T *varp;
+clear_tv(typval_T *varp)
{
if (varp != NULL)
{
@@ -21905,8 +21058,7 @@ clear_tv(varp)
* Set the value of a variable to NULL without freeing items.
*/
static void
-init_tv(varp)
- typval_T *varp;
+init_tv(typval_T *varp)
{
if (varp != NULL)
vim_memset(varp, 0, sizeof(typval_T));
@@ -21921,8 +21073,7 @@ init_tv(varp)
* is not NULL or returns -1 otherwise.
*/
static long
-get_tv_number(varp)
- typval_T *varp;
+get_tv_number(typval_T *varp)
{
int error = FALSE;
@@ -21930,9 +21081,7 @@ get_tv_number(varp)
}
long
-get_tv_number_chk(varp, denote)
- typval_T *varp;
- int *denote;
+get_tv_number_chk(typval_T *varp, int *denote)
{
long n = 0L;
@@ -21975,8 +21124,7 @@ get_tv_number_chk(varp, denote)
#ifdef FEAT_FLOAT
static float_T
-get_tv_float(varp)
- typval_T *varp;
+get_tv_float(typval_T *varp)
{
switch (varp->v_type)
{
@@ -22013,8 +21161,7 @@ get_tv_float(varp)
* Returns -1 on error.
*/
static linenr_T
-get_tv_lnum(argvars)
- typval_T *argvars;
+get_tv_lnum(typval_T *argvars)
{
typval_T rettv;
linenr_T lnum;
@@ -22036,9 +21183,7 @@ get_tv_lnum(argvars)
* Returns 0 on error.
*/
static linenr_T
-get_tv_lnum_buf(argvars, buf)
- typval_T *argvars;
- buf_T *buf;
+get_tv_lnum_buf(typval_T *argvars, buf_T *buf)
{
if (argvars[0].v_type == VAR_STRING
&& argvars[0].vval.v_string != NULL
@@ -22059,8 +21204,7 @@ get_tv_lnum_buf(argvars, buf)
* NULL on error.
*/
static char_u *
-get_tv_string(varp)
- typval_T *varp;
+get_tv_string(typval_T *varp)
{
static char_u mybuf[NUMBUFLEN];
@@ -22068,9 +21212,7 @@ get_tv_string(varp)
}
static char_u *
-get_tv_string_buf(varp, buf)
- typval_T *varp;
- char_u *buf;
+get_tv_string_buf(typval_T *varp, char_u *buf)
{
char_u *res = get_tv_string_buf_chk(varp, buf);
@@ -22081,8 +21223,7 @@ get_tv_string_buf(varp, buf)
* Careful: This uses a single, static buffer. YOU CAN ONLY USE IT ONCE!
*/
char_u *
-get_tv_string_chk(varp)
- typval_T *varp;
+get_tv_string_chk(typval_T *varp)
{
static char_u mybuf[NUMBUFLEN];
@@ -22090,9 +21231,7 @@ get_tv_string_chk(varp)
}
char_u *
-get_tv_string_buf_chk(varp, buf)
- typval_T *varp;
- char_u *buf;
+get_tv_string_buf_chk(typval_T *varp, char_u *buf)
{
switch (varp->v_type)
{
@@ -22136,10 +21275,7 @@ get_tv_string_buf_chk(varp, buf)
* hashtab_T used.
*/
static dictitem_T *
-find_var(name, htp, no_autoload)
- char_u *name;
- hashtab_T **htp;
- int no_autoload;
+find_var(char_u *name, hashtab_T **htp, int no_autoload)
{
char_u *varname;
hashtab_T *ht;
@@ -22157,11 +21293,11 @@ find_var(name, htp, no_autoload)
* Returns NULL if not found.
*/
static dictitem_T *
-find_var_in_ht(ht, htname, varname, no_autoload)
- hashtab_T *ht;
- int htname;
- char_u *varname;
- int no_autoload;
+find_var_in_ht(
+ hashtab_T *ht,
+ int htname,
+ char_u *varname,
+ int no_autoload)
{
hashitem_T *hi;
@@ -22213,9 +21349,7 @@ find_var_in_ht(ht, htname, varname, no_autoload)
* Set "varname" to the start of name without ':'.
*/
static hashtab_T *
-find_var_ht(name, varname)
- char_u *name;
- char_u **varname;
+find_var_ht(char_u *name, char_u **varname)
{
hashitem_T *hi;
@@ -22269,7 +21403,7 @@ find_var_ht(name, varname)
* Get function call environment based on bactrace debug level
*/
static funccall_T *
-get_funccal()
+get_funccal(void)
{
int i;
funccall_T *funccal;
@@ -22297,8 +21431,7 @@ get_funccal()
* Returns NULL when it doesn't exist.
*/
char_u *
-get_var_value(name)
- char_u *name;
+get_var_value(char_u *name)
{
dictitem_T *v;
@@ -22313,8 +21446,7 @@ get_var_value(name)
* sourcing this script and when executing functions defined in the script.
*/
void
-new_script_vars(id)
- scid_T id;
+new_script_vars(scid_T id)
{
int i;
hashtab_T *ht;
@@ -22349,10 +21481,7 @@ new_script_vars(id)
* point to it.
*/
void
-init_var_dict(dict, dict_var, scope)
- dict_T *dict;
- dictitem_T *dict_var;
- int scope;
+init_var_dict(dict_T *dict, dictitem_T *dict_var, int scope)
{
hash_init(&dict->dv_hashtab);
dict->dv_lock = 0;
@@ -22370,8 +21499,7 @@ init_var_dict(dict, dict_var, scope)
* Unreference a dictionary initialized by init_var_dict().
*/
void
-unref_var_dict(dict)
- dict_T *dict;
+unref_var_dict(dict_T *dict)
{
/* Now the dict needs to be freed if no one else is using it, go back to
* normal reference counting. */
@@ -22385,8 +21513,7 @@ unref_var_dict(dict)
* Clears hashtab "ht", does not free it.
*/
void
-vars_clear(ht)
- hashtab_T *ht;
+vars_clear(hashtab_T *ht)
{
vars_clear_ext(ht, TRUE);
}
@@ -22395,9 +21522,7 @@ vars_clear(ht)
* Like vars_clear(), but only free the value if "free_val" is TRUE.
*/
static void
-vars_clear_ext(ht, free_val)
- hashtab_T *ht;
- int free_val;
+vars_clear_ext(hashtab_T *ht, int free_val)
{
int todo;
hashitem_T *hi;
@@ -22430,9 +21555,7 @@ vars_clear_ext(ht, free_val)
* Clear the variable value and free the dictitem.
*/
static void
-delete_var(ht, hi)
- hashtab_T *ht;
- hashitem_T *hi;
+delete_var(hashtab_T *ht, hashitem_T *hi)
{
dictitem_T *di = HI2DI(hi);
@@ -22445,10 +21568,7 @@ delete_var(ht, hi)
* List the value of one internal variable.
*/
static void
-list_one_var(v, prefix, first)
- dictitem_T *v;
- char_u *prefix;
- int *first;
+list_one_var(dictitem_T *v, char_u *prefix, int *first)
{
char_u *tofree;
char_u *s;
@@ -22461,12 +21581,12 @@ list_one_var(v, prefix, first)
}
static void
-list_one_var_a(prefix, name, type, string, first)
- char_u *prefix;
- char_u *name;
- int type;
- char_u *string;
- int *first; /* when TRUE clear rest of screen and set to FALSE */
+list_one_var_a(
+ char_u *prefix,
+ char_u *name,
+ int type,
+ char_u *string,
+ int *first) /* when TRUE clear rest of screen and set to FALSE */
{
/* don't use msg() or msg_attr() to avoid overwriting "v:statusmsg" */
msg_start();
@@ -22511,10 +21631,10 @@ list_one_var_a(prefix, name, type, string, first)
* Otherwise the variable is created.
*/
static void
-set_var(name, tv, copy)
- char_u *name;
- typval_T *tv;
- int copy; /* make copy of value in "tv" */
+set_var(
+ char_u *name,
+ typval_T *tv,
+ int copy) /* make copy of value in "tv" */
{
dictitem_T *v;
char_u *varname;
@@ -22634,10 +21754,7 @@ set_var(name, tv, copy)
* Also give an error message.
*/
static int
-var_check_ro(flags, name, use_gettext)
- int flags;
- char_u *name;
- int use_gettext;
+var_check_ro(int flags, char_u *name, int use_gettext)
{
if (flags & DI_FLAGS_RO)
{
@@ -22657,10 +21774,7 @@ var_check_ro(flags, name, use_gettext)
* Also give an error message.
*/
static int
-var_check_fixed(flags, name, use_gettext)
- int flags;
- char_u *name;
- int use_gettext;
+var_check_fixed(int flags, char_u *name, int use_gettext)
{
if (flags & DI_FLAGS_FIX)
{
@@ -22676,9 +21790,9 @@ var_check_fixed(flags, name, use_gettext)
* Return TRUE and give an error if not.
*/
static int
-var_check_func_name(name, new_var)
- char_u *name; /* points to start of variable name */
- int new_var; /* TRUE when creating the variable */
+var_check_func_name(
+ char_u *name, /* points to start of variable name */
+ int new_var) /* TRUE when creating the variable */
{
/* Allow for w: b: s: and t:. */
if (!(vim_strchr((char_u *)"wbst", name[0]) != NULL && name[1] == ':')
@@ -22706,8 +21820,7 @@ var_check_func_name(name, new_var)
* Return FALSE and give an error if not.
*/
static int
-valid_varname(varname)
- char_u *varname;
+valid_varname(char_u *varname)
{
char_u *p;
@@ -22727,10 +21840,7 @@ valid_varname(varname)
* TRUE.
*/
static int
-tv_check_lock(lock, name, use_gettext)
- int lock;
- char_u *name;
- int use_gettext;
+tv_check_lock(int lock, char_u *name, int use_gettext)
{
if (lock & VAR_LOCKED)
{
@@ -22759,9 +21869,7 @@ tv_check_lock(lock, name, use_gettext)
* make a copy later.
*/
void
-copy_tv(from, to)
- typval_T *from;
- typval_T *to;
+copy_tv(typval_T *from, typval_T *to)
{
to->v_type = from->v_type;
to->v_lock = 0;
@@ -22819,11 +21927,11 @@ copy_tv(from, to)
* Returns FAIL or OK.
*/
static int
-item_copy(from, to, deep, copyID)
- typval_T *from;
- typval_T *to;
- int deep;
- int copyID;
+item_copy(
+ typval_T *from,
+ typval_T *to,
+ int deep,
+ int copyID)
{
static int recurse = 0;
int ret = OK;
@@ -22891,8 +21999,7 @@ item_copy(from, to, deep, copyID)
* ":echon expr1 ..." print each argument plain.
*/
void
-ex_echo(eap)
- exarg_T *eap;
+ex_echo(exarg_T *eap)
{
char_u *arg = eap->arg;
typval_T rettv;
@@ -22995,8 +22102,7 @@ ex_echo(eap)
* ":echohl {name}".
*/
void
-ex_echohl(eap)
- exarg_T *eap;
+ex_echohl(exarg_T *eap)
{
int id;
@@ -23015,8 +22121,7 @@ ex_echohl(eap)
* echo commands
*/
void
-ex_execute(eap)
- exarg_T *eap;
+ex_execute(exarg_T *eap)
{
char_u *arg = eap->arg;
typval_T rettv;
@@ -23101,9 +22206,7 @@ ex_execute(eap)
* after the option name.
*/
static char_u *
-find_option_end(arg, opt_flags)
- char_u **arg;
- int *opt_flags;
+find_option_end(char_u **arg, int *opt_flags)
{
char_u *p = *arg;
@@ -23137,8 +22240,7 @@ find_option_end(arg, opt_flags)
* ":function"
*/
void
-ex_function(eap)
- exarg_T *eap;
+ex_function(exarg_T *eap)
{
char_u *theline;
int i;
@@ -23811,11 +22913,11 @@ ret_free:
* Advances "pp" to just after the function name (if no error).
*/
static char_u *
-trans_function_name(pp, skip, flags, fdp)
- char_u **pp;
- int skip; /* only find the end, don't evaluate */
- int flags;
- funcdict_T *fdp; /* return: info about dictionary used */
+trans_function_name(
+ char_u **pp,
+ int skip, /* only find the end, don't evaluate */
+ int flags,
+ funcdict_T *fdp) /* return: info about dictionary used */
{
char_u *name = NULL;
char_u *start;
@@ -24022,8 +23124,7 @@ theend:
* Return 0 otherwise.
*/
static int
-eval_fname_script(p)
- char_u *p;
+eval_fname_script(char_u *p)
{
/* Use MB_STRICMP() because in Turkish comparing the "I" may not work with
* the standard library function. */
@@ -24040,8 +23141,7 @@ eval_fname_script(p)
* Only works if eval_fname_script() returned non-zero for "p"!
*/
static int
-eval_fname_sid(p)
- char_u *p;
+eval_fname_sid(char_u *p)
{
return (*p == 's' || TOUPPER_ASC(p[2]) == 'I');
}
@@ -24050,9 +23150,7 @@ eval_fname_sid(p)
* List the head of the function: "name(arg1, arg2)".
*/
static void
-list_func_head(fp, indent)
- ufunc_T *fp;
- int indent;
+list_func_head(ufunc_T *fp, int indent)
{
int j;
@@ -24097,8 +23195,7 @@ list_func_head(fp, indent)
* Return NULL for unknown function.
*/
static ufunc_T *
-find_func(name)
- char_u *name;
+find_func(char_u *name)
{
hashitem_T *hi;
@@ -24110,7 +23207,7 @@ find_func(name)
#if defined(EXITFREE) || defined(PROTO)
void
-free_all_functions()
+free_all_functions(void)
{
hashitem_T *hi;
@@ -24127,8 +23224,7 @@ free_all_functions()
#endif
int
-translated_function_exists(name)
- char_u *name;
+translated_function_exists(char_u *name)
{
if (builtin_function(name, -1))
return find_internal_func(name) >= 0;
@@ -24139,8 +23235,7 @@ translated_function_exists(name)
* Return TRUE if a function "name" exists.
*/
static int
-function_exists(name)
- char_u *name;
+function_exists(char_u *name)
{
char_u *nm = name;
char_u *p;
@@ -24159,9 +23254,7 @@ function_exists(name)
}
char_u *
-get_expanded_name(name, check)
- char_u *name;
- int check;
+get_expanded_name(char_u *name, int check)
{
char_u *nm = name;
char_u *p;
@@ -24182,9 +23275,7 @@ get_expanded_name(name, check)
* "len" is the length of "name", or -1 for NUL terminated.
*/
static int
-builtin_function(name, len)
- char_u *name;
- int len;
+builtin_function(char_u *name, int len)
{
char_u *p;
@@ -24199,8 +23290,7 @@ builtin_function(name, len)
* Start profiling function "fp".
*/
static void
-func_do_profile(fp)
- ufunc_T *fp;
+func_do_profile(ufunc_T *fp)
{
int len = fp->uf_lines.ga_len;
@@ -24229,8 +23319,7 @@ func_do_profile(fp)
* Dump the profiling results for all functions in file "fd".
*/
void
-func_dump_profile(fd)
- FILE *fd;
+func_dump_profile(FILE *fd)
{
hashitem_T *hi;
int todo;
@@ -24296,12 +23385,12 @@ func_dump_profile(fd)
}
static void
-prof_sort_list(fd, sorttab, st_len, title, prefer_self)
- FILE *fd;
- ufunc_T **sorttab;
- int st_len;
- char *title;
- int prefer_self; /* when equal print only self time */
+prof_sort_list(
+ FILE *fd,
+ ufunc_T **sorttab,
+ int st_len,
+ char *title,
+ int prefer_self) /* when equal print only self time */
{
int i;
ufunc_T *fp;
@@ -24325,12 +23414,12 @@ prof_sort_list(fd, sorttab, st_len, title, prefer_self)
* Print the count and times for one function or function line.
*/
static void
-prof_func_line(fd, count, total, self, prefer_self)
- FILE *fd;
- int count;
- proftime_T *total;
- proftime_T *self;
- int prefer_self; /* when equal print only self time */
+prof_func_line(
+ FILE *fd,
+ int count,
+ proftime_T *total,
+ proftime_T *self,
+ int prefer_self) /* when equal print only self time */
{
if (count > 0)
{
@@ -24355,9 +23444,7 @@ prof_func_line(fd, count, total, self, prefer_self)
#ifdef __BORLANDC__
_RTLENTRYF
#endif
-prof_total_cmp(s1, s2)
- const void *s1;
- const void *s2;
+prof_total_cmp(const void *s1, const void *s2)
{
ufunc_T *p1, *p2;
@@ -24373,9 +23460,7 @@ prof_total_cmp(s1, s2)
#ifdef __BORLANDC__
_RTLENTRYF
#endif
-prof_self_cmp(s1, s2)
- const void *s1;
- const void *s2;
+prof_self_cmp(const void *s1, const void *s2)
{
ufunc_T *p1, *p2;
@@ -24391,9 +23476,9 @@ prof_self_cmp(s1, s2)
* Return TRUE if a package was loaded.
*/
static int
-script_autoload(name, reload)
- char_u *name;
- int reload; /* load script again when already loaded */
+script_autoload(
+ char_u *name,
+ int reload) /* load script again when already loaded */
{
char_u *p;
char_u *scriptname, *tofree;
@@ -24437,8 +23522,7 @@ script_autoload(name, reload)
* Returns NULL when out of memory.
*/
static char_u *
-autoload_name(name)
- char_u *name;
+autoload_name(char_u *name)
{
char_u *p;
char_u *scriptname;
@@ -24463,9 +23547,7 @@ autoload_name(name)
* function names.
*/
char_u *
-get_user_func_name(xp, idx)
- expand_T *xp;
- int idx;
+get_user_func_name(expand_T *xp, int idx)
{
static long_u done;
static hashitem_T *hi;
@@ -24510,9 +23592,7 @@ get_user_func_name(xp, idx)
* Takes care of script-local function names.
*/
static void
-cat_func_name(buf, fp)
- char_u *buf;
- ufunc_T *fp;
+cat_func_name(char_u *buf, ufunc_T *fp)
{
if (fp->uf_name[0] == K_SPECIAL)
{
@@ -24527,8 +23607,7 @@ cat_func_name(buf, fp)
* ":delfunction {name}"
*/
void
-ex_delfunction(eap)
- exarg_T *eap;
+ex_delfunction(exarg_T *eap)
{
ufunc_T *fp = NULL;
char_u *p;
@@ -24586,8 +23665,7 @@ ex_delfunction(eap)
* Free a function and remove it from the list of functions.
*/
static void
-func_free(fp)
- ufunc_T *fp;
+func_free(ufunc_T *fp)
{
hashitem_T *hi;
@@ -24615,8 +23693,7 @@ func_free(fp)
* becomes zero. Only for numbered functions.
*/
void
-func_unref(name)
- char_u *name;
+func_unref(char_u *name)
{
ufunc_T *fp;
@@ -24639,8 +23716,7 @@ func_unref(name)
* Count a reference to a Function.
*/
void
-func_ref(name)
- char_u *name;
+func_ref(char_u *name)
{
ufunc_T *fp;
@@ -24658,14 +23734,14 @@ func_ref(name)
* Call a user function.
*/
static void
-call_user_func(fp, argcount, argvars, rettv, firstline, lastline, selfdict)
- ufunc_T *fp; /* pointer to function */
- int argcount; /* nr of args */
- typval_T *argvars; /* arguments */
- typval_T *rettv; /* return value */
- linenr_T firstline; /* first line of range */
- linenr_T lastline; /* last line of range */
- dict_T *selfdict; /* Dictionary for "self" */
+call_user_func(
+ ufunc_T *fp, /* pointer to function */
+ int argcount, /* nr of args */
+ typval_T *argvars, /* arguments */
+ typval_T *rettv, /* return value */
+ linenr_T firstline, /* first line of range */
+ linenr_T lastline, /* last line of range */
+ dict_T *selfdict) /* Dictionary for "self" */
{
char_u *save_sourcing_name;
linenr_T save_sourcing_lnum;
@@ -25031,9 +24107,7 @@ call_user_func(fp, argcount, argvars, rettv, firstline, lastline, selfdict)
* referenced from anywhere that is in use.
*/
static int
-can_free_funccal(fc, copyID)
- funccall_T *fc;
- int copyID;
+can_free_funccal(funccall_T *fc, int copyID)
{
return (fc->l_varlist.lv_copyID != copyID
&& fc->l_vars.dv_copyID != copyID
@@ -25044,9 +24118,9 @@ can_free_funccal(fc, copyID)
* Free "fc" and what it contains.
*/
static void
-free_funccal(fc, free_val)
- funccall_T *fc;
- int free_val; /* a: vars were allocated */
+free_funccal(
+ funccall_T *fc,
+ int free_val) /* a: vars were allocated */
{
listitem_T *li;
@@ -25069,11 +24143,11 @@ free_funccal(fc, free_val)
* Add a number variable "name" to dict "dp" with value "nr".
*/
static void
-add_nr_var(dp, v, name, nr)
- dict_T *dp;
- dictitem_T *v;
- char *name;
- varnumber_T nr;
+add_nr_var(
+ dict_T *dp,
+ dictitem_T *v,
+ char *name,
+ varnumber_T nr)
{
STRCPY(v->di_key, name);
v->di_flags = DI_FLAGS_RO | DI_FLAGS_FIX;
@@ -25087,8 +24161,7 @@ add_nr_var(dp, v, name, nr)
* ":return [expr]"
*/
void
-ex_return(eap)
- exarg_T *eap;
+ex_return(exarg_T *eap)
{
char_u *arg = eap->arg;
typval_T rettv;
@@ -25144,11 +24217,11 @@ ex_return(eap)
* FALSE when the return gets pending.
*/
int
-do_return(eap, reanimate, is_cmd, rettv)
- exarg_T *eap;
- int reanimate;
- int is_cmd;
- void *rettv;
+do_return(
+ exarg_T *eap,
+ int reanimate,
+ int is_cmd,
+ void *rettv)
{
int idx;
struct condstack *cstack = eap->cstack;
@@ -25225,8 +24298,7 @@ do_return(eap, reanimate, is_cmd, rettv)
* Free the variable with a pending return value.
*/
void
-discard_pending_return(rettv)
- void *rettv;
+discard_pending_return(void *rettv)
{
free_tv((typval_T *)rettv);
}
@@ -25236,8 +24308,7 @@ discard_pending_return(rettv)
* is an allocated string. Used by report_pending() for verbose messages.
*/
char_u *
-get_return_cmd(rettv)
- void *rettv;
+get_return_cmd(void *rettv)
{
char_u *s = NULL;
char_u *tofree = NULL;
@@ -25262,10 +24333,10 @@ get_return_cmd(rettv)
* Returns allocated string, or NULL for end of function.
*/
char_u *
-get_func_line(c, cookie, indent)
- int c UNUSED;
- void *cookie;
- int indent UNUSED;
+get_func_line(
+ int c UNUSED,
+ void *cookie,
+ int indent UNUSED)
{
funccall_T *fcp = (funccall_T *)cookie;
ufunc_T *fp = fcp->func;
@@ -25328,8 +24399,7 @@ get_func_line(c, cookie, indent)
* until later and we need to store the time now.
*/
void
-func_line_start(cookie)
- void *cookie;
+func_line_start(void *cookie)
{
funccall_T *fcp = (funccall_T *)cookie;
ufunc_T *fp = fcp->func;
@@ -25352,8 +24422,7 @@ func_line_start(cookie)
* Called when actually executing a function line.
*/
void
-func_line_exec(cookie)
- void *cookie;
+func_line_exec(void *cookie)
{
funccall_T *fcp = (funccall_T *)cookie;
ufunc_T *fp = fcp->func;
@@ -25366,8 +24435,7 @@ func_line_exec(cookie)
* Called when done with a function line.
*/
void
-func_line_end(cookie)
- void *cookie;
+func_line_end(void *cookie)
{
funccall_T *fcp = (funccall_T *)cookie;
ufunc_T *fp = fcp->func;
@@ -25393,8 +24461,7 @@ func_line_end(cookie)
* return was encountered or an error occurred. Used inside a ":while".
*/
int
-func_has_ended(cookie)
- void *cookie;
+func_has_ended(void *cookie)
{
funccall_T *fcp = (funccall_T *)cookie;
@@ -25408,8 +24475,8 @@ func_has_ended(cookie)
* return TRUE if cookie indicates a function which "abort"s on errors.
*/
int
-func_has_abort(cookie)
- void *cookie;
+func_has_abort(
+ void *cookie)
{
return ((funccall_T *)cookie)->func->uf_flags & FC_ABORT;
}
@@ -25425,8 +24492,7 @@ typedef enum
static var_flavour_T var_flavour(char_u *varname);
static var_flavour_T
-var_flavour(varname)
- char_u *varname;
+var_flavour(char_u *varname)
{
char_u *p = varname;
@@ -25447,9 +24513,7 @@ var_flavour(varname)
* Restore global vars that start with a capital from the viminfo file
*/
int
-read_viminfo_varlist(virp, writing)
- vir_T *virp;
- int writing;
+read_viminfo_varlist(vir_T *virp, int writing)
{
char_u *tab;
int type = VAR_NUMBER;
@@ -25522,8 +24586,7 @@ read_viminfo_varlist(virp, writing)
* Write global vars that start with a capital to the viminfo file
*/
void
-write_viminfo_varlist(fp)
- FILE *fp;
+write_viminfo_varlist(FILE *fp)
{
hashitem_T *hi;
dictitem_T *this_var;
@@ -25571,8 +24634,7 @@ write_viminfo_varlist(fp)
#if defined(FEAT_SESSION) || defined(PROTO)
int
-store_session_globals(fd)
- FILE *fd;
+store_session_globals(FILE *fd)
{
hashitem_T *hi;
dictitem_T *this_var;
@@ -25644,8 +24706,7 @@ store_session_globals(fd)
* Should only be invoked when 'verbose' is non-zero.
*/
void
-last_set_msg(scriptID)
- scid_T scriptID;
+last_set_msg(scid_T scriptID)
{
char_u *p;
@@ -25667,8 +24728,7 @@ last_set_msg(scriptID)
* List v:oldfiles in a nice way.
*/
void
-ex_oldfiles(eap)
- exarg_T *eap UNUSED;
+ex_oldfiles(exarg_T *eap UNUSED)
{
list_T *l = vimvars[VV_OLDFILES].vv_list;
listitem_T *li;
@@ -25720,7 +24780,7 @@ ex_oldfiles(eap)
/* reset v:option_new, v:option_old and v:option_type */
void
-reset_v_option_vars()
+reset_v_option_vars(void)
{
set_vim_var_string(VV_OPTION_NEW, NULL, -1);
set_vim_var_string(VV_OPTION_OLD, NULL, -1);
@@ -25750,10 +24810,7 @@ static int shortpath_for_partial(char_u **fnamep, char_u **bufp, int *fnamelen);
* Returns OK on success, FAIL on failure.
*/
static int
-get_short_pathname(fnamep, bufp, fnamelen)
- char_u **fnamep;
- char_u **bufp;
- int *fnamelen;
+get_short_pathname(char_u **fnamep, char_u **bufp, int *fnamelen)
{
int l, len;
char_u *newbuf;
@@ -25795,10 +24852,10 @@ get_short_pathname(fnamep, bufp, fnamelen)
* Returns OK on success (or nothing done) and FAIL on failure (out of memory).
*/
static int
-shortpath_for_invalid_fname(fname, bufp, fnamelen)
- char_u **fname;
- char_u **bufp;
- int *fnamelen;
+shortpath_for_invalid_fname(
+ char_u **fname,
+ char_u **bufp,
+ int *fnamelen)
{
char_u *short_fname, *save_fname, *pbuf_unused;
char_u *endp, *save_endp;
@@ -25902,10 +24959,10 @@ theend:
* Returns OK for success, FAIL for failure.
*/
static int
-shortpath_for_partial(fnamep, bufp, fnamelen)
- char_u **fnamep;
- char_u **bufp;
- int *fnamelen;
+shortpath_for_partial(
+ char_u **fnamep,
+ char_u **bufp,
+ int *fnamelen)
{
int sepcount, len, tflen;
char_u *p;
@@ -25986,12 +25043,12 @@ shortpath_for_partial(fnamep, bufp, fnamelen)
* When there is an error, *fnamep is set to NULL.
*/
int
-modify_fname(src, usedlen, fnamep, bufp, fnamelen)
- char_u *src; /* string with modifiers */
- int *usedlen; /* characters after src that are used */
- char_u **fnamep; /* file name so far */
- char_u **bufp; /* buffer for allocated file name or NULL */
- int *fnamelen; /* length of fnamep */
+modify_fname(
+ char_u *src, /* string with modifiers */
+ int *usedlen, /* characters after src that are used */
+ char_u **fnamep, /* file name so far */
+ char_u **bufp, /* buffer for allocated file name or NULL */
+ int *fnamelen) /* length of fnamep */
{
int valid = 0;
char_u *tail;
@@ -26375,11 +25432,11 @@ repeat:
* Returns an allocated string, NULL for error.
*/
char_u *
-do_string_sub(str, pat, sub, flags)
- char_u *str;
- char_u *pat;
- char_u *sub;
- char_u *flags;
+do_string_sub(
+ char_u *str,
+ char_u *pat,
+ char_u *sub,
+ char_u *flags)
{
int sublen;
regmatch_T regmatch;