summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-01-30 15:52:46 +0100
committerBram Moolenaar <Bram@vim.org>2016-01-30 15:52:46 +0100
commit78c0b7d43e5048fd71d12816659667834170c76d (patch)
treef2b1c0d69cb07d050087eb1695f5c4457248d94c /src
parent7454a06e2642d2b37afad1c5e71cec68081ca4ff (diff)
downloadvim-78c0b7d43e5048fd71d12816659667834170c76d.zip
patch 7.4.1206
Problem: Using old style function declarations. Solution: Change to new style function declarations. (script by Hirohito Higashi)
Diffstat (limited to 'src')
-rw-r--r--src/ex_cmds.c358
-rw-r--r--src/ex_cmds2.c386
-rw-r--r--src/ex_docmd.c841
-rw-r--r--src/ex_eval.c145
-rw-r--r--src/ex_getln.c431
-rw-r--r--src/farsi.c93
-rw-r--r--src/fileio.c519
-rw-r--r--src/version.c2
8 files changed, 1101 insertions, 1674 deletions
diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index e9630ee07..9b2a1932f 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -44,8 +44,7 @@ static void prepare_help_buffer(void);
* ":ascii" and "ga".
*/
void
-do_ascii(eap)
- exarg_T *eap UNUSED;
+do_ascii(exarg_T *eap UNUSED)
{
int c;
int cval;
@@ -144,8 +143,7 @@ do_ascii(eap)
* ":left", ":center" and ":right": align text.
*/
void
-ex_align(eap)
- exarg_T *eap;
+ex_align(exarg_T *eap)
{
pos_T save_curpos;
int len;
@@ -247,8 +245,7 @@ ex_align(eap)
* Get the length of the current line, excluding trailing white space.
*/
static int
-linelen(has_tab)
- int *has_tab;
+linelen(int *has_tab)
{
char_u *line;
char_u *first;
@@ -315,9 +312,7 @@ sort_compare(const void *s1, const void *s2);
#ifdef __BORLANDC__
_RTLENTRYF
#endif
-sort_compare(s1, s2)
- const void *s1;
- const void *s2;
+sort_compare(const void *s1, const void *s2)
{
sorti_T l1 = *(sorti_T *)s1;
sorti_T l2 = *(sorti_T *)s2;
@@ -368,8 +363,7 @@ sort_compare(s1, s2)
* ":sort".
*/
void
-ex_sort(eap)
- exarg_T *eap;
+ex_sort(exarg_T *eap)
{
regmatch_T regmatch;
int len;
@@ -648,8 +642,7 @@ sortend:
* ":retab".
*/
void
-ex_retab(eap)
- exarg_T *eap;
+ex_retab(exarg_T *eap)
{
linenr_T lnum;
int got_tab = FALSE;
@@ -798,10 +791,7 @@ ex_retab(eap)
* return FAIL for failure, OK otherwise
*/
int
-do_move(line1, line2, dest)
- linenr_T line1;
- linenr_T line2;
- linenr_T dest;
+do_move(linenr_T line1, linenr_T line2, linenr_T dest)
{
char_u *str;
linenr_T l;
@@ -929,10 +919,7 @@ do_move(line1, line2, dest)
* ":copy"
*/
void
-ex_copy(line1, line2, n)
- linenr_T line1;
- linenr_T line2;
- linenr_T n;
+ex_copy(linenr_T line1, linenr_T line2, linenr_T n)
{
linenr_T count;
char_u *p;
@@ -987,7 +974,7 @@ static char_u *prevcmd = NULL; /* the previous command */
#if defined(EXITFREE) || defined(PROTO)
void
-free_prev_shellcmd()
+free_prev_shellcmd(void)
{
vim_free(prevcmd);
}
@@ -999,11 +986,12 @@ free_prev_shellcmd()
* Remember the argument.
*/
void
-do_bang(addr_count, eap, forceit, do_in, do_out)
- int addr_count;
- exarg_T *eap;
- int forceit;
- int do_in, do_out;
+do_bang(
+ int addr_count,
+ exarg_T *eap,
+ int forceit,
+ int do_in,
+ int do_out)
{
char_u *arg = eap->arg; /* command */
linenr_T line1 = eap->line1; /* start of range */
@@ -1165,11 +1153,13 @@ do_bang(addr_count, eap, forceit, do_in, do_out)
* We use output redirection if do_out is TRUE.
*/
static void
-do_filter(line1, line2, eap, cmd, do_in, do_out)
- linenr_T line1, line2;
- exarg_T *eap; /* for forced 'ff' and 'fenc' */
- char_u *cmd;
- int do_in, do_out;
+do_filter(
+ linenr_T line1,
+ linenr_T line2,
+ exarg_T *eap, /* for forced 'ff' and 'fenc' */
+ char_u *cmd,
+ int do_in,
+ int do_out)
{
char_u *itmp = NULL;
char_u *otmp = NULL;
@@ -1445,9 +1435,9 @@ filterend:
* When "cmd" is NULL start an interactive shell.
*/
void
-do_shell(cmd, flags)
- char_u *cmd;
- int flags; /* may be SHELL_DOOUT when output is redirected */
+do_shell(
+ char_u *cmd,
+ int flags) /* may be SHELL_DOOUT when output is redirected */
{
buf_T *buf;
#ifndef FEAT_GUI_MSWIN
@@ -1628,10 +1618,10 @@ do_shell(cmd, flags)
* Returns an allocated string with the shell command, or NULL for failure.
*/
char_u *
-make_filter_cmd(cmd, itmp, otmp)
- char_u *cmd; /* command */
- char_u *itmp; /* NULL or name of input file */
- char_u *otmp; /* NULL or name of output file */
+make_filter_cmd(
+ char_u *cmd, /* command */
+ char_u *itmp, /* NULL or name of input file */
+ char_u *otmp) /* NULL or name of output file */
{
char_u *buf;
long_u len;
@@ -1723,11 +1713,11 @@ make_filter_cmd(cmd, itmp, otmp)
* STRLEN(opt) + STRLEN(fname) + 3
*/
void
-append_redir(buf, buflen, opt, fname)
- char_u *buf;
- int buflen;
- char_u *opt;
- char_u *fname;
+append_redir(
+ char_u *buf,
+ int buflen,
+ char_u *opt,
+ char_u *fname)
{
char_u *p;
char_u *end;
@@ -1764,7 +1754,7 @@ static void write_viminfo_barlines(vir_T *virp, FILE *fp_out);
static int viminfo_errcnt;
static int
-no_viminfo()
+no_viminfo(void)
{
/* "vim -i NONE" does not read or write a viminfo file */
return (use_viminfo != NULL && STRCMP(use_viminfo, "NONE") == 0);
@@ -1775,10 +1765,7 @@ no_viminfo()
* Count the number of errors. When there are more than 10, return TRUE.
*/
int
-viminfo_error(errnum, message, line)
- char *errnum;
- char *message;
- char_u *line;
+viminfo_error(char *errnum, char *message, char_u *line)
{
vim_snprintf((char *)IObuff, IOSIZE, _("%sviminfo: %s in line: "),
errnum, message);
@@ -1799,9 +1786,9 @@ viminfo_error(errnum, message, line)
* set are not over-written unless "flags" includes VIF_FORCEIT. -- webb
*/
int
-read_viminfo(file, flags)
- char_u *file; /* file name or NULL to use default name */
- int flags; /* VIF_WANT_INFO et al. */
+read_viminfo(
+ char_u *file, /* file name or NULL to use default name */
+ int flags) /* VIF_WANT_INFO et al. */
{
FILE *fp;
char_u *fname;
@@ -1845,9 +1832,7 @@ read_viminfo(file, flags)
* info is written to the file.
*/
void
-write_viminfo(file, forceit)
- char_u *file;
- int forceit;
+write_viminfo(char_u *file, int forceit)
{
char_u *fname;
FILE *fp_in = NULL; /* input viminfo file, if any */
@@ -2120,8 +2105,7 @@ end:
* Returns an allocated string. NULL when out of memory.
*/
static char_u *
-viminfo_filename(file)
- char_u *file;
+viminfo_filename(char_u *file)
{
if (file == NULL || *file == NUL)
{
@@ -2158,10 +2142,7 @@ viminfo_filename(file)
* do_viminfo() -- Should only be called from read_viminfo() & write_viminfo().
*/
static void
-do_viminfo(fp_in, fp_out, flags)
- FILE *fp_in;
- FILE *fp_out;
- int flags;
+do_viminfo(FILE *fp_in, FILE *fp_out, int flags)
{
int count = 0;
int eof = FALSE;
@@ -2232,10 +2213,10 @@ do_viminfo(fp_in, fp_out, flags)
* are local to a file. Returns TRUE when end-of-file is reached. -- webb
*/
static int
-read_viminfo_up_to_marks(virp, forceit, writing)
- vir_T *virp;
- int forceit;
- int writing;
+read_viminfo_up_to_marks(
+ vir_T *virp,
+ int forceit,
+ int writing)
{
int eof;
buf_T *buf;
@@ -2331,8 +2312,7 @@ read_viminfo_up_to_marks(virp, forceit, writing)
* conversion of text with iconv() in viminfo_readstring().
*/
static int
-viminfo_encoding(virp)
- vir_T *virp;
+viminfo_encoding(vir_T *virp)
{
#ifdef FEAT_MBYTE
char_u *p;
@@ -2361,8 +2341,7 @@ viminfo_encoding(virp)
* Returns TRUE for end-of-file;
*/
int
-viminfo_readline(virp)
- vir_T *virp;
+viminfo_readline(vir_T *virp)
{
return vim_fgets(virp->vir_line, LSIZE, virp->vir_fd);
}
@@ -2378,10 +2357,10 @@ viminfo_readline(virp)
* Return the string in allocated memory (NULL when out of memory).
*/
char_u *
-viminfo_readstring(virp, off, convert)
- vir_T *virp;
- int off; /* offset for virp->vir_line */
- int convert UNUSED; /* convert the string */
+viminfo_readstring(
+ vir_T *virp,
+ int off, /* offset for virp->vir_line */
+ int convert UNUSED) /* convert the string */
{
char_u *retval;
char_u *s, *d;
@@ -2451,9 +2430,7 @@ viminfo_readstring(virp, off, convert)
* - write " < <string> \n " in second line
*/
void
-viminfo_writestring(fd, p)
- FILE *fd;
- char_u *p;
+viminfo_writestring(FILE *fd, char_u *p)
{
int c;
char_u *s;
@@ -2509,8 +2486,7 @@ write_viminfo_barlines(vir_T *virp, FILE *fp_out)
* not ^? ^?
*/
void
-do_fixdel(eap)
- exarg_T *eap UNUSED;
+do_fixdel(exarg_T *eap UNUSED)
{
char_u *p;
@@ -2520,10 +2496,10 @@ do_fixdel(eap)
}
void
-print_line_no_prefix(lnum, use_number, list)
- linenr_T lnum;
- int use_number;
- int list;
+print_line_no_prefix(
+ linenr_T lnum,
+ int use_number,
+ int list)
{
char_u numbuf[30];
@@ -2540,10 +2516,7 @@ print_line_no_prefix(lnum, use_number, list)
* Print a text line. Also in silent mode ("ex -s").
*/
void
-print_line(lnum, use_number, list)
- linenr_T lnum;
- int use_number;
- int list;
+print_line(linenr_T lnum, int use_number, int list)
{
int save_silent = silent_mode;
@@ -2562,8 +2535,7 @@ print_line(lnum, use_number, list)
}
int
-rename_buffer(new_fname)
- char_u *new_fname;
+rename_buffer(char_u *new_fname)
{
char_u *fname, *sfname, *xfname;
buf_T *buf;
@@ -2618,8 +2590,7 @@ rename_buffer(new_fname)
* ":file[!] [fname]".
*/
void
-ex_file(eap)
- exarg_T *eap;
+ex_file(exarg_T *eap)
{
/* ":0file" removes the file name. Check for illegal uses ":3file",
* "0file name", etc. */
@@ -2645,8 +2616,7 @@ ex_file(eap)
* ":update".
*/
void
-ex_update(eap)
- exarg_T *eap;
+ex_update(exarg_T *eap)
{
if (curbufIsChanged())
(void)do_write(eap);
@@ -2656,8 +2626,7 @@ ex_update(eap)
* ":write" and ":saveas".
*/
void
-ex_write(eap)
- exarg_T *eap;
+ex_write(exarg_T *eap)
{
if (eap->usefilter) /* input lines to shell command */
do_bang(1, eap, FALSE, TRUE, FALSE);
@@ -2674,8 +2643,7 @@ ex_write(eap)
* return FAIL for failure, OK otherwise
*/
int
-do_write(eap)
- exarg_T *eap;
+do_write(exarg_T *eap)
{
int other;
char_u *fname = NULL; /* init to shut up gcc */
@@ -2886,13 +2854,13 @@ theend:
* Return OK if it's OK, FAIL if it is not.
*/
int
-check_overwrite(eap, buf, fname, ffname, other)
- exarg_T *eap;
- buf_T *buf;
- char_u *fname; /* file name to be used (can differ from
+check_overwrite(
+ exarg_T *eap,
+ buf_T *buf,
+ char_u *fname, /* file name to be used (can differ from
buf->ffname) */
- char_u *ffname; /* full path version of fname */
- int other; /* writing under other name */
+ char_u *ffname, /* full path version of fname */
+ int other) /* writing under other name */
{
/*
* write to other file or b_flags set or not writing the whole file:
@@ -3005,8 +2973,7 @@ check_overwrite(eap, buf, fname, ffname, other)
* Handle ":wnext", ":wNext" and ":wprevious" commands.
*/
void
-ex_wnext(eap)
- exarg_T *eap;
+ex_wnext(exarg_T *eap)
{
int i;
@@ -3024,8 +2991,7 @@ ex_wnext(eap)
* ":wall", ":wqall" and ":xall": Write all changed files (and exit).
*/
void
-do_wqall(eap)
- exarg_T *eap;
+do_wqall(exarg_T *eap)
{
buf_T *buf;
int error = 0;
@@ -3092,7 +3058,7 @@ do_wqall(eap)
* Return TRUE and give a message when it's not st.
*/
int
-not_writing()
+not_writing(void)
{
if (p_write)
return FALSE;
@@ -3106,9 +3072,7 @@ not_writing()
* message when the buffer is readonly.
*/
static int
-check_readonly(forceit, buf)
- int *forceit;
- buf_T *buf;
+check_readonly(int *forceit, buf_T *buf)
{
struct stat st;
@@ -3163,13 +3127,13 @@ check_readonly(forceit, buf)
* 'lnum' is the line number for the cursor in the new file (if non-zero).
*/
int
-getfile(fnum, ffname, sfname, setpm, lnum, forceit)
- int fnum;
- char_u *ffname;
- char_u *sfname;
- int setpm;
- linenr_T lnum;
- int forceit;
+getfile(
+ int fnum,
+ char_u *ffname,
+ char_u *sfname,
+ int setpm,
+ linenr_T lnum,
+ int forceit)
{
int other;
int retval;
@@ -3264,14 +3228,14 @@ theend:
* return FAIL for failure, OK otherwise
*/
int
-do_ecmd(fnum, ffname, sfname, eap, newlnum, flags, oldwin)
- int fnum;
- char_u *ffname;
- char_u *sfname;
- exarg_T *eap; /* can be NULL! */
- linenr_T newlnum;
- int flags;
- win_T *oldwin;
+do_ecmd(
+ int fnum,
+ char_u *ffname,
+ char_u *sfname,
+ exarg_T *eap, /* can be NULL! */
+ linenr_T newlnum,
+ int flags,
+ win_T *oldwin)
{
int other_file; /* TRUE if editing another file */
int oldbuf; /* TRUE if using existing buffer */
@@ -3982,8 +3946,7 @@ theend:
#ifdef FEAT_AUTOCMD
static void
-delbuf_msg(name)
- char_u *name;
+delbuf_msg(char_u *name)
{
EMSG2(_("E143: Autocommands unexpectedly deleted new buffer %s"),
name == NULL ? (char_u *)"" : name);
@@ -3998,8 +3961,7 @@ static int append_indent = 0; /* autoindent for first line */
* ":insert" and ":append", also used by ":change"
*/
void
-ex_append(eap)
- exarg_T *eap;
+ex_append(exarg_T *eap)
{
char_u *theline;
int did_undo = FALSE;
@@ -4143,8 +4105,7 @@ ex_append(eap)
* ":change"
*/
void
-ex_change(eap)
- exarg_T *eap;
+ex_change(exarg_T *eap)
{
linenr_T lnum;
@@ -4173,8 +4134,7 @@ ex_change(eap)
}
void
-ex_z(eap)
- exarg_T *eap;
+ex_z(exarg_T *eap)
{
char_u *x;
int bigness;
@@ -4304,7 +4264,7 @@ ex_z(eap)
* Otherwise, return FALSE.
*/
int
-check_restricted()
+check_restricted(void)
{
if (restricted)
{
@@ -4320,7 +4280,7 @@ check_restricted()
* Otherwise, return FALSE.
*/
int
-check_secure()
+check_secure(void)
{
if (secure)
{
@@ -4355,8 +4315,7 @@ static int global_need_beginline; /* call beginline() after ":g" */
* The usual escapes are supported as described in the regexp docs.
*/
void
-do_sub(eap)
- exarg_T *eap;
+do_sub(exarg_T *eap)
{
linenr_T lnum;
long i = 0;
@@ -5434,8 +5393,8 @@ outofmem:
* Return TRUE if a message was given.
*/
int
-do_sub_msg(count_only)
- int count_only; /* used 'n' flag for ":s" */
+do_sub_msg(
+ int count_only) /* used 'n' flag for ":s" */
{
/*
* Only report substitutions when:
@@ -5494,8 +5453,7 @@ do_sub_msg(count_only)
* lines we do not know where to search for the next match.
*/
void
-ex_global(eap)
- exarg_T *eap;
+ex_global(exarg_T *eap)
{
linenr_T lnum; /* line number according to old situation */
int ndone = 0;
@@ -5615,8 +5573,7 @@ ex_global(eap)
* Execute "cmd" on lines marked with ml_setmarked().
*/
void
-global_exe(cmd)
- char_u *cmd;
+global_exe(char_u *cmd)
{
linenr_T old_lcount; /* b_ml.ml_line_count before the command */
buf_T *old_buf = curbuf; /* remember what buffer we started in */
@@ -5673,9 +5630,7 @@ global_exe(cmd)
#ifdef FEAT_VIMINFO
int
-read_viminfo_sub_string(virp, force)
- vir_T *virp;
- int force;
+read_viminfo_sub_string(vir_T *virp, int force)
{
if (force)
vim_free(old_sub);
@@ -5685,8 +5640,7 @@ read_viminfo_sub_string(virp, force)
}
void
-write_viminfo_sub_string(fp)
- FILE *fp;
+write_viminfo_sub_string(FILE *fp)
{
if (get_viminfo_parameter('/') != 0 && old_sub != NULL)
{
@@ -5698,7 +5652,7 @@ write_viminfo_sub_string(fp)
#if defined(EXITFREE) || defined(PROTO)
void
-free_old_sub()
+free_old_sub(void)
{
vim_free(old_sub);
}
@@ -5710,8 +5664,8 @@ free_old_sub()
* Return TRUE when it was created.
*/
int
-prepare_tagpreview(undo_sync)
- int undo_sync; /* sync undo when leaving the window */
+prepare_tagpreview(
+ int undo_sync) /* sync undo when leaving the window */
{
win_T *wp;
@@ -5760,8 +5714,7 @@ prepare_tagpreview(undo_sync)
* ":help": open a read-only window on a help file
*/
void
-ex_help(eap)
- exarg_T *eap;
+ex_help(exarg_T *eap)
{
char_u *arg;
char_u *tag;
@@ -5978,8 +5931,7 @@ erret:
* ":helpclose": Close one help window
*/
void
-ex_helpclose(eap)
- exarg_T *eap UNUSED;
+ex_helpclose(exarg_T *eap UNUSED)
{
#if defined(FEAT_WINDOWS)
win_T *win;
@@ -6002,8 +5954,7 @@ ex_helpclose(eap)
* Returns NULL if not found.
*/
char_u *
-check_help_lang(arg)
- char_u *arg;
+check_help_lang(char_u *arg)
{
int len = (int)STRLEN(arg);
@@ -6029,10 +5980,10 @@ check_help_lang(arg)
* match some string for which help is requested. webb.
*/
int
-help_heuristic(matched_string, offset, wrong_case)
- char_u *matched_string;
- int offset; /* offset for match */
- int wrong_case; /* no matching case */
+help_heuristic(
+ char_u *matched_string,
+ int offset, /* offset for match */
+ int wrong_case) /* no matching case */
{
int num_letters;
char_u *p;
@@ -6073,9 +6024,7 @@ help_heuristic(matched_string, offset, wrong_case)
#ifdef __BORLANDC__
_RTLENTRYF
#endif
-help_compare(s1, s2)
- const void *s1;
- const void *s2;
+help_compare(const void *s1, const void *s2)
{
char *p1;
char *p2;
@@ -6092,11 +6041,11 @@ help_compare(s1, s2)
* When "keep_lang" is TRUE try keeping the language of the current buffer.
*/
int
-find_help_tags(arg, num_matches, matches, keep_lang)
- char_u *arg;
- int *num_matches;
- char_u ***matches;
- int keep_lang;
+find_help_tags(
+ char_u *arg,
+ int *num_matches,
+ char_u ***matches,
+ int keep_lang)
{
char_u *s, *d;
int i;
@@ -6300,7 +6249,7 @@ find_help_tags(arg, num_matches, matches, keep_lang)
* Called when starting to edit a buffer for a help file.
*/
static void
-prepare_help_buffer()
+prepare_help_buffer(void)
{
char_u *p;
@@ -6368,7 +6317,7 @@ prepare_help_buffer()
* highlighting is not used.
*/
void
-fix_help_buffer()
+fix_help_buffer(void)
{
linenr_T lnum;
char_u *line;
@@ -6610,8 +6559,7 @@ fix_help_buffer()
* ":exusage"
*/
void
-ex_exusage(eap)
- exarg_T *eap UNUSED;
+ex_exusage(exarg_T *eap UNUSED)
{
do_cmdline_cmd((char_u *)"help ex-cmd-index");
}
@@ -6620,8 +6568,7 @@ ex_exusage(eap)
* ":viusage"
*/
void
-ex_viusage(eap)
- exarg_T *eap UNUSED;
+ex_viusage(exarg_T *eap UNUSED)
{
do_cmdline_cmd((char_u *)"help normal-index");
}
@@ -6633,8 +6580,7 @@ static void helptags_one(char_u *dir, char_u *ext, char_u *lang, int add_help_ta
* ":helptags"
*/
void
-ex_helptags(eap)
- exarg_T *eap;
+ex_helptags(exarg_T *eap)
{
garray_T ga;
int i, j;
@@ -6758,11 +6704,11 @@ ex_helptags(eap)
}
static void
-helptags_one(dir, ext, tagfname, add_help_tags)
- char_u *dir; /* doc directory */
- char_u *ext; /* suffix, ".txt", ".itx", ".frx", etc. */
- char_u *tagfname; /* "tags" for English, "tags-fr" for French. */
- int add_help_tags; /* add "help-tags" tag */
+helptags_one(
+ char_u *dir, /* doc directory */
+ char_u *ext, /* suffix, ".txt", ".itx", ".frx", etc. */
+ char_u *tagfname, /* "tags" for English, "tags-fr" for French. */
+ int add_help_tags) /* add "help-tags" tag */
{
FILE *fd_tags;
FILE *fd;
@@ -7064,9 +7010,9 @@ static char *cmds[] = {
* "*end_cmd" must be writable.
*/
static int
-sign_cmd_idx(begin_cmd, end_cmd)
- char_u *begin_cmd; /* begin of sign subcmd */
- char_u *end_cmd; /* just after sign subcmd */
+sign_cmd_idx(
+ char_u *begin_cmd, /* begin of sign subcmd */
+ char_u *end_cmd) /* just after sign subcmd */
{
int idx;
char save = *end_cmd;
@@ -7083,8 +7029,7 @@ sign_cmd_idx(begin_cmd, end_cmd)
* ":sign" command
*/
void
-ex_sign(eap)
- exarg_T *eap;
+ex_sign(exarg_T *eap)
{
char_u *arg = eap->arg;
char_u *p;
@@ -7490,7 +7435,7 @@ ex_sign(eap)
* signs before it starts.
*/
void
-sign_gui_started()
+sign_gui_started(void)
{
sign_T *sp;
@@ -7504,8 +7449,7 @@ sign_gui_started()
* List one sign.
*/
static void
-sign_list_defined(sp)
- sign_T *sp;
+sign_list_defined(sign_T *sp)
{
char_u *p;
@@ -7550,9 +7494,7 @@ sign_list_defined(sp)
* Undefine a sign and free its memory.
*/
static void
-sign_undefine(sp, sp_prev)
- sign_T *sp;
- sign_T *sp_prev;
+sign_undefine(sign_T *sp, sign_T *sp_prev)
{
vim_free(sp->sn_name);
vim_free(sp->sn_icon);
@@ -7576,9 +7518,7 @@ sign_undefine(sp, sp_prev)
* If "line" is TRUE: line highl, if FALSE: text highl.
*/
int
-sign_get_attr(typenr, line)
- int typenr;
- int line;
+sign_get_attr(int typenr, int line)
{
sign_T *sp;
@@ -7605,8 +7545,7 @@ sign_get_attr(typenr, line)
* Returns NULL if there isn't one.
*/
char_u *
-sign_get_text(typenr)
- int typenr;
+sign_get_text(int typenr)
{
sign_T *sp;
@@ -7618,8 +7557,8 @@ sign_get_text(typenr)
# if defined(FEAT_SIGN_ICONS) || defined(PROTO)
void *
-sign_get_image(typenr)
- int typenr; /* the attribute which may have a sign */
+sign_get_image(
+ int typenr) /* the attribute which may have a sign */
{
sign_T *sp;
@@ -7634,8 +7573,7 @@ sign_get_image(typenr)
* Get the name of a sign by its typenr.
*/
char_u *
-sign_typenr2name(typenr)
- int typenr;
+sign_typenr2name(int typenr)
{
sign_T *sp;
@@ -7650,7 +7588,7 @@ sign_typenr2name(typenr)
* Undefine/free all signs.
*/
void
-free_signs()
+free_signs(void)
{
while (first_sign != NULL)
sign_undefine(first_sign, NULL);
@@ -7672,9 +7610,7 @@ static enum
* expansion.
*/
char_u *
-get_sign_name(xp, idx)
- expand_T *xp UNUSED;
- int idx;
+get_sign_name(expand_T *xp UNUSED, int idx)
{
sign_T *sp;
int current_idx;
@@ -7720,9 +7656,7 @@ get_sign_name(xp, idx)
* Handle command line completion for :sign command.
*/
void
-set_context_in_sign_cmd(xp, arg)
- expand_T *xp;
- char_u *arg;
+set_context_in_sign_cmd(expand_T *xp, char_u *arg)
{
char_u *p;
char_u *end_subcmd;
@@ -7842,8 +7776,7 @@ set_context_in_sign_cmd(xp, arg)
* Make the user happy.
*/
void
-ex_smile(eap)
- exarg_T *eap UNUSED;
+ex_smile(exarg_T *eap UNUSED)
{
static char *code = "\34 \4o\14$\4ox\30 \2o\30$\1ox\25 \2o\36$\1o\11 \1o\1$\3 \2$\1 \1o\1$x\5 \1o\1 \1$\1 \2o\10 \1o\44$\1o\7 \2$\1 \2$\1 \2$\1o\1$x\2 \2o\1 \1$\1 \1$\1 \1\"\1$\6 \1o\11$\4 \15$\4 \11$\1o\7 \3$\1o\2$\1o\1$x\2 \1\"\6$\1o\1$\5 \1o\11$\6 \13$\6 \12$\1o\4 \10$x\4 \7$\4 \13$\6 \13$\6 \27$x\4 \27$\4 \15$\4 \16$\2 \3\"\3$x\5 \1\"\3$\4\"\61$\5 \1\"\3$x\6 \3$\3 \1o\62$\5 \1\"\3$\1ox\5 \1o\2$\1\"\3 \63$\7 \3$\1ox\5 \3$\4 \55$\1\"\1 \1\"\6$\5o\4$\1ox\4 \1o\3$\4o\5$\2 \45$\3 \1o\21$x\4 \10$\1\"\4$\3 \42$\5 \4$\10\"x\3 \4\"\7 \4$\4 \1\"\34$\1\"\6 \1o\3$x\16 \1\"\3$\1o\5 \3\"\22$\1\"\2$\1\"\11 \3$x\20 \3$\1o\12 \1\"\2$\2\"\6$\4\"\13 \1o\3$x\21 \4$\1o\40 \1o\3$\1\"x\22 \1\"\4$\1o\6 \1o\6$\1o\1\"\4$\1o\10 \1o\4$x\24 \1\"\5$\2o\5 \2\"\4$\1o\5$\1o\3 \1o\4$\2\"x\27 \2\"\5$\4o\2 \1\"\3$\1o\11$\3\"x\32 \2\"\7$\2o\1 \12$x\42 \4\"\13$x\46 \14$x\47 \12$\1\"x\50 \1\"\3$\4\"x";
char *p;
@@ -7870,8 +7803,7 @@ ex_smile(eap)
* the argument list is redefined.
*/
void
-ex_drop(eap)
- exarg_T *eap;
+ex_drop(exarg_T *eap)
{
int split = FALSE;
win_T *wp;
diff --git a/src/ex_cmds2.c b/src/ex_cmds2.c
index 67ec84b6a..c1adea4c7 100644
--- a/src/ex_cmds2.c
+++ b/src/ex_cmds2.c
@@ -78,8 +78,7 @@ static void do_showbacktrace(char_u *cmd);
* Repeatedly get Ex commands, until told to continue normal execution.
*/
void
-do_debug(cmd)
- char_u *cmd;
+do_debug(char_u *cmd)
{
int save_msg_scroll = msg_scroll;
int save_State = State;
@@ -433,8 +432,7 @@ do_showbacktrace(char_u *cmd)
* ":debug".
*/
void
-ex_debug(eap)
- exarg_T *eap;
+ex_debug(exarg_T *eap)
{
int debug_break_level_save = debug_break_level;
@@ -464,8 +462,7 @@ static char_u *debug_skipped_name;
* Called from do_one_cmd() before executing a command.
*/
void
-dbg_check_breakpoint(eap)
- exarg_T *eap;
+dbg_check_breakpoint(exarg_T *eap)
{
char_u *p;
@@ -512,8 +509,7 @@ dbg_check_breakpoint(eap)
* set. Return TRUE when the debug mode is entered this time.
*/
int
-dbg_check_skipped(eap)
- exarg_T *eap;
+dbg_check_skipped(exarg_T *eap)
{
int prev_got_int;
@@ -572,9 +568,9 @@ static linenr_T debuggy_find(int file,char_u *fname, linenr_T after, garray_T *g
* Returns FAIL for failure.
*/
static int
-dbg_parsearg(arg, gap)
- char_u *arg;
- garray_T *gap; /* either &dbg_breakp or &prof_ga */
+dbg_parsearg(
+ char_u *arg,
+ garray_T *gap) /* either &dbg_breakp or &prof_ga */
{
char_u *p = arg;
char_u *q;
@@ -669,8 +665,7 @@ dbg_parsearg(arg, gap)
* ":breakadd".
*/
void
-ex_breakadd(eap)
- exarg_T *eap;
+ex_breakadd(exarg_T *eap)
{
struct debuggy *bp;
char_u *pat;
@@ -715,8 +710,7 @@ ex_breakadd(eap)
* ":debuggreedy".
*/
void
-ex_debuggreedy(eap)
- exarg_T *eap;
+ex_debuggreedy(exarg_T *eap)
{
if (eap->addr_count == 0 || eap->line2 != 0)
debug_greedy = TRUE;
@@ -728,8 +722,7 @@ ex_debuggreedy(eap)
* ":breakdel" and ":profdel".
*/
void
-ex_breakdel(eap)
- exarg_T *eap;
+ex_breakdel(exarg_T *eap)
{
struct debuggy *bp, *bpi;
int nr;
@@ -819,8 +812,7 @@ ex_breakdel(eap)
* ":breaklist".
*/
void
-ex_breaklist(eap)
- exarg_T *eap UNUSED;
+ex_breaklist(exarg_T *eap UNUSED)
{
struct debuggy *bp;
int i;
@@ -846,10 +838,10 @@ ex_breaklist(eap)
* Returns line number at which to break; zero when no matching breakpoint.
*/
linenr_T
-dbg_find_breakpoint(file, fname, after)
- int file; /* TRUE for a file, FALSE for a function */
- char_u *fname; /* file or function name */
- linenr_T after; /* after this line number */
+dbg_find_breakpoint(
+ int file, /* TRUE for a file, FALSE for a function */
+ char_u *fname, /* file or function name */
+ linenr_T after) /* after this line number */
{
return debuggy_find(file, fname, after, &dbg_breakp, NULL);
}
@@ -859,10 +851,10 @@ dbg_find_breakpoint(file, fname, after)
* Return TRUE if profiling is on for a function or sourced file.
*/
int
-has_profiling(file, fname, fp)
- int file; /* TRUE for a file, FALSE for a function */
- char_u *fname; /* file or function name */
- int *fp; /* return: forceit */
+has_profiling(
+ int file, /* TRUE for a file, FALSE for a function */
+ char_u *fname, /* file or function name */
+ int *fp) /* return: forceit */
{
return (debuggy_find(file, fname, (linenr_T)0, &prof_ga, fp)
!= (linenr_T)0);
@@ -873,12 +865,12 @@ has_profiling(file, fname, fp)
* Common code for dbg_find_breakpoint() and has_profiling().
*/
static linenr_T
-debuggy_find(file, fname, after, gap, fp)
- int file; /* TRUE for a file, FALSE for a function */
- char_u *fname; /* file or function name */
- linenr_T after; /* after this line number */
- garray_T *gap; /* either &dbg_breakp or &prof_ga */
- int *fp; /* if not NULL: return forceit */
+debuggy_find(
+ int file, /* TRUE for a file, FALSE for a function */
+ char_u *fname, /* file or function name */
+ linenr_T after, /* after this line number */
+ garray_T *gap, /* either &dbg_breakp or &prof_ga */
+ int *fp) /* if not NULL: return forceit */
{
struct debuggy *bp;
int i;
@@ -940,9 +932,7 @@ debuggy_find(file, fname, after, gap, fp)
* Called when a breakpoint was encountered.
*/
void
-dbg_breakpoint(name, lnum)
- char_u *name;
- linenr_T lnum;
+dbg_breakpoint(char_u *name, linenr_T lnum)
{
/* We need to check if this line is actually executed in do_one_cmd() */
debug_breakpoint_name = name;
@@ -955,8 +945,7 @@ dbg_breakpoint(name, lnum)
* Store the current time in "tm".
*/
void
-profile_start(tm)
- proftime_T *tm;
+profile_start(proftime_T *tm)
{
# ifdef WIN3264
QueryPerformanceCounter(tm);
@@ -969,8 +958,7 @@ profile_start(tm)
* Compute the elapsed time from "tm" till now and store in "tm".
*/
void
-profile_end(tm)
- proftime_T *tm;
+profile_end(proftime_T *tm)
{
proftime_T now;
@@ -993,8 +981,7 @@ profile_end(tm)
* Subtract the time "tm2" from "tm".
*/
void
-profile_sub(tm, tm2)
- proftime_T *tm, *tm2;
+profile_sub(proftime_T *tm, proftime_T *tm2)
{
# ifdef WIN3264
tm->QuadPart -= tm2->QuadPart;
@@ -1014,8 +1001,7 @@ profile_sub(tm, tm2)
* Uses a static buffer!
*/
char *
-profile_msg(tm)
- proftime_T *tm;
+profile_msg(proftime_T *tm)
{
static char buf[50];
@@ -1034,9 +1020,7 @@ profile_msg(tm)
* Put the time "msec" past now in "tm".
*/
void
-profile_setlimit(msec, tm)
- long msec;
- proftime_T *tm;
+profile_setlimit(long msec, proftime_T *tm)
{
if (msec <= 0) /* no limit */
profile_zero(tm);
@@ -1063,8 +1047,7 @@ profile_setlimit(msec, tm)
* Return TRUE if the current time is past "tm".
*/
int
-profile_passed_limit(tm)
- proftime_T *tm;
+profile_passed_limit(proftime_T *tm)
{
proftime_T now;
@@ -1086,8 +1069,7 @@ profile_passed_limit(tm)
* Set the time in "tm" to zero.
*/
void
-profile_zero(tm)
- proftime_T *tm;
+profile_zero(proftime_T *tm)
{
# ifdef WIN3264
tm->QuadPart = 0;
@@ -1108,10 +1090,7 @@ profile_zero(tm)
* Divide the time "tm" by "count" and store in "tm2".
*/
void
-profile_divide(tm, count, tm2)
- proftime_T *tm;
- proftime_T *tm2;
- int count;
+profile_divide(proftime_T *tm, int count, proftime_T *tm2)
{
if (count == 0)
profile_zero(tm2);
@@ -1141,8 +1120,7 @@ static proftime_T prof_wait_time;
* Add the time "tm2" to "tm".
*/
void
-profile_add(tm, tm2)
- proftime_T *tm, *tm2;
+profile_add(proftime_T *tm, proftime_T *tm2)
{
# ifdef WIN3264
tm->QuadPart += tm2->QuadPart;
@@ -1161,8 +1139,7 @@ profile_add(tm, tm2)
* Add the "self" time from the total time and the children's time.
*/
void
-profile_self(self, total, children)
- proftime_T *self, *total, *children;
+profile_self(proftime_T *self, proftime_T *total, proftime_T *children)
{
/* Check that the result won't be negative. Can happen with recursive
* calls. */
@@ -1183,8 +1160,7 @@ profile_self(self, total, children)
* Get the current waittime.
*/
void
-profile_get_wait(tm)
- proftime_T *tm;
+profile_get_wait(proftime_T *tm)
{
*tm = prof_wait_time;
}
@@ -1193,8 +1169,7 @@ profile_get_wait(tm)
* Subtract the passed waittime since "tm" from "tma".
*/
void
-profile_sub_wait(tm, tma)
- proftime_T *tm, *tma;
+profile_sub_wait(proftime_T *tm, proftime_T *tma)
{
proftime_T tm3 = prof_wait_time;
@@ -1206,8 +1181,7 @@ profile_sub_wait(tm, tma)
* Return TRUE if "tm1" and "tm2" are equal.
*/
int
-profile_equal(tm1, tm2)
- proftime_T *tm1, *tm2;
+profile_equal(proftime_T *tm1, proftime_T *tm2)
{
# ifdef WIN3264
return (tm1->QuadPart == tm2->QuadPart);
@@ -1220,8 +1194,7 @@ profile_equal(tm1, tm2)
* Return <0, 0 or >0 if "tm1" < "tm2", "tm1" == "tm2" or "tm1" > "tm2"
*/
int
-profile_cmp(tm1, tm2)
- const proftime_T *tm1, *tm2;
+profile_cmp(const proftime_T *tm1, const proftime_T *tm2)
{
# ifdef WIN3264
return (int)(tm2->QuadPart - tm1->QuadPart);
@@ -1239,8 +1212,7 @@ static proftime_T pause_time;
* ":profile cmd args"
*/
void
-ex_profile(eap)
- exarg_T *eap;
+ex_profile(exarg_T *eap)
{
char_u *e;
int len;
@@ -1308,9 +1280,7 @@ static char *pexpand_cmds[] = {
* specific expansion.
*/
char_u *
-get_profile_name(xp, idx)
- expand_T *xp UNUSED;
- int idx;
+get_profile_name(expand_T *xp UNUSED, int idx)
{
switch (pexpand_what)
{
@@ -1326,9 +1296,7 @@ get_profile_name(xp, idx)
* Handle command line completion for :profile command.
*/
void
-set_context_in_profile_cmd(xp, arg)
- expand_T *xp;
- char_u *arg;
+set_context_in_profile_cmd(expand_T *xp, char_u *arg)
{
char_u *end_subcmd;
@@ -1356,7 +1324,7 @@ set_context_in_profile_cmd(xp, arg)
* Dump the profiling info.
*/
void
-profile_dump()
+profile_dump(void)
{
FILE *fd;
@@ -1378,8 +1346,7 @@ profile_dump()
* Start profiling script "fp".
*/
static void
-script_do_profile(si)
- scriptitem_T *si;
+script_do_profile(scriptitem_T *si)
{
si->sn_pr_count = 0;
profile_zero(&si->sn_pr_total);
@@ -1395,8 +1362,8 @@ script_do_profile(si)
* save time when starting to invoke another script or function.
*/
void
-script_prof_save(tm)
- proftime_T *tm; /* place to store wait time */
+script_prof_save(
+ proftime_T *tm) /* place to store wait time */
{
scriptitem_T *si;
@@ -1413,8 +1380,7 @@ script_prof_save(tm)
* Count time spent in children after invoking another script or function.
*/
void
-script_prof_restore(tm)
- proftime_T *tm;
+script_prof_restore(proftime_T *tm)
{
scriptitem_T *si;
@@ -1437,7 +1403,7 @@ static proftime_T inchar_time;
* Called when starting to wait for the user to type a character.
*/
void
-prof_inchar_enter()
+prof_inchar_enter(void)
{
profile_start(&inchar_time);
}
@@ -1446,7 +1412,7 @@ prof_inchar_enter()
* Called when finished waiting for the user to type a character.
*/
void
-prof_inchar_exit()
+prof_inchar_exit(void)
{
profile_end(&inchar_time);
profile_add(&prof_wait_time, &inchar_time);
@@ -1456,8 +1422,7 @@ prof_inchar_exit()
* Dump the profiling results for all scripts in file "fd".
*/
static void
-script_dump_profile(fd)
- FILE *fd;
+script_dump_profile(FILE *fd)
{
int id;
scriptitem_T *si;
@@ -1515,7 +1480,7 @@ script_dump_profile(fd)
* profiled.
*/
int
-prof_def_func()
+prof_def_func(void)
{
if (current_SID > 0)
return SCRIPT_ITEM(current_SID).sn_pr_force;
@@ -1532,9 +1497,7 @@ prof_def_func()
* return FAIL for failure, OK otherwise
*/
int
-autowrite(buf, forceit)
- buf_T *buf;
- int forceit;
+autowrite(buf_T *buf, int forceit)
{
int r;
@@ -1558,7 +1521,7 @@ autowrite(buf, forceit)
* flush all buffers, except the ones that are readonly
*/
void
-autowrite_all()
+autowrite_all(void)
{
buf_T *buf;
@@ -1581,9 +1544,7 @@ autowrite_all()
* For flags use the CCGD_ values.
*/
int
-check_changed(buf, flags)
- buf_T *buf;
- int flags;
+check_changed(buf_T *buf, int flags)
{
int forceit = (flags & CCGD_FORCEIT);
@@ -1637,8 +1598,7 @@ check_changed(buf, flags)
* When wanting to write a file without a file name, ask the user for a name.
*/
void
-browse_save_fname(buf)
- buf_T *buf;
+browse_save_fname(buf_T *buf)
{
if (buf->b_fname == NULL)
{
@@ -1661,9 +1621,9 @@ browse_save_fname(buf)
* Must check 'write' option first!
*/
void
-dialog_changed(buf, checkall)
- buf_T *buf;
- int checkall; /* may abandon all changed buffers */
+dialog_changed(
+ buf_T *buf,
+ int checkall) /* may abandon all changed buffers */
{
char_u buff[DIALOG_MSG_SIZE];
int ret;
@@ -1746,9 +1706,7 @@ dialog_changed(buf, checkall)
* hidden, autowriting it or unloading it.
*/
int
-can_abandon(buf, forceit)
- buf_T *buf;
- int forceit;
+can_abandon(buf_T *buf, int forceit)
{
return ( P_HID(buf)
|| !bufIsChanged(buf)
@@ -1763,10 +1721,7 @@ static void add_bufnum(int *bufnrs, int *bufnump, int nr);
* Add a buffer number to "bufnrs", unless it's already there.
*/
static void
-add_bufnum(bufnrs, bufnump, nr)
- int *bufnrs;
- int *bufnump;
- int nr;
+add_bufnum(int *bufnrs, int *bufnump, int nr)
{
int i;
@@ -1784,9 +1739,9 @@ add_bufnum(bufnrs, bufnump, nr)
* hidden. This is used for ":q!".
*/
int
-check_changed_any(hidden, unload)
- int hidden; /* Only check hidden buffers */
- int unload;
+check_changed_any(
+ int hidden, /* Only check hidden buffers */
+ int unload)
{
int ret = FALSE;
buf_T *buf;
@@ -1909,7 +1864,7 @@ theend:
* give error message for FAIL
*/
int
-check_fname()
+check_fname(void)
{
if (curbuf->b_ffname == NULL)
{
@@ -1925,9 +1880,7 @@ check_fname()
* return FAIL for failure, OK otherwise
*/
int
-buf_write_all(buf, forceit)
- buf_T *buf;
- int forceit;
+buf_write_all(buf_T *buf, int forceit)
{
int retval;
#ifdef FEAT_AUTOCMD
@@ -1968,8 +1921,7 @@ static int alist_add_list(int count, char_u **files, int after);
* Return a pointer to the start of the next argument.
*/
static char_u *
-do_one_arg(str)
- char_u *str;
+do_one_arg(char_u *str)
{
char_u *p;
int inbacktick;
@@ -2005,9 +1957,7 @@ do_one_arg(str)
* growarray "gap".
*/
int
-get_arglist(gap, str)
- garray_T *gap;
- char_u *str;
+get_arglist(garray_T *gap, char_u *str)
{
ga_init2(gap, (int)sizeof(char_u *), 20);
while (*str != NUL)
@@ -2032,11 +1982,11 @@ get_arglist(gap, str)
* Return FAIL or OK.
*/
int
-get_arglist_exp(str, fcountp, fnamesp, wig)
- char_u *str;
- int *fcountp;
- char_u ***fnamesp;
- int wig;
+get_arglist_exp(
+ char_u *str,
+ int *fcountp,
+ char_u ***fnamesp,
+ int wig)
{
garray_T ga;
int i;
@@ -2060,8 +2010,7 @@ get_arglist_exp(str, fcountp, fnamesp, wig)
* Redefine the argument list.
*/
void
-set_arglist(str)
- char_u *str;
+set_arglist(char_u *str)
{
do_arglist(str, AL_SET, 0);
}
@@ -2075,10 +2024,10 @@ set_arglist(str)
* Return FAIL for failure, OK otherwise.
*/
static int
-do_arglist(str, what, after)
- char_u *str;
- int what UNUSED;
- int after UNUSED; /* 0 means before first one */
+do_arglist(
+ char_u *str,
+ int what UNUSED,
+ int after UNUSED) /* 0 means before first one */
{
garray_T new_ga;
int exp_count;
@@ -2183,7 +2132,7 @@ do_arglist(str, what, after)
* Check the validity of the arg_idx for each other window.
*/
static void
-alist_check_arg_idx()
+alist_check_arg_idx(void)
{
#ifdef FEAT_WINDOWS
win_T *win;
@@ -2202,8 +2151,7 @@ alist_check_arg_idx()
* index.
*/
static int
-editing_arg_idx(win)
- win_T *win;
+editing_arg_idx(win_T *win)
{
return !(win->w_arg_idx >= WARGCOUNT(win)
|| (win->w_buffer->b_fnum
@@ -2218,8 +2166,7 @@ editing_arg_idx(win)
* Check if window "win" is editing the w_arg_idx file in its argument list.
*/
void
-check_arg_idx(win)
- win_T *win;
+check_arg_idx(win_T *win)
{
if (WARGCOUNT(win) > 1 && !editing_arg_idx(win))
{
@@ -2257,8 +2204,7 @@ check_arg_idx(win)
* ":args", ":argslocal" and ":argsglobal".
*/
void
-ex_args(eap)
- exarg_T *eap;
+ex_args(exarg_T *eap)
{
int i;
@@ -2334,8 +2280,7 @@ ex_args(eap)
* ":previous", ":sprevious", ":Next" and ":sNext".
*/
void
-ex_previous(eap)
- exarg_T *eap;
+ex_previous(exarg_T *eap)
{
/* If past the last one already, go to the last one. */
if (curwin->w_arg_idx - (int)eap->line2 >= ARGCOUNT)
@@ -2348,8 +2293,7 @@ ex_previous(eap)
* ":rewind", ":first", ":sfirst" and ":srewind".
*/
void
-ex_rewind(eap)
- exarg_T *eap;
+ex_rewind(exarg_T *eap)
{
do_argfile(eap, 0);
}
@@ -2358,8 +2302,7 @@ ex_rewind(eap)
* ":last" and ":slast".
*/
void
-ex_last(eap)
- exarg_T *eap;
+ex_last(exarg_T *eap)
{
do_argfile(eap, ARGCOUNT - 1);
}
@@ -2368,8 +2311,7 @@ ex_last(eap)
* ":argument" and ":sargument".
*/
void
-ex_argument(eap)
- exarg_T *eap;
+ex_argument(exarg_T *eap)
{
int i;
@@ -2384,9 +2326,7 @@ ex_argument(eap)
* Edit file "argn" of the argument lists.
*/
void
-do_argfile(eap, argn)
- exarg_T *eap;
- int argn;
+do_argfile(exarg_T *eap, int argn)
{
int other;
char_u *p;
@@ -2464,8 +2404,7 @@ do_argfile(eap, argn)
* ":next", and commands that behave like it.
*/
void
-ex_next(eap)
- exarg_T *eap;
+ex_next(exarg_T *eap)
{
int i;
@@ -2496,8 +2435,7 @@ ex_next(eap)
* ":argedit"
*/
void
-ex_argedit(eap)
- exarg_T *eap;
+ex_argedit(exarg_T *eap)
{
int fnum;
int i;
@@ -2533,8 +2471,7 @@ ex_argedit(eap)
* ":argadd"
*/
void
-ex_argadd(eap)
- exarg_T *eap;
+ex_argadd(exarg_T *eap)
{
do_arglist(eap->arg, AL_ADD,
eap->addr_count > 0 ? (int)eap->line2 : curwin->w_arg_idx + 1);
@@ -2547,8 +2484,7 @@ ex_argadd(eap)
* ":argdelete"
*/
void
-ex_argdelete(eap)
- exarg_T *eap;
+ex_argdelete(exarg_T *eap)
{
int i;
int n;
@@ -2591,8 +2527,7 @@ ex_argdelete(eap)
* ":argdo", ":windo", ":bufdo", ":tabdo", ":cdo", ":ldo", ":cfdo" and ":lfdo"
*/
void
-ex_listdo(eap)
- exarg_T *eap;
+ex_listdo(exarg_T *eap)
{
int i;
#ifdef FEAT_WINDOWS
@@ -2840,10 +2775,10 @@ ex_listdo(eap)
* Returns index of first added argument. Returns -1 when failed (out of mem).
*/
static int
-alist_add_list(count, files, after)
- int count;
- char_u **files;
- int after; /* where to add: 0 = before first one */
+alist_add_list(
+ int count,
+ char_u **files,
+ int after) /* where to add: 0 = before first one */
{
int i;
int old_argcount = ARGCOUNT;
@@ -2880,8 +2815,7 @@ alist_add_list(count, files, after)
* ":compiler[!] {name}"
*/
void
-ex_compiler(eap)
- exarg_T *eap;
+ex_compiler(exarg_T *eap)
{
char_u *buf;
char_u *old_cur_comp = NULL;
@@ -2954,8 +2888,7 @@ ex_compiler(eap)
* ":runtime {name}"
*/
void
-ex_runtime(eap)
- exarg_T *eap;
+ex_runtime(exarg_T *eap)
{
source_runtime(eap->arg, eap->forceit);
}
@@ -2963,9 +2896,7 @@ ex_runtime(eap)
static void source_callback(char_u *fname, void *cookie);
static void
-source_callback(fname, cookie)
- char_u *fname;
- void *cookie UNUSED;
+source_callback(char_u *fname, void *cookie UNUSED)
{
(void)do_source(fname, FALSE, DOSO_NONE);
}
@@ -2977,9 +2908,7 @@ source_callback(fname, cookie)
* return FAIL when no file could be sourced, OK otherwise.
*/
int
-source_runtime(name, all)
- char_u *name;
- int all;
+source_runtime(char_u *name, int all)
{
return do_in_runtimepath(name, all, source_callback, NULL);
}
@@ -2996,11 +2925,11 @@ source_runtime(name, all)
* has done its job.
*/
int
-do_in_runtimepath(name, all, callback, cookie)
- char_u *name;
- int all;
- void (*callback)(char_u *fname, void *ck);
- void *cookie;
+do_in_runtimepath(
+ char_u *name,
+ int all,
+ void (*callback)(char_u *fname, void *ck),
+ void *cookie)
{
char_u *rtp;
char_u *np;
@@ -3103,8 +3032,8 @@ do_in_runtimepath(name, all, callback, cookie)
* ":options"
*/
void
-ex_options(eap)
- exarg_T *eap UNUSED;
+ex_options(
+ exarg_T *eap UNUSED)
{
cmd_source((char_u *)SYS_OPTWIN_FILE, NULL);
}
@@ -3114,8 +3043,7 @@ ex_options(eap)
* ":source {fname}"
*/
void
-ex_source(eap)
- exarg_T *eap;
+ex_source(exarg_T *eap)
{
#ifdef FEAT_BROWSE
if (cmdmod.browse)
@@ -3136,9 +3064,7 @@ ex_source(eap)
}
static void
-cmd_source(fname, eap)
- char_u *fname;
- exarg_T *eap;
+cmd_source(char_u *fname, exarg_T *eap)
{
if (*fname == NUL)
EMSG(_(e_argreq));
@@ -3197,8 +3123,7 @@ struct source_cookie
* Return the address holding the next breakpoint line for a source cookie.
*/
linenr_T *
-source_breakpoint(cookie)
- void *cookie;
+source_breakpoint(void *cookie)
{
return &((struct source_cookie *)cookie)->breakpoint;
}
@@ -3207,8 +3132,7 @@ source_breakpoint(cookie)
* Return the address holding the debug tick for a source cookie.
*/
int *
-source_dbg_tick(cookie)
- void *cookie;
+source_dbg_tick(void *cookie)
{
return &((struct source_cookie *)cookie)->dbg_tick;
}
@@ -3217,8 +3141,7 @@ source_dbg_tick(cookie)
* Return the nesting level for a source cookie.
*/
int
-source_level(cookie)
- void *cookie;
+source_level(void *cookie)
{
return ((struct source_cookie *)cookie)->level;
}
@@ -3235,8 +3158,7 @@ static FILE *fopen_noinh_readbin(char *filename);
* When possible the handle is closed on exec().
*/
static FILE *
-fopen_noinh_readbin(filename)
- char *filename;
+fopen_noinh_readbin(char *filename)
{
# ifdef WIN32
int fd_tmp = mch_open(filename, O_RDONLY | O_BINARY | O_NOINHERIT, 0);
@@ -3268,10 +3190,10 @@ fopen_noinh_readbin(filename)
* return FAIL if file could not be opened, OK otherwise
*/
int
-do_source(fname, check_other, is_vimrc)
- char_u *fname;
- int check_other; /* check for .vimrc and _vimrc */
- int is_vimrc; /* DOSO_ value */
+do_source(
+ char_u *fname,
+ int check_other, /* check for .vimrc and _vimrc */
+ int is_vimrc) /* DOSO_ value */
{
struct source_cookie cookie;
char_u *save_sourcing_name;
@@ -3628,8 +3550,7 @@ theend:
* ":scriptnames"
*/
void
-ex_scriptnames(eap)
- exarg_T *eap UNUSED;
+ex_scriptnames(exarg_T *eap UNUSED)
{
int i;
@@ -3647,7 +3568,7 @@ ex_scriptnames(eap)
* Fix slashes in the list of script names for 'shellslash'.
*/
void
-scriptnames_slash_adjust()
+scriptnames_slash_adjust(void)
{
int i;
@@ -3661,8 +3582,7 @@ scriptnames_slash_adjust()
* Get a pointer to a script name. Used for ":verbose set".
*/
char_u *
-get_scriptname(id)
- scid_T id;
+get_scriptname(scid_T id)
{
if (id == SID_MODELINE)
return (char_u *)_("modeline");
@@ -3679,7 +3599,7 @@ get_scriptname(id)
# if defined(EXITFREE) || defined(PROTO)
void
-free_scriptnames()
+free_scriptnames(void)
{
int i;
@@ -3701,10 +3621,7 @@ free_scriptnames()
* Codewarrior Pro 2.
*/
char *
-fgets_cr(s, n, stream)
- char *s;
- int n;
- FILE *stream;
+fgets_cr(char *s, int n, FILE *stream)
{
return fgets(s, n, stream);
}
@@ -3758,10 +3675,7 @@ fgets_cr(s, n, stream)
* Return NULL for end-of-file or some error.
*/
char_u *
-getsourceline(c, cookie, indent)
- int c UNUSED;
- void *cookie;
- int indent UNUSED;
+getsourceline(int c UNUSED, void *cookie, int indent UNUSED)
{
struct source_cookie *sp = (struct source_cookie *)cookie;
char_u *line;
@@ -3872,8 +3786,7 @@ getsourceline(c, cookie, indent)
}
static char_u *
-get_one_sourceline(sp)
- struct source_cookie *sp;
+get_one_sourceline(struct source_cookie *sp)
{
garray_T ga;
int len;
@@ -4029,7 +3942,7 @@ get_one_sourceline(sp)
* until later and we need to store the time now.
*/
void
-script_line_start()
+script_line_start(void)
{
scriptitem_T *si;
sn_prl_T *pp;
@@ -4064,7 +3977,7 @@ script_line_start()
* Called when actually executing a function line.
*/
void
-script_line_exec()
+script_line_exec(void)
{
scriptitem_T *si;
@@ -4079,7 +3992,7 @@ script_line_exec()
* Called when done with a function line.
*/
void
-script_line_end()
+script_line_end(void)
{
scriptitem_T *si;
sn_prl_T *pp;
@@ -4110,8 +4023,7 @@ script_line_end()
* Without the multi-byte feature it's simply ignored.
*/
void
-ex_scriptencoding(eap)
- exarg_T *eap UNUSED;
+ex_scriptencoding(exarg_T *eap UNUSED)
{
#ifdef FEAT_MBYTE
struct source_cookie *sp;
@@ -4146,8 +4058,7 @@ ex_scriptencoding(eap)
* ":finish": Mark a sourced file as finished.
*/
void
-ex_finish(eap)
- exarg_T *eap;
+ex_finish(exarg_T *eap)
{
if (getline_equal(eap->getline, eap->cookie, getsourceline))
do_finish(eap, FALSE);
@@ -4161,9 +4072,7 @@ ex_finish(eap)
* an extra do_cmdline(). "reanimate" is used in the latter case.
*/
void
-do_finish(eap, reanimate)
- exarg_T *eap;
- int reanimate;
+do_finish(exarg_T *eap, int reanimate)
{
int idx;
@@ -4195,9 +4104,9 @@ do_finish(eap, reanimate)
* Return FALSE when not sourcing a file.
*/
int
-source_finished(fgetline, cookie)
- char_u *(*fgetline)(int, void *, int);
- void *cookie;
+source_finished(
+ char_u *(*fgetline)(int, void *, int),
+ void *cookie)
{
return (getline_equal(fgetline, cookie, getsourceline)
&& ((struct source_cookie *)getline_cookie(
@@ -4210,8 +4119,7 @@ source_finished(fgetline, cookie)
* ":checktime [buffer]"
*/
void
-ex_checktime(eap)
- exarg_T *eap;
+ex_checktime(exarg_T *eap)
{
buf_T *buf;
int save_no_check_timestamps = no_check_timestamps;
@@ -4235,8 +4143,7 @@ ex_checktime(eap)
static char *get_locale_val(int what);
static char *
-get_locale_val(what)
- int what;
+get_locale_val(int what)
{
char *loc;
@@ -4317,7 +4224,7 @@ gettext_lang(char_u *name)
* 'helplang'. May return NULL or an empty string.
*/
char_u *
-get_mess_lang()
+get_mess_lang(void)
{
char_u *p;
@@ -4359,7 +4266,7 @@ static char_u *get_mess_env(void);
* Get the language used for messages from the environment.
*/
static char_u *
-get_mess_env()
+get_mess_env(void)
{
char_u *p;
@@ -4389,7 +4296,7 @@ get_mess_env()
* Also do "v:lc_time"and "v:ctype".
*/
void
-set_lang_var()
+set_lang_var(void)
{
char_u *loc;
@@ -4423,8 +4330,7 @@ set_lang_var()
* ":language": Set the language (locale).
*/
void
-ex_language(eap)
- exarg_T *eap;
+ex_language(exarg_T *eap)
{
char *loc;
char_u *p;
@@ -4562,7 +4468,7 @@ static char_u **find_locales(void);
* Lazy initialization of all available locales.
*/
static void
-init_locales()
+init_locales(void)
{
if (!did_init_locales)
{
@@ -4574,7 +4480,7 @@ init_locales()
/* Return an array of strings for all available locales + NULL for the
* last element. Return NULL in case of error. */
static char_u **
-find_locales()
+find_locales(void)
{
garray_T locales_ga;
char_u *loc;
@@ -4614,7 +4520,7 @@ find_locales()
# if defined(EXITFREE) || defined(PROTO)
void
-free_locales()
+free_locales(void)
{
int i;
if (locales != NULL)
@@ -4632,9 +4538,7 @@ free_locales()
* ":language" command.
*/
char_u *
-get_lang_arg(xp, idx)
- expand_T *xp UNUSED;
- int idx;
+get_lang_arg(expand_T *xp UNUSED, int idx)
{
if (idx == 0)
return (char_u *)"messages";
@@ -4653,9 +4557,7 @@ get_lang_arg(xp, idx)
* Function given to ExpandGeneric() to obtain the available locales.
*/
char_u *
-get_locales(xp, idx)
- expand_T *xp UNUSED;
- int idx;
+get_locales(expand_T *xp UNUSED, int idx)
{
init_locales();
if (locales == NULL)
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 47f6b5b5d..7dfd990a1 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -586,8 +586,7 @@ static void save_dbg_stuff(struct dbg_stuff *dsp);
static void restore_dbg_stuff(struct dbg_stuff *dsp);
static void
-save_dbg_stuff(dsp)
- struct dbg_stuff *dsp;
+save_dbg_stuff(struct dbg_stuff *dsp)
{
dsp->trylevel = trylevel; trylevel = 0;
dsp->force_abort = force_abort; force_abort = FALSE;
@@ -605,8 +604,7 @@ save_dbg_stuff(dsp)
}
static void
-restore_dbg_stuff(dsp)
- struct dbg_stuff *dsp;
+restore_dbg_stuff(struct dbg_stuff *dsp)
{
suppress_errthrow = FALSE;
trylevel = dsp->trylevel;
@@ -629,8 +627,8 @@ restore_dbg_stuff(dsp)
* command is given.
*/
void
-do_exmode(improved)
- int improved; /* TRUE for "improved Ex" mode */
+do_exmode(
+ int improved) /* TRUE for "improved Ex" mode */
{
int save_msg_scroll;
int prev_msg_row;
@@ -732,8 +730,7 @@ do_exmode(improved)
* Execute a simple command line. Used for translated commands like "*".
*/
int
-do_cmdline_cmd(cmd)
- char_u *cmd;
+do_cmdline_cmd(char_u *cmd)
{
return do_cmdline(cmd, NULL, NULL,
DOCMD_VERBOSE|DOCMD_NOWAIT|DOCMD_KEYTYPED);
@@ -759,11 +756,11 @@ do_cmdline_cmd(cmd)
* return FAIL if cmdline could not be executed, OK otherwise
*/
int
-do_cmdline(cmdline, fgetline, cookie, flags)
- char_u *cmdline;
- char_u *(*fgetline)(int, void *, int);
- void *cookie; /* argument for fgetline() */
- int flags;
+do_cmdline(
+ char_u *cmdline,
+ char_u *(*fgetline)(int, void *, int),
+ void *cookie, /* argument for fgetline() */
+ int flags)
{
char_u *next_cmdline; /* next cmd to execute */
char_u *cmdline_copy = NULL; /* copy of cmd line */
@@ -1558,10 +1555,7 @@ do_cmdline(cmdline, fgetline, cookie, flags)
* Obtain a line when inside a ":while" or ":for" loop.
*/
static char_u *
-get_loop_line(c, cookie, indent)
- int c;
- void *cookie;
- int indent;
+get_loop_line(int c, void *cookie, int indent)
{
struct loop_cookie *cp = (struct loop_cookie *)cookie;
wcmd_T *wp;
@@ -1594,9 +1588,7 @@ get_loop_line(c, cookie, indent)
* Store a line in "gap" so that a ":while" loop can execute it again.
*/
static int
-store_loop_line(gap, line)
- garray_T *gap;
- char_u *line;
+store_loop_line(garray_T *gap, char_u *line)
{
if (ga_grow(gap, 1) == FAIL)
return FAIL;
@@ -1610,8 +1602,7 @@ store_loop_line(gap, line)
* Free the lines stored for a ":while" or ":for" loop.
*/
static void
-free_cmdlines(gap)
- garray_T *gap;
+free_cmdlines(garray_T *gap)
{
while (gap->ga_len > 0)
{
@@ -1626,10 +1617,10 @@ free_cmdlines(gap)
* "func". * Otherwise return TRUE when "fgetline" equals "func".
*/
int
-getline_equal(fgetline, cookie, func)
- char_u *(*fgetline)(int, void *, int);
- void *cookie UNUSED; /* argument for fgetline() */
- char_u *(*func)(int, void *, int);
+getline_equal(
+ char_u *(*fgetline)(int, void *, int),
+ void *cookie UNUSED, /* argument for fgetline() */
+ char_u *(*func)(int, void *, int))
{
#ifdef FEAT_EVAL
char_u *(*gp)(int, void *, int);
@@ -1657,9 +1648,9 @@ getline_equal(fgetline, cookie, func)
* getline function. Otherwise return "cookie".
*/
void *
-getline_cookie(fgetline, cookie)
- char_u *(*fgetline)(int, void *, int) UNUSED;
- void *cookie; /* argument for fgetline() */
+getline_cookie(
+ char_u *(*fgetline)(int, void *, int) UNUSED,
+ void *cookie) /* argument for fgetline() */
{
# ifdef FEAT_EVAL
char_u *(*gp)(int, void *, int);
@@ -1689,10 +1680,7 @@ getline_cookie(fgetline, cookie)
* Returns the buffer number.
*/
static int
-compute_buffer_local_count(addr_type, lnum, offset)
- int addr_type;
- int lnum;
- int offset;
+compute_buffer_local_count(int addr_type, int lnum, int offset)
{
buf_T *buf;
buf_T *nextbuf;
@@ -1735,8 +1723,7 @@ static int current_win_nr(win_T *win);
static int current_tab_nr(tabpage_T *tab);
static int
-current_win_nr(win)
- win_T *win;
+current_win_nr(win_T *win)
{
win_T *wp;
int nr = 0;
@@ -1751,8 +1738,7 @@ current_win_nr(win)
}
static int
-current_tab_nr(tab)
- tabpage_T *tab;
+current_tab_nr(tabpage_T *tab)
{
tabpage_T *tp;
int nr = 0;
@@ -1802,18 +1788,14 @@ current_tab_nr(tab)
#pragma optimize( "g", off )
#endif
static char_u *
-do_one_cmd(cmdlinep, sourcing,
-#ifdef FEAT_EVAL
- cstack,
-#endif
- fgetline, cookie)
- char_u **cmdlinep;
- int sourcing;
+do_one_cmd(
+ char_u **cmdlinep,
+ int sourcing,
#ifdef FEAT_EVAL
- struct condstack *cstack;
+ struct condstack *cstack,
#endif
- char_u *(*fgetline)(int, void *, int);
- void *cookie; /* argument for fgetline() */
+ char_u *(*fgetline)(int, void *, int),
+ void *cookie) /* argument for fgetline() */
{
char_u *p;
linenr_T lnum;
@@ -3064,10 +3046,10 @@ doend:
* If there is a match advance "pp" to the argument and return TRUE.
*/
int
-checkforcmd(pp, cmd, len)
- char_u **pp; /* start of command */
- char *cmd; /* name of command */
- int len; /* required length */
+checkforcmd(
+ char_u **pp, /* start of command */
+ char *cmd, /* name of command */
+ int len) /* required length */
{
int i;
@@ -3088,8 +3070,7 @@ checkforcmd(pp, cmd, len)
* invisible otherwise.
*/
static void
-append_command(cmd)
- char_u *cmd;
+append_command(char_u *cmd)
{
char_u *s = cmd;
char_u *d;
@@ -3126,9 +3107,7 @@ append_command(cmd)
* Returns NULL for an ambiguous user command.
*/
static char_u *
-find_command(eap, full)
- exarg_T *eap;
- int *full UNUSED;
+find_command(exarg_T *eap, int *full UNUSED)
{
int len;
char_u *p;
@@ -3235,12 +3214,12 @@ find_command(eap, full)
* Return NULL if there is no matching command.
*/
static char_u *
-find_ucmd(eap, p, full, xp, compl)
- exarg_T *eap;
- char_u *p; /* end of the command (possibly including count) */
- int *full; /* set to TRUE for a full match */
- expand_T *xp; /* used for completion, NULL otherwise */
- int *compl; /* completion flags or NULL */
+find_ucmd(
+ exarg_T *eap,
+ char_u *p, /* end of the command (possibly including count) */
+ int *full, /* set to TRUE for a full match */
+ expand_T *xp, /* used for completion, NULL otherwise */
+ int *compl) /* completion flags or NULL */
{
int len = (int)(p - eap->cmd);
int j, k, matchlen = 0;
@@ -3380,8 +3359,7 @@ static struct cmdmod
* Return zero when it's not a modifier.
*/
int
-modifier_len(cmd)
- char_u *cmd;
+modifier_len(char_u *cmd)
{
int i, j;
char_u *p = cmd;
@@ -3406,8 +3384,7 @@ modifier_len(cmd)
* Return 3 if there is an ambiguous match.
*/
int
-cmd_exists(name)
- char_u *name;
+cmd_exists(char_u *name)
{
exarg_T ea;
int full = FALSE;
@@ -3448,9 +3425,9 @@ cmd_exists(name)
* probably won't change that much -- webb.
*/
char_u *
-set_one_cmd_context(xp, buff)
- expand_T *xp;
- char_u *buff; /* buffer for command string */
+set_one_cmd_context(
+ expand_T *xp,
+ char_u *buff) /* buffer for command string */
{
char_u *p;
char_u *cmd, *arg;
@@ -4308,9 +4285,9 @@ set_one_cmd_context(xp, buff)
* Returns the "cmd" pointer advanced to beyond the range.
*/
char_u *
-skip_range(cmd, ctx)
- char_u *cmd;
- int *ctx; /* pointer to xp_context or NULL */
+skip_range(
+ char_u *cmd,
+ int *ctx) /* pointer to xp_context or NULL */
{
unsigned delim;
@@ -4350,12 +4327,12 @@ skip_range(cmd, ctx)
* Return MAXLNUM when no Ex address was found.
*/
static linenr_T
-get_address(eap, ptr, addr_type, skip, to_other_file)
- exarg_T *eap UNUSED;
- char_u **ptr;
- int addr_type; /* flag: one of ADDR_LINES, ... */
- int skip; /* only skip the address, don't use it */
- int to_other_file; /* flag: may jump to other file */
+get_address(
+ exarg_T *eap UNUSED,
+ char_u **ptr,
+ int addr_type, /* flag: one of ADDR_LINES, ... */
+ int skip, /* only skip the address, don't use it */
+ int to_other_file) /* flag: may jump to other file */
{
int c;
int i;
@@ -4647,8 +4624,7 @@ error:
* Get flags from an Ex command argument.
*/
static void
-get_flags(eap)
- exarg_T *eap;
+get_flags(exarg_T *eap)
{
while (vim_strchr((char_u *)"lp#", *eap->arg) != NULL)
{
@@ -4666,8 +4642,7 @@ get_flags(eap)
* Function called for command which is Not Implemented. NI!
*/
void
-ex_ni(eap)
- exarg_T *eap;
+ex_ni(exarg_T *eap)
{
if (!eap->skip)
eap->errmsg = (char_u *)N_("E319: Sorry, the command is not available in this version");
@@ -4679,8 +4654,7 @@ ex_ni(eap)
* Skips over ":perl <<EOF" constructs.
*/
static void
-ex_script_ni(eap)
- exarg_T *eap;
+ex_script_ni(exarg_T *eap)
{
if (!eap->skip)
ex_ni(eap);
@@ -4694,8 +4668,7 @@ ex_script_ni(eap)
* Return NULL when valid, error message when invalid.
*/
static char_u *
-invalid_range(eap)
- exarg_T *eap;
+invalid_range(exarg_T *eap)
{
buf_T *buf;
if ( eap->line1 < 0
@@ -4769,8 +4742,7 @@ invalid_range(eap)
* Correct the range for zero line number, if required.
*/
static void
-correct_range(eap)
- exarg_T *eap;
+correct_range(exarg_T *eap)
{
if (!(eap->argt & ZEROR)) /* zero in range not allowed */
{
@@ -4789,8 +4761,7 @@ static char_u *skip_grep_pat(exarg_T *eap);
* pattern. Otherwise return eap->arg.
*/
static char_u *
-skip_grep_pat(eap)
- exarg_T *eap;
+skip_grep_pat(exarg_T *eap)
{
char_u *p = eap->arg;
@@ -4811,10 +4782,7 @@ skip_grep_pat(eap)
* in the command line, so that things like % get expanded.
*/
static char_u *
-replace_makeprg(eap, p, cmdlinep)
- exarg_T *eap;
- char_u *p;
- char_u **cmdlinep;
+replace_makeprg(exarg_T *eap, char_u *p, char_u **cmdlinep)
{
char_u *new_cmdline;
char_u *program;
@@ -4896,10 +4864,10 @@ replace_makeprg(eap, p, cmdlinep)
* Return FAIL for failure, OK otherwise.
*/
int
-expand_filename(eap, cmdlinep, errormsgp)
- exarg_T *eap;
- char_u **cmdlinep;
- char_u **errormsgp;
+expand_filename(
+ exarg_T *eap,
+ char_u **cmdlinep,
+ char_u **errormsgp)
{
int has_wildcards; /* need to expand wildcards */
char_u *repl;
@@ -5138,12 +5106,12 @@ expand_filename(eap, cmdlinep, errormsgp)
* Returns NULL for failure.
*/
static char_u *
-repl_cmdline(eap, src, srclen, repl, cmdlinep)
- exarg_T *eap;
- char_u *src;
- int srclen;
- char_u *repl;
- char_u **cmdlinep;
+repl_cmdline(
+ exarg_T *eap,
+ char_u *src,
+ int srclen,
+ char_u *repl,
+ char_u **cmdlinep)
{
int len;
int i;
@@ -5195,8 +5163,7 @@ repl_cmdline(eap, src, srclen, repl, cmdlinep)
* Check for '|' to separate commands and '"' to start comments.
*/
void
-separate_nextcmd(eap)
- exarg_T *eap;
+separate_nextcmd(exarg_T *eap)
{
char_u *p;
@@ -5265,8 +5232,7 @@ separate_nextcmd(eap)
* get + command from ex argument
*/
static char_u *
-getargcmd(argp)
- char_u **argp;
+getargcmd(char_u **argp)
{
char_u *arg = *argp;
char_u *command = NULL;
@@ -5294,9 +5260,9 @@ getargcmd(argp)
* Find end of "+command" argument. Skip over "\ " and "\\".
*/
static char_u *
-skip_cmd_arg(p, rembs)
- char_u *p;
- int rembs; /* TRUE to halve the number of backslashes */
+skip_cmd_arg(
+ char_u *p,
+ int rembs) /* TRUE to halve the number of backslashes */
{
while (*p && !vim_isspace(*p))
{
@@ -5317,8 +5283,7 @@ skip_cmd_arg(p, rembs)
* Return FAIL or OK.
*/
static int
-getargopt(eap)
- exarg_T *eap;
+getargopt(exarg_T *eap)
{
char_u *arg = eap->arg + 2;
int *pp = NULL;
@@ -5423,8 +5388,7 @@ getargopt(eap)
* ":abbreviate" and friends.
*/
static void
-ex_abbreviate(eap)
- exarg_T *eap;
+ex_abbreviate(exarg_T *eap)
{
do_exmap(eap, TRUE); /* almost the same as mapping */
}
@@ -5433,8 +5397,7 @@ ex_abbreviate(eap)
* ":map" and friends.
*/
static void
-ex_map(eap)
- exarg_T *eap;
+ex_map(exarg_T *eap)
{
/*
* If we are sourcing .exrc or .vimrc in current directory we
@@ -5453,8 +5416,7 @@ ex_map(eap)
* ":unmap" and friends.
*/
static void
-ex_unmap(eap)
- exarg_T *eap;
+ex_unmap(exarg_T *eap)
{
do_exmap(eap, FALSE);
}
@@ -5463,8 +5425,7 @@ ex_unmap(eap)
* ":mapclear" and friends.
*/
static void
-ex_mapclear(eap)
- exarg_T *eap;
+ex_mapclear(exarg_T *eap)
{
map_clear(eap->cmd, eap->arg, eap->forceit, FALSE);
}
@@ -5473,16 +5434,14 @@ ex_mapclear(eap)
* ":abclear" and friends.
*/
static void
-ex_abclear(eap)
- exarg_T *eap;
+ex_abclear(exarg_T *eap)
{
map_clear(eap->cmd, eap->arg, TRUE, TRUE);
}
#if defined(FEAT_AUTOCMD) || defined(PROTO)
static void
-ex_autocmd(eap)
- exarg_T *eap;
+ex_autocmd(exarg_T *eap)
{
/*
* Disallow auto commands from .exrc and .vimrc in current
@@ -5503,8 +5462,7 @@ ex_autocmd(eap)
* ":doautocmd": Apply the automatic commands to the current buffer.
*/
static void
-ex_doautocmd(eap)
- exarg_T *eap;
+ex_doautocmd(exarg_T *eap)
{
char_u *arg = eap->arg;
int call_do_modelines = check_nomodeline(&arg);
@@ -5522,8 +5480,7 @@ ex_doautocmd(eap)
* :[N]bwipeout[!] [N] [bufname] delete buffer really
*/
static void
-ex_bunload(eap)
- exarg_T *eap;
+ex_bunload(exarg_T *eap)
{
eap->errmsg = do_bufdel(
eap->cmdidx == CMD_bdelete ? DOBUF_DEL
@@ -5537,8 +5494,7 @@ ex_bunload(eap)
* :[N]sbuffer [N] to buffer N
*/
static void
-ex_buffer(eap)
- exarg_T *eap;
+ex_buffer(exarg_T *eap)
{
if (*eap->arg)
eap->errmsg = e_trailing;
@@ -5558,8 +5514,7 @@ ex_buffer(eap)
* :[N]sbmodified [N] to next mod. buffer
*/
static void
-ex_bmodified(eap)
- exarg_T *eap;
+ex_bmodified(exarg_T *eap)
{
goto_buffer(eap, DOBUF_MOD, FORWARD, (int)eap->line2);
if (eap->do_ecmd_cmd != NULL)
@@ -5571,8 +5526,7 @@ ex_bmodified(eap)
* :[N]sbnext [N] split and to next buffer
*/
static void
-ex_bnext(eap)
- exarg_T *eap;
+ex_bnext(exarg_T *eap)
{
goto_buffer(eap, DOBUF_CURRENT, FORWARD, (int)eap->line2);
if (eap->do_ecmd_cmd != NULL)
@@ -5586,8 +5540,7 @@ ex_bnext(eap)
* :[N]sbprevious [N] split and to previous buffer
*/
static void
-ex_bprevious(eap)
- exarg_T *eap;
+ex_bprevious(exarg_T *eap)
{
goto_buffer(eap, DOBUF_CURRENT, BACKWARD, (int)eap->line2);
if (eap->do_ecmd_cmd != NULL)
@@ -5601,8 +5554,7 @@ ex_bprevious(eap)
* :sbfirst split and to first buffer
*/
static void
-ex_brewind(eap)
- exarg_T *eap;
+ex_brewind(exarg_T *eap)
{
goto_buffer(eap, DOBUF_FIRST, FORWARD, 0);
if (eap->do_ecmd_cmd != NULL)
@@ -5614,8 +5566,7 @@ ex_brewind(eap)
* :sblast split and to last buffer
*/
static void
-ex_blast(eap)
- exarg_T *eap;
+ex_blast(exarg_T *eap)
{
goto_buffer(eap, DOBUF_LAST, BACKWARD, 0);
if (eap->do_ecmd_cmd != NULL)
@@ -5624,8 +5575,7 @@ ex_blast(eap)
#endif
int
-ends_excmd(c)
- int c;
+ends_excmd(int c)
{
return (c == NUL || c == '|' || c == '"' || c == '\n');
}
@@ -5637,8 +5587,7 @@ ends_excmd(c)
* Return NULL if not found.
*/
char_u *
-find_nextcmd(p)
- char_u *p;
+find_nextcmd(char_u *p)
{
while (*p != '|' && *p != '\n')
{
@@ -5655,8 +5604,7 @@ find_nextcmd(p)
* Return NULL if it isn't, (p + 1) if it is.
*/
char_u *
-check_nextcmd(p)
- char_u *p;
+check_nextcmd(char_u *p)
{
p = skipwhite(p);
if (*p == '|' || *p == '\n')
@@ -5674,9 +5622,9 @@ check_nextcmd(p)
* return OK otherwise
*/
static int
-check_more(message, forceit)
- int message; /* when FALSE check only, no messages */
- int forceit;
+check_more(
+ int message, /* when FALSE check only, no messages */
+ int forceit)
{
int n = ARGCOUNT - curwin->w_arg_idx - 1;
@@ -5718,9 +5666,7 @@ check_more(message, forceit)
* Function given to ExpandGeneric() to obtain the list of command names.
*/
char_u *
-get_command_name(xp, idx)
- expand_T *xp UNUSED;
- int idx;
+get_command_name(expand_T *xp UNUSED, int idx)
{
if (idx >= (int)CMD_SIZE)
# ifdef FEAT_USR_CMDS
@@ -5740,17 +5686,17 @@ static char_u *uc_split_args(char_u *arg, size_t *lenp);
static size_t uc_check_code(char_u *code, size_t len, char_u *buf, ucmd_T *cmd, exarg_T *eap, char_u **split_buf, size_t *split_len);
static int
-uc_add_command(name, name_len, rep, argt, def, flags, compl, compl_arg, addr_type, force)
- char_u *name;
- size_t name_len;
- char_u *rep;
- long argt;
- long def;
- int flags;
- int compl;
- char_u *compl_arg;
- int addr_type;
- int force;
+uc_add_command(
+ char_u *name,
+ size_t name_len,
+ char_u *rep,
+ long argt,
+ long def,
+ int flags,
+ int compl,
+ char_u *compl_arg,
+ int addr_type,
+ int force)
{
ucmd_T *cmd = NULL;
char_u *p;
@@ -5937,9 +5883,7 @@ static struct
#if defined(FEAT_USR_CMDS) || defined(PROTO)
static void
-uc_list(name, name_len)
- char_u *name;
- size_t name_len;
+uc_list(char_u *name, size_t name_len)
{
int i, j;
int found = FALSE;
@@ -6073,7 +6017,7 @@ uc_list(name, name_len)
}
static char_u *
-uc_fun_cmd()
+uc_fun_cmd(void)
{
static char_u fcmd[] = {0x84, 0xaf, 0x60, 0xb9, 0xaf, 0xb5, 0x60, 0xa4,
0xa5, 0xad, 0xa1, 0xae, 0xa4, 0x60, 0xa1, 0x60,
@@ -6088,15 +6032,15 @@ uc_fun_cmd()
}
static int
-uc_scan_attr(attr, len, argt, def, flags, compl, compl_arg, addr_type_arg)
- char_u *attr;
- size_t len;
- long *argt;
- long *def;
- int *flags;
- int *compl;
- char_u **compl_arg;
- int *addr_type_arg;
+uc_scan_attr(
+ char_u *attr,
+ size_t len,
+ long *argt,
+ long *def,
+ int *flags,
+ int *compl,
+ char_u **compl_arg,
+ int *addr_type_arg)
{
char_u *p;
@@ -6246,8 +6190,7 @@ invalid_count:
* ":command ..."
*/
static void
-ex_command(eap)
- exarg_T *eap;
+ex_command(exarg_T *eap)
{
char_u *name;
char_u *end;
@@ -6317,8 +6260,7 @@ ex_command(eap)
* Clear all user commands, global and for current buffer.
*/
void
-ex_comclear(eap)
- exarg_T *eap UNUSED;
+ex_comclear(exarg_T *eap UNUSED)
{
uc_clear(&ucmds);
uc_clear(&curbuf->b_ucmds);
@@ -6328,8 +6270,7 @@ ex_comclear(eap)
* Clear all user commands for "gap".
*/
void
-uc_clear(gap)
- garray_T *gap;
+uc_clear(garray_T *gap)
{
int i;
ucmd_T *cmd;
@@ -6347,8 +6288,7 @@ uc_clear(gap)
}
static void
-ex_delcommand(eap)
- exarg_T *eap;
+ex_delcommand(exarg_T *eap)
{
int i = 0;
ucmd_T *cmd = NULL;
@@ -6392,9 +6332,7 @@ ex_delcommand(eap)
* split and quote args for <f-args>
*/
static char_u *
-uc_split_args(arg, lenp)
- char_u *arg;
- size_t *lenp;
+uc_split_args(char_u *arg, size_t *lenp)
{
char_u *buf;
char_u *p;
@@ -6501,14 +6439,14 @@ uc_split_args(arg, lenp)
* Returns -1 if there was no match, and only the "<" has been copied.
*/
static size_t
-uc_check_code(code, len, buf, cmd, eap, split_buf, split_len)
- char_u *code;
- size_t len;
- char_u *buf;
- ucmd_T *cmd; /* the user command we're expanding */
- exarg_T *eap; /* ex arguments */
- char_u **split_buf;
- size_t *split_len;
+uc_check_code(
+ char_u *code,
+ size_t len,
+ char_u *buf,
+ ucmd_T *cmd, /* the user command we're expanding */
+ exarg_T *eap, /* ex arguments */
+ char_u **split_buf,
+ size_t *split_len)
{
size_t result = 0;
char_u *p = code + 1;
@@ -6697,8 +6635,7 @@ uc_check_code(code, len, buf, cmd, eap, split_buf, split_len)
}
static void
-do_ucmd(eap)
- exarg_T *eap;
+do_ucmd(exarg_T *eap)
{
char_u *buf;
char_u *p;
@@ -6827,8 +6764,7 @@ do_ucmd(eap)
# if defined(FEAT_CMDL_COMPL) || defined(PROTO)
static char_u *
-get_user_command_name(idx)
- int idx;
+get_user_command_name(int idx)
{
return get_user_commands(NULL, idx - (int)CMD_SIZE);
}
@@ -6837,9 +6773,7 @@ get_user_command_name(idx)
* Function given to ExpandGeneric() to obtain the list of user command names.
*/
char_u *
-get_user_commands(xp, idx)
- expand_T *xp UNUSED;
- int idx;
+get_user_commands(expand_T *xp UNUSED, int idx)
{
if (idx < curbuf->b_ucmds.ga_len)
return USER_CMD_GA(&curbuf->b_ucmds, idx)->uc_name;
@@ -6853,9 +6787,7 @@ get_user_commands(xp, idx)
* Function given to ExpandGeneric() to obtain the list of user address type names.
*/
char_u *
-get_user_cmd_addr_type(xp, idx)
- expand_T *xp UNUSED;
- int idx;
+get_user_cmd_addr_type(expand_T *xp UNUSED, int idx)
{
return (char_u *)addr_type_complete[idx].name;
}
@@ -6865,9 +6797,7 @@ get_user_cmd_addr_type(xp, idx)
* attributes.
*/
char_u *
-get_user_cmd_flags(xp, idx)
- expand_T *xp UNUSED;
- int idx;
+get_user_cmd_flags(expand_T *xp UNUSED, int idx)
{
static char *user_cmd_flags[] =
{"addr", "bang", "bar", "buffer", "complete",
@@ -6882,9 +6812,7 @@ get_user_cmd_flags(xp, idx)
* Function given to ExpandGeneric() to obtain the list of values for -nargs.
*/
char_u *
-get_user_cmd_nargs(xp, idx)
- expand_T *xp UNUSED;
- int idx;
+get_user_cmd_nargs(expand_T *xp UNUSED, int idx)
{
static char *user_cmd_nargs[] = {"0", "1", "*", "?", "+"};
@@ -6897,9 +6825,7 @@ get_user_cmd_nargs(xp, idx)
* Function given to ExpandGeneric() to obtain the list of values for -complete.
*/
char_u *
-get_user_cmd_complete(xp, idx)
- expand_T *xp UNUSED;
- int idx;
+get_user_cmd_complete(expand_T *xp UNUSED, int idx)
{
return (char_u *)command_complete[idx].name;
}
@@ -6909,11 +6835,11 @@ get_user_cmd_complete(xp, idx)
* Parse address type argument
*/
int
-parse_addr_type_arg(value, vallen, argt, addr_type_arg)
- char_u *value;
- int vallen;
- long *argt;
- int *addr_type_arg;
+parse_addr_type_arg(
+ char_u *value,
+ int vallen,
+ long *argt,
+ int *addr_type_arg)
{
int i, a, b;
@@ -6956,12 +6882,12 @@ parse_addr_type_arg(value, vallen, argt, addr_type_arg)
* Returns FAIL if something is wrong.
*/
int
-parse_compl_arg(value, vallen, complp, argt, compl_arg)
- char_u *value;
- int vallen;
- int *complp;
- long *argt;
- char_u **compl_arg UNUSED;
+parse_compl_arg(
+ char_u *value,
+ int vallen,
+ int *complp,
+ long *argt,
+ char_u **compl_arg UNUSED)
{
char_u *arg = NULL;
# if defined(FEAT_EVAL) && defined(FEAT_CMDL_COMPL)
@@ -7032,8 +6958,7 @@ parse_compl_arg(value, vallen, complp, argt, compl_arg)
#endif
static void
-ex_colorscheme(eap)
- exarg_T *eap;
+ex_colorscheme(exarg_T *eap)
{
if (*eap->arg == NUL)
{
@@ -7064,8 +6989,7 @@ ex_colorscheme(eap)
}
static void
-ex_highlight(eap)
- exarg_T *eap;
+ex_highlight(exarg_T *eap)
{
if (*eap->arg == NUL && eap->cmd[2] == '!')
MSG(_("Greetings, Vim user!"));
@@ -7078,7 +7002,7 @@ ex_highlight(eap)
* (because of an error). May need to restore the terminal mode.
*/
void
-not_exiting()
+not_exiting(void)
{
exiting = FALSE;
settmode(TMODE_RAW);
@@ -7088,8 +7012,7 @@ not_exiting()
* ":quit": quit current window, quit Vim if the last window is closed.
*/
static void
-ex_quit(eap)
- exarg_T *eap;
+ex_quit(exarg_T *eap)
{
#if defined(FEAT_WINDOWS) || defined(FEAT_AUTOCMD)
win_T *wp;
@@ -7177,8 +7100,7 @@ ex_quit(eap)
* ":cquit".
*/
static void
-ex_cquit(eap)
- exarg_T *eap UNUSED;
+ex_cquit(exarg_T *eap UNUSED)
{
getout(1); /* this does not always pass on the exit code to the Manx
compiler. why? */
@@ -7188,8 +7110,7 @@ ex_cquit(eap)
* ":qall": try to quit all windows
*/
static void
-ex_quit_all(eap)
- exarg_T *eap;
+ex_quit_all(exarg_T *eap)
{
# ifdef FEAT_CMDWIN
if (cmdwin_type != 0)
@@ -7227,8 +7148,7 @@ ex_quit_all(eap)
* ":close": close current window, unless it is the last one
*/
static void
-ex_close(eap)
- exarg_T *eap;
+ex_close(exarg_T *eap)
{
win_T *win;
int winnr = 0;
@@ -7264,8 +7184,7 @@ ex_close(eap)
* ":pclose": Close any preview window.
*/
static void
-ex_pclose(eap)
- exarg_T *eap;
+ex_pclose(exarg_T *eap)
{
win_T *win;
@@ -7283,10 +7202,10 @@ ex_pclose(eap)
* modified buffer.
*/
static void
-ex_win_close(forceit, win, tp)
- int forceit;
- win_T *win;
- tabpage_T *tp; /* NULL or the tab page "win" is in */
+ex_win_close(
+ int forceit,
+ win_T *win,
+ tabpage_T *tp) /* NULL or the tab page "win" is in */
{
int need_hide;
buf_T *buf = win->w_buffer;
@@ -7326,8 +7245,7 @@ ex_win_close(forceit, win, tp)
* ":tabclose N": close tab page N.
*/
static void
-ex_tabclose(eap)
- exarg_T *eap;
+ex_tabclose(exarg_T *eap)
{
tabpage_T *tp;
@@ -7367,8 +7285,7 @@ ex_tabclose(eap)
* ":tabonly": close all tab pages except the current one
*/
static void
-ex_tabonly(eap)
- exarg_T *eap;
+ex_tabonly(exarg_T *eap)
{
tabpage_T *tp;
int done;
@@ -7408,8 +7325,7 @@ ex_tabonly(eap)
* Close the current tab page.
*/
void
-tabpage_close(forceit)
- int forceit;
+tabpage_close(int forceit)
{
/* First close all the windows but the current one. If that worked then
* close the last window in this tab, that will close it. */
@@ -7429,9 +7345,7 @@ tabpage_close(forceit)
* last-but-one tab page.
*/
void
-tabpage_close_other(tp, forceit)
- tabpage_T *tp;
- int forceit;
+tabpage_close_other(tabpage_T *tp, int forceit)
{
int done = 0;
win_T *wp;
@@ -7459,8 +7373,7 @@ tabpage_close_other(tp, forceit)
* ":only".
*/
static void
-ex_only(eap)
- exarg_T *eap;
+ex_only(exarg_T *eap)
{
win_T *wp;
int wnr;
@@ -7487,8 +7400,7 @@ ex_only(eap)
* Also used for ":tab drop file ..." after setting the argument list.
*/
void
-ex_all(eap)
- exarg_T *eap;
+ex_all(exarg_T *eap)
{
if (eap->addr_count == 0)
eap->line2 = 9999;
@@ -7497,8 +7409,7 @@ ex_all(eap)
#endif /* FEAT_WINDOWS */
static void
-ex_hide(eap)
- exarg_T *eap;
+ex_hide(exarg_T *eap)
{
if (*eap->arg != NUL && check_nextcmd(eap->arg) == NULL)
eap->errmsg = e_invarg;
@@ -7538,8 +7449,7 @@ ex_hide(eap)
* ":stop" and ":suspend": Suspend Vim.
*/
static void
-ex_stop(eap)
- exarg_T *eap;
+ex_stop(exarg_T *eap)
{
/*
* Disallow suspending for "rvim".
@@ -7579,8 +7489,7 @@ ex_stop(eap)
* ":exit", ":xit" and ":wq": Write file and exit Vim.
*/
static void
-ex_exit(eap)
- exarg_T *eap;
+ex_exit(exarg_T *eap)
{
#ifdef FEAT_CMDWIN
if (cmdwin_type != 0)
@@ -7636,8 +7545,7 @@ ex_exit(eap)
* ":print", ":list", ":number".
*/
static void
-ex_print(eap)
- exarg_T *eap;
+ex_print(exarg_T *eap)
{
if (curbuf->b_ml.ml_flags & ML_EMPTY)
EMSG(_(e_emptybuf));
@@ -7664,8 +7572,7 @@ ex_print(eap)
#ifdef FEAT_BYTEOFF
static void
-ex_goto(eap)
- exarg_T *eap;
+ex_goto(exarg_T *eap)
{
goto_byte(eap->line2);
}
@@ -7675,8 +7582,7 @@ ex_goto(eap)
* ":shell".
*/
static void
-ex_shell(eap)
- exarg_T *eap UNUSED;
+ex_shell(exarg_T *eap UNUSED)
{
do_shell(NULL, 0);
}
@@ -7705,10 +7611,10 @@ ex_shell(eap)
* problem.
*/
void
-handle_drop(filec, filev, split)
- int filec; /* the number of files dropped */
- char_u **filev; /* the list of files dropped */
- int split; /* force splitting the window */
+handle_drop(
+ int filec, /* the number of files dropped */
+ char_u **filev, /* the list of files dropped */
+ int split) /* force splitting the window */
{
exarg_T ea;
int save_msg_scroll = msg_scroll;
@@ -7780,8 +7686,7 @@ handle_drop(filec, filev, split)
* Clear an argument list: free all file names and reset it to zero entries.
*/
void
-alist_clear(al)
- alist_T *al;
+alist_clear(alist_T *al)
{
while (--al->al_ga.ga_len >= 0)
vim_free(AARGLIST(al)[al->al_ga.ga_len].ae_fname);
@@ -7792,8 +7697,7 @@ alist_clear(al)
* Init an argument list.
*/
void
-alist_init(al)
- alist_T *al;
+alist_init(alist_T *al)
{
ga_init2(&al->al_ga, (int)sizeof(aentry_T), 5);
}
@@ -7806,8 +7710,7 @@ alist_init(al)
* If the argument list is no longer used by any window, free it.
*/
void
-alist_unlink(al)
- alist_T *al;
+alist_unlink(alist_T *al)
{
if (al != &global_alist && --al->al_refcount <= 0)
{
@@ -7821,7 +7724,7 @@ alist_unlink(al)
* Create a new argument list and use it for the current window.
*/
void
-alist_new()
+alist_new(void)
{
curwin->w_alist = (alist_T *)alloc((unsigned)sizeof(alist_T));
if (curwin->w_alist == NULL)
@@ -7846,9 +7749,7 @@ alist_new()
* numbers to be re-used.
*/
void
-alist_expand(fnum_list, fnum_len)
- int *fnum_list;
- int fnum_len;
+alist_expand(int *fnum_list, int fnum_len)
{
char_u **old_arg_files;
int old_arg_count;
@@ -7886,13 +7787,13 @@ alist_expand(fnum_list, fnum_len)
* Takes over the allocated files[] and the allocated fnames in it.
*/
void
-alist_set(al, count, files, use_curbuf, fnum_list, fnum_len)
- alist_T *al;
- int count;
- char_u **files;
- int use_curbuf;
- int *fnum_list;
- int fnum_len;
+alist_set(
+ alist_T *al,
+ int count,
+ char_u **files,
+ int use_curbuf,
+ int *fnum_list,
+ int fnum_len)
{
int i;
@@ -7933,10 +7834,10 @@ alist_set(al, count, files, use_curbuf, fnum_list, fnum_len)
* "fname" must have been allocated and "al" must have been checked for room.
*/
void
-alist_add(al, fname, set_fnum)
- alist_T *al;
- char_u *fname;
- int set_fnum; /* 1: set buffer number; 2: re-use curbuf */
+alist_add(
+ alist_T *al,
+ char_u *fname,
+ int set_fnum) /* 1: set buffer number; 2: re-use curbuf */
{
if (fname == NULL) /* don't add NULL file names */
return;
@@ -7955,7 +7856,7 @@ alist_add(al, fname, set_fnum)
* Adjust slashes in file names. Called after 'shellslash' was set.
*/
void
-alist_slash_adjust()
+alist_slash_adjust(void)
{
int i;
# ifdef FEAT_WINDOWS
@@ -7980,8 +7881,7 @@ alist_slash_adjust()
* ":preserve".
*/
static void
-ex_preserve(eap)
- exarg_T *eap UNUSED;
+ex_preserve(exarg_T *eap UNUSED)
{
curbuf->b_flags |= BF_PRESERVED;
ml_preserve(curbuf, TRUE);
@@ -7991,8 +7891,7 @@ ex_preserve(eap)
* ":recover".
*/
static void
-ex_recover(eap)
- exarg_T *eap;
+ex_recover(exarg_T *eap)
{
/* Set recoverymode right away to avoid the ATTENTION prompt. */
recoverymode = TRUE;
@@ -8011,8 +7910,7 @@ ex_recover(eap)
* Command modifier used in a wrong way.
*/
static void
-ex_wrongmodifier(eap)
- exarg_T *eap;
+ex_wrongmodifier(exarg_T *eap)
{
eap->errmsg = e_invcmd;
}
@@ -8032,8 +7930,7 @@ ex_wrongmodifier(eap)
* :tabfind [+command] file open new Tab page and find "file"
*/
void
-ex_splitview(eap)
- exarg_T *eap;
+ex_splitview(exarg_T *eap)
{
win_T *old_curwin = curwin;
# if defined(FEAT_SEARCHPATH) || defined(FEAT_BROWSE)
@@ -8169,7 +8066,7 @@ theend:
* Open a new tab page.
*/
void
-tabpage_new()
+tabpage_new(void)
{
exarg_T ea;
@@ -8184,8 +8081,7 @@ tabpage_new()
* :tabnext command
*/
static void
-ex_tabnext(eap)
- exarg_T *eap;
+ex_tabnext(exarg_T *eap)
{
switch (eap->cmdidx)
{
@@ -8210,8 +8106,7 @@ ex_tabnext(eap)
* :tabmove command
*/
static void
-ex_tabmove(eap)
- exarg_T *eap;
+ex_tabmove(exarg_T *eap)
{
int tab_number;
@@ -8274,8 +8169,7 @@ ex_tabmove(eap)
* :tabs command: List tabs and their contents.
*/
static void
-ex_tabs(eap)
- exarg_T *eap UNUSED;
+ex_tabs(exarg_T *eap UNUSED)
{
tabpage_T *tp;
win_T *wp;
@@ -8321,8 +8215,7 @@ ex_tabs(eap)
* If no argument given, just get the screen size and redraw.
*/
static void
-ex_mode(eap)
- exarg_T *eap;
+ex_mode(exarg_T *eap)
{
if (*eap->arg == NUL)
shell_resized();
@@ -8336,8 +8229,7 @@ ex_mode(eap)
* set, increment or decrement current window height
*/
static void
-ex_resize(eap)
- exarg_T *eap;
+ex_resize(exarg_T *eap)
{
int n;
win_T *wp = curwin;
@@ -8378,8 +8270,7 @@ ex_resize(eap)
* ":find [+command] <file>" command.
*/
static void
-ex_find(eap)
- exarg_T *eap;
+ex_find(exarg_T *eap)
{
#ifdef FEAT_SEARCHPATH
char_u *fname;
@@ -8415,8 +8306,7 @@ ex_find(eap)
* ":open" simulation: for now just work like ":visual".
*/
static void
-ex_open(eap)
- exarg_T *eap;
+ex_open(exarg_T *eap)
{
regmatch_T regmatch;
char_u *p;
@@ -8453,8 +8343,7 @@ ex_open(eap)
* ":edit", ":badd", ":visual".
*/
static void
-ex_edit(eap)
- exarg_T *eap;
+ex_edit(exarg_T *eap)
{
do_exedit(eap, NULL);
}
@@ -8463,9 +8352,9 @@ ex_edit(eap)
* ":edit <file>" command and alikes.
*/
void
-do_exedit(eap, old_curwin)
- exarg_T *eap;
- win_T *old_curwin; /* curwin before doing a split or NULL */
+do_exedit(
+ exarg_T *eap,
+ win_T *old_curwin) /* curwin before doing a split or NULL */
{
int n;
#ifdef FEAT_WINDOWS
@@ -8650,8 +8539,7 @@ do_exedit(eap, old_curwin)
* ":gui" and ":gvim" when there is no GUI.
*/
static void
-ex_nogui(eap)
- exarg_T *eap;
+ex_nogui(exarg_T *eap)
{
eap->errmsg = e_nogvim;
}
@@ -8659,8 +8547,7 @@ ex_nogui(eap)
#if defined(FEAT_GUI_W32) && defined(FEAT_MENU) && defined(FEAT_TEAROFF)
static void
-ex_tearoff(eap)
- exarg_T *eap;
+ex_tearoff(exarg_T *eap)
{
gui_make_tearoff(eap->arg);
}
@@ -8668,16 +8555,14 @@ ex_tearoff(eap)
#if (defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_GTK)) && defined(FEAT_MENU)
static void
-ex_popup(eap)
- exarg_T *eap;
+ex_popup(exarg_T *eap)
{
gui_make_popup(eap->arg, eap->forceit);
}
#endif
static void
-ex_swapname(eap)
- exarg_T *eap UNUSED;
+ex_swapname(exarg_T *eap UNUSED)
{
if (curbuf->b_ml.ml_mfp == NULL || curbuf->b_ml.ml_mfp->mf_fname == NULL)
MSG(_("No swap file"));
@@ -8691,8 +8576,7 @@ ex_swapname(eap)
* (1998-11-02 16:21:01 R. Edward Ralston <eralston@computer.org>)
*/
static void
-ex_syncbind(eap)
- exarg_T *eap UNUSED;
+ex_syncbind(exarg_T *eap UNUSED)
{
#ifdef FEAT_SCROLLBIND
win_T *wp;
@@ -8769,8 +8653,7 @@ ex_syncbind(eap)
static void
-ex_read(eap)
- exarg_T *eap;
+ex_read(exarg_T *eap)
{
int i;
int empty = (curbuf->b_ml.ml_flags & ML_EMPTY);
@@ -8851,7 +8734,7 @@ static char_u *prev_dir = NULL;
#if defined(EXITFREE) || defined(PROTO)
void
-free_cd_dir()
+free_cd_dir(void)
{
vim_free(prev_dir);
prev_dir = NULL;
@@ -8866,8 +8749,7 @@ free_cd_dir()
* When "local" is TRUE then this was after an ":lcd" command.
*/
void
-post_chdir(local)
- int local;
+post_chdir(int local)
{
vim_free(curwin->w_localdir);
curwin->w_localdir = NULL;
@@ -8897,8 +8779,7 @@ post_chdir(local)
* ":cd", ":lcd", ":chdir" and ":lchdir".
*/
void
-ex_cd(eap)
- exarg_T *eap;
+ex_cd(exarg_T *eap)
{
char_u *new_dir;
char_u *tofree;
@@ -8977,8 +8858,7 @@ ex_cd(eap)
* ":pwd".
*/
static void
-ex_pwd(eap)
- exarg_T *eap UNUSED;
+ex_pwd(exarg_T *eap UNUSED)
{
if (mch_dirname(NameBuff, MAXPATHL) == OK)
{
@@ -8995,16 +8875,14 @@ ex_pwd(eap)
* ":=".
*/
static void
-ex_equal(eap)
- exarg_T *eap;
+ex_equal(exarg_T *eap)
{
smsg((char_u *)"%ld", (long)eap->line2);
ex_may_print(eap);
}
static void
-ex_sleep(eap)
- exarg_T *eap;
+ex_sleep(exarg_T *eap)
{
int n;
long len;
@@ -9030,8 +8908,7 @@ ex_sleep(eap)
* Sleep for "msec" milliseconds, but keep checking for a CTRL-C every second.
*/
void
-do_sleep(msec)
- long msec;
+do_sleep(long msec)
{
long done;
@@ -9051,9 +8928,7 @@ do_sleep(msec)
}
static void
-do_exmap(eap, isabbrev)
- exarg_T *eap;
- int isabbrev;
+do_exmap(exarg_T *eap, int isabbrev)
{
int mode;
char_u *cmdp;
@@ -9075,8 +8950,7 @@ do_exmap(eap, isabbrev)
* ":winsize" command (obsolete).
*/
static void
-ex_winsize(eap)
- exarg_T *eap;
+ex_winsize(exarg_T *eap)
{
int w, h;
char_u *arg = eap->arg;
@@ -9094,8 +8968,7 @@ ex_winsize(eap)
#ifdef FEAT_WINDOWS
static void
-ex_wincmd(eap)
- exarg_T *eap;
+ex_wincmd(exarg_T *eap)
{
int xchar = NUL;
char_u *p;
@@ -9135,8 +9008,7 @@ ex_wincmd(eap)
* ":winpos".
*/
static void
-ex_winpos(eap)
- exarg_T *eap;
+ex_winpos(exarg_T *eap)
{
int x, y;
char_u *arg = eap->arg;
@@ -9198,8 +9070,7 @@ ex_winpos(eap)
* Handle command that work like operators: ":delete", ":yank", ":>" and ":<".
*/
static void
-ex_operators(eap)
- exarg_T *eap;
+ex_operators(exarg_T *eap)
{
oparg_T oa;
@@ -9258,8 +9129,7 @@ ex_operators(eap)
* ":put".
*/
static void
-ex_put(eap)
- exarg_T *eap;
+ex_put(exarg_T *eap)
{
/* ":0put" works like ":1put!". */
if (eap->line2 == 0)
@@ -9276,8 +9146,7 @@ ex_put(eap)
* Handle ":copy" and ":move".
*/
static void
-ex_copymove(eap)
- exarg_T *eap;
+ex_copymove(exarg_T *eap)
{
long n;
@@ -9314,8 +9183,7 @@ ex_copymove(eap)
* Print the current line if flags were given to the Ex command.
*/
void
-ex_may_print(eap)
- exarg_T *eap;
+ex_may_print(exarg_T *eap)
{
if (eap->flags != 0)
{
@@ -9329,8 +9197,7 @@ ex_may_print(eap)
* ":smagic" and ":snomagic".
*/
static void
-ex_submagic(eap)
- exarg_T *eap;
+ex_submagic(exarg_T *eap)
{
int magic_save = p_magic;
@@ -9343,8 +9210,7 @@ ex_submagic(eap)
* ":join".
*/
static void
-ex_join(eap)
- exarg_T *eap;
+ex_join(exarg_T *eap)
{
curwin->w_cursor.lnum = eap->line1;
if (eap->line1 == eap->line2)
@@ -9367,8 +9233,7 @@ ex_join(eap)
* ":[addr]@r" or ":[addr]*r": execute register
*/
static void
-ex_at(eap)
- exarg_T *eap;
+ex_at(exarg_T *eap)
{
int c;
int prev_len = typebuf.tb_len;
@@ -9411,8 +9276,7 @@ ex_at(eap)
* ":!".
*/
static void
-ex_bang(eap)
- exarg_T *eap;
+ex_bang(exarg_T *eap)
{
do_bang(eap->addr_count, eap, eap->forceit, TRUE, TRUE);
}
@@ -9421,8 +9285,7 @@ ex_bang(eap)
* ":undo".
*/
static void
-ex_undo(eap)
- exarg_T *eap UNUSED;
+ex_undo(exarg_T *eap UNUSED)
{
if (eap->addr_count == 1) /* :undo 123 */
undo_time(eap->line2, FALSE, FALSE, TRUE);
@@ -9432,8 +9295,7 @@ ex_undo(eap)
#ifdef FEAT_PERSISTENT_UNDO
static void
-ex_wundo(eap)
- exarg_T *eap;
+ex_wundo(exarg_T *eap)
{
char_u hash[UNDO_HASH_SIZE];
@@ -9442,8 +9304,7 @@ ex_wundo(eap)
}
static void
-ex_rundo(eap)
- exarg_T *eap;
+ex_rundo(exarg_T *eap)
{
char_u hash[UNDO_HASH_SIZE];
@@ -9456,8 +9317,7 @@ ex_rundo(eap)
* ":redo".
*/
static void
-ex_redo(eap)
- exarg_T *eap UNUSED;
+ex_redo(exarg_T *eap UNUSED)
{
u_redo(1);
}
@@ -9466,8 +9326,7 @@ ex_redo(eap)
* ":earlier" and ":later".
*/
static void
-ex_later(eap)
- exarg_T *eap;
+ex_later(exarg_T *eap)
{
long count = 0;
int sec = FALSE;
@@ -9500,8 +9359,7 @@ ex_later(eap)
* ":redir": start/stop redirection.
*/
static void
-ex_redir(eap)
- exarg_T *eap;
+ex_redir(exarg_T *eap)
{
char *mode;
char_u *fname;
@@ -9622,8 +9480,7 @@ ex_redir(eap)
* ":redraw": force redraw
*/
static void
-ex_redraw(eap)
- exarg_T *eap;
+ex_redraw(exarg_T *eap)
{
int r = RedrawingDisabled;
int p = p_lz;
@@ -9653,8 +9510,7 @@ ex_redraw(eap)
* ":redrawstatus": force redraw of status line(s)
*/
static void
-ex_redrawstatus(eap)
- exarg_T *eap UNUSED;
+ex_redrawstatus(exarg_T *eap UNUSED)
{
#if defined(FEAT_WINDOWS)
int r = RedrawingDisabled;
@@ -9674,7 +9530,7 @@ ex_redrawstatus(eap)
}
static void
-close_redir()
+close_redir(void)
{
if (redir_fd != NULL)
{
@@ -9700,8 +9556,8 @@ static int mksession_nl = FALSE; /* use NL only in put_eol() */
* ":mkexrc", ":mkvimrc", ":mkview" and ":mksession".
*/
static void
-ex_mkrc(eap)
- exarg_T *eap;
+ex_mkrc(
+ exarg_T *eap)
{
FILE *fd;
int failed = FALSE;
@@ -9926,9 +9782,7 @@ theend:
#if ((defined(FEAT_SESSION) || defined(FEAT_EVAL)) && defined(vim_mkdir)) \
|| defined(PROTO)
int
-vim_mkdir_emsg(name, prot)
- char_u *name;
- int prot UNUSED;
+vim_mkdir_emsg(char_u *name, int prot UNUSED)
{
if (vim_mkdir(name, prot) != 0)
{
@@ -9944,10 +9798,10 @@ vim_mkdir_emsg(name, prot)
* Return file descriptor, or NULL on failure.
*/
FILE *
-open_exfile(fname, forceit, mode)
- char_u *fname;
- int forceit;
- char *mode; /* "w" for create new file or "a" for append */
+open_exfile(
+ char_u *fname,
+ int forceit,
+ char *mode) /* "w" for create new file or "a" for append */
{
FILE *fd;
@@ -9975,8 +9829,7 @@ open_exfile(fname, forceit, mode)
* ":mark" and ":k".
*/
static void
-ex_mark(eap)
- exarg_T *eap;
+ex_mark(exarg_T *eap)
{
pos_T pos;
@@ -9999,7 +9852,7 @@ ex_mark(eap)
* Update w_topline, w_leftcol and the cursor position.
*/
void
-update_topline_cursor()
+update_topline_cursor(void)
{
check_cursor(); /* put cursor on valid line */
update_topline();
@@ -10013,8 +9866,7 @@ update_topline_cursor()
* ":normal[!] {commands}": Execute normal mode commands.
*/
static void
-ex_normal(eap)
- exarg_T *eap;
+ex_normal(exarg_T *eap)
{
int save_msg_scroll = msg_scroll;
int save_restart_edit = restart_edit;
@@ -10173,8 +10025,7 @@ ex_normal(eap)
* ":startinsert", ":startreplace" and ":startgreplace"
*/
static void
-ex_startinsert(eap)
- exarg_T *eap;
+ex_startinsert(exarg_T *eap)
{
if (eap->forceit)
{
@@ -10207,8 +10058,7 @@ ex_startinsert(eap)
* ":stopinsert"
*/
static void
-ex_stopinsert(eap)
- exarg_T *eap UNUSED;
+ex_stopinsert(exarg_T *eap UNUSED)
{
restart_edit = 0;
stop_insert_mode = TRUE;
@@ -10221,10 +10071,7 @@ ex_stopinsert(eap)
* "remap" can be REMAP_NONE or REMAP_YES.
*/
void
-exec_normal_cmd(cmd, remap, silent)
- char_u *cmd;
- int remap;
- int silent;
+exec_normal_cmd(char_u *cmd, int remap, int silent)
{
/* Stuff the argument into the typeahead buffer. */
ins_typebuf(cmd, remap, 0, TRUE, silent);
@@ -10255,8 +10102,7 @@ exec_normal(int was_typed)
#ifdef FEAT_FIND_ID
static void
-ex_checkpath(eap)
- exarg_T *eap;
+ex_checkpath(exarg_T *eap)
{
find_pattern_in_path(NULL, 0, 0, FALSE, FALSE, CHECK_PATH, 1L,
eap->forceit ? ACTION_SHOW_ALL : ACTION_SHOW,
@@ -10268,8 +10114,7 @@ ex_checkpath(eap)
* ":psearch"
*/
static void
-ex_psearch(eap)
- exarg_T *eap;
+ex_psearch(exarg_T *eap)
{
g_do_tagpreview = p_pvh;
ex_findpat(eap);
@@ -10278,8 +10123,7 @@ ex_psearch(eap)
#endif
static void
-ex_findpat(eap)
- exarg_T *eap;
+ex_findpat(exarg_T *eap)
{
int whole = TRUE;
long n;
@@ -10343,8 +10187,7 @@ ex_findpat(eap)
* ":ptag", ":ptselect", ":ptjump", ":ptnext", etc.
*/
static void
-ex_ptag(eap)
- exarg_T *eap;
+ex_ptag(exarg_T *eap)
{
g_do_tagpreview = p_pvh; /* will be reset to 0 in ex_tag_cmd() */
ex_tag_cmd(eap, cmdnames[eap->cmdidx].cmd_name + 1);
@@ -10354,8 +10197,7 @@ ex_ptag(eap)
* ":pedit"
*/
static void
-ex_pedit(eap)
- exarg_T *eap;
+ex_pedit(exarg_T *eap)
{
win_T *curwin_save = curwin;
@@ -10379,8 +10221,7 @@ ex_pedit(eap)
* ":stag", ":stselect" and ":stjump".
*/
static void
-ex_stag(eap)
- exarg_T *eap;
+ex_stag(exarg_T *eap)
{
postponed_split = -1;
postponed_split_flags = cmdmod.split;
@@ -10395,16 +10236,13 @@ ex_stag(eap)
* ":tag", ":tselect", ":tjump", ":tnext", etc.
*/
static void
-ex_tag(eap)
- exarg_T *eap;
+ex_tag(exarg_T *eap)
{
ex_tag_cmd(eap, cmdnames[eap->cmdidx].cmd_name);
}
static void
-ex_tag_cmd(eap, name)
- exarg_T *eap;
- char_u *name;
+ex_tag_cmd(exarg_T *eap, char_u *name)
{
int cmd;
@@ -10459,9 +10297,7 @@ ex_tag_cmd(eap, name)
* the variable. Otherwise return -1 and "*usedlen" is unchanged.
*/
int
-find_cmdline_var(src, usedlen)
- char_u *src;
- int *usedlen;
+find_cmdline_var(char_u *src, int *usedlen)
{
int len;
int i;
@@ -10531,13 +10367,13 @@ find_cmdline_var(src, usedlen)
* number of characters to skip.
*/
char_u *
-eval_vars(src, srcstart, usedlen, lnump, errormsg, escaped)
- char_u *src; /* pointer into commandline */
- char_u *srcstart; /* beginning of valid memory for src */
- int *usedlen; /* characters after src that are used */
- linenr_T *lnump; /* line number for :e command, or NULL */
- char_u **errormsg; /* pointer to error message */
- int *escaped; /* return value has escaped white space (can
+eval_vars(
+ char_u *src, /* pointer into commandline */
+ char_u *srcstart, /* beginning of valid memory for src */
+ int *usedlen, /* characters after src that are used */
+ linenr_T *lnump, /* line number for :e command, or NULL */
+ char_u **errormsg, /* pointer to error message */
+ int *escaped) /* return value has escaped white space (can
* be NULL) */
{
int i;
@@ -10794,7 +10630,7 @@ eval_vars(src, srcstart, usedlen, lnump, errormsg, escaped)
* Returns NULL when out of memory.
*/
static char_u *
-arg_all()
+arg_all(void)
{
int len;
int idx;
@@ -10864,8 +10700,7 @@ arg_all()
* Returns an allocated string, or NULL for any error.
*/
char_u *
-expand_sfile(arg)
- char_u *arg;
+expand_sfile(char_u *arg)
{
char_u *errormsg;
int len;
@@ -10938,9 +10773,9 @@ static int ses_fname(FILE *fd, buf_T *buf, unsigned *flagp);
* Return FAIL on error, OK otherwise.
*/
static int
-makeopens(fd, dirnow)
- FILE *fd;
- char_u *dirnow; /* Current directory name */
+makeopens(
+ FILE *fd,
+ char_u *dirnow) /* Current directory name */
{
buf_T *buf;
int only_save_windows = TRUE;
@@ -11256,10 +11091,10 @@ makeopens(fd, dirnow)
}
static int
-ses_winsizes(fd, restore_size, tab_firstwin)
- FILE *fd;
- int restore_size;
- win_T *tab_firstwin;
+ses_winsizes(
+ FILE *fd,
+ int restore_size,
+ win_T *tab_firstwin)
{
int n = 0;
win_T *wp;
@@ -11304,9 +11139,7 @@ ses_winsizes(fd, restore_size, tab_firstwin)
* Returns FAIL when writing the commands to "fd" fails.
*/
static int
-ses_win_rec(fd, fr)
- FILE *fd;
- frame_T *fr;
+ses_win_rec(FILE *fd, frame_T *fr)
{
frame_T *frc;
int count = 0;
@@ -11354,8 +11187,7 @@ ses_win_rec(fd, fr)
* Returns NULL when there none.
*/
static frame_T *
-ses_skipframe(fr)
- frame_T *fr;
+ses_skipframe(frame_T *fr)
{
frame_T *frc;
@@ -11370,8 +11202,7 @@ ses_skipframe(fr)
* the Session.
*/
static int
-ses_do_frame(fr)
- frame_T *fr;
+ses_do_frame(frame_T *fr)
{
frame_T *frc;
@@ -11387,8 +11218,7 @@ ses_do_frame(fr)
* Return non-zero if window "wp" is to be stored in the Session.
*/
static int
-ses_do_win(wp)
- win_T *wp;
+ses_do_win(win_T *wp)
{
if (wp->w_buffer->b_fname == NULL
#ifdef FEAT_QUICKFIX
@@ -11407,12 +11237,12 @@ ses_do_win(wp)
* Caller must make sure 'scrolloff' is zero.
*/
static int
-put_view(fd, wp, add_edit, flagp, current_arg_idx)
- FILE *fd;
- win_T *wp;
- int add_edit; /* add ":edit" command to view */
- unsigned *flagp; /* vop_flags or ssop_flags */
- int current_arg_idx; /* current argument index of the window, use
+put_view(
+ FILE *fd,
+ win_T *wp,
+ int add_edit, /* add ":edit" command to view */
+ unsigned *flagp, /* vop_flags or ssop_flags */
+ int current_arg_idx) /* current argument index of the window, use
* -1 if unknown */
{
win_T *save_curwin;
@@ -11612,12 +11442,12 @@ put_view(fd, wp, add_edit, flagp, current_arg_idx)
* Returns FAIL if writing fails.
*/
static int
-ses_arglist(fd, cmd, gap, fullname, flagp)
- FILE *fd;
- char *cmd;
- garray_T *gap;
- int fullname; /* TRUE: use full path name */
- unsigned *flagp;
+ses_arglist(
+ FILE *fd,
+ char *cmd,
+ garray_T *gap,
+ int fullname, /* TRUE: use full path name */
+ unsigned *flagp)
{
int i;
char_u *buf = NULL;
@@ -11661,10 +11491,7 @@ ses_arglist(fd, cmd, gap, fullname, flagp)
* Returns FAIL if writing fails.
*/
static int
-ses_fname(fd, buf, flagp)
- FILE *fd;
- buf_T *buf;
- unsigned *flagp;
+ses_fname(FILE *fd, buf_T *buf, unsigned *flagp)
{
char_u *name;
@@ -11695,10 +11522,7 @@ ses_fname(fd, buf, flagp)
* Returns FAIL if writing fails or out of memory.
*/
static int
-ses_put_fname(fd, name, flagp)
- FILE *fd;
- char_u *name;
- unsigned *flagp;
+ses_put_fname(FILE *fd, char_u *name, unsigned *flagp)
{
char_u *sname;
char_u *p;
@@ -11734,8 +11558,7 @@ ses_put_fname(fd, name, flagp)
* ":loadview [nr]"
*/
static void
-ex_loadview(eap)
- exarg_T *eap;
+ex_loadview(exarg_T *eap)
{
char_u *fname;
@@ -11751,8 +11574,7 @@ ex_loadview(eap)
* Get the name of the view file for the current buffer.
*/
static char_u *
-get_view_file(c)
- int c;
+get_view_file(int c)
{
int len = 0;
char_u *p, *s;
@@ -11820,8 +11642,7 @@ get_view_file(c)
* Return FAIL for a write error.
*/
int
-put_eol(fd)
- FILE *fd;
+put_eol(FILE *fd)
{
if (
#ifdef USE_CRNL
@@ -11841,9 +11662,7 @@ put_eol(fd)
* Return FAIL for a write error.
*/
int
-put_line(fd, s)
- FILE *fd;
- char *s;
+put_line(FILE *fd, char *s)
{
if (fputs(s, fd) < 0 || put_eol(fd) == FAIL)
return FAIL;
@@ -11855,8 +11674,8 @@ put_line(fd, s)
* ":rviminfo" and ":wviminfo".
*/
static void
-ex_viminfo(eap)
- exarg_T *eap;
+ex_viminfo(
+ exarg_T *eap)
{
char_u *save_viminfo;
@@ -11881,10 +11700,7 @@ ex_viminfo(eap)
* "format" must contain "%s".
*/
void
-dialog_msg(buff, format, fname)
- char_u *buff;
- char *format;
- char_u *fname;
+dialog_msg(char_u *buff, char *format, char_u *fname)
{
if (fname == NULL)
fname = (char_u *)_("Untitled");
@@ -11896,8 +11712,7 @@ dialog_msg(buff, format, fname)
* ":behave {mswin,xterm}"
*/
static void
-ex_behave(eap)
- exarg_T *eap;
+ex_behave(exarg_T *eap)
{
if (STRCMP(eap->arg, "mswin") == 0)
{
@@ -11924,9 +11739,7 @@ ex_behave(eap)
* ":behave {mswin,xterm}" command.
*/
char_u *
-get_behave_arg(xp, idx)
- expand_T *xp UNUSED;
- int idx;
+get_behave_arg(expand_T *xp UNUSED, int idx)
{
if (idx == 0)
return (char_u *)"mswin";
@@ -11951,8 +11764,7 @@ static int filetype_indent = FALSE;
* indent off: load indoff.vim
*/
static void
-ex_filetype(eap)
- exarg_T *eap;
+ex_filetype(exarg_T *eap)
{
char_u *arg = eap->arg;
int plugin = FALSE;
@@ -12037,8 +11849,7 @@ ex_filetype(eap)
* ":setfiletype {name}"
*/
static void
-ex_setfiletype(eap)
- exarg_T *eap;
+ex_setfiletype(exarg_T *eap)
{
if (!did_filetype)
set_option_value((char_u *)"filetype", 0L, eap->arg, OPT_LOCAL);
@@ -12046,8 +11857,7 @@ ex_setfiletype(eap)
#endif
static void
-ex_digraphs(eap)
- exarg_T *eap UNUSED;
+ex_digraphs(exarg_T *eap UNUSED)
{
#ifdef FEAT_DIGRAPHS
if (*eap->arg != NUL)
@@ -12060,8 +11870,7 @@ ex_digraphs(eap)
}
static void
-ex_set(eap)
- exarg_T *eap;
+ex_set(exarg_T *eap)
{
int flags = 0;
@@ -12082,8 +11891,7 @@ ex_set(eap)
* ":nohlsearch"
*/
static void
-ex_nohlsearch(eap)
- exarg_T *eap UNUSED;
+ex_nohlsearch(exarg_T *eap UNUSED)
{
SET_NO_HLSEARCH(TRUE);
redraw_all_later(SOME_VALID);
@@ -12095,8 +11903,7 @@ ex_nohlsearch(eap)
* skipping commands to find the next command.
*/
static void
-ex_match(eap)
- exarg_T *eap;
+ex_match(exarg_T *eap)
{
char_u *p;
char_u *g = NULL;
@@ -12166,8 +11973,7 @@ ex_match(eap)
* ":X": Get crypt key
*/
static void
-ex_X(eap)
- exarg_T *eap UNUSED;
+ex_X(exarg_T *eap UNUSED)
{
crypt_check_current_method();
(void)crypt_get_key(TRUE, TRUE);
@@ -12176,24 +11982,21 @@ ex_X(eap)
#ifdef FEAT_FOLDING
static void
-ex_fold(eap)
- exarg_T *eap;
+ex_fold(exarg_T *eap)
{
if (foldManualAllowed(TRUE))
foldCreate(eap->line1, eap->line2);
}
static void
-ex_foldopen(eap)
- exarg_T *eap;
+ex_foldopen(exarg_T *eap)
{
opFoldRange(eap->line1, eap->line2, eap->cmdidx == CMD_foldopen,
eap->forceit, FALSE);
}
static void
-ex_folddo(eap)
- exarg_T *eap;
+ex_folddo(exarg_T *eap)
{
linenr_T lnum;
diff --git a/src/ex_eval.c b/src/ex_eval.c
index 2632f0c9a..c8e33c2ee 100644
--- a/src/ex_eval.c
+++ b/src/ex_eval.c
@@ -93,7 +93,7 @@ static int cause_abort = FALSE;
* due to a parsing error, aborting() always returns the same value.
*/
int
-aborting()
+aborting(void)
{
return (did_emsg && force_abort) || got_int || did_throw;
}
@@ -105,7 +105,7 @@ aborting()
* error message has been reached. update_force_abort() should be called then.
*/
void
-update_force_abort()
+update_force_abort(void)
{
if (cause_abort)
force_abort = TRUE;
@@ -118,8 +118,7 @@ update_force_abort()
* displayed and actually caused the abortion.
*/
int
-should_abort(retcode)
- int retcode;
+should_abort(int retcode)
{
return ((retcode == FAIL && trylevel != 0 && !emsg_silent) || aborting());
}
@@ -131,7 +130,7 @@ should_abort(retcode)
* commands are still reported.
*/
int
-aborted_in_try()
+aborted_in_try(void)
{
/* This function is only called after an error. In this case, "force_abort"
* determines whether searching for finally clauses is necessary. */
@@ -148,10 +147,10 @@ aborted_in_try()
* set to TRUE, if a later but severer message should be used instead.
*/
int
-cause_errthrow(mesg, severe, ignore)
- char_u *mesg;
- int severe;
- int *ignore;
+cause_errthrow(
+ char_u *mesg,
+ int severe,
+ int *ignore)
{
struct msglist *elem;
struct msglist **plist;
@@ -305,8 +304,7 @@ cause_errthrow(mesg, severe, ignore)
* Free a "msg_list" and the messages it contains.
*/
static void
-free_msglist(l)
- struct msglist *l;
+free_msglist(struct msglist *l)
{
struct msglist *messages, *next;
@@ -325,7 +323,7 @@ free_msglist(l)
* to NULL.
*/
void
-free_global_msglist()
+free_global_msglist(void)
{
free_msglist(*msg_list);
*msg_list = NULL;
@@ -337,9 +335,7 @@ free_global_msglist()
* has returned (see do_one_cmd()).
*/
void
-do_errthrow(cstack, cmdname)
- struct condstack *cstack;
- char_u *cmdname;
+do_errthrow(struct condstack *cstack, char_u *cmdname)
{
/*
* Ensure that all commands in nested function calls and sourced files
@@ -374,8 +370,7 @@ do_errthrow(cstack, cmdname)
* FALSE otherwise.
*/
int
-do_intthrow(cstack)
- struct condstack *cstack;
+do_intthrow(struct condstack *cstack)
{
/*
* If no interrupt occurred or no try conditional is active and no exception
@@ -425,11 +420,11 @@ do_intthrow(cstack)
* Get an exception message that is to be stored in current_exception->value.
*/
char_u *
-get_exception_string(value, type, cmdname, should_free)
- void *value;
- int type;
- char_u *cmdname;
- int *should_free;
+get_exception_string(
+ void *value,
+ int type,
+ char_u *cmdname,
+ int *should_free)
{
char_u *ret, *mesg;
int cmdlen;
@@ -508,10 +503,7 @@ get_exception_string(value, type, cmdname, should_free)
* error exception.
*/
static int
-throw_exception(value, type, cmdname)
- void *value;
- int type;
- char_u *cmdname;
+throw_exception(void *value, int type, char_u *cmdname)
{
except_T *excp;
int should_free;
@@ -597,9 +589,7 @@ fail:
* caught and the catch clause has been ended normally.
*/
static void
-discard_exception(excp, was_finished)
- except_T *excp;
- int was_finished;
+discard_exception(except_T *excp, int was_finished)
{
char_u *saved_IObuff;
@@ -648,7 +638,7 @@ discard_exception(excp, was_finished)
* Discard the exception currently being thrown.
*/
void
-discard_current_exception()
+discard_current_exception(void)
{
discard_exception(current_exception, FALSE);
current_exception = NULL;
@@ -660,8 +650,7 @@ discard_current_exception()
* Put an exception on the caught stack.
*/
static void
-catch_exception(excp)
- except_T *excp;
+catch_exception(except_T *excp)
{
excp->caught = caught_stack;
caught_stack = excp;
@@ -708,8 +697,7 @@ catch_exception(excp)
* Remove an exception from the caught stack.
*/
static void
-finish_exception(excp)
- except_T *excp;
+finish_exception(except_T *excp)
{
if (excp != caught_stack)
EMSG(_(e_internal));
@@ -758,10 +746,7 @@ finish_exception(excp)
* or the exception value for a pending exception.
*/
static void
-report_pending(action, pending, value)
- int action;
- int pending;
- void *value;
+report_pending(int action, int pending, void *value)
{
char_u *mesg;
char *s;
@@ -841,9 +826,7 @@ report_pending(action, pending, value)
* the 'verbose' option or when debugging.
*/
void
-report_make_pending(pending, value)
- int pending;
- void *value;
+report_make_pending(int pending, void *value)
{
if (p_verbose >= 14 || debug_break_level > 0)
{
@@ -860,9 +843,7 @@ report_make_pending(pending, value)
* it if required by the 'verbose' option or when debugging.
*/
void
-report_resume_pending(pending, value)
- int pending;
- void *value;
+report_resume_pending(int pending, void *value)
{
if (p_verbose >= 14 || debug_break_level > 0)
{
@@ -879,9 +860,7 @@ report_resume_pending(pending, value)
* by the 'verbose' option or when debugging.
*/
void
-report_discard_pending(pending, value)
- int pending;
- void *value;
+report_discard_pending(int pending, void *value)
{
if (p_verbose >= 14 || debug_break_level > 0)
{
@@ -898,8 +877,7 @@ report_discard_pending(pending, value)
* ":if".
*/
void
-ex_if(eap)
- exarg_T *eap;
+ex_if(exarg_T *eap)
{
int error;
int skip;
@@ -937,8 +915,7 @@ ex_if(eap)
* ":endif".
*/
void
-ex_endif(eap)
- exarg_T *eap;
+ex_endif(exarg_T *eap)
{
did_endif = TRUE;
if (eap->cstack->cs_idx < 0
@@ -968,8 +945,7 @@ ex_endif(eap)
* ":else" and ":elseif".
*/
void
-ex_else(eap)
- exarg_T *eap;
+ex_else(exarg_T *eap)
{
int error;
int skip;
@@ -1060,8 +1036,7 @@ ex_else(eap)
* Handle ":while" and ":for".
*/
void
-ex_while(eap)
- exarg_T *eap;
+ex_while(exarg_T *eap)
{
int error;
int skip;
@@ -1160,8 +1135,7 @@ ex_while(eap)
* ":continue"
*/
void
-ex_continue(eap)
- exarg_T *eap;
+ex_continue(exarg_T *eap)
{
int idx;
struct condstack *cstack = eap->cstack;
@@ -1199,8 +1173,7 @@ ex_continue(eap)
* ":break"
*/
void
-ex_break(eap)
- exarg_T *eap;
+ex_break(exarg_T *eap)
{
int idx;
struct condstack *cstack = eap->cstack;
@@ -1226,8 +1199,7 @@ ex_break(eap)
* ":endwhile" and ":endfor"
*/
void
-ex_endwhile(eap)
- exarg_T *eap;
+ex_endwhile(exarg_T *eap)
{
struct condstack *cstack = eap->cstack;
int idx;
@@ -1313,8 +1285,7 @@ ex_endwhile(eap)
* ":throw expr"
*/
void
-ex_throw(eap)
- exarg_T *eap;
+ex_throw(exarg_T *eap)
{
char_u *arg = eap->arg;
char_u *value;
@@ -1344,8 +1315,7 @@ ex_throw(eap)
* used for rethrowing an uncaught exception.
*/
void
-do_throw(cstack)
- struct condstack *cstack;
+do_throw(struct condstack *cstack)
{
int idx;
int inactivate_try = FALSE;
@@ -1426,8 +1396,7 @@ do_throw(cstack)
* ":try"
*/
void
-ex_try(eap)
- exarg_T *eap;
+ex_try(exarg_T *eap)
{
int skip;
struct condstack *cstack = eap->cstack;
@@ -1496,8 +1465,7 @@ ex_try(eap)
* ":catch /{pattern}/" and ":catch"
*/
void
-ex_catch(eap)
- exarg_T *eap;
+ex_catch(exarg_T *eap)
{
int idx = 0;
int give_up = FALSE;
@@ -1657,8 +1625,7 @@ ex_catch(eap)
* ":finally"
*/
void
-ex_finally(eap)
- exarg_T *eap;
+ex_finally(exarg_T *eap)
{
int idx;
int skip = FALSE;
@@ -1785,8 +1752,7 @@ ex_finally(eap)
* ":endtry"
*/
void
-ex_endtry(eap)
- exarg_T *eap;
+ex_endtry(exarg_T *eap)
{
int idx;
int skip;
@@ -1984,8 +1950,7 @@ ex_endtry(eap)
* execution.
*/
void
-enter_cleanup(csp)
- cleanup_T *csp;
+enter_cleanup(cleanup_T *csp)
{
int pending = CSTP_NONE;
@@ -2047,8 +2012,7 @@ enter_cleanup(csp)
* exception state is discarded.
*/
void
-leave_cleanup(csp)
- cleanup_T *csp;
+leave_cleanup(cleanup_T *csp)
{
int pending = csp->pending;
@@ -2133,10 +2097,10 @@ leave_cleanup(csp)
* when such a try conditional is left.
*/
int
-cleanup_conditionals(cstack, searched_cond, inclusive)
- struct condstack *cstack;
- int searched_cond;
- int inclusive;
+cleanup_conditionals(
+ struct condstack *cstack,
+ int searched_cond,
+ int inclusive)
{
int idx;
int stop = FALSE;
@@ -2256,8 +2220,7 @@ cleanup_conditionals(cstack, searched_cond, inclusive)
* Return an appropriate error message for a missing endwhile/endfor/endif.
*/
static char_u *
-get_end_emsg(cstack)
- struct condstack *cstack;
+get_end_emsg(struct condstack *cstack)
{
if (cstack->cs_flags[cstack->cs_idx] & CSF_WHILE)
return e_endwhile;
@@ -2275,11 +2238,11 @@ get_end_emsg(cstack)
* Also free "for info" structures where needed.
*/
void
-rewind_conditionals(cstack, idx, cond_type, cond_level)
- struct condstack *cstack;
- int idx;
- int cond_type;
- int *cond_level;
+rewind_conditionals(
+ struct condstack *cstack,
+ int idx,
+ int cond_type,
+ int *cond_level)
{
while (cstack->cs_idx > idx)
{
@@ -2295,8 +2258,7 @@ rewind_conditionals(cstack, idx, cond_type, cond_level)
* ":endfunction" when not after a ":function"
*/
void
-ex_endfunction(eap)
- exarg_T *eap UNUSED;
+ex_endfunction(exarg_T *eap UNUSED)
{
EMSG(_("E193: :endfunction not inside a function"));
}
@@ -2305,8 +2267,7 @@ ex_endfunction(eap)
* Return TRUE if the string "p" looks like a ":while" or ":for" command.
*/
int
-has_loop_cmd(p)
- char_u *p;
+has_loop_cmd(char_u *p)
{
int len;
diff --git a/src/ex_getln.c b/src/ex_getln.c
index 6afe06f45..9a49f9f4f 100644
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -156,10 +156,10 @@ sort_func_compare(const void *s1, const void *s2);
* otherwise.
*/
char_u *
-getcmdline(firstc, count, indent)
- int firstc;
- long count UNUSED; /* only used for incremental search */
- int indent; /* indent for inside conditionals */
+getcmdline(
+ int firstc,
+ long count UNUSED, /* only used for incremental search */
+ int indent) /* indent for inside conditionals */
{
int c;
int i;
@@ -1988,12 +1988,12 @@ returncmd:
* Returns the command line in allocated memory, or NULL.
*/
char_u *
-getcmdline_prompt(firstc, prompt, attr, xp_context, xp_arg)
- int firstc;
- char_u *prompt; /* command line prompt */
- int attr; /* attributes for prompt */
- int xp_context; /* type of expansion */
- char_u *xp_arg; /* user-defined expansion argument */
+getcmdline_prompt(
+ int firstc,
+ char_u *prompt, /* command line prompt */
+ int attr, /* attributes for prompt */
+ int xp_context, /* type of expansion */
+ char_u *xp_arg) /* user-defined expansion argument */
{
char_u *s;
struct cmdline_info save_ccline;
@@ -2026,7 +2026,7 @@ getcmdline_prompt(firstc, prompt, attr, xp_context, xp_arg)
* 'balloonexpr', etc.
*/
int
-text_locked()
+text_locked(void)
{
#ifdef FEAT_CMDWIN
if (cmdwin_type != 0)
@@ -2040,7 +2040,7 @@ text_locked()
* window is open or editing the cmdline in another way.
*/
void
-text_locked_msg()
+text_locked_msg(void)
{
#ifdef FEAT_CMDWIN
if (cmdwin_type != 0)
@@ -2056,7 +2056,7 @@ text_locked_msg()
* and give an error message.
*/
int
-curbuf_locked()
+curbuf_locked(void)
{
if (curbuf_lock > 0)
{
@@ -2071,7 +2071,7 @@ curbuf_locked()
* message.
*/
int
-allbuf_locked()
+allbuf_locked(void)
{
if (allbuf_lock > 0)
{
@@ -2083,8 +2083,7 @@ allbuf_locked()
#endif
static int
-cmdline_charsize(idx)
- int idx;
+cmdline_charsize(int idx)
{
#if defined(FEAT_CRYPT) || defined(FEAT_EVAL)
if (cmdline_star > 0) /* showing '*', always 1 position */
@@ -2098,7 +2097,7 @@ cmdline_charsize(idx)
* indent.
*/
static void
-set_cmdspos()
+set_cmdspos(void)
{
if (ccline.cmdfirstc != NUL)
ccline.cmdspos = 1 + ccline.cmdindent;
@@ -2110,7 +2109,7 @@ set_cmdspos()
* Compute the screen position for the cursor on the command line.
*/
static void
-set_cmdspos_cursor()
+set_cmdspos_cursor(void)
{
int i, m, c;
@@ -2151,9 +2150,7 @@ set_cmdspos_cursor()
* character that doesn't fit, so that a ">" must be displayed.
*/
static void
-correct_cmdspos(idx, cells)
- int idx;
- int cells;
+correct_cmdspos(int idx, int cells)
{
if ((*mb_ptr2len)(ccline.cmdbuff + idx) > 1
&& (*mb_ptr2cells)(ccline.cmdbuff + idx) > 1
@@ -2166,10 +2163,10 @@ correct_cmdspos(idx, cells)
* Get an Ex command line for the ":" command.
*/
char_u *
-getexline(c, cookie, indent)
- int c; /* normally ':', NUL for ":append" */
- void *cookie UNUSED;
- int indent; /* indent for inside conditionals */
+getexline(
+ int c, /* normally ':', NUL for ":append" */
+ void *cookie UNUSED,
+ int indent) /* indent for inside conditionals */
{
/* When executing a register, remove ':' that's in front of each line. */
if (exec_from_reg && vpeekc() == ':')
@@ -2184,11 +2181,11 @@ getexline(c, cookie, indent)
* Returns a string in allocated memory or NULL.
*/
char_u *
-getexmodeline(promptc, cookie, indent)
- int promptc; /* normally ':', NUL for ":append" and '?' for
+getexmodeline(
+ int promptc, /* normally ':', NUL for ":append" and '?' for
:s prompt */
- void *cookie UNUSED;
- int indent; /* indent for inside conditionals */
+ void *cookie UNUSED,
+ int indent) /* indent for inside conditionals */
{
garray_T line_ga;
char_u *pend;
@@ -2473,7 +2470,7 @@ redraw:
* Return TRUE if ccline.overstrike is on.
*/
int
-cmdline_overstrike()
+cmdline_overstrike(void)
{
return ccline.overstrike;
}
@@ -2482,7 +2479,7 @@ cmdline_overstrike()
* Return TRUE if the cursor is at the end of the cmdline.
*/
int
-cmdline_at_end()
+cmdline_at_end(void)
{
return (ccline.cmdpos >= ccline.cmdlen);
}
@@ -2494,7 +2491,7 @@ cmdline_at_end()
* This is used by the IM code to obtain the start of the preedit string.
*/
colnr_T
-cmdline_getvcol_cursor()
+cmdline_getvcol_cursor(void)
{
if (ccline.cmdbuff == NULL || ccline.cmdpos > ccline.cmdlen)
return MAXCOL;
@@ -2522,7 +2519,7 @@ cmdline_getvcol_cursor()
* IM feedback attributes. The cursor position is restored after drawing.
*/
static void
-redrawcmd_preedit()
+redrawcmd_preedit(void)
{
if ((State & CMDLINE)
&& xic != NULL
@@ -2594,8 +2591,7 @@ redrawcmd_preedit()
* Returns the new value of ccline.cmdbuff and ccline.cmdbufflen.
*/
static void
-alloc_cmdbuff(len)
- int len;
+alloc_cmdbuff(int len)
{
/*
* give some extra space to avoid having to allocate all the time
@@ -2614,8 +2610,7 @@ alloc_cmdbuff(len)
* return FAIL for failure, OK otherwise
*/
static int
-realloc_cmdbuff(len)
- int len;
+realloc_cmdbuff(int len)
{
char_u *p;
@@ -2656,7 +2651,7 @@ static char_u *arshape_buf = NULL;
# if defined(EXITFREE) || defined(PROTO)
void
-free_cmdline_buf()
+free_cmdline_buf(void)
{
vim_free(arshape_buf);
}
@@ -2668,9 +2663,7 @@ free_cmdline_buf()
* when cmdline_star is TRUE.
*/
static void
-draw_cmdline(start, len)
- int start;
- int len;
+draw_cmdline(int start, int len)
{
#if defined(FEAT_CRYPT) || defined(FEAT_EVAL)
int i;
@@ -2791,9 +2784,7 @@ draw_cmdline(start, len)
* "c" must be printable (fit in one display cell)!
*/
void
-putcmdline(c, shift)
- int c;
- int shift;
+putcmdline(int c, int shift)
{
if (cmd_silent)
return;
@@ -2809,7 +2800,7 @@ putcmdline(c, shift)
* Undo a putcmdline(c, FALSE).
*/
void
-unputcmdline()
+unputcmdline(void)
{
if (cmd_silent)
return;
@@ -2836,10 +2827,7 @@ unputcmdline()
* called afterwards.
*/
int
-put_on_cmdline(str, len, redraw)
- char_u *str;
- int len;
- int redraw;
+put_on_cmdline(char_u *str, int len, int redraw)
{
int retval;
int i;
@@ -3009,8 +2997,7 @@ static int prev_ccline_used = FALSE;
* available globally in prev_ccline.
*/
static void
-save_cmdline(ccp)
- struct cmdline_info *ccp;
+save_cmdline(struct cmdline_info *ccp)
{
if (!prev_ccline_used)
{
@@ -3028,8 +3015,7 @@ save_cmdline(ccp)
* Restore ccline after it has been saved with save_cmdline().
*/
static void
-restore_cmdline(ccp)
- struct cmdline_info *ccp;
+restore_cmdline(struct cmdline_info *ccp)
{
ccline = prev_ccline;
prev_ccline = *ccp;
@@ -3042,7 +3028,7 @@ restore_cmdline(ccp)
* Returns NULL when failed.
*/
char_u *
-save_cmdline_alloc()
+save_cmdline_alloc(void)
{
struct cmdline_info *p;
@@ -3056,8 +3042,7 @@ save_cmdline_alloc()
* Restore the command line from the return value of save_cmdline_alloc().
*/
void
-restore_cmdline_alloc(p)
- char_u *p;
+restore_cmdline_alloc(char_u *p)
{
if (p != NULL)
{
@@ -3076,10 +3061,10 @@ restore_cmdline_alloc(p)
* Return FAIL for failure, OK otherwise.
*/
static int
-cmdline_paste(regname, literally, remcr)
- int regname;
- int literally; /* Insert text literally instead of "as typed" */
- int remcr; /* remove trailing CR */
+cmdline_paste(
+ int regname,
+ int literally, /* Insert text literally instead of "as typed" */
+ int remcr) /* remove trailing CR */
{
long i;
char_u *arg;
@@ -3165,9 +3150,7 @@ cmdline_paste(regname, literally, remcr)
* line.
*/
void
-cmdline_paste_str(s, literally)
- char_u *s;
- int literally;
+cmdline_paste_str(char_u *s, int literally)
{
int c, cv;
@@ -3202,8 +3185,7 @@ cmdline_paste_str(s, literally)
* position.
*/
static void
-cmdline_del(from)
- int from;
+cmdline_del(int from)
{
mch_memmove(ccline.cmdbuff + from, ccline.cmdbuff + ccline.cmdpos,
(size_t)(ccline.cmdlen - ccline.cmdpos + 1));
@@ -3217,7 +3199,7 @@ cmdline_del(from)
* search
*/
void
-redrawcmdline()
+redrawcmdline(void)
{
if (cmd_silent)
return;
@@ -3228,7 +3210,7 @@ redrawcmdline()
}
static void
-redrawcmdprompt()
+redrawcmdprompt(void)
{
int i;
@@ -3253,7 +3235,7 @@ redrawcmdprompt()
* Redraw what is currently on the command line.
*/
void
-redrawcmd()
+redrawcmd(void)
{
if (cmd_silent)
return;
@@ -3289,7 +3271,7 @@ redrawcmd()
}
void
-compute_cmdrow()
+compute_cmdrow(void)
{
if (exmode_active || msg_scrolled != 0)
cmdline_row = Rows - 1;
@@ -3299,7 +3281,7 @@ compute_cmdrow()
}
static void
-cursorcmd()
+cursorcmd(void)
{
if (cmd_silent)
return;
@@ -3331,8 +3313,7 @@ cursorcmd()
}
void
-gotocmdline(clr)
- int clr;
+gotocmdline(int clr)
{
msg_start();
#ifdef FEAT_RIGHTLEFT
@@ -3353,8 +3334,7 @@ gotocmdline(clr)
* backspaces and the replacement string is inserted, followed by "c".
*/
static int
-ccheck_abbr(c)
- int c;
+ccheck_abbr(int c)
{
if (p_paste || no_abbr) /* no abbreviations or in paste mode */
return FALSE;
@@ -3367,9 +3347,7 @@ ccheck_abbr(c)
#ifdef __BORLANDC__
_RTLENTRYF
#endif
-sort_func_compare(s1, s2)
- const void *s1;
- const void *s2;
+sort_func_compare(const void *s1, const void *s2)
{
char_u *p1 = *(char_u **)s1;
char_u *p2 = *(char_u **)s2;
@@ -3387,11 +3365,11 @@ sort_func_compare(s1, s2)
* normal character (instead of being expanded). This allows :s/^I^D etc.
*/
static int
-nextwild(xp, type, options, escape)
- expand_T *xp;
- int type;
- int options; /* extra options for ExpandOne() */
- int escape; /* if TRUE, escape the returned matches */
+nextwild(
+ expand_T *xp,
+ int type,
+ int options, /* extra options for ExpandOne() */
+ int escape) /* if TRUE, escape the returned matches */
{
int i, j;
char_u *p1;
@@ -3540,12 +3518,12 @@ nextwild(xp, type, options, escape)
* The variables xp->xp_context and xp->xp_backslash must have been set!
*/
char_u *
-ExpandOne(xp, str, orig, options, mode)
- expand_T *xp;
- char_u *str;
- char_u *orig; /* allocated copy of original of expanded string */
- int options;
- int mode;
+ExpandOne(
+ expand_T *xp,
+ char_u *str,
+ char_u *orig, /* allocated copy of original of expanded string */
+ int options,
+ int mode)
{
char_u *ss = NULL;
static int findex;
@@ -3771,8 +3749,7 @@ ExpandOne(xp, str, orig, options, mode)
* Prepare an expand structure for use.
*/
void
-ExpandInit(xp)
- expand_T *xp;
+ExpandInit(expand_T *xp)
{
xp->xp_pattern = NULL;
xp->xp_pattern_len = 0;
@@ -3792,8 +3769,7 @@ ExpandInit(xp)
* Cleanup an expand structure after use.
*/
void
-ExpandCleanup(xp)
- expand_T *xp;
+ExpandCleanup(expand_T *xp)
{
if (xp->xp_numfiles >= 0)
{
@@ -3803,12 +3779,12 @@ ExpandCleanup(xp)
}
void
-ExpandEscape(xp, str, numfiles, files, options)
- expand_T *xp;
- char_u *str;
- int numfiles;
- char_u **files;
- int options;
+ExpandEscape(
+ expand_T *xp,
+ char_u *str,
+ int numfiles,
+ char_u **files,
+ int options)
{
int i;
char_u *p;
@@ -3899,9 +3875,7 @@ ExpandEscape(xp, str, numfiles, files, options)
* Returns the result in allocated memory.
*/
char_u *
-vim_strsave_fnameescape(fname, shell)
- char_u *fname;
- int shell;
+vim_strsave_fnameescape(char_u *fname, int shell)
{
char_u *p;
#ifdef BACKSLASH_IN_FILENAME
@@ -3940,8 +3914,7 @@ vim_strsave_fnameescape(fname, shell)
* Put a backslash before the file name in "pp", which is in allocated memory.
*/
static void
-escape_fname(pp)
- char_u **pp;
+escape_fname(char_u **pp)
{
char_u *p;
@@ -3960,10 +3933,10 @@ escape_fname(pp)
* If 'orig_pat' starts with "~/", replace the home directory with "~".
*/
void
-tilde_replace(orig_pat, num_files, files)
- char_u *orig_pat;
- int num_files;
- char_u **files;
+tilde_replace(
+ char_u *orig_pat,
+ int num_files,
+ char_u **files)
{
int i;
char_u *p;
@@ -3988,9 +3961,7 @@ tilde_replace(orig_pat, num_files, files)
* be inserted like a normal character.
*/
static int
-showmatches(xp, wildmenu)
- expand_T *xp;
- int wildmenu UNUSED;
+showmatches(expand_T *xp, int wildmenu UNUSED)
{
#define L_SHOWFILE(m) (showtail ? sm_gettail(files_found[m]) : files_found[m])
int num_files;
@@ -4172,8 +4143,7 @@ showmatches(xp, wildmenu)
* Find tail of file name path, but ignore trailing "/".
*/
char_u *
-sm_gettail(s)
- char_u *s;
+sm_gettail(char_u *s)
{
char_u *p;
char_u *t = s;
@@ -4203,8 +4173,7 @@ sm_gettail(s)
* returned.
*/
static int
-expand_showtail(xp)
- expand_T *xp;
+expand_showtail(expand_T *xp)
{
char_u *s;
char_u *end;
@@ -4239,10 +4208,10 @@ expand_showtail(xp)
* the name into allocated memory and prepend "^".
*/
char_u *
-addstar(fname, len, context)
- char_u *fname;
- int len;
- int context; /* EXPAND_FILES etc. */
+addstar(
+ char_u *fname,
+ int len,
+ int context) /* EXPAND_FILES etc. */
{
char_u *retval;
int i, j;
@@ -4408,8 +4377,7 @@ addstar(fname, len, context)
* EXPAND_USER Complete user names
*/
static void
-set_expand_context(xp)
- expand_T *xp;
+set_expand_context(expand_T *xp)
{
/* only expansion for ':', '>' and '=' command-lines */
if (ccline.cmdfirstc != ':'
@@ -4426,11 +4394,11 @@ set_expand_context(xp)
}
void
-set_cmd_context(xp, str, len, col)
- expand_T *xp;
- char_u *str; /* start of command line */
- int len; /* length of command line (excl. NUL) */
- int col; /* position of cursor */
+set_cmd_context(
+ expand_T *xp,
+ char_u *str, /* start of command line */
+ int len, /* length of command line (excl. NUL) */
+ int col) /* position of cursor */
{
int old_char = NUL;
char_u *nextcomm;
@@ -4485,12 +4453,12 @@ set_cmd_context(xp, str, len, col)
* Returns EXPAND_OK otherwise.
*/
int
-expand_cmdline(xp, str, col, matchcount, matches)
- expand_T *xp;
- char_u *str; /* start of command line */
- int col; /* position of cursor */
- int *matchcount; /* return: nr of matches */
- char_u ***matches; /* return: array of pointers to matches */
+expand_cmdline(
+ expand_T *xp,
+ char_u *str, /* start of command line */
+ int col, /* position of cursor */
+ int *matchcount, /* return: nr of matches */
+ char_u ***matches) /* return: array of pointers to matches */
{
char_u *file_str = NULL;
int options = WILD_ADD_SLASH|WILD_SILENT;
@@ -4533,9 +4501,7 @@ expand_cmdline(xp, str, col, matchcount, matches)
static void cleanup_help_tags(int num_file, char_u **file);
static void
-cleanup_help_tags(num_file, file)
- int num_file;
- char_u **file;
+cleanup_help_tags(int num_file, char_u **file)
{
int i, j;
int len;
@@ -4563,12 +4529,12 @@ cleanup_help_tags(num_file, file)
* Do the expansion based on xp->xp_context and "pat".
*/
static int
-ExpandFromContext(xp, pat, num_file, file, options)
- expand_T *xp;
- char_u *pat;
- int *num_file;
- char_u ***file;
- int options; /* EW_ flags */
+ExpandFromContext(
+ expand_T *xp,
+ char_u *pat,
+ int *num_file,
+ char_u ***file,
+ int options) /* EW_ flags */
{
#ifdef FEAT_CMDL_COMPL
regmatch_T regmatch;
@@ -4799,14 +4765,14 @@ ExpandFromContext(xp, pat, num_file, file, options)
* Returns OK when no problems encountered, FAIL for error (out of memory).
*/
int
-ExpandGeneric(xp, regmatch, num_file, file, func, escaped)
- expand_T *xp;
- regmatch_T *regmatch;
- int *num_file;
- char_u ***file;
- char_u *((*func)(expand_T *, int));
+ExpandGeneric(
+ expand_T *xp,
+ regmatch_T *regmatch,
+ int *num_file,
+ char_u ***file,
+ char_u *((*func)(expand_T *, int)),
/* returns a string from the list */
- int escaped;
+ int escaped)
{
int i;
int count = 0;
@@ -4891,11 +4857,11 @@ ExpandGeneric(xp, regmatch, num_file, file, func, escaped)
* Returns FAIL or OK;
*/
static int
-expand_shellcmd(filepat, num_file, file, flagsarg)
- char_u *filepat; /* pattern to match with command names */
- int *num_file; /* return: number of matches */
- char_u ***file; /* return: array with matches */
- int flagsarg; /* EW_ flags */
+expand_shellcmd(
+ char_u *filepat, /* pattern to match with command names */
+ int *num_file, /* return: number of matches */
+ char_u ***file, /* return: array with matches */
+ int flagsarg) /* EW_ flags */
{
char_u *pat;
int i;
@@ -5016,11 +4982,11 @@ static void * call_user_expand_func(void *(*user_expand_func)(char_u *, int, cha
* the result (either a string or a List).
*/
static void *
-call_user_expand_func(user_expand_func, xp, num_file, file)
- void *(*user_expand_func)(char_u *, int, char_u **, int);
- expand_T *xp;
- int *num_file;
- char_u ***file;
+call_user_expand_func(
+ void *(*user_expand_func)(char_u *, int, char_u **, int),
+ expand_T *xp,
+ int *num_file,
+ char_u ***file)
{
int keep = 0;
char_u num[50];
@@ -5066,11 +5032,11 @@ call_user_expand_func(user_expand_func, xp, num_file, file)
* Expand names with a function defined by the user.
*/
static int
-ExpandUserDefined(xp, regmatch, num_file, file)
- expand_T *xp;
- regmatch_T *regmatch;
- int *num_file;
- char_u ***file;
+ExpandUserDefined(
+ expand_T *xp,
+ regmatch_T *regmatch,
+ int *num_file,
+ char_u ***file)
{
char_u *retstr;
char_u *s;
@@ -5119,10 +5085,10 @@ ExpandUserDefined(xp, regmatch, num_file, file)
* Expand names with a list returned by a function defined by the user.
*/
static int
-ExpandUserList(xp, num_file, file)
- expand_T *xp;
- int *num_file;
- char_u ***file;
+ExpandUserList(
+ expand_T *xp,
+ int *num_file,
+ char_u ***file)
{
list_T *retlist;
listitem_T *li;
@@ -5160,11 +5126,11 @@ ExpandUserList(xp, num_file, file)
* "dirnames" is an array with one or more directory names.
*/
static int
-ExpandRTDir(pat, num_file, file, dirnames)
- char_u *pat;
- int *num_file;
- char_u ***file;
- char *dirnames[];
+ExpandRTDir(
+ char_u *pat,
+ int *num_file,
+ char_u ***file,
+ char *dirnames[])
{
char_u *s;
char_u *e;
@@ -5228,11 +5194,11 @@ ExpandRTDir(pat, num_file, file, dirnames)
* Adds the matches to "ga". Caller must init "ga".
*/
void
-globpath(path, file, ga, expand_options)
- char_u *path;
- char_u *file;
- garray_T *ga;
- int expand_options;
+globpath(
+ char_u *path,
+ char_u *file,
+ garray_T *ga,
+ int expand_options)
{
expand_T xpc;
char_u *buf;
@@ -5298,8 +5264,7 @@ globpath(path, file, ga, expand_options)
* Translate a history character to the associated type number.
*/
static int
-hist_char2type(c)
- int c;
+hist_char2type(int c)
{
if (c == ':')
return HIST_CMD;
@@ -5334,9 +5299,7 @@ static char *(history_names[]) =
* arguments of the ":history command.
*/
static char_u *
-get_history_arg(xp, idx)
- expand_T *xp UNUSED;
- int idx;
+get_history_arg(expand_T *xp UNUSED, int idx)
{
static char_u compl[2] = { NUL, NUL };
char *short_names = ":=@>?/";
@@ -5361,7 +5324,7 @@ get_history_arg(xp, idx)
* Also used to re-allocate the history when the size changes.
*/
void
-init_history()
+init_history(void)
{
int newlen; /* new length of history table */
histentry_T *temp;
@@ -5439,8 +5402,7 @@ init_history()
}
static void
-clear_hist_entry(hisptr)
- histentry_T *hisptr;
+clear_hist_entry(histentry_T *hisptr)
{
hisptr->hisnum = 0;
hisptr->viminfo = FALSE;
@@ -5452,12 +5414,12 @@ clear_hist_entry(hisptr)
* If 'move_to_front' is TRUE, matching entry is moved to end of history.
*/
static int
-in_history(type, str, move_to_front, sep, writing)
- int type;
- char_u *str;
- int move_to_front; /* Move the entry to the front if it exists */
- int sep;
- int writing; /* ignore entries read from viminfo */
+in_history(
+ int type,
+ char_u *str,
+ int move_to_front, /* Move the entry to the front if it exists */
+ int sep,
+ int writing) /* ignore entries read from viminfo */
{
int i;
int last_i = -1;
@@ -5511,8 +5473,7 @@ in_history(type, str, move_to_front, sep, writing)
* Returns -1 for unknown history name.
*/
int
-get_histtype(name)
- char_u *name;
+get_histtype(char_u *name)
{
int i;
int len = (int)STRLEN(name);
@@ -5539,11 +5500,11 @@ static int last_maptick = -1; /* last seen maptick */
* values.
*/
void
-add_to_history(histype, new_entry, in_map, sep)
- int histype;
- char_u *new_entry;
- int in_map; /* consider maptick when inside a mapping */
- int sep; /* separator character used (search hist) */
+add_to_history(
+ int histype,
+ char_u *new_entry,
+ int in_map, /* consider maptick when inside a mapping */
+ int sep) /* separator character used (search hist) */
{
histentry_T *hisptr;
int len;
@@ -5600,8 +5561,7 @@ add_to_history(histype, new_entry, in_map, sep)
* "histype" may be one of the HIST_ values.
*/
int
-get_history_idx(histype)
- int histype;
+get_history_idx(int histype)
{
if (hislen == 0 || histype < 0 || histype >= HIST_COUNT
|| hisidx[histype] < 0)
@@ -5617,7 +5577,7 @@ static struct cmdline_info *get_ccline_ptr(void);
* ccline and put the previous value in prev_ccline.
*/
static struct cmdline_info *
-get_ccline_ptr()
+get_ccline_ptr(void)
{
if ((State & CMDLINE) == 0)
return NULL;
@@ -5634,7 +5594,7 @@ get_ccline_ptr()
* Returns NULL when something is wrong.
*/
char_u *
-get_cmdline_str()
+get_cmdline_str(void)
{
struct cmdline_info *p = get_ccline_ptr();
@@ -5650,7 +5610,7 @@ get_cmdline_str()
* Returns -1 when something is wrong.
*/
int
-get_cmdline_pos()
+get_cmdline_pos(void)
{
struct cmdline_info *p = get_ccline_ptr();
@@ -5665,8 +5625,8 @@ get_cmdline_pos()
* Returns 1 when failed, 0 when OK.
*/
int
-set_cmdline_pos(pos)
- int pos;
+set_cmdline_pos(
+ int pos)
{
struct cmdline_info *p = get_ccline_ptr();
@@ -5707,9 +5667,7 @@ get_cmdline_type()
* "histype" may be one of the HIST_ values.
*/
static int
-calc_hist_idx(histype, num)
- int histype;
- int num;
+calc_hist_idx(int histype, int num)
{
int i;
histentry_T *hist;
@@ -5749,9 +5707,7 @@ calc_hist_idx(histype, num)
* "histype" may be one of the HIST_ values.
*/
char_u *
-get_history_entry(histype, idx)
- int histype;
- int idx;
+get_history_entry(int histype, int idx)
{
idx = calc_hist_idx(histype, idx);
if (idx >= 0)
@@ -5765,8 +5721,7 @@ get_history_entry(histype, idx)
* "histype" may be one of the HIST_ values.
*/
int
-clr_history(histype)
- int histype;
+clr_history(int histype)
{
int i;
histentry_T *hisptr;
@@ -5791,9 +5746,7 @@ clr_history(histype)
* "histype" may be one of the HIST_ values.
*/
int
-del_history_entry(histype, str)
- int histype;
- char_u *str;
+del_history_entry(int histype, char_u *str)
{
regmatch_T regmatch;
histentry_T *hisptr;
@@ -5849,9 +5802,7 @@ del_history_entry(histype, str)
* "histype" may be one of the HIST_ values.
*/
int
-del_history_idx(histype, idx)
- int histype;
- int idx;
+del_history_idx(int histype, int idx)
{
int i, j;
@@ -5888,7 +5839,7 @@ del_history_idx(histype, idx)
* history.
*/
void
-remove_key_from_history()
+remove_key_from_history(void)
{
char_u *p;
int i;
@@ -5923,10 +5874,7 @@ remove_key_from_history()
* Returns OK if parsed successfully, otherwise FAIL.
*/
int
-get_list_range(str, num1, num2)
- char_u **str;
- int *num1;
- int *num2;
+get_list_range(char_u **str, int *num1, int *num2)
{
int len;
int first = FALSE;
@@ -5964,8 +5912,7 @@ get_list_range(str, num1, num2)
* :history command - print a history
*/
void
-ex_history(eap)
- exarg_T *eap;
+ex_history(exarg_T *eap)
{
histentry_T *hist;
int histype1 = HIST_CMD;
@@ -6072,9 +6019,9 @@ static int hist_type2char(int type, int use_question);
* Translate a history type number to the associated character.
*/
static int
-hist_type2char(type, use_question)
- int type;
- int use_question; /* use '?' instead of '/' */
+hist_type2char(
+ int type,
+ int use_question) /* use '?' instead of '/' */
{
if (type == HIST_CMD)
return ':';
@@ -6095,9 +6042,7 @@ hist_type2char(type, use_question)
* This allocates history arrays to store the read history lines.
*/
void
-prepare_viminfo_history(asklen, writing)
- int asklen;
- int writing;
+prepare_viminfo_history(int asklen, int writing)
{
int i;
int num;
@@ -6137,9 +6082,7 @@ prepare_viminfo_history(asklen, writing)
* new.
*/
int
-read_viminfo_history(virp, writing)
- vir_T *virp;
- int writing;
+read_viminfo_history(vir_T *virp, int writing)
{
int type;
long_u len;
@@ -6189,7 +6132,7 @@ read_viminfo_history(virp, writing)
* Finish reading history lines from viminfo. Not used when writing viminfo.
*/
void
-finish_viminfo_history()
+finish_viminfo_history(void)
{
int idx;
int i;
@@ -6249,9 +6192,9 @@ finish_viminfo_history()
* When "merge" is FALSE just write all history lines. Used for ":wviminfo!".
*/
void
-write_viminfo_history(fp, merge)
- FILE *fp;
- int merge;
+write_viminfo_history(
+ FILE *fp,
+ int merge)
{
int i;
int type;
@@ -6348,8 +6291,7 @@ write_viminfo_history(fp, merge)
* It is directly written into the command buffer block.
*/
void
-cmd_pchar(c, offset)
- int c, offset;
+cmd_pchar(int c, int offset)
{
if (ccline.cmdpos + offset >= ccline.cmdlen || ccline.cmdpos + offset < 0)
{
@@ -6361,8 +6303,7 @@ cmd_pchar(c, offset)
}
int
-cmd_gchar(offset)
- int offset;
+cmd_gchar(int offset)
{
if (ccline.cmdpos + offset >= ccline.cmdlen || ccline.cmdpos + offset < 0)
{
@@ -6383,7 +6324,7 @@ cmd_gchar(offset)
* K_IGNORE if editing continues
*/
static int
-ex_window()
+ex_window(void)
{
struct cmdline_info save_ccline;
buf_T *old_curbuf = curbuf;
@@ -6674,9 +6615,7 @@ ex_window()
* Returns a pointer to allocated memory with {script} or NULL.
*/
char_u *
-script_get(eap, cmd)
- exarg_T *eap;
- char_u *cmd;
+script_get(exarg_T *eap, char_u *cmd)
{
char_u *theline;
char *end_pattern = NULL;
diff --git a/src/farsi.c b/src/farsi.c
index 253d7b5c9..28f86f46c 100644
--- a/src/farsi.c
+++ b/src/farsi.c
@@ -38,8 +38,7 @@ static void lrswapbuf(char_u *buf, int len);
** Convert the given Farsi character into a _X or _X_ type
*/
static int
-toF_Xor_X_(c)
- int c;
+toF_Xor_X_(int c)
{
int tempc;
@@ -132,8 +131,7 @@ toF_Xor_X_(c)
** Convert the given Farsi character into Farsi capital character .
*/
int
-toF_TyA(c)
- int c ;
+toF_TyA(int c )
{
switch (c)
{
@@ -212,8 +210,7 @@ toF_TyA(c)
** Note: the offset is used only for command line buffer.
*/
static int
-F_is_TyB_TyC_TyD(src, offset)
- int src, offset;
+F_is_TyB_TyC_TyD(int src, int offset)
{
int c;
@@ -264,8 +261,7 @@ F_is_TyB_TyC_TyD(src, offset)
** Is the Farsi character one of the terminating only type.
*/
static int
-F_is_TyE(c)
- int c;
+F_is_TyE(int c)
{
switch (c)
{
@@ -288,8 +284,7 @@ F_is_TyE(c)
** Is the Farsi character one of the none leading type.
*/
static int
-F_is_TyC_TyD(c)
- int c;
+F_is_TyC_TyD(int c)
{
switch (c)
{
@@ -313,8 +308,7 @@ F_is_TyC_TyD(c)
** Convert a none leading Farsi char into a leading type.
*/
static int
-toF_TyB(c)
- int c;
+toF_TyB(int c)
{
switch (c)
{
@@ -337,8 +331,7 @@ toF_TyB(c)
** Overwrite the current redo and cursor characters + left adjust
*/
static void
-put_curr_and_l_to_X(c)
- int c;
+put_curr_and_l_to_X(int c)
{
int tempc;
@@ -372,8 +365,7 @@ put_curr_and_l_to_X(c)
}
static void
-put_and_redo(c)
- int c;
+put_and_redo(int c)
{
pchar_cursor(c);
AppendCharToRedobuff(K_BS);
@@ -384,7 +376,7 @@ put_and_redo(c)
** Change the char. under the cursor to a X_ or X type
*/
static void
-chg_c_toX_orX()
+chg_c_toX_orX(void)
{
int tempc, curc;
@@ -509,7 +501,7 @@ chg_c_toX_orX()
*/
static void
-chg_c_to_X_orX_()
+chg_c_to_X_orX_(void)
{
int tempc;
@@ -560,7 +552,7 @@ chg_c_to_X_orX_()
** Change the char. under the cursor to a _X_ or _X type
*/
static void
-chg_c_to_X_or_X ()
+chg_c_to_X_or_X (void)
{
int tempc;
@@ -591,7 +583,7 @@ chg_c_to_X_or_X ()
** Change the character left to the cursor to a _X_ or X_ type
*/
static void
-chg_l_to_X_orX_ ()
+chg_l_to_X_orX_ (void)
{
int tempc;
@@ -660,7 +652,7 @@ chg_l_to_X_orX_ ()
*/
static void
-chg_l_toXor_X ()
+chg_l_toXor_X (void)
{
int tempc;
@@ -729,7 +721,7 @@ chg_l_toXor_X ()
*/
static void
-chg_r_to_Xor_X_()
+chg_r_to_Xor_X_(void)
{
int tempc, c;
@@ -754,8 +746,7 @@ chg_r_to_Xor_X_()
*/
int
-fkmap(c)
- int c;
+fkmap(int c)
{
int tempc;
static int revins;
@@ -1473,8 +1464,7 @@ fkmap(c)
** Convert a none leading Farsi char into a leading type.
*/
static int
-toF_leading(c)
- int c;
+toF_leading(int c)
{
switch (c)
{
@@ -1528,8 +1518,7 @@ toF_leading(c)
** Convert a given Farsi char into right joining type.
*/
static int
-toF_Rjoin(c)
- int c;
+toF_Rjoin(int c)
{
switch (c)
{
@@ -1585,8 +1574,7 @@ toF_Rjoin(c)
** Can a given Farsi character join via its left edj.
*/
static int
-canF_Ljoin(c)
- int c;
+canF_Ljoin(int c)
{
switch (c)
{
@@ -1660,8 +1648,7 @@ canF_Ljoin(c)
** Can a given Farsi character join via its right edj.
*/
static int
-canF_Rjoin(c)
- int c;
+canF_Rjoin(int c)
{
switch (c)
{
@@ -1689,8 +1676,7 @@ canF_Rjoin(c)
** is a given Farsi character a terminating type.
*/
static int
-F_isterm(c)
- int c;
+F_isterm(int c)
{
switch (c)
{
@@ -1717,8 +1703,7 @@ F_isterm(c)
** Convert the given Farsi character into a ending type .
*/
static int
-toF_ending(c)
- int c;
+toF_ending(int c)
{
switch (c)
@@ -1795,7 +1780,7 @@ toF_ending(c)
** Convert the Farsi 3342 standard into Farsi VIM.
*/
void
-conv_to_pvim()
+conv_to_pvim(void)
{
char_u *ptr;
int lnum, llen, i;
@@ -1844,7 +1829,7 @@ conv_to_pvim()
* Convert the Farsi VIM into Farsi 3342 standard.
*/
void
-conv_to_pstd()
+conv_to_pstd(void)
{
char_u *ptr;
int lnum, llen, i;
@@ -1877,9 +1862,7 @@ conv_to_pstd()
* left-right swap the characters in buf[len].
*/
static void
-lrswapbuf(buf, len)
- char_u *buf;
- int len;
+lrswapbuf(char_u *buf, int len)
{
char_u *s, *e;
int c;
@@ -1901,8 +1884,7 @@ lrswapbuf(buf, len)
* swap all the characters in reverse direction
*/
char_u *
-lrswap(ibuf)
- char_u *ibuf;
+lrswap(char_u *ibuf)
{
if (ibuf != NULL && *ibuf != NUL)
lrswapbuf(ibuf, (int)STRLEN(ibuf));
@@ -1913,9 +1895,7 @@ lrswap(ibuf)
* swap all the Farsi characters in reverse direction
*/
char_u *
-lrFswap(cmdbuf, len)
- char_u *cmdbuf;
- int len;
+lrFswap(char_u *cmdbuf, int len)
{
int i, cnt;
@@ -1945,8 +1925,7 @@ lrFswap(cmdbuf, len)
* TODO: handle different separator characters. Use skip_regexp().
*/
char_u *
-lrF_sub(ibuf)
- char_u *ibuf;
+lrF_sub(char_u *ibuf)
{
char_u *p, *ep;
int i, cnt;
@@ -1986,8 +1965,7 @@ lrF_sub(ibuf)
* Map Farsi keyboard when in cmd_fkmap mode.
*/
int
-cmdl_fkmap(c)
- int c;
+cmdl_fkmap(int c)
{
int tempc;
@@ -2246,8 +2224,7 @@ cmdl_fkmap(c)
* F_isalpha returns TRUE if 'c' is a Farsi alphabet
*/
int
-F_isalpha(c)
- int c;
+F_isalpha(int c)
{
return (( c >= TEE_ && c <= _YE)
|| (c >= ALEF_A && c <= YE)
@@ -2258,8 +2235,7 @@ F_isalpha(c)
* F_isdigit returns TRUE if 'c' is a Farsi digit
*/
int
-F_isdigit(c)
- int c;
+F_isdigit(int c)
{
return (c >= FARSI_0 && c <= FARSI_9);
}
@@ -2268,15 +2244,14 @@ F_isdigit(c)
* F_ischar returns TRUE if 'c' is a Farsi character.
*/
int
-F_ischar(c)
- int c;
+F_ischar(int c)
{
- return (c >= TEE_ && c <= YE_);
+ return (c >= TEE_ && c <= YE_);
}
void
-farsi_fkey(cap)
- cmdarg_T *cap;
+farsi_fkey(
+ cmdarg_T *cap)
{
int c = cap->cmdchar;
diff --git a/src/fileio.c b/src/fileio.c
index b022d2513..6ae1572ab 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -144,11 +144,11 @@ static char *e_auchangedbuf = N_("E812: Autocommands changed buffer or buffer na
#endif
void
-filemess(buf, name, s, attr)
- buf_T *buf;
- char_u *name;
- char_u *s;
- int attr;
+filemess(
+ buf_T *buf,
+ char_u *name,
+ char_u *s,
+ int attr)
{
int msg_scroll_save;
@@ -204,14 +204,14 @@ filemess(buf, name, s, attr)
* return FAIL for failure, OK otherwise
*/
int
-readfile(fname, sfname, from, lines_to_skip, lines_to_read, eap, flags)
- char_u *fname;
- char_u *sfname;
- linenr_T from;
- linenr_T lines_to_skip;
- linenr_T lines_to_read;
- exarg_T *eap; /* can be NULL! */
- int flags;
+readfile(
+ char_u *fname,
+ char_u *sfname,
+ linenr_T from,
+ linenr_T lines_to_skip,
+ linenr_T lines_to_read,
+ exarg_T *eap, /* can be NULL! */
+ int flags)
{
int fd = 0;
int newfile = (flags & READ_NEW);
@@ -2696,8 +2696,7 @@ failed:
* Do not accept "/dev/fd/[012]", opening these may hang Vim.
*/
static int
-is_dev_fd_file(fname)
- char_u *fname;
+is_dev_fd_file(char_u *fname)
{
return (STRNCMP(fname, "/dev/fd/", 8) == 0
&& VIM_ISDIGIT(fname[8])
@@ -2715,10 +2714,10 @@ is_dev_fd_file(fname)
* Used for error messages that include a line number.
*/
static linenr_T
-readfile_linenr(linecnt, p, endp)
- linenr_T linecnt; /* line count before reading more bytes */
- char_u *p; /* start of more bytes read */
- char_u *endp; /* end of more bytes read */
+readfile_linenr(
+ linenr_T linecnt, /* line count before reading more bytes */
+ char_u *p, /* start of more bytes read */
+ char_u *endp) /* end of more bytes read */
{
char_u *s;
linenr_T lnum;
@@ -2737,9 +2736,7 @@ readfile_linenr(linecnt, p, endp)
* Returns OK or FAIL.
*/
int
-prep_exarg(eap, buf)
- exarg_T *eap;
- buf_T *buf;
+prep_exarg(exarg_T *eap, buf_T *buf)
{
eap->cmd = alloc((unsigned)(STRLEN(buf->b_p_ff)
#ifdef FEAT_MBYTE
@@ -2768,9 +2765,7 @@ prep_exarg(eap, buf)
* Set default or forced 'fileformat' and 'binary'.
*/
void
-set_file_options(set_options, eap)
- int set_options;
- exarg_T *eap;
+set_file_options(int set_options, exarg_T *eap)
{
/* set default 'fileformat' */
if (set_options)
@@ -2796,8 +2791,7 @@ set_file_options(set_options, eap)
* Set forced 'fileencoding'.
*/
void
-set_forced_fenc(eap)
- exarg_T *eap;
+set_forced_fenc(exarg_T *eap)
{
if (eap->force_enc != 0)
{
@@ -2818,8 +2812,7 @@ set_forced_fenc(eap)
* When *pp is not set to NULL, the result is in allocated memory.
*/
static char_u *
-next_fenc(pp)
- char_u **pp;
+next_fenc(char_u **pp)
{
char_u *p;
char_u *r;
@@ -2864,10 +2857,10 @@ next_fenc(pp)
* Returns NULL if the conversion failed ("*fdp" is not set) .
*/
static char_u *
-readfile_charconvert(fname, fenc, fdp)
- char_u *fname; /* name of input file */
- char_u *fenc; /* converted from */
- int *fdp; /* in/out: file descriptor of file */
+readfile_charconvert(
+ char_u *fname, /* name of input file */
+ char_u *fenc, /* converted from */
+ int *fdp) /* in/out: file descriptor of file */
{
char_u *tmpname;
char_u *errmsg = NULL;
@@ -2916,7 +2909,7 @@ readfile_charconvert(fname, fenc, fdp)
* buffer marks and the buffer has a name.
*/
static void
-check_marks_read()
+check_marks_read(void)
{
if (!curbuf->b_marks_read && get_viminfo_parameter('\'') > 0
&& curbuf->b_ffname != NULL)
@@ -2936,14 +2929,14 @@ check_marks_read()
* Return the (new) encryption key, NULL for no encryption.
*/
static char_u *
-check_for_cryptkey(cryptkey, ptr, sizep, filesizep, newfile, fname, did_ask)
- char_u *cryptkey; /* previous encryption key or NULL */
- char_u *ptr; /* pointer to read bytes */
- long *sizep; /* length of read bytes */
- off_t *filesizep; /* nr of bytes used from file */
- int newfile; /* editing a new buffer */
- char_u *fname; /* file name to display */
- int *did_ask; /* flag: whether already asked for key */
+check_for_cryptkey(
+ char_u *cryptkey, /* previous encryption key or NULL */
+ char_u *ptr, /* pointer to read bytes */
+ long *sizep, /* length of read bytes */
+ off_t *filesizep, /* nr of bytes used from file */
+ int newfile, /* editing a new buffer */
+ char_u *fname, /* file name to display */
+ int *did_ask) /* flag: whether already asked for key */
{
int method = crypt_method_nr_from_magic((char *)ptr, *sizep);
int b_p_ro = curbuf->b_p_ro;
@@ -3011,10 +3004,10 @@ check_for_cryptkey(cryptkey, ptr, sizep, filesizep, newfile, fname, did_ask)
#ifdef UNIX
static void
-set_file_time(fname, atime, mtime)
- char_u *fname;
- time_t atime; /* access time */
- time_t mtime; /* modification time */
+set_file_time(
+ char_u *fname,
+ time_t atime, /* access time */
+ time_t mtime) /* modification time */
{
# if defined(HAVE_UTIME) && defined(HAVE_UTIME_H)
struct utimbuf buf;
@@ -3049,9 +3042,9 @@ set_file_time(fname, atime, mtime)
* Return TRUE if a file appears to be read-only from the file permissions.
*/
int
-check_file_readonly(fname, perm)
- char_u *fname; /* full path to file */
- int perm; /* known permissions on file */
+check_file_readonly(
+ char_u *fname, /* full path to file */
+ int perm) /* known permissions on file */
{
#ifndef USE_MCH_ACCESS
int fd = 0;
@@ -3088,18 +3081,18 @@ check_file_readonly(fname, perm)
* return FAIL for failure, OK otherwise
*/
int
-buf_write(buf, fname, sfname, start, end, eap, append, forceit,
- reset_changed, filtering)
- buf_T *buf;
- char_u *fname;
- char_u *sfname;
- linenr_T start, end;
- exarg_T *eap; /* for forced 'ff' and 'fenc', can be
+buf_write(
+ buf_T *buf,
+ char_u *fname,
+ char_u *sfname,
+ linenr_T start,
+ linenr_T end,
+ exarg_T *eap, /* for forced 'ff' and 'fenc', can be
NULL! */
- int append; /* append to the file */
- int forceit;
- int reset_changed;
- int filtering;
+ int append, /* append to the file */
+ int forceit,
+ int reset_changed,
+ int filtering)
{
int fd;
char_u *backup = NULL;
@@ -5123,9 +5116,7 @@ nofail:
* name and a ":r" or ":w" command with a file name is used.
*/
static int
-set_rw_fname(fname, sfname)
- char_u *fname;
- char_u *sfname;
+set_rw_fname(char_u *fname, char_u *sfname)
{
#ifdef FEAT_AUTOCMD
buf_T *buf = curbuf;
@@ -5175,9 +5166,7 @@ set_rw_fname(fname, sfname)
* Put file name into IObuff with quotes.
*/
void
-msg_add_fname(buf, fname)
- buf_T *buf;
- char_u *fname;
+msg_add_fname(buf_T *buf, char_u *fname)
{
if (fname == NULL)
fname = (char_u *)"-stdin-";
@@ -5191,8 +5180,7 @@ msg_add_fname(buf, fname)
* Return TRUE if something appended.
*/
static int
-msg_add_fileformat(eol_type)
- int eol_type;
+msg_add_fileformat(int eol_type)
{
#ifndef USE_CRNL
if (eol_type == EOL_DOS)
@@ -5222,10 +5210,10 @@ msg_add_fileformat(eol_type)
* Append line and character count to IObuff.
*/
void
-msg_add_lines(insert_space, lnum, nchars)
- int insert_space;
- long lnum;
- off_t nchars;
+msg_add_lines(
+ int insert_space,
+ long lnum,
+ off_t nchars)
{
char_u *p;
@@ -5267,7 +5255,7 @@ msg_add_lines(insert_space, lnum, nchars)
* Append message for missing line separator to IObuff.
*/
static void
-msg_add_eol()
+msg_add_eol(void)
{
STRCAT(IObuff, shortmess(SHM_LAST) ? _("[noeol]") : _("[Incomplete last line]"));
}
@@ -5278,9 +5266,7 @@ msg_add_eol()
* using the same timestamp but can't set the size.
*/
static int
-check_mtime(buf, st)
- buf_T *buf;
- struct stat *st;
+check_mtime(buf_T *buf, struct stat *st)
{
if (buf->b_mtime_read != 0
&& time_differs((long)st->st_mtime, buf->b_mtime_read))
@@ -5299,8 +5285,7 @@ check_mtime(buf, st)
}
static int
-time_differs(t1, t2)
- long t1, t2;
+time_differs(long t1, long t2)
{
#if defined(__linux__) || defined(MSDOS) || defined(MSWIN)
/* On a FAT filesystem, esp. under Linux, there are only 5 bits to store
@@ -5319,8 +5304,7 @@ time_differs(t1, t2)
* Return FAIL for failure, OK otherwise.
*/
static int
-buf_write_bytes(ip)
- struct bw_info *ip;
+buf_write_bytes(struct bw_info *ip)
{
int wlen;
char_u *buf = ip->bw_buf; /* data to write */
@@ -5714,10 +5698,10 @@ buf_write_bytes(ip)
* Return TRUE for an error, FALSE when it's OK.
*/
static int
-ucs2bytes(c, pp, flags)
- unsigned c; /* in: character */
- char_u **pp; /* in/out: pointer to result */
- int flags; /* FIO_ flags */
+ucs2bytes(
+ unsigned c, /* in: character */
+ char_u **pp, /* in/out: pointer to result */
+ int flags) /* FIO_ flags */
{
char_u *p = *pp;
int error = FALSE;
@@ -5799,8 +5783,7 @@ ucs2bytes(c, pp, flags)
* 'encoding'.
*/
static int
-need_conversion(fenc)
- char_u *fenc;
+need_conversion(char_u *fenc)
{
int same_encoding;
int enc_flags;
@@ -5837,8 +5820,7 @@ need_conversion(fenc)
* if "ptr" is an empty string, use 'encoding'.
*/
static int
-get_fio_flags(ptr)
- char_u *ptr;
+get_fio_flags(char_u *ptr)
{
int prop;
@@ -5881,8 +5863,7 @@ get_fio_flags(ptr)
* Used for conversion between 'encoding' and 'fileencoding'.
*/
static int
-get_win_fio_flags(ptr)
- char_u *ptr;
+get_win_fio_flags(char_u *ptr)
{
int cp;
@@ -5910,8 +5891,7 @@ get_win_fio_flags(ptr)
* needed for the internal conversion to/from utf-8 or latin1.
*/
static int
-get_mac_fio_flags(ptr)
- char_u *ptr;
+get_mac_fio_flags(char_u *ptr)
{
if ((enc_utf8 || STRCMP(p_enc, "latin1") == 0)
&& (enc_canon_props(ptr) & ENC_MACROMAN))
@@ -5927,11 +5907,11 @@ get_mac_fio_flags(ptr)
* Returns NULL when no BOM found.
*/
static char_u *
-check_for_bom(p, size, lenp, flags)
- char_u *p;
- long size;
- int *lenp;
- int flags;
+check_for_bom(
+ char_u *p,
+ long size,
+ int *lenp,
+ int flags)
{
char *name = NULL;
int len = 2;
@@ -5981,9 +5961,7 @@ check_for_bom(p, size, lenp, flags)
* Return the length of the BOM (zero when no BOM).
*/
static int
-make_bom(buf, name)
- char_u *buf;
- char_u *name;
+make_bom(char_u *buf, char_u *name)
{
int flags;
char_u *p;
@@ -6015,8 +5993,7 @@ make_bom(buf, name)
* Returns "full_path" or pointer into "full_path" if shortened.
*/
char_u *
-shorten_fname1(full_path)
- char_u *full_path;
+shorten_fname1(char_u *full_path)
{
char_u *dirname;
char_u *p = full_path;
@@ -6042,9 +6019,7 @@ shorten_fname1(full_path)
* otherwise.
*/
char_u *
-shorten_fname(full_path, dir_name)
- char_u *full_path;
- char_u *dir_name;
+shorten_fname(char_u *full_path, char_u *dir_name)
{
int len;
char_u *p;
@@ -6099,8 +6074,7 @@ shorten_fname(full_path, dir_name)
* name.
*/
void
-shorten_fnames(force)
- int force;
+shorten_fnames(int force)
{
char_u dirname[MAXPATHL];
buf_T *buf;
@@ -6148,9 +6122,7 @@ shorten_fnames(force)
* Shorten all filenames in "fnames[count]" by current directory.
*/
void
-shorten_filenames(fnames, count)
- char_u **fnames;
- int count;
+shorten_filenames(char_u **fnames, int count)
{
int i;
char_u dirname[MAXPATHL];
@@ -6186,9 +6158,10 @@ shorten_filenames(fnames, count)
* Returns NULL when out of memory.
*/
char_u *
-modname(fname, ext, prepend_dot)
- char_u *fname, *ext;
- int prepend_dot; /* may prepend a '.' to file name */
+modname(
+ char_u *fname,
+ char_u *ext,
+ int prepend_dot) /* may prepend a '.' to file name */
{
return buf_modname(
#ifdef SHORT_FNAME
@@ -6200,10 +6173,11 @@ modname(fname, ext, prepend_dot)
}
char_u *
-buf_modname(shortname, fname, ext, prepend_dot)
- int shortname; /* use 8.3 file name */
- char_u *fname, *ext;
- int prepend_dot; /* may prepend a '.' to file name */
+buf_modname(
+ int shortname, /* use 8.3 file name */
+ char_u *fname,
+ char_u *ext,
+ int prepend_dot) /* may prepend a '.' to file name */
{
char_u *retval;
char_u *s;
@@ -6387,10 +6361,7 @@ buf_modname(shortname, fname, ext, prepend_dot)
* rest of the line is thrown away. Returns TRUE for end-of-file.
*/
int
-vim_fgets(buf, size, fp)
- char_u *buf;
- int size;
- FILE *fp;
+vim_fgets(char_u *buf, int size, FILE *fp)
{
char *eof;
#define FGETS_SIZE 200
@@ -6427,10 +6398,7 @@ vim_fgets(buf, size, fp)
* Only used for the Mac, because it's much slower than vim_fgets().
*/
int
-tag_fgets(buf, size, fp)
- char_u *buf;
- int size;
- FILE *fp;
+tag_fgets(char_u *buf, int size, FILE *fp)
{
int i = 0;
int c;
@@ -6470,9 +6438,7 @@ tag_fgets(buf, size, fp)
* Return -1 for failure, 0 for success.
*/
int
-vim_rename(from, to)
- char_u *from;
- char_u *to;
+vim_rename(char_u *from, char_u *to)
{
int fd_in;
int fd_out;
@@ -6690,8 +6656,8 @@ static int already_warned = FALSE;
* cursor positioned).
*/
int
-check_timestamps(focus)
- int focus; /* called for GUI focus event */
+check_timestamps(
+ int focus) /* called for GUI focus event */
{
buf_T *buf;
int didit = 0;
@@ -6758,9 +6724,7 @@ check_timestamps(focus)
* empty.
*/
static int
-move_lines(frombuf, tobuf)
- buf_T *frombuf;
- buf_T *tobuf;
+move_lines(buf_T *frombuf, buf_T *tobuf)
{
buf_T *tbuf = curbuf;
int retval = OK;
@@ -6807,9 +6771,9 @@ move_lines(frombuf, tobuf)
* return 0 otherwise.
*/
int
-buf_check_timestamp(buf, focus)
- buf_T *buf;
- int focus UNUSED; /* called for GUI focus event */
+buf_check_timestamp(
+ buf_T *buf,
+ int focus UNUSED) /* called for GUI focus event */
{
struct stat st;
int stat_res;
@@ -7100,9 +7064,7 @@ buf_check_timestamp(buf, focus)
* buf->b_orig_mode may have been reset already.
*/
void
-buf_reload(buf, orig_mode)
- buf_T *buf;
- int orig_mode;
+buf_reload(buf_T *buf, int orig_mode)
{
exarg_T ea;
pos_T old_cursor;
@@ -7254,10 +7216,7 @@ buf_reload(buf, orig_mode)
}
void
-buf_store_time(buf, st, fname)
- buf_T *buf;
- struct stat *st;
- char_u *fname UNUSED;
+buf_store_time(buf_T *buf, struct stat *st, char_u *fname UNUSED)
{
buf->b_mtime = (long)st->st_mtime;
buf->b_orig_size = st->st_size;
@@ -7273,8 +7232,7 @@ buf_store_time(buf, st, fname)
* Used for do_filter(), when the input lines for the filter are deleted.
*/
void
-write_lnum_adjust(offset)
- linenr_T offset;
+write_lnum_adjust(linenr_T offset)
{
if (curbuf->b_no_eol_lnum != 0) /* only if there is a missing eol */
curbuf->b_no_eol_lnum += offset;
@@ -7335,7 +7293,7 @@ static long temp_count = 0; /* Temp filename counter. */
* Delete the temp directory and all files it contains.
*/
void
-vim_deltempdir()
+vim_deltempdir(void)
{
if (vim_tempdir != NULL)
{
@@ -7353,8 +7311,7 @@ vim_deltempdir()
* "tempdir" must be no longer than MAXPATHL.
*/
static void
-vim_settempdir(tempdir)
- char_u *tempdir;
+vim_settempdir(char_u *tempdir)
{
char_u *buf;
@@ -7385,9 +7342,9 @@ vim_settempdir(tempdir)
* The returned pointer is NULL if no valid name was found.
*/
char_u *
-vim_tempname(extra_char, keep)
- int extra_char UNUSED; /* char to use in the name instead of '?' */
- int keep UNUSED;
+vim_tempname(
+ int extra_char UNUSED, /* char to use in the name instead of '?' */
+ int keep UNUSED)
{
#ifdef USE_TMPNAM
char_u itmp[L_tmpnam]; /* use tmpnam() */
@@ -7587,8 +7544,7 @@ vim_tempname(extra_char, keep)
* it looks like a URL.
*/
void
-forward_slash(fname)
- char_u *fname;
+forward_slash(char_u *fname)
{
char_u *p;
@@ -7838,9 +7794,7 @@ static int autocmd_blocked = 0; /* block all autocmds */
* Show the autocommands for one AutoPat.
*/
static void
-show_autocmd(ap, event)
- AutoPat *ap;
- event_T event;
+show_autocmd(AutoPat *ap, event_T event)
{
AutoCmd *ac;
@@ -7904,8 +7858,7 @@ show_autocmd(ap, event)
* Mark an autocommand pattern for deletion.
*/
static void
-au_remove_pat(ap)
- AutoPat *ap;
+au_remove_pat(AutoPat *ap)
{
vim_free(ap->pat);
ap->pat = NULL;
@@ -7917,8 +7870,7 @@ au_remove_pat(ap)
* Mark all commands for a pattern for deletion.
*/
static void
-au_remove_cmds(ap)
- AutoPat *ap;
+au_remove_cmds(AutoPat *ap)
{
AutoCmd *ac;
@@ -7935,7 +7887,7 @@ au_remove_cmds(ap)
* This is only done when not executing autocommands.
*/
static void
-au_cleanup()
+au_cleanup(void)
{
AutoPat *ap, **prev_ap;
AutoCmd *ac, **prev_ac;
@@ -7988,8 +7940,7 @@ au_cleanup()
* autocmds.
*/
void
-aubuflocal_remove(buf)
- buf_T *buf;
+aubuflocal_remove(buf_T *buf)
{
AutoPat *ap;
event_T event;
@@ -8025,8 +7976,7 @@ aubuflocal_remove(buf)
* Return it's ID. Returns AUGROUP_ERROR (< 0) for error.
*/
static int
-au_new_group(name)
- char_u *name;
+au_new_group(char_u *name)
{
int i;
@@ -8051,8 +8001,7 @@ au_new_group(name)
}
static void
-au_del_group(name)
- char_u *name;
+au_del_group(char_u *name)
{
int i;
@@ -8071,8 +8020,7 @@ au_del_group(name)
* Return it's ID. Returns AUGROUP_ERROR (< 0) for error.
*/
static int
-au_find_group(name)
- char_u *name;
+au_find_group(char_u *name)
{
int i;
@@ -8086,8 +8034,7 @@ au_find_group(name)
* Return TRUE if augroup "name" exists.
*/
int
-au_has_group(name)
- char_u *name;
+au_has_group(char_u *name)
{
return au_find_group(name) != AUGROUP_ERROR;
}
@@ -8096,9 +8043,7 @@ au_has_group(name)
* ":augroup {name}".
*/
void
-do_augroup(arg, del_group)
- char_u *arg;
- int del_group;
+do_augroup(char_u *arg, int del_group)
{
int i;
@@ -8135,7 +8080,7 @@ do_augroup(arg, del_group)
#if defined(EXITFREE) || defined(PROTO)
void
-free_all_autocmds()
+free_all_autocmds(void)
{
for (current_augroup = -1; current_augroup < augroups.ga_len;
++current_augroup)
@@ -8150,9 +8095,7 @@ free_all_autocmds()
* Return a pointer to the next event name in "end".
*/
static event_T
-event_name2nr(start, end)
- char_u *start;
- char_u **end;
+event_name2nr(char_u *start, char_u **end)
{
char_u *p;
int i;
@@ -8179,8 +8122,7 @@ event_name2nr(start, end)
* Return the name for event "event".
*/
static char_u *
-event_nr2name(event)
- event_T event;
+event_nr2name(event_T event)
{
int i;
@@ -8194,9 +8136,9 @@ event_nr2name(event)
* Scan over the events. "*" stands for all events.
*/
static char_u *
-find_end_event(arg, have_group)
- char_u *arg;
- int have_group; /* TRUE when group name was found */
+find_end_event(
+ char_u *arg,
+ int have_group) /* TRUE when group name was found */
{
char_u *pat;
char_u *p;
@@ -8231,8 +8173,7 @@ find_end_event(arg, have_group)
* Return TRUE if "event" is included in 'eventignore'.
*/
static int
-event_ignored(event)
- event_T event;
+event_ignored(event_T event)
{
char_u *p = p_ei;
@@ -8251,7 +8192,7 @@ event_ignored(event)
* Return OK when the contents of p_ei is valid, FAIL otherwise.
*/
int
-check_ei()
+check_ei(void)
{
char_u *p = p_ei;
@@ -8278,8 +8219,7 @@ check_ei()
* Returns the old value of 'eventignore' in allocated memory.
*/
char_u *
-au_event_disable(what)
- char *what;
+au_event_disable(char *what)
{
char_u *new_ei;
char_u *save_ei;
@@ -8303,8 +8243,7 @@ au_event_disable(what)
}
void
-au_event_restore(old_ei)
- char_u *old_ei;
+au_event_restore(char_u *old_ei)
{
if (old_ei != NULL)
{
@@ -8348,9 +8287,7 @@ au_event_restore(old_ei)
* Mostly a {group} argument can optionally appear before <event>.
*/
void
-do_autocmd(arg, forceit)
- char_u *arg;
- int forceit;
+do_autocmd(char_u *arg, int forceit)
{
char_u *pat;
char_u *envpat = NULL;
@@ -8466,8 +8403,7 @@ do_autocmd(arg, forceit)
* Returns the group ID, AUGROUP_ERROR for error (out of memory).
*/
static int
-au_get_grouparg(argp)
- char_u **argp;
+au_get_grouparg(char_u **argp)
{
char_u *group_name;
char_u *p;
@@ -8498,13 +8434,13 @@ au_get_grouparg(argp)
* If group is not AUGROUP_ALL, only use this group.
*/
static int
-do_autocmd_event(event, pat, nested, cmd, forceit, group)
- event_T event;
- char_u *pat;
- int nested;
- char_u *cmd;
- int forceit;
- int group;
+do_autocmd_event(
+ event_T event,
+ char_u *pat,
+ int nested,
+ char_u *cmd,
+ int forceit,
+ int group)
{
AutoPat *ap;
AutoPat **prev_ap;
@@ -8747,9 +8683,9 @@ do_autocmd_event(event, pat, nested, cmd, forceit, group)
* Return OK for success, FAIL for failure;
*/
int
-do_doautocmd(arg, do_msg)
- char_u *arg;
- int do_msg; /* give message for no matching autocmds? */
+do_doautocmd(
+ char_u *arg,
+ int do_msg) /* give message for no matching autocmds? */
{
char_u *fname;
int nothing_done = TRUE;
@@ -8800,8 +8736,7 @@ do_doautocmd(arg, do_msg)
* ":doautoall": execute autocommands for each loaded buffer.
*/
void
-ex_doautoall(eap)
- exarg_T *eap;
+ex_doautoall(exarg_T *eap)
{
int retval;
aco_save_T aco;
@@ -8852,8 +8787,7 @@ ex_doautoall(eap)
* Thus return TRUE when do_modelines() should be called.
*/
int
-check_nomodeline(argp)
- char_u **argp;
+check_nomodeline(char_u **argp)
{
if (STRNCMP(*argp, "<nomodeline>", 12) == 0)
{
@@ -8871,9 +8805,9 @@ check_nomodeline(argp)
* When FEAT_AUTOCMD is not defined another version is used, see below.
*/
void
-aucmd_prepbuf(aco, buf)
- aco_save_T *aco; /* structure to save values in */
- buf_T *buf; /* new curbuf */
+aucmd_prepbuf(
+ aco_save_T *aco, /* structure to save values in */
+ buf_T *buf) /* new curbuf */
{
win_T *win;
#ifdef FEAT_WINDOWS
@@ -8974,8 +8908,8 @@ aucmd_prepbuf(aco, buf)
* When FEAT_AUTOCMD is not defined another version is used, see below.
*/
void
-aucmd_restbuf(aco)
- aco_save_T *aco; /* structure holding saved values */
+aucmd_restbuf(
+ aco_save_T *aco) /* structure holding saved values */
{
#ifdef FEAT_WINDOWS
int dummy;
@@ -9089,12 +9023,12 @@ static int autocmd_nested = FALSE;
* Return TRUE if some commands were executed.
*/
int
-apply_autocmds(event, fname, fname_io, force, buf)
- event_T event;
- char_u *fname; /* NULL or empty means use actual file name */
- char_u *fname_io; /* fname to use for <afile> on cmdline */
- int force; /* when TRUE, ignore autocmd_busy */
- buf_T *buf; /* buffer for <abuf> */
+apply_autocmds(
+ event_T event,
+ char_u *fname, /* NULL or empty means use actual file name */
+ char_u *fname_io, /* fname to use for <afile> on cmdline */
+ int force, /* when TRUE, ignore autocmd_busy */
+ buf_T *buf) /* buffer for <abuf> */
{
return apply_autocmds_group(event, fname, fname_io, force,
AUGROUP_ALL, buf, NULL);
@@ -9105,13 +9039,13 @@ apply_autocmds(event, fname, fname_io, force, buf)
* setting v:filearg.
*/
static int
-apply_autocmds_exarg(event, fname, fname_io, force, buf, eap)
- event_T event;
- char_u *fname;
- char_u *fname_io;
- int force;
- buf_T *buf;
- exarg_T *eap;
+apply_autocmds_exarg(
+ event_T event,
+ char_u *fname,
+ char_u *fname_io,
+ int force,
+ buf_T *buf,
+ exarg_T *eap)
{
return apply_autocmds_group(event, fname, fname_io, force,
AUGROUP_ALL, buf, eap);
@@ -9124,13 +9058,13 @@ apply_autocmds_exarg(event, fname, fname_io, force, buf, eap)
* cause the script to be aborted, retval is set to FAIL.
*/
int
-apply_autocmds_retval(event, fname, fname_io, force, buf, retval)
- event_T event;
- char_u *fname; /* NULL or empty means use actual file name */
- char_u *fname_io; /* fname to use for <afile> on cmdline */
- int force; /* when TRUE, ignore autocmd_busy */
- buf_T *buf; /* buffer for <abuf> */
- int *retval; /* pointer to caller's retval */
+apply_autocmds_retval(
+ event_T event,
+ char_u *fname, /* NULL or empty means use actual file name */
+ char_u *fname_io, /* fname to use for <afile> on cmdline */
+ int force, /* when TRUE, ignore autocmd_busy */
+ buf_T *buf, /* buffer for <abuf> */
+ int *retval) /* pointer to caller's retval */
{
int did_cmd;
@@ -9154,7 +9088,7 @@ apply_autocmds_retval(event, fname, fname_io, force, buf, retval)
* Return TRUE when there is a CursorHold autocommand defined.
*/
int
-has_cursorhold()
+has_cursorhold(void)
{
return (first_autopat[(int)(get_real_state() == NORMAL_BUSY
? EVENT_CURSORHOLD : EVENT_CURSORHOLDI)] != NULL);
@@ -9164,7 +9098,7 @@ has_cursorhold()
* Return TRUE if the CursorHold event can be triggered.
*/
int
-trigger_cursorhold()
+trigger_cursorhold(void)
{
int state;
@@ -9188,7 +9122,7 @@ trigger_cursorhold()
* Return TRUE when there is a CursorMoved autocommand defined.
*/
int
-has_cursormoved()
+has_cursormoved(void)
{
return (first_autopat[(int)EVENT_CURSORMOVED] != NULL);
}
@@ -9197,7 +9131,7 @@ has_cursormoved()
* Return TRUE when there is a CursorMovedI autocommand defined.
*/
int
-has_cursormovedI()
+has_cursormovedI(void)
{
return (first_autopat[(int)EVENT_CURSORMOVEDI] != NULL);
}
@@ -9206,7 +9140,7 @@ has_cursormovedI()
* Return TRUE when there is a TextChanged autocommand defined.
*/
int
-has_textchanged()
+has_textchanged(void)
{
return (first_autopat[(int)EVENT_TEXTCHANGED] != NULL);
}
@@ -9215,7 +9149,7 @@ has_textchanged()
* Return TRUE when there is a TextChangedI autocommand defined.
*/
int
-has_textchangedI()
+has_textchangedI(void)
{
return (first_autopat[(int)EVENT_TEXTCHANGEDI] != NULL);
}
@@ -9224,7 +9158,7 @@ has_textchangedI()
* Return TRUE when there is an InsertCharPre autocommand defined.
*/
int
-has_insertcharpre()
+has_insertcharpre(void)
{
return (first_autopat[(int)EVENT_INSERTCHARPRE] != NULL);
}
@@ -9233,7 +9167,7 @@ has_insertcharpre()
* Return TRUE when there is an CmdUndefined autocommand defined.
*/
int
-has_cmdundefined()
+has_cmdundefined(void)
{
return (first_autopat[(int)EVENT_CMDUNDEFINED] != NULL);
}
@@ -9242,21 +9176,21 @@ has_cmdundefined()
* Return TRUE when there is an FuncUndefined autocommand defined.
*/
int
-has_funcundefined()
+has_funcundefined(void)
{
return (first_autopat[(int)EVENT_FUNCUNDEFINED] != NULL);
}
static int
-apply_autocmds_group(event, fname, fname_io, force, group, buf, eap)
- event_T event;
- char_u *fname; /* NULL or empty means use actual file name */
- char_u *fname_io; /* fname to use for <afile> on cmdline, NULL means
+apply_autocmds_group(
+ event_T event,
+ char_u *fname, /* NULL or empty means use actual file name */
+ char_u *fname_io, /* fname to use for <afile> on cmdline, NULL means
use fname */
- int force; /* when TRUE, ignore autocmd_busy */
- int group; /* group ID, or AUGROUP_ALL */
- buf_T *buf; /* buffer for <abuf> */
- exarg_T *eap; /* command arguments */
+ int force, /* when TRUE, ignore autocmd_busy */
+ int group, /* group ID, or AUGROUP_ALL */
+ buf_T *buf, /* buffer for <abuf> */
+ exarg_T *eap) /* command arguments */
{
char_u *sfname = NULL; /* short file name */
char_u *tail;
@@ -9647,7 +9581,7 @@ static char_u *old_termresponse = NULL;
* Can be used recursively, so long as it's symmetric.
*/
void
-block_autocmds()
+block_autocmds(void)
{
# ifdef FEAT_EVAL
/* Remember the value of v:termresponse. */
@@ -9658,7 +9592,7 @@ block_autocmds()
}
void
-unblock_autocmds()
+unblock_autocmds(void)
{
--autocmd_blocked;
@@ -9673,7 +9607,7 @@ unblock_autocmds()
}
int
-is_autocmd_blocked()
+is_autocmd_blocked(void)
{
return autocmd_blocked != 0;
}
@@ -9682,9 +9616,9 @@ is_autocmd_blocked()
* Find next autocommand pattern that matches.
*/
static void
-auto_next_pat(apc, stop_at_last)
- AutoPatCmd *apc;
- int stop_at_last; /* stop when 'last' flag is set */
+auto_next_pat(
+ AutoPatCmd *apc,
+ int stop_at_last) /* stop when 'last' flag is set */
{
AutoPat *ap;
AutoCmd *cp;
@@ -9748,10 +9682,7 @@ auto_next_pat(apc, stop_at_last)
* Returns allocated string, or NULL for end of autocommands.
*/
char_u *
-getnextac(c, cookie, indent)
- int c UNUSED;
- void *cookie;
- int indent UNUSED;
+getnextac(int c UNUSED, void *cookie, int indent UNUSED)
{
AutoPatCmd *acp = (AutoPatCmd *)cookie;
char_u *retval;
@@ -9812,10 +9743,7 @@ getnextac(c, cookie, indent)
* in which buffer the file will be opened.
*/
int
-has_autocmd(event, sfname, buf)
- event_T event;
- char_u *sfname;
- buf_T *buf;
+has_autocmd(event_T event, char_u *sfname, buf_T *buf)
{
AutoPat *ap;
char_u *fname;
@@ -9863,9 +9791,7 @@ has_autocmd(event, sfname, buf)
* names.
*/
char_u *
-get_augroup_name(xp, idx)
- expand_T *xp UNUSED;
- int idx;
+get_augroup_name(expand_T *xp UNUSED, int idx)
{
if (idx == augroups.ga_len) /* add "END" add the end */
return (char_u *)"END";
@@ -9879,10 +9805,10 @@ get_augroup_name(xp, idx)
static int include_groups = FALSE;
char_u *
-set_context_in_autocmd(xp, arg, doautocmd)
- expand_T *xp;
- char_u *arg;
- int doautocmd; /* TRUE for :doauto*, FALSE for :autocmd */
+set_context_in_autocmd(
+ expand_T *xp,
+ char_u *arg,
+ int doautocmd) /* TRUE for :doauto*, FALSE for :autocmd */
{
char_u *p;
int group;
@@ -9931,9 +9857,7 @@ set_context_in_autocmd(xp, arg, doautocmd)
* Function given to ExpandGeneric() to obtain the list of event names.
*/
char_u *
-get_event_name(xp, idx)
- expand_T *xp UNUSED;
- int idx;
+get_event_name(expand_T *xp UNUSED, int idx)
{
if (idx < augroups.ga_len) /* First list group names, if wanted */
{
@@ -9950,8 +9874,7 @@ get_event_name(xp, idx)
* Return TRUE if autocmd is supported.
*/
int
-autocmd_supported(name)
- char_u *name;
+autocmd_supported(char_u *name)
{
char_u *p;
@@ -9971,8 +9894,7 @@ autocmd_supported(name)
* exists("#Event#pat")
*/
int
-au_exists(arg)
- char_u *arg;
+au_exists(char_u *arg)
{
char_u *arg_save;
char_u *pattern = NULL;
@@ -10102,13 +10024,13 @@ aucmd_restbuf(aco)
* Returns TRUE if there is a match, FALSE otherwise.
*/
static int
-match_file_pat(pattern, prog, fname, sfname, tail, allow_dirs)
- char_u *pattern; /* pattern to match with */
- regprog_T **prog; /* pre-compiled regprog or NULL */
- char_u *fname; /* full path of file name */
- char_u *sfname; /* short file name or NULL */
- char_u *tail; /* tail of path */
- int allow_dirs; /* allow matching with dir */
+match_file_pat(
+ char_u *pattern, /* pattern to match with */
+ regprog_T **prog, /* pre-compiled regprog or NULL */
+ char_u *fname, /* full path of file name */
+ char_u *sfname, /* short file name or NULL */
+ char_u *tail, /* tail of path */
+ int allow_dirs) /* allow matching with dir */
{
regmatch_T regmatch;
int result = FALSE;
@@ -10148,10 +10070,7 @@ match_file_pat(pattern, prog, fname, sfname, tail, allow_dirs)
* "sfname" is the short file name or NULL, "ffname" the long file name.
*/
int
-match_file_list(list, sfname, ffname)
- char_u *list;
- char_u *sfname;
- char_u *ffname;
+match_file_list(char_u *list, char_u *sfname, char_u *ffname)
{
char_u buf[100];
char_u *tail;
@@ -10190,11 +10109,11 @@ match_file_list(list, sfname, ffname)
* Returns NULL when out of memory.
*/
char_u *
-file_pat_to_reg_pat(pat, pat_end, allow_dirs, no_bslash)
- char_u *pat;
- char_u *pat_end; /* first char after pattern or NULL */
- char *allow_dirs; /* Result passed back out in here */
- int no_bslash UNUSED; /* Don't use a backward slash as pathsep */
+file_pat_to_reg_pat(
+ char_u *pat,
+ char_u *pat_end, /* first char after pattern or NULL */
+ char *allow_dirs, /* Result passed back out in here */
+ int no_bslash UNUSED) /* Don't use a backward slash as pathsep */
{
int size = 2; /* '^' at start, '$' at end */
char_u *endp;
@@ -10400,10 +10319,7 @@ file_pat_to_reg_pat(pat, pat_end, allow_dirs, no_bslash)
* by a SIGWINCH).
*/
long
-read_eintr(fd, buf, bufsize)
- int fd;
- void *buf;
- size_t bufsize;
+read_eintr(int fd, void *buf, size_t bufsize)
{
long ret;
@@ -10421,10 +10337,7 @@ read_eintr(fd, buf, bufsize)
* by a SIGWINCH).
*/
long
-write_eintr(fd, buf, bufsize)
- int fd;
- void *buf;
- size_t bufsize;
+write_eintr(int fd, void *buf, size_t bufsize)
{
long ret = 0;
long wlen;
diff --git a/src/version.c b/src/version.c
index f08e4d6ab..0a3662770 100644
--- a/src/version.c
+++ b/src/version.c
@@ -747,6 +747,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1206,
+/**/
1205,
/**/
1204,