diff src/ex_getln.c @ 7819:f86adafb28d4 v7.4.1206

commit https://github.com/vim/vim/commit/78c0b7d43e5048fd71d12816659667834170c76d Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jan 30 15:52:46 2016 +0100 patch 7.4.1206 Problem: Using old style function declarations. Solution: Change to new style function declarations. (script by Hirohito Higashi)
author Christian Brabandt <cb@256bit.org>
date Sat, 30 Jan 2016 16:00:06 +0100
parents 1a5d34492798
children 10f17a228661
line wrap: on
line diff
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -156,10 +156,10 @@ sort_func_compare(const void *s1, const 
  * 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, 
  * '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, o
  * 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,
 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, fil
  * 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, fi
  * 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
  * 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, 
  * 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
  * 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, dirname
  * 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
  * 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 se
  * 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_ma
  * "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_p
  * 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 
  * 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;