summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-01-30 21:10:09 +0100
committerBram Moolenaar <Bram@vim.org>2016-01-30 21:10:09 +0100
commit764b23c8fd3369cb05ae9122abf3ca16fec539d7 (patch)
tree9f9c938d8f1d4d38aae0ea514eed94c89cb1aeb8
parent055409764ca5f7978d4c399d2c440af0ce971c4f (diff)
patch 7.4.1214v7.4.1214
Problem: Using old style function declarations. Solution: Change to new style function declarations. (script by Hirohito Higashi)
-rw-r--r--src/search.c383
-rw-r--r--src/sha256.c48
-rw-r--r--src/spell.c964
-rw-r--r--src/syntax.c717
-rw-r--r--src/tag.c141
-rw-r--r--src/term.c261
-rw-r--r--src/termlib.c56
-rw-r--r--src/ui.c327
-rw-r--r--src/undo.c250
-rw-r--r--src/version.c2
10 files changed, 1260 insertions, 1889 deletions
diff --git a/src/search.c b/src/search.c
index 3aa752a86f..23cb2911ed 100644
--- a/src/search.c
+++ b/src/search.c
@@ -140,12 +140,12 @@ typedef struct SearchedFile
* returns FAIL if failed, OK otherwise.
*/
int
-search_regcomp(pat, pat_save, pat_use, options, regmatch)
- char_u *pat;
- int pat_save;
- int pat_use;
- int options;
- regmmatch_T *regmatch; /* return: pattern and ignore-case flag */
+search_regcomp(
+ char_u *pat,
+ int pat_save,
+ int pat_use,
+ int options,
+ regmmatch_T *regmatch) /* return: pattern and ignore-case flag */
{
int magic;
int i;
@@ -230,7 +230,7 @@ search_regcomp(pat, pat_save, pat_use, options, regmatch)
* Get search pattern used by search_regcomp().
*/
char_u *
-get_search_pat()
+get_search_pat(void)
{
return mr_pattern;
}
@@ -241,8 +241,7 @@ get_search_pat()
* Returns the allocated string, NULL when out of memory.
*/
char_u *
-reverse_text(s)
- char_u *s;
+reverse_text(char_u *s)
{
unsigned len;
unsigned s_i, rev_i;
@@ -280,10 +279,7 @@ reverse_text(s)
#endif
void
-save_re_pat(idx, pat, magic)
- int idx;
- char_u *pat;
- int magic;
+save_re_pat(int idx, char_u *pat, int magic)
{
if (spats[idx].pat != pat)
{
@@ -309,7 +305,7 @@ save_re_pat(idx, pat, magic)
static int save_level = 0;
void
-save_search_patterns()
+save_search_patterns(void)
{
if (save_level++ == 0)
{
@@ -327,7 +323,7 @@ save_search_patterns()
}
void
-restore_search_patterns()
+restore_search_patterns(void)
{
if (--save_level == 0)
{
@@ -348,7 +344,7 @@ restore_search_patterns()
#if defined(EXITFREE) || defined(PROTO)
void
-free_search_patterns()
+free_search_patterns(void)
{
vim_free(spats[0].pat);
vim_free(spats[1].pat);
@@ -369,8 +365,7 @@ free_search_patterns()
* Uses the 'ignorecase' and 'smartcase' options.
*/
int
-ignorecase(pat)
- char_u *pat;
+ignorecase(char_u *pat)
{
int ic = p_ic;
@@ -389,8 +384,7 @@ ignorecase(pat)
* Return TRUE if pattern "pat" has an uppercase character.
*/
int
-pat_has_uppercase(pat)
- char_u *pat;
+pat_has_uppercase(char_u *pat)
{
char_u *p = pat;
@@ -427,7 +421,7 @@ pat_has_uppercase(pat)
}
char_u *
-last_csearch()
+last_csearch(void)
{
#ifdef FEAT_MBYTE
return lastc_bytes;
@@ -437,22 +431,19 @@ last_csearch()
}
int
-last_csearch_forward()
+last_csearch_forward(void)
{
return lastcdir == FORWARD;
}
int
-last_csearch_until()
+last_csearch_until(void)
{
return last_t_cmd == TRUE;
}
void
-set_last_csearch(c, s, len)
- int c;
- char_u *s UNUSED;
- int len UNUSED;
+set_last_csearch(int c, char_u *s UNUSED, int len UNUSED)
{
*lastc = c;
#ifdef FEAT_MBYTE
@@ -465,21 +456,19 @@ set_last_csearch(c, s, len)
}
void
-set_csearch_direction(cdir)
- int cdir;
+set_csearch_direction(int cdir)
{
lastcdir = cdir;
}
void
-set_csearch_until(t_cmd)
- int t_cmd;
+set_csearch_until(int t_cmd)
{
last_t_cmd = t_cmd;
}
char_u *
-last_search_pat()
+last_search_pat(void)
{
return spats[last_idx].pat;
}
@@ -488,7 +477,7 @@ last_search_pat()
* Reset search direction to forward. For "gd" and "gD" commands.
*/
void
-reset_search_dir()
+reset_search_dir(void)
{
spats[0].off.dir = '/';
#if defined(FEAT_EVAL)
@@ -502,11 +491,11 @@ reset_search_dir()
* Also set the saved search pattern, so that this works in an autocommand.
*/
void
-set_last_search_pat(s, idx, magic, setlast)
- char_u *s;
- int idx;
- int magic;
- int setlast;
+set_last_search_pat(
+ char_u *s,
+ int idx,
+ int magic,
+ int setlast)
{
vim_free(spats[idx].pat);
/* An empty string means that nothing should be matched. */
@@ -550,8 +539,7 @@ set_last_search_pat(s, idx, magic, setlast)
* Values returned in regmatch->regprog and regmatch->rmm_ic.
*/
void
-last_pat_prog(regmatch)
- regmmatch_T *regmatch;
+last_pat_prog(regmmatch_T *regmatch)
{
if (spats[last_idx].pat == NULL)
{
@@ -585,18 +573,18 @@ last_pat_prog(regmatch)
* subpattern plus one; one if there was none.
*/
int
-searchit(win, buf, pos, dir, pat, count, options, pat_use, stop_lnum, tm)
- win_T *win; /* window to search in; can be NULL for a
+searchit(
+ win_T *win, /* window to search in; can be NULL for a
buffer without a window! */
- buf_T *buf;
- pos_T *pos;
- int dir;
- char_u *pat;
- long count;
- int options;
- int pat_use; /* which pattern to use when "pat" is empty */
- linenr_T stop_lnum; /* stop after this line number when != 0 */
- proftime_T *tm UNUSED; /* timeout limit or NULL */
+ buf_T *buf,
+ pos_T *pos,
+ int dir,
+ char_u *pat,
+ long count,
+ int options,
+ int pat_use, /* which pattern to use when "pat" is empty */
+ linenr_T stop_lnum, /* stop after this line number when != 0 */
+ proftime_T *tm UNUSED) /* timeout limit or NULL */
{
int found;
linenr_T lnum; /* no init to shut up Apollo cc */
@@ -1088,14 +1076,13 @@ searchit(win, buf, pos, dir, pat, count, options, pat_use, stop_lnum, tm)
#ifdef FEAT_EVAL
void
-set_search_direction(cdir)
- int cdir;
+set_search_direction(int cdir)
{
spats[0].off.dir = cdir;
}
static void
-set_vv_searchforward()
+set_vv_searchforward(void)
{
set_vim_var_nr(VV_SEARCHFORWARD, (long)(spats[0].off.dir == '/'));
}
@@ -1105,8 +1092,7 @@ set_vv_searchforward()
* Return zero if none of them matched.
*/
static int
-first_submatch(rp)
- regmmatch_T *rp;
+first_submatch(regmmatch_T *rp)
{
int submatch;
@@ -1146,13 +1132,13 @@ first_submatch(rp)
* Return 0 for failure, 1 for found, 2 for found and line offset added.
*/
int
-do_search(oap, dirc, pat, count, options, tm)
- oparg_T *oap; /* can be NULL */
- int dirc; /* '/' or '?' */
- char_u *pat;
- long count;
- int options;
- proftime_T *tm; /* timeout limit or NULL */
+do_search(
+ oparg_T *oap, /* can be NULL */
+ int dirc, /* '/' or '?' */
+ char_u *pat,
+ long count,
+ int options,
+ proftime_T *tm) /* timeout limit or NULL */
{
pos_T pos; /* position of the last match */
char_u *searchstr;
@@ -1536,11 +1522,11 @@ end_do_search:
* Return OK for success, or FAIL if no line found.
*/
int
-search_for_exact_line(buf, pos, dir, pat)
- buf_T *buf;
- pos_T *pos;
- int dir;
- char_u *pat;
+search_for_exact_line(
+ buf_T *buf,
+ pos_T *pos,
+ int dir,
+ char_u *pat)
{
linenr_T start = 0;
char_u *ptr;
@@ -1617,9 +1603,7 @@ search_for_exact_line(buf, pos, dir, pat)
* Return FAIL or OK.
*/
int
-searchc(cap, t_cmd)
- cmdarg_T *cap;
- int t_cmd;
+searchc(cmdarg_T *cap, int t_cmd)
{
int c = cap->nchar; /* char to search for */
int dir = cap->arg; /* TRUE for searching forward */
@@ -1754,9 +1738,7 @@ searchc(cap, t_cmd)
* Improvement over vi: Braces inside quotes are ignored.
*/
pos_T *
-findmatch(oap, initc)
- oparg_T *oap;
- int initc;
+findmatch(oparg_T *oap, int initc)
{
return findmatchlimit(oap, initc, 0, 0);
}
@@ -1769,11 +1751,11 @@ findmatch(oap, initc)
* Handles multibyte string correctly.
*/
static int
-check_prevcol(linep, col, ch, prevcol)
- char_u *linep;
- int col;
- int ch;
- int *prevcol;
+check_prevcol(
+ char_u *linep,
+ int col,
+ int ch,
+ int *prevcol)
{
--col;
#ifdef FEAT_MBYTE
@@ -1792,10 +1774,7 @@ static int find_rawstring_end(char_u *linep, pos_T *startpos, pos_T *endpos);
* Return TRUE if the matching end can be found between startpos and endpos.
*/
static int
-find_rawstring_end(linep, startpos, endpos)
- char_u *linep;
- pos_T *startpos;
- pos_T *endpos;
+find_rawstring_end(char_u *linep, pos_T *startpos, pos_T *endpos)
{
char_u *p;
char_u *delim_copy;
@@ -1854,11 +1833,11 @@ find_rawstring_end(linep, startpos, endpos)
*/
pos_T *
-findmatchlimit(oap, initc, flags, maxtravel)
- oparg_T *oap;
- int initc;
- int flags;
- int maxtravel;
+findmatchlimit(
+ oparg_T *oap,
+ int initc,
+ int flags,
+ int maxtravel)
{
static pos_T pos; /* current search position */
int findc = 0; /* matching brace */
@@ -2504,8 +2483,7 @@ findmatchlimit(oap, initc, flags, maxtravel)
* TODO: skip strings.
*/
static int
-check_linecomment(line)
- char_u *line;
+check_linecomment(char_u *line)
{
char_u *p;
@@ -2565,8 +2543,8 @@ check_linecomment(line)
* If there isn't a match, then beep.
*/
void
-showmatch(c)
- int c; /* char to show match for */
+showmatch(
+ int c) /* char to show match for */
{
pos_T *lpos, save_cursor;
pos_T mpos;
@@ -2672,9 +2650,7 @@ showmatch(c)
* Return OK if the next sentence was found.
*/
int
-findsent(dir, count)
- int dir;
- long count;
+findsent(int dir, long count)
{
pos_T pos, tpos;
int c;
@@ -2801,12 +2777,12 @@ found:
* Return TRUE if the next paragraph or section was found.
*/
int
-findpar(pincl, dir, count, what, both)
- int *pincl; /* Return: TRUE if last char is to be included */
- int dir;
- long count;
- int what;
- int both;
+findpar(
+ int *pincl, /* Return: TRUE if last char is to be included */
+ int dir,
+ long count,
+ int what,
+ int both)
{
linenr_T curr;
int did_skip; /* TRUE after separating lines have been skipped */
@@ -2880,9 +2856,7 @@ findpar(pincl, dir, count, what, both)
* check if the string 's' is a nroff macro that is in option 'opt'
*/
static int
-inmacro(opt, s)
- char_u *opt;
- char_u *s;
+inmacro(char_u *opt, char_u *s)
{
char_u *macro;
@@ -2911,10 +2885,7 @@ inmacro(opt, s)
* If 'both' is TRUE also stop at '}'
*/
int
-startPS(lnum, para, both)
- linenr_T lnum;
- int para;
- int both;
+startPS(linenr_T lnum, int para, int both)
{
char_u *s;
@@ -2953,7 +2924,7 @@ static int cls_bigword; /* TRUE for "W", "B" or "E" */
* boundaries are of interest.
*/
static int
-cls()
+cls(void)
{
int c;
@@ -3000,10 +2971,10 @@ cls()
* If eol is TRUE, last word stops at end of line (for operators).
*/
int
-fwd_word(count, bigword, eol)
- long count;
- int bigword; /* "W", "E" or "B" */
- int eol;
+fwd_word(
+ long count,
+ int bigword, /* "W", "E" or "B" */
+ int eol)
{
int sclass; /* starting class */
int i;
@@ -3072,10 +3043,7 @@ fwd_word(count, bigword, eol)
* Returns FAIL if top of the file was reached.
*/
int
-bck_word(count, bigword, stop)
- long count;
- int bigword;
- int stop;
+bck_word(long count, int bigword, int stop)
{
int sclass; /* starting class */
@@ -3140,11 +3108,11 @@ finished:
* If empty is TRUE stop on an empty line.
*/
int
-end_word(count, bigword, stop, empty)
- long count;
- int bigword;
- int stop;
- int empty;
+end_word(
+ long count,
+ int bigword,
+ int stop,
+ int empty)
{
int sclass; /* starting class */
@@ -3210,10 +3178,10 @@ finished:
* Returns FAIL if start of the file was reached.
*/
int
-bckend_word(count, bigword, eol)
- long count;
- int bigword; /* TRUE for "B" */
- int eol; /* TRUE: stop at end of line. */
+bckend_word(
+ long count,
+ int bigword, /* TRUE for "B" */
+ int eol) /* TRUE: stop at end of line. */
{
int sclass; /* starting class */
int i;
@@ -3259,9 +3227,7 @@ bckend_word(count, bigword, eol)
* Return TRUE when end-of-file reached, FALSE otherwise.
*/
static int
-skip_chars(cclass, dir)
- int cclass;
- int dir;
+skip_chars(int cclass, int dir)
{
while (cls() == cclass)
if ((dir == FORWARD ? inc_cursor() : dec_cursor()) == -1)
@@ -3274,7 +3240,7 @@ skip_chars(cclass, dir)
* Go back to the start of the word or the start of white space
*/
static void
-back_in_line()
+back_in_line(void)
{
int sclass; /* starting class */
@@ -3293,8 +3259,7 @@ back_in_line()
}
static void
-find_first_blank(posp)
- pos_T *posp;
+find_first_blank(pos_T *posp)
{
int c;
@@ -3313,9 +3278,9 @@ find_first_blank(posp)
* Skip count/2 sentences and count/2 separating white spaces.
*/
static void
-findsent_forward(count, at_start_sent)
- long count;
- int at_start_sent; /* cursor is at start of sentence */
+findsent_forward(
+ long count,
+ int at_start_sent) /* cursor is at start of sentence */
{
while (count--)
{
@@ -3333,11 +3298,11 @@ findsent_forward(count, at_start_sent)
* Used while an operator is pending, and in Visual mode.
*/
int
-current_word(oap, count, include, bigword)
- oparg_T *oap;
- long count;
- int include; /* TRUE: include word and white space */
- int bigword; /* FALSE == word, TRUE == WORD */
+current_word(
+ oparg_T *oap,
+ long count,
+ int include, /* TRUE: include word and white space */
+ int bigword) /* FALSE == word, TRUE == WORD */
{
pos_T start_pos;
pos_T pos;
@@ -3507,10 +3472,7 @@ current_word(oap, count, include, bigword)
* When Visual active, extend it by one or more sentences.
*/
int
-current_sent(oap, count, include)
- oparg_T *oap;
- long count;
- int include;
+current_sent(oparg_T *oap, long count, int include)
{
pos_T start_pos;
pos_T pos;
@@ -3687,12 +3649,12 @@ extend:
* "what" and "other" are two matching parenthesis/brace/etc.
*/
int
-current_block(oap, count, include, what, other)
- oparg_T *oap;
- long count;
- int include; /* TRUE == include white space */
- int what; /* '(', '{', etc. */
- int other; /* ')', '}', etc. */
+current_block(
+ oparg_T *oap,
+ long count,
+ int include, /* TRUE == include white space */
+ int what, /* '(', '{', etc. */
+ int other) /* ')', '}', etc. */
{
pos_T old_pos;
pos_T *pos = NULL;
@@ -3838,8 +3800,8 @@ static int in_html_tag(int);
* When "end_tag" is TRUE return TRUE if the cursor is on "</aaa>".
*/
static int
-in_html_tag(end_tag)
- int end_tag;
+in_html_tag(
+ int end_tag)
{
char_u *line = ml_get_curline();
char_u *p;
@@ -3911,10 +3873,10 @@ in_html_tag(end_tag)
* Find tag block under the cursor, cursor at end.
*/
int
-current_tagblock(oap, count_arg, include)
- oparg_T *oap;
- long count_arg;
- int include; /* TRUE == include white space */
+current_tagblock(
+ oparg_T *oap,
+ long count_arg,
+ int include) /* TRUE == include white space */
{
long count = count_arg;
long n;
@@ -4117,11 +4079,11 @@ theend:
}
int
-current_par(oap, count, include, type)
- oparg_T *oap;
- long count;
- int include; /* TRUE == include white space */
- int type; /* 'p' for paragraph, 'S' for section */
+current_par(
+ oparg_T *oap,
+ long count,
+ int include, /* TRUE == include white space */
+ int type) /* 'p' for paragraph, 'S' for section */
{
linenr_T start_lnum;
linenr_T end_lnum;
@@ -4296,11 +4258,11 @@ static int find_prev_quote(char_u *line, int col_start, int quotechar, char_u *e
* Returns column number of "quotechar" or -1 when not found.
*/
static int
-find_next_quote(line, col, quotechar, escape)
- char_u *line;
- int col;
- int quotechar;
- char_u *escape; /* escape characters, can be NULL */
+find_next_quote(
+ char_u *line,
+ int col,
+ int quotechar,
+ char_u *escape) /* escape characters, can be NULL */
{
int c;
@@ -4330,11 +4292,11 @@ find_next_quote(line, col, quotechar, escape)
* Return the found column or zero.
*/
static int
-find_prev_quote(line, col_start, quotechar, escape)
- char_u *line;
- int col_start;
- int quotechar;
- char_u *escape; /* escape characters, can be NULL */
+find_prev_quote(
+ char_u *line,
+ int col_start,
+ int quotechar,
+ char_u *escape) /* escape characters, can be NULL */
{
int n;
@@ -4362,11 +4324,11 @@ find_prev_quote(line, col_start, quotechar, escape)
* Returns TRUE if found, else FALSE.
*/
int
-current_quote(oap, count, include, quotechar)
- oparg_T *oap;
- long count;
- int include; /* TRUE == include quote char */
- int quotechar; /* Quote character */
+current_quote(
+ oparg_T *oap,
+ long count,
+ int include, /* TRUE == include quote char */
+ int quotechar) /* Quote character */
{
char_u *line = ml_get_curline();
int col_end;
@@ -4605,9 +4567,9 @@ static int is_one_char(char_u *pattern, int move);
* Used while an operator is pending, and in Visual mode.
*/
int
-current_search(count, forward)
- long count;
- int forward; /* move forward or backwards */
+current_search(
+ long count,
+ int forward) /* move forward or backwards */
{
pos_T start_pos; /* position before the pattern */
pos_T orig_pos; /* position of the cursor at beginning */
@@ -4764,9 +4726,7 @@ current_search(count, forward)
* Returns TRUE, FALSE or -1 for failure.
*/
static int
-is_one_char(pattern, move)
- char_u *pattern;
- int move;
+is_one_char(char_u *pattern, int move)
{
regmmatch_T regmatch;
int nmatched = 0;
@@ -4818,8 +4778,7 @@ is_one_char(pattern, move)
* return TRUE if line 'lnum' is empty or has white chars only.
*/
int
-linewhite(lnum)
- linenr_T lnum;
+linewhite(linenr_T lnum)
{
char_u *p;
@@ -4834,19 +4793,18 @@ linewhite(lnum)
* If p_ic && (compl_cont_status & CONT_SOL) then ptr must be in lowercase.
*/
void
-find_pattern_in_path(ptr, dir, len, whole, skip_comments,
- type, count, action, start_lnum, end_lnum)
- char_u *ptr; /* pointer to search pattern */
- int dir UNUSED; /* direction of expansion */
- int len; /* length of search pattern */
- int whole; /* match whole words only */
- int skip_comments; /* don't match inside comments */
- int type; /* Type of search; are we looking for a type?
+find_pattern_in_path(
+ char_u *ptr, /* pointer to search pattern */
+ int dir UNUSED, /* direction of expansion */
+ int len, /* length of search pattern */
+ int whole, /* match whole words only */
+ int skip_comments, /* don't match inside comments */
+ int type, /* Type of search; are we looking for a type?
a macro? */
- long count;
- int action; /* What to do when we find it */
- linenr_T start_lnum; /* first line to start searching */
- linenr_T end_lnum; /* last line for searching */
+ long count,
+ int action, /* What to do when we find it */
+ linenr_T start_lnum, /* first line to start searching */
+ linenr_T end_lnum) /* last line for searching */
{
SearchedFile *files; /* Stack of included files */
SearchedFile *bigger; /* When we need more space */
@@ -5543,14 +5501,14 @@ fpip_end:
}
static void
-show_pat_in_path(line, type, did_show, action, fp, lnum, count)
- char_u *line;
- int type;
- int did_show;
- int action;
- FILE *fp;
- linenr_T *lnum;
- long count;
+show_pat_in_path(
+ char_u *line,
+ int type,
+ int did_show,
+ int action,
+ FILE *fp,
+ linenr_T *lnum,
+ long count)
{
char_u *p;
@@ -5607,9 +5565,7 @@ show_pat_in_path(line, type, did_show, action, fp, lnum, count)
#ifdef FEAT_VIMINFO
int
-read_viminfo_search_pattern(virp, force)
- vir_T *virp;
- int force;
+read_viminfo_search_pattern(vir_T *virp, int force)
{
char_u *lp;
int idx = -1;
@@ -5695,8 +5651,7 @@ read_viminfo_search_pattern(virp, force)
}
void
-write_viminfo_search_pattern(fp)
- FILE *fp;
+write_viminfo_search_pattern(FILE *fp)
{
if (get_viminfo_parameter('/') != 0)
{
@@ -5710,11 +5665,11 @@ write_viminfo_search_pattern(fp)
}
static void
-wvsp_one(fp, idx, s, sc)
- FILE *fp; /* file to write to */
- int idx; /* spats[] index */
- char *s; /* search pat */
- int sc; /* dir char */
+wvsp_one(
+ FILE *fp, /* file to write to */
+ int idx, /* spats[] index */
+ char *s, /* search pat */
+ int sc) /* dir char */
{
if (spats[idx].pat != NULL)
{
diff --git a/src/sha256.c b/src/sha256.c
index d65b72c0f0..db916a691f 100644
--- a/src/sha256.c
+++ b/src/sha256.c
@@ -43,8 +43,7 @@ static void sha256_process(context_sha256_T *ctx, char_u data[64]);
}
void
-sha256_start(ctx)
- context_sha256_T *ctx;
+sha256_start(context_sha256_T *ctx)
{
ctx->total[0] = 0;
ctx->total[1] = 0;
@@ -60,9 +59,7 @@ sha256_start(ctx)
}
static void
-sha256_process(ctx, data)
- context_sha256_T *ctx;
- char_u data[64];
+sha256_process(context_sha256_T *ctx, char_u data[64])
{
UINT32_T temp1, temp2, W[64];
UINT32_T A, B, C, D, E, F, G, H;
@@ -194,10 +191,7 @@ sha256_process(ctx, data)
}
void
-sha256_update(ctx, input, length)
- context_sha256_T *ctx;
- char_u *input;
- UINT32_T length;
+sha256_update(context_sha256_T *ctx, char_u *input, UINT32_T length)
{
UINT32_T left, fill;
@@ -241,9 +235,7 @@ static char_u sha256_padding[64] = {
};
void
-sha256_finish(ctx, digest)
- context_sha256_T *ctx;
- char_u digest[32];
+sha256_finish(context_sha256_T *ctx, char_u digest[32])
{
UINT32_T last, padn;
UINT32_T high, low;
@@ -280,11 +272,11 @@ static unsigned int get_some_time(void);
* if "salt" is not NULL also do "salt[salt_len]".
*/
char_u *
-sha256_bytes(buf, buf_len, salt, salt_len)
- char_u *buf;
- int buf_len;
- char_u *salt;
- int salt_len;
+sha256_bytes(
+ char_u *buf,
+ int buf_len,
+ char_u *salt,
+ int salt_len)
{
char_u sha256sum[32];
static char_u hexit[65];
@@ -308,10 +300,10 @@ sha256_bytes(buf, buf_len, salt, salt_len)
* Returns sha256(buf) as 64 hex chars in static array.
*/
char_u *
-sha256_key(buf, salt, salt_len)
- char_u *buf;
- char_u *salt;
- int salt_len;
+sha256_key(
+ char_u *buf,
+ char_u *salt,
+ int salt_len)
{
/* No passwd means don't encrypt */
if (buf == NULL || *buf == NUL)
@@ -344,7 +336,7 @@ static char *sha_self_test_vector[] = {
* Return FAIL or OK.
*/
int
-sha256_self_test()
+sha256_self_test(void)
{
int i, j;
char output[65];
@@ -389,7 +381,7 @@ sha256_self_test()
}
static unsigned int
-get_some_time()
+get_some_time(void)
{
# ifdef HAVE_GETTIMEOFDAY
struct timeval tv;
@@ -407,11 +399,11 @@ get_some_time()
* Also "salt[salt_len]" when "salt" is not NULL.
*/
void
-sha2_seed(header, header_len, salt, salt_len)
- char_u *header;
- int header_len;
- char_u *salt;
- int salt_len;
+sha2_seed(
+ char_u *header,
+ int header_len,
+ char_u *salt,
+ int salt_len)
{
int i;
static char_u random_data[1000];
diff --git a/src/spell.c b/src/spell.c
index e22d8c06cb..9220bc0bed 100644
--- a/src/spell.c
+++ b/src/spell.c
@@ -1026,12 +1026,12 @@ static char_u *repl_to = NULL;
* caller can skip over the word.
*/
int
-spell_check(wp, ptr, attrp, capcol, docount)
- win_T *wp; /* current window */
- char_u *ptr;
- hlf_T *attrp;
- int *capcol; /* column to check for Capital */
- int docount; /* count good words */
+spell_check(
+ win_T *wp, /* current window */
+ char_u *ptr,
+ hlf_T *attrp,
+ int *capcol, /* column to check for Capital */
+ int docount) /* count good words */
{
matchinf_T mi; /* Most things are put in "mi" so that it can
be passed to functions quickly. */
@@ -1247,9 +1247,7 @@ spell_check(wp, ptr, attrp, capcol, docount)
* For a match mip->mi_result is updated.
*/
static void
-find_word(mip, mode)
- matchinf_T *mip;
- int mode;
+find_word(matchinf_T *mip, int mode)
{
idx_T arridx = 0;
int endlen[MAXWLEN]; /* length at possible word endings */
@@ -1767,10 +1765,10 @@ find_word(mip, mode)
* end of ptr[wlen] and the second part matches after it.
*/
static int
-match_checkcompoundpattern(ptr, wlen, gap)
- char_u *ptr;
- int wlen;
- garray_T *gap; /* &sl_comppat */
+match_checkcompoundpattern(
+ char_u *ptr,
+ int wlen,
+ garray_T *gap) /* &sl_comppat */
{
int i;
char_u *p;
@@ -1797,10 +1795,7 @@ match_checkcompoundpattern(ptr, wlen, gap)
* does not have too many syllables.
*/
static int
-can_compound(slang, word, flags)
- slang_T *slang;
- char_u *word;
- char_u *flags;
+can_compound(slang_T *slang, char_u *word, char_u *flags)
{
#ifdef FEAT_MBYTE
char_u uflags[MAXWLEN * 2];
@@ -1841,11 +1836,11 @@ can_compound(slang, word, flags)
* lines if they don't contain wildcards.
*/
static int
-can_be_compound(sp, slang, compflags, flag)
- trystate_T *sp;
- slang_T *slang;
- char_u *compflags;
- int flag;
+can_be_compound(
+ trystate_T *sp,
+ slang_T *slang,
+ char_u *compflags,
+ int flag)
{
/* If the flag doesn't appear in sl_compstartflags or sl_compallflags
* then it can't possibly compound. */
@@ -1878,9 +1873,7 @@ can_be_compound(sp, slang, compflags, flag)
* Caller must check that slang->sl_comprules is not NULL.
*/
static int
-match_compoundrule(slang, compflags)
- slang_T *slang;
- char_u *compflags;
+match_compoundrule(slang_T *slang, char_u *compflags)
{
char_u *p;
int i;
@@ -1933,13 +1926,13 @@ match_compoundrule(slang, compflags)
* The WF_RAREPFX flag is included in the return value for a rare prefix.
*/
static int
-valid_word_prefix(totprefcnt, arridx, flags, word, slang, cond_req)
- int totprefcnt; /* nr of prefix IDs */
- int arridx; /* idx in sl_pidxs[] */
- int flags;
- char_u *word;
- slang_T *slang;
- int cond_req; /* only use prefixes with a condition */
+valid_word_prefix(
+ int totprefcnt, /* nr of prefix IDs */
+ int arridx, /* idx in sl_pidxs[] */
+ int flags,
+ char_u *word,
+ slang_T *slang,
+ int cond_req) /* only use prefixes with a condition */
{
int prefcnt;
int pidx;
@@ -1987,9 +1980,7 @@ valid_word_prefix(totprefcnt, arridx, flags, word, slang, cond_req)
* For a match mip->mi_result is updated.
*/
static void
-find_prefix(mip, mode)
- matchinf_T *mip;
- int mode;
+find_prefix(matchinf_T *mip, int mode)
{
idx_T arridx = 0;
int len;
@@ -2110,8 +2101,7 @@ find_prefix(mip, mode)
* Return the length of the folded chars in bytes.
*/
static int
-fold_more(mip)
- matchinf_T *mip;
+fold_more(matchinf_T *mip)
{
int flen;
char_u *p;
@@ -2139,9 +2129,9 @@ fold_more(mip)
* case.
*/
static int
-spell_valid_case(wordflags, treeflags)
- int wordflags; /* flags for the checked word. */
- int treeflags; /* flags for the word in the spell tree */
+spell_valid_case(
+ int wordflags, /* flags for the checked word. */
+ int treeflags) /* flags for the word in the spell tree */
{
return ((wordflags == WF_ALLCAP && (treeflags & WF_FIXCAP) == 0)
|| ((treeflags & (WF_ALLCAP | WF_KEEPCAP)) == 0
@@ -2153,8 +2143,7 @@ spell_valid_case(wordflags, treeflags)
* Return TRUE if spell checking is not enabled.
*/
static int
-no_spell_checking(wp)
- win_T *wp;
+no_spell_checking(win_T *wp)
{
if (!wp->w_p_spell || *wp->w_s->b_p_spl == NUL
|| wp->w_s->b_langp.ga_len == 0)
@@ -2174,12 +2163,12 @@ no_spell_checking(wp)
* Return 0 if not found, length of the badly spelled word otherwise.
*/
int
-spell_move_to(wp, dir, allwords, curline, attrp)
- win_T *wp;
- int dir; /* FORWARD or BACKWARD */
- int allwords; /* TRUE for "[s"/"]s", FALSE for "[S"/"]S" */
- int curline;
- hlf_T *attrp; /* return: attributes of bad word or NULL
+spell_move_to(
+ win_T *wp,
+ int dir, /* FORWARD or BACKWARD */
+ int allwords, /* TRUE for "[s"/"]s", FALSE for "[S"/"]S" */
+ int curline,
+ hlf_T *attrp) /* return: attributes of bad word or NULL
(only when "dir" is FORWARD) */
{
linenr_T lnum;
@@ -2421,10 +2410,7 @@ spell_move_to(wp, dir, allwords, curline, attrp)
* to skip those bytes if the word was OK.
*/
void
-spell_cat_line(buf, line, maxlen)
- char_u *buf;
- char_u *line;
- int maxlen;
+spell_cat_line(char_u *buf, char_u *line, int maxlen)
{
char_u *p;
int n;
@@ -2461,8 +2447,7 @@ typedef struct spelload_S
* "lang" must be the language without the region: e.g., "en".
*/
static void
-spell_load_lang(lang)
- char_u *lang;
+spell_load_lang(char_u *lang)
{
char_u fname_enc[85];
int r;
@@ -2543,7 +2528,7 @@ spell_load_lang(lang)
* use "latin1" for "latin9". And limit to 60 characters (just in case).
*/
static char_u *
-spell_enc()
+spell_enc(void)
{
#ifdef FEAT_MBYTE
@@ -2558,8 +2543,7 @@ spell_enc()
* "fname[MAXPATHL]".
*/
static void
-int_wordlist_spl(fname)
- char_u *fname;
+int_wordlist_spl(char_u *fname)
{
vim_snprintf((char *)fname, MAXPATHL, SPL_FNAME_TMPL,
int_wordlist, spell_enc());
@@ -2570,8 +2554,7 @@ int_wordlist_spl(fname)
* Caller must fill "sl_next".
*/
static slang_T *
-slang_alloc(lang)
- char_u *lang;
+slang_alloc(char_u *lang)
{
slang_T *lp;
@@ -2594,8 +2577,7 @@ slang_alloc(lang)
* Free the contents of an slang