# HG changeset patch # User Christian Brabandt # Date 1454184904 -3600 # Node ID 4d7ce6c03fdad0f5debd6601cfb1f4307f45f6bb # Parent 2d1dc9ec41ce27f1991ed567a3a7081347ab1db6 commit https://github.com/vim/vim/commit/764b23c8fd3369cb05ae9122abf3ca16fec539d7 Author: Bram Moolenaar Date: Sat Jan 30 21:10:09 2016 +0100 patch 7.4.1214 Problem: Using old style function declarations. Solution: Change to new style function declarations. (script by Hirohito Higashi) diff --git a/src/search.c b/src/search.c --- 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, o * 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, setla * 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, #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 *li * 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, endp */ 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, maxtra * 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", * 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, bigwor * 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 "". */ 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, * 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, es * 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, quotech * 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, * 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, a #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 --- a/src/sha256.c +++ b/src/sha256.c @@ -43,8 +43,7 @@ static void sha256_process(context_sha25 } 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_le * 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 --- 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, doco * 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, ga * 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, fl * 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, fl * 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 * 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_T and the structure itself. */ static void -slang_free(lp) - slang_T *lp; +slang_free(slang_T *lp) { vim_free(lp->sl_name); vim_free(lp->sl_fname); @@ -2607,8 +2589,7 @@ slang_free(lp) * Clear an slang_T so that the file can be reloaded. */ static void -slang_clear(lp) - slang_T *lp; +slang_clear(slang_T *lp) { garray_T *gap; fromto_T *ftp; @@ -2714,8 +2695,7 @@ slang_clear(lp) * Clear the info from the .sug file in "lp". */ static void -slang_clear_sug(lp) - slang_T *lp; +slang_clear_sug(slang_T *lp) { vim_free(lp->sl_sbyts); lp->sl_sbyts = NULL; @@ -2732,9 +2712,7 @@ slang_clear_sug(lp) * Invoked through do_in_runtimepath(). */ static void -spell_load_cb(fname, cookie) - char_u *fname; - void *cookie; +spell_load_cb(char_u *fname, void *cookie) { spelload_T *slp = (spelload_T *)cookie; slang_T *slang; @@ -2767,11 +2745,11 @@ spell_load_cb(fname, cookie) * Returns the slang_T the spell file was loaded into. NULL for error. */ static slang_T * -spell_load_file(fname, lang, old_lp, silent) - char_u *fname; - char_u *lang; - slang_T *old_lp; - int silent; /* no error if file doesn't exist */ +spell_load_file( + char_u *fname, + char_u *lang, + slang_T *old_lp, + int silent) /* no error if file doesn't exist */ { FILE *fd; char_u buf[VIMSPELLMAGICL]; @@ -3025,10 +3003,7 @@ endOK: * otherwise. */ static char_u * -read_cnt_string(fd, cnt_bytes, cntp) - FILE *fd; - int cnt_bytes; - int *cntp; +read_cnt_string(FILE *fd, int cnt_bytes, int *cntp) { int cnt = 0; int i; @@ -3057,10 +3032,7 @@ read_cnt_string(fd, cnt_bytes, cntp) * Return SP_*ERROR flags. */ static int -read_region_section(fd, lp, len) - FILE *fd; - slang_T *lp; - int len; +read_region_section(FILE *fd, slang_T *lp, int len) { int i; @@ -3078,8 +3050,7 @@ read_region_section(fd, lp, len) * Return SP_*ERROR flags. */ static int -read_charflags_section(fd) - FILE *fd; +read_charflags_section(FILE *fd) { char_u *flags; char_u *fol; @@ -3116,9 +3087,7 @@ read_charflags_section(fd) * Return SP_*ERROR flags. */ static int -read_prefcond_section(fd, lp) - FILE *fd; - slang_T *lp; +read_prefcond_section(FILE *fd, slang_T *lp) { int cnt; int i; @@ -3164,10 +3133,7 @@ read_prefcond_section(fd, lp) * Return SP_*ERROR flags. */ static int -read_rep_section(fd, gap, first) - FILE *fd; - garray_T *gap; - short *first; +read_rep_section(FILE *fd, garray_T *gap, short *first) { int cnt; fromto_T *ftp; @@ -3216,9 +3182,7 @@ read_rep_section(fd, gap, first) * Return SP_*ERROR flags. */ static int -read_sal_section(fd, slang) - FILE *fd; - slang_T *slang; +read_sal_section(FILE *fd, slang_T *slang) { int i; int cnt; @@ -3369,10 +3333,7 @@ read_sal_section(fd, slang) * Return SP_*ERROR flags. */ static int -read_words_section(fd, lp, len) - FILE *fd; - slang_T *lp; - int len; +read_words_section(FILE *fd, slang_T *lp, int len) { int done = 0; int i; @@ -3406,11 +3367,11 @@ read_words_section(fd, lp, len) * If it's already there then the counter is increased. */ static void -count_common_word(lp, word, len, count) - slang_T *lp; - char_u *word; - int len; /* word length, -1 for upto NUL */ - int count; /* 1 to count once, 10 to init */ +count_common_word( + slang_T *lp, + char_u *word, + int len, /* word length, -1 for upto NUL */ + int count) /* 1 to count once, 10 to init */ { hash_T hash; hashitem_T *hi; @@ -3449,11 +3410,11 @@ count_common_word(lp, word, len, count) * Adjust the score of common words. */ static int -score_wordcount_adj(slang, score, word, split) - slang_T *slang; - int score; - char_u *word; - int split; /* word was split, less bonus */ +score_wordcount_adj( + slang_T *slang, + int score, + char_u *word, + int split) /* word was split, less bonus */ { hashitem_T *hi; wordcount_T *wc; @@ -3486,9 +3447,7 @@ score_wordcount_adj(slang, score, word, * Return SP_*ERROR flags. */ static int -read_sofo_section(fd, slang) - FILE *fd; - slang_T *slang; +read_sofo_section(FILE *fd, slang_T *slang) { int cnt; char_u *from, *to; @@ -3528,10 +3487,7 @@ read_sofo_section(fd, slang) * Returns SP_*ERROR flags. */ static int -read_compound(fd, slang, len) - FILE *fd; - slang_T *slang; - int len; +read_compound(FILE *fd, slang_T *slang, int len) { int todo = len; int c; @@ -3728,9 +3684,7 @@ read_compound(fd, slang, len) * Like strchr() but independent of locale. */ static int -byte_in_str(str, n) - char_u *str; - int n; +byte_in_str(char_u *str, int n) { char_u *p; @@ -3752,8 +3706,7 @@ typedef struct syl_item_S * in "slang->sl_syl_items". */ static int -init_syl_tab(slang) - slang_T *slang; +init_syl_tab(slang_T *slang) { char_u *p; char_u *s; @@ -3791,9 +3744,7 @@ init_syl_tab(slang) * Returns zero if syllables are not defines. */ static int -count_syllables(slang, word) - slang_T *slang; - char_u *word; +count_syllables(slang_T *slang, char_u *word) { int cnt = 0; int skip = FALSE; @@ -3857,10 +3808,7 @@ count_syllables(slang, word) * Returns SP_*ERROR flags when there is something wrong. */ static int -set_sofo(lp, from, to) - slang_T *lp; - char_u *from; - char_u *to; +set_sofo(slang_T *lp, char_u *from, char_u *to) { int i; @@ -3949,8 +3897,7 @@ set_sofo(lp, from, to) * Fill the first-index table for "lp". */ static void -set_sal_first(lp) - slang_T *lp; +set_sal_first(slang_T *lp) { salfirst_T *sfirst; int i; @@ -4015,8 +3962,7 @@ set_sal_first(lp) * Return it in allocated memory (NULL for out-of-memory) */ static int * -mb_str2wide(s) - char_u *s; +mb_str2wide(char_u *s) { int *res; char_u *p; @@ -4040,12 +3986,12 @@ mb_str2wide(s) * Returns zero when OK, SP_ value for an error. */ static int -spell_read_tree(fd, bytsp, idxsp, prefixtree, prefixcnt) - FILE *fd; - char_u **bytsp; - idx_T **idxsp; - int prefixtree; /* TRUE for the prefix tree */ - int prefixcnt; /* when "prefixtree" is TRUE: prefix count */ +spell_read_tree( + FILE *fd, + char_u **bytsp, + idx_T **idxsp, + int prefixtree, /* TRUE for the prefix tree */ + int prefixcnt) /* when "prefixtree" is TRUE: prefix count */ { int len; int idx; @@ -4090,14 +4036,14 @@ spell_read_tree(fd, bytsp, idxsp, prefix * Returns SP_FORMERROR if there is a format error. */ static idx_T -read_tree_node(fd, byts, idxs, maxidx, startidx, prefixtree, maxprefcondnr) - FILE *fd; - char_u *byts; - idx_T *idxs; - int maxidx; /* size of arrays */ - idx_T startidx; /* current index in "byts" and "idxs" */ - int prefixtree; /* TRUE for reading PREFIXTREE */ - int maxprefcondnr; /* maximum for */ +read_tree_node( + FILE *fd, + char_u *byts, + idx_T *idxs, + int maxidx, /* size of arrays */ + idx_T startidx, /* current index in "byts" and "idxs" */ + int prefixtree, /* TRUE for reading PREFIXTREE */ + int maxprefcondnr) /* maximum for */ { int len; int i; @@ -4206,8 +4152,7 @@ read_tree_node(fd, byts, idxs, maxidx, s * Returns NULL if it's OK, an error message otherwise. */ char_u * -did_set_spelllang(wp) - win_T *wp; +did_set_spelllang(win_T *wp) { garray_T ga; char_u *splp; @@ -4530,8 +4475,7 @@ theend: * Clear the midword characters for buffer "buf". */ static void -clear_midword(wp) - win_T *wp; +clear_midword(win_T *wp) { vim_memset(wp->w_s->b_spell_ismw, 0, 256); #ifdef FEAT_MBYTE @@ -4545,9 +4489,7 @@ clear_midword(wp) * They add up to any currently used midword characters. */ static void -use_midword(lp, wp) - slang_T *lp; - win_T *wp; +use_midword(slang_T *lp, win_T *wp) { char_u *p; @@ -4593,9 +4535,7 @@ use_midword(lp, wp) * Returns the index if found (first is 0), REGION_ALL if not found. */ static int -find_region(rp, region) - char_u *rp; - char_u *region; +find_region(char_u *rp, char_u *region) { int i; @@ -4617,9 +4557,9 @@ find_region(rp, region) * WoRd wOrd WF_KEEPCAP */ static int -captype(word, end) - char_u *word; - char_u *end; /* When NULL use up to NUL byte. */ +captype( + char_u *word, + char_u *end) /* When NULL use up to NUL byte. */ { char_u *p; int c; @@ -4673,9 +4613,7 @@ captype(word, end) * Add ALLCAP for "WOrD". */ static int -badword_captype(word, end) - char_u *word; - char_u *end; +badword_captype(char_u *word, char_u *end) { int flags = captype(word, end); int c; @@ -4720,7 +4658,7 @@ badword_captype(word, end) * Delete the internal wordlist and its .spl file. */ void -spell_delete_wordlist() +spell_delete_wordlist(void) { char_u fname[MAXPATHL]; @@ -4739,7 +4677,7 @@ spell_delete_wordlist() * Free all languages. */ void -spell_free_all() +spell_free_all(void) { slang_T *slang; buf_T *buf; @@ -4770,7 +4708,7 @@ spell_free_all() * Used after 'encoding' is set and when ":mkspell" was used. */ void -spell_reload() +spell_reload(void) { win_T *wp; @@ -4803,9 +4741,9 @@ spell_reload() * Reload the spell file "fname" if it's loaded. */ static void -spell_reload_one(fname, added_word) - char_u *fname; - int added_word; /* invoked through "zg" */ +spell_reload_one( + char_u *fname, + int added_word) /* invoked through "zg" */ { slang_T *slang; int didit = FALSE; @@ -5213,9 +5151,7 @@ spell_print_tree(wordnode_T *root) * Returns an afffile_T, NULL for complete failure. */ static afffile_T * -spell_read_aff(spin, fname) - spellinfo_T *spin; - char_u *fname; +spell_read_aff(spellinfo_T *spin, char_u *fname) { FILE *fd; afffile_T *aff; @@ -6163,11 +6099,11 @@ spell_read_aff(spin, fname) * a comment is following after item "mincount". */ static int -is_aff_rule(items, itemcnt, rulename, mincount) - char_u **items; - int itemcnt; - char *rulename; - int mincount; +is_aff_rule( + char_u **items, + int itemcnt, + char *rulename, + int mincount) { return (STRCMP(items[0], rulename) == 0 && (itemcnt == mincount @@ -6179,9 +6115,7 @@ is_aff_rule(items, itemcnt, rulename, mi * ae_flags to ae_comppermit and ae_compforbid. */ static void -aff_process_flags(affile, entry) - afffile_T *affile; - affentry_T *entry; +aff_process_flags(afffile_T *affile, affentry_T *entry) { char_u *p; char_u *prevp; @@ -6215,8 +6149,7 @@ aff_process_flags(affile, entry) * Return TRUE if "s" is the name of an info item in the affix file. */ static int -spell_info_item(s) - char_u *s; +spell_info_item(char_u *s) { return STRCMP(s, "NAME") == 0 || STRCMP(s, "HOME") == 0 @@ -6231,11 +6164,11 @@ spell_info_item(s) * returns zero for failure. */ static unsigned -affitem2flag(flagtype, item, fname, lnum) - int flagtype; - char_u *item; - char_u *fname; - int lnum; +affitem2flag( + int flagtype, + char_u *item, + char_u *fname, + int lnum) { unsigned res; char_u *p = item; @@ -6264,9 +6197,7 @@ affitem2flag(flagtype, item, fname, lnum * Returns zero for an error, still advances the pointer then. */ static unsigned -get_affitem(flagtype, pp) - int flagtype; - char_u **pp; +get_affitem(int flagtype, char_u **pp) { int res; @@ -6308,10 +6239,10 @@ get_affitem(flagtype, pp) * they fit in one byte. */ static void -process_compflags(spin, aff, compflags) - spellinfo_T *spin; - afffile_T *aff; - char_u *compflags; +process_compflags( + spellinfo_T *spin, + afffile_T *aff, + char_u *compflags) { char_u *p; char_u *prevp; @@ -6392,8 +6323,7 @@ process_compflags(spin, aff, compflags) * When that is used up an error message is given. */ static void -check_renumber(spin) - spellinfo_T *spin; +check_renumber(spellinfo_T *spin) { if (spin->si_newprefID == spin->si_newcompID && spin->si_newcompID < 128) { @@ -6406,10 +6336,7 @@ check_renumber(spin) * Return TRUE if flag "flag" appears in affix list "afflist". */ static int -flag_in_afflist(flagtype, afflist, flag) - int flagtype; - char_u *afflist; - unsigned flag; +flag_in_afflist(int flagtype, char_u *afflist, unsigned flag) { char_u *p; unsigned n; @@ -6458,10 +6385,7 @@ flag_in_afflist(flagtype, afflist, flag) * Give a warning when "spinval" and "affval" numbers are set and not the same. */ static void -aff_check_number(spinval, affval, name) - int spinval; - int affval; - char *name; +aff_check_number(int spinval, int affval, char *name) { if (spinval != 0 && spinval != affval) smsg((char_u *)_("%s value differs from what is used in another .aff file"), name); @@ -6471,10 +6395,7 @@ aff_check_number(spinval, affval, name) * Give a warning when "spinval" and "affval" strings are set and not the same. */ static void -aff_check_string(spinval, affval, name) - char_u *spinval; - char_u *affval; - char *name; +aff_check_string(char_u *spinval, char_u *affval, char *name) { if (spinval != NULL && STRCMP(spinval, affval) != 0) smsg((char_u *)_("%s value differs from what is used in another .aff file"), name); @@ -6485,9 +6406,7 @@ aff_check_string(spinval, affval, name) * NULL as equal. */ static int -str_equal(s1, s2) - char_u *s1; - char_u *s2; +str_equal(char_u *s1, char_u *s2) { if (s1 == NULL || s2 == NULL) return s1 == s2; @@ -6499,11 +6418,11 @@ str_equal(s1, s2) * They are stored case-folded. */ static void -add_fromto(spin, gap, from, to) - spellinfo_T *spin; - garray_T *gap; - char_u *from; - char_u *to; +add_fromto( + spellinfo_T *spin, + garray_T *gap, + char_u *from, + char_u *to) { fromto_T *ftp; char_u word[MAXWLEN]; @@ -6523,8 +6442,7 @@ add_fromto(spin, gap, from, to) * Convert a boolean argument in a SAL line to TRUE or FALSE; */ static int -sal_to_bool(s) - char_u *s; +sal_to_bool(char_u *s) { return STRCMP(s, "1") == 0 || STRCMP(s, "true") == 0; } @@ -6533,8 +6451,7 @@ sal_to_bool(s) * Free the structure filled by spell_read_aff(). */ static void -spell_free_aff(aff) - afffile_T *aff; +spell_free_aff(afffile_T *aff) { hashtab_T *ht; hashitem_T *hi; @@ -6572,10 +6489,7 @@ spell_free_aff(aff) * Returns OK or FAIL; */ static int -spell_read_dic(spin, fname, affile) - spellinfo_T *spin; - char_u *fname; - afffile_T *affile; +spell_read_dic(spellinfo_T *spin, char_u *fname, afffile_T *affile) { hashtab_T ht; char_u line[MAXLINELEN]; @@ -6789,9 +6703,7 @@ spell_read_dic(spin, fname, affile) * Return WF_ flags. */ static int -get_affix_flags(affile, afflist) - afffile_T *affile; - char_u *afflist; +get_affix_flags(afffile_T *affile, char_u *afflist) { int flags = 0; @@ -6823,10 +6735,10 @@ get_affix_flags(affile, afflist) * and return the number of affixes. */ static int -get_pfxlist(affile, afflist, store_afflist) - afffile_T *affile; - char_u *afflist; - char_u *store_afflist; +get_pfxlist( + afffile_T *affile, + char_u *afflist, + char_u *store_afflist) { char_u *p; char_u *prevp; @@ -6865,10 +6777,10 @@ get_pfxlist(affile, afflist, store_affli * Puts the flags in "store_afflist[]". */ static void -get_compflags(affile, afflist, store_afflist) - afffile_T *affile; - char_u *afflist; - char_u *store_afflist; +get_compflags( + afffile_T *affile, + char_u *afflist, + char_u *store_afflist) { char_u *p; char_u *prevp; @@ -6904,18 +6816,17 @@ get_compflags(affile, afflist, store_aff * Returns FAIL when out of memory. */ static int -store_aff_word(spin, word, afflist, affile, ht, xht, condit, flags, - pfxlist, pfxlen) - spellinfo_T *spin; /* spell info */ - char_u *word; /* basic word start */ - char_u *afflist; /* list of names of supported affixes */ - afffile_T *affile; - hashtab_T *ht; - hashtab_T *xht; - int condit; /* CONDIT_SUF et al. */ - int flags; /* flags for the word */ - char_u *pfxlist; /* list of prefix IDs */ - int pfxlen; /* nr of flags in "pfxlist" for prefixes, rest +store_aff_word( + spellinfo_T *spin, /* spell info */ + char_u *word, /* basic word start */ + char_u *afflist, /* list of names of supported affixes */ + afffile_T *affile, + hashtab_T *ht, + hashtab_T *xht, + int condit, /* CONDIT_SUF et al. */ + int flags, /* flags for the word */ + char_u *pfxlist, /* list of prefix IDs */ + int pfxlen) /* nr of flags in "pfxlist" for prefixes, rest * is compound flags */ { int todo; @@ -7170,9 +7081,7 @@ store_aff_word(spin, word, afflist, affi * Read a file with a list of words. */ static int -spell_read_wordfile(spin, fname) - spellinfo_T *spin; - char_u *fname; +spell_read_wordfile(spellinfo_T *spin, char_u *fname) { FILE *fd; long lnum = 0; @@ -7380,10 +7289,10 @@ spell_read_wordfile(spin, fname) * Returns NULL when out of memory. */ static void * -getroom(spin, len, align) - spellinfo_T *spin; - size_t len; /* length needed */ - int align; /* align for pointer */ +getroom( + spellinfo_T *spin, + size_t len, /* length needed */ + int align) /* align for pointer */ { char_u *p; sblock_T *bl = spin->si_blocks; @@ -7428,9 +7337,7 @@ getroom(spin, len, align) * Returns NULL when out of memory. */ static char_u * -getroom_save(spin, s) - spellinfo_T *spin; - char_u *s; +getroom_save(spellinfo_T *spin, char_u *s) { char_u *sc; @@ -7445,8 +7352,7 @@ getroom_save(spin, s) * Free the list of allocated sblock_T. */ static void -free_blocks(bl) - sblock_T *bl; +free_blocks(sblock_T *bl) { sblock_T *next; @@ -7463,8 +7369,7 @@ free_blocks(bl) * Returns NULL when out of memory. */ static wordnode_T * -wordtree_alloc(spin) - spellinfo_T *spin; +wordtree_alloc(spellinfo_T *spin) { return (wordnode_T *)getroom(spin, sizeof(wordnode_T), TRUE); } @@ -7479,13 +7384,13 @@ wordtree_alloc(spin) * compound flag. */ static int -store_word(spin, word, flags, region, pfxlist, need_affix) - spellinfo_T *spin; - char_u *word; - int flags; /* extra flags, WF_BANNED */ - int region; /* supported region(s) */ - char_u *pfxlist; /* list of prefix IDs or NULL */ - int need_affix; /* only store word with affix ID */ +store_word( + spellinfo_T *spin, + char_u *word, + int flags, /* extra flags, WF_BANNED */ + int region, /* supported region(s) */ + char_u *pfxlist, /* list of prefix IDs or NULL */ + int need_affix) /* only store word with affix ID */ { int len = (int)STRLEN(word); int ct = captype(word, word + len); @@ -7526,13 +7431,13 @@ store_word(spin, word, flags, region, pf * Returns FAIL when out of memory. */ static int -tree_add_word(spin, word, root, flags, region, affixID) - spellinfo_T *spin; - char_u *word; - wordnode_T *root; - int flags; - int region; - int affixID; +tree_add_word( + spellinfo_T *spin, + char_u *word, + wordnode_T *root, + int flags, + int region, + int affixID) { wordnode_T *node = root; wordnode_T *np; @@ -7706,7 +7611,7 @@ tree_add_word(spin, word, root, flags, r * Sets "sps_flags". */ int -spell_check_msm() +spell_check_msm(void) { char_u *p = p_msm; long start = 0; @@ -7748,8 +7653,7 @@ spell_check_msm() * Returns NULL when out of memory. */ static wordnode_T * -get_wordnode(spin) - spellinfo_T *spin; +get_wordnode(spellinfo_T *spin) { wordnode_T *n; @@ -7776,9 +7680,7 @@ get_wordnode(spin) * Returns the number of nodes actually freed. */ static int -deref_wordnode(spin, node) - spellinfo_T *spin; - wordnode_T *node; +deref_wordnode(spellinfo_T *spin, wordnode_T *node) { wordnode_T *np; int cnt = 0; @@ -7802,9 +7704,7 @@ deref_wordnode(spin, node) * Only the "wn_child" field becomes invalid. */ static void -free_wordnode(spin, n) - spellinfo_T *spin; - wordnode_T *n; +free_wordnode(spellinfo_T *spin, wordnode_T *n) { n->wn_child = spin->si_first_free; spin->si_first_free = n; @@ -7815,9 +7715,7 @@ free_wordnode(spin, n) * Compress a tree: find tails that are identical and can be shared. */ static void -wordtree_compress(spin, root) - spellinfo_T *spin; - wordnode_T *root; +wordtree_compress(spellinfo_T *spin, wordnode_T *root) { hashtab_T ht; int n; @@ -7858,11 +7756,11 @@ wordtree_compress(spin, root) * Returns the number of compressed nodes. */ static int -node_compress(spin, node, ht, tot) - spellinfo_T *spin; - wordnode_T *node; - hashtab_T *ht; - int *tot; /* total count of nodes before compressing, +node_compress( + spellinfo_T *spin, + wordnode_T *node, + hashtab_T *ht, + int *tot) /* total count of nodes before compressing, incremented while going through the tree */ { wordnode_T *np; @@ -7964,9 +7862,7 @@ node_compress(spin, node, ht, tot) * Return TRUE when two nodes have identical siblings and children. */ static int -node_equal(n1, n2) - wordnode_T *n1; - wordnode_T *n2; +node_equal(wordnode_T *n1, wordnode_T *n2) { wordnode_T *p1; wordnode_T *p2; @@ -7997,9 +7893,7 @@ rep_compare(const void *s1, const void * #ifdef __BORLANDC__ _RTLENTRYF #endif -rep_compare(s1, s2) - const void *s1; - const void *s2; +rep_compare(const void *s1, const void *s2) { fromto_T *p1 = (fromto_T *)s1; fromto_T *p2 = (fromto_T *)s2; @@ -8012,9 +7906,7 @@ rep_compare(s1, s2) * Return FAIL or OK; */ static int -write_vim_spell(spin, fname) - spellinfo_T *spin; - char_u *fname; +write_vim_spell(spellinfo_T *spin, char_u *fname) { FILE *fd; int regionmask; @@ -8434,8 +8326,7 @@ theend: * space. */ static void -clear_node(node) - wordnode_T *node; +clear_node(wordnode_T *node) { wordnode_T *np; @@ -8464,12 +8355,12 @@ clear_node(node) * Returns the number of nodes used. */ static int -put_node(fd, node, idx, regionmask, prefixtree) - FILE *fd; /* NULL when only counting */ - wordnode_T *node; - int idx; - int regionmask; - int prefixtree; /* TRUE for PREFIXTREE */ +put_node( + FILE *fd, /* NULL when only counting */ + wordnode_T *node, + int idx, + int regionmask, + int prefixtree) /* TRUE for PREFIXTREE */ { int newindex = idx; int siblingcount = 0; @@ -8594,8 +8485,7 @@ put_node(fd, node, idx, regionmask, pref * ":mkspell [-ascii] addfile" */ void -ex_mkspell(eap) - exarg_T *eap; +ex_mkspell(exarg_T *eap) { int fcount; char_u **fnames; @@ -8622,9 +8512,7 @@ ex_mkspell(eap) * Writes the file with the name "wfname", with ".spl" changed to ".sug". */ static void -spell_make_sugfile(spin, wfname) - spellinfo_T *spin; - char_u *wfname; +spell_make_sugfile(spellinfo_T *spin, char_u *wfname) { char_u *fname = NULL; int len; @@ -8711,9 +8599,7 @@ theend: * Build the soundfold trie for language "slang". */ static int -sug_filltree(spin, slang) - spellinfo_T *spin; - slang_T *slang; +sug_filltree(spellinfo_T *spin, slang_T *slang) { char_u *byts; idx_T *idxs; @@ -8819,8 +8705,7 @@ sug_filltree(spin, slang) * Returns FAIL when out of memory. */ static int -sug_maketable(spin) - spellinfo_T *spin; +sug_maketable(spellinfo_T *spin) { garray_T ga; int res = OK; @@ -8849,11 +8734,11 @@ sug_maketable(spin) * Returns -1 when out of memory. */ static int -sug_filltable(spin, node, startwordnr, gap) - spellinfo_T *spin; - wordnode_T *node; - int startwordnr; - garray_T *gap; /* place to store line of numbers */ +sug_filltable( + spellinfo_T *spin, + wordnode_T *node, + int startwordnr, + garray_T *gap) /* place to store line of numbers */ { wordnode_T *p, *np; int wordnr = startwordnr; @@ -8916,9 +8801,7 @@ sug_filltable(spin, node, startwordnr, g * bytes. */ static int -offset2bytes(nr, buf) - int nr; - char_u *buf; +offset2bytes(int nr, char_u *buf) { int rem; int b1, b2, b3, b4; @@ -8963,8 +8846,7 @@ offset2bytes(nr, buf) * Returns the offset. */ static int -bytes2offset(pp) - char_u **pp; +bytes2offset(char_u **pp) { char_u *p = *pp; int nr; @@ -9002,9 +8884,7 @@ bytes2offset(pp) * Write the .sug file in "fname". */ static void -sug_write(spin, fname) - spellinfo_T *spin; - char_u *fname; +sug_write(spellinfo_T *spin, char_u *fname) { FILE *fd; wordnode_T *tree; @@ -9101,7 +8981,7 @@ theend: * Returns NULL when out of memory. */ static buf_T * -open_spellbuf() +open_spellbuf(void) { buf_T *buf; @@ -9123,8 +9003,7 @@ open_spellbuf() * Close the buffer used for spell info. */ static void -close_spellbuf(buf) - buf_T *buf; +close_spellbuf(buf_T *buf) { if (buf != NULL) { @@ -9142,12 +9021,12 @@ close_spellbuf(buf) * and ".spl" is appended to make the output file name. */ static void -mkspell(fcount, fnames, ascii, over_write, added_word) - int fcount; - char_u **fnames; - int ascii; /* -ascii argument given */ - int over_write; /* overwrite existing output file */ - int added_word; /* invoked through "zg" */ +mkspell( + int fcount, + char_u **fnames, + int ascii, /* -ascii argument given */ + int over_write, /* overwrite existing output file */ + int added_word) /* invoked through "zg" */ { char_u *fname = NULL; char_u *wfname; @@ -9402,9 +9281,7 @@ theend: * ":mkspell". "str" can be IObuff. */ static void -spell_message(spin, str) - spellinfo_T *spin; - char_u *str; +spell_message(spellinfo_T *spin, char_u *str) { if (spin->si_verbose || p_verbose > 2) { @@ -9423,8 +9300,7 @@ spell_message(spin, str) * ":[count]spellundo {word}" */ void -ex_spell(eap) - exarg_T *eap; +ex_spell(exarg_T *eap) { spell_add_word(eap->arg, (int)STRLEN(eap->arg), eap->cmdidx == CMD_spellwrong, eap->forceit ? 0 : (int)eap->line2, @@ -9435,13 +9311,13 @@ ex_spell(eap) * Add "word[len]" to 'spellfile' as a good or bad word. */ void -spell_add_word(word, len, bad, idx, undo) - char_u *word; - int len; - int bad; - int idx; /* "zG" and "zW": zero, otherwise index in +spell_add_word( + char_u *word, + int len, + int bad, + int idx, /* "zG" and "zW": zero, otherwise index in 'spellfile' */ - int undo; /* TRUE for "zug", "zuG", "zuw" and "zuW" */ + int undo) /* TRUE for "zug", "zuG", "zuw" and "zuW" */ { FILE *fd = NULL; buf_T *buf = NULL; @@ -9604,7 +9480,7 @@ spell_add_word(word, len, bad, idx, undo * Initialize 'spellfile' for the current buffer. */ static void -init_spellfile() +init_spellfile(void) { char_u *buf; int l; @@ -9685,8 +9561,7 @@ init_spellfile() * EBCDIC is not supported! */ static void -clear_spell_chartab(sp) - spelltab_T *sp; +clear_spell_chartab(spelltab_T *sp) { int i; @@ -9724,7 +9599,7 @@ clear_spell_chartab(sp) * locale. For utf-8 we don't use isalpha() but our own functions. */ void -init_spell_chartab() +init_spell_chartab(void) { int i; @@ -9779,10 +9654,7 @@ init_spell_chartab() * Set the spell character tables from strings in the affix file. */ static int -set_spell_chartab(fol, low, upp) - char_u *fol; - char_u *low; - char_u *upp; +set_spell_chartab(char_u *fol, char_u *low, char_u *upp) { /* We build the new tables here first, so that we can compare with the * previous one. */ @@ -9857,10 +9729,10 @@ set_spell_chartab(fol, low, upp) * Set the spell character tables from strings in the .spl file. */ static void -set_spell_charflags(flags, cnt, fol) - char_u *flags; - int cnt; /* length of "flags" */ - char_u *fol; +set_spell_charflags( + char_u *flags, + int cnt, /* length of "flags" */ + char_u *fol) { /* We build the new tables here first, so that we can compare with the * previous one. */ @@ -9896,8 +9768,7 @@ set_spell_charflags(flags, cnt, fol) } static int -set_spell_finish(new_st) - spelltab_T *new_st; +set_spell_finish(spelltab_T *new_st) { int i; @@ -9933,9 +9804,9 @@ set_spell_finish(new_st) * Thus this only works properly when past the first character of the word. */ static int -spell_iswordp(p, wp) - char_u *p; - win_T *wp; /* buffer used */ +spell_iswordp( + char_u *p, + win_T *wp) /* buffer used */ { #ifdef FEAT_MBYTE char_u *s; @@ -9976,9 +9847,7 @@ spell_iswordp(p, wp) * Unlike spell_iswordp() this doesn't check for "midword" characters. */ static int -spell_iswordp_nmw(p, wp) - char_u *p; - win_T *wp; +spell_iswordp_nmw(char_u *p, win_T *wp) { #ifdef FEAT_MBYTE int c; @@ -10002,9 +9871,7 @@ spell_iswordp_nmw(p, wp) * See also dbcs_class() and utf_class() in mbyte.c. */ static int -spell_mb_isword_class(cl, wp) - int cl; - win_T *wp; +spell_mb_isword_class(int cl, win_T *wp) { if (wp->w_s->b_cjk) /* East Asian characters are not considered word characters. */ @@ -10017,9 +9884,7 @@ spell_mb_isword_class(cl, wp) * Wide version of spell_iswordp(). */ static int -spell_iswordp_w(p, wp) - int *p; - win_T *wp; +spell_iswordp_w(int *p, win_T *wp) { int *s; @@ -10048,9 +9913,7 @@ spell_iswordp_w(p, wp) * When "fd" is NULL only count the length of what is written. */ static int -write_spell_prefcond(fd, gap) - FILE *fd; - garray_T *gap; +write_spell_prefcond(FILE *fd, garray_T *gap) { int i; char_u *p; @@ -10091,11 +9954,11 @@ write_spell_prefcond(fd, gap) * Returns FAIL when something wrong. */ static int -spell_casefold(str, len, buf, buflen) - char_u *str; - int len; - char_u *buf; - int buflen; +spell_casefold( + char_u *str, + int len, + char_u *buf, + int buflen) { int i; @@ -10150,7 +10013,7 @@ static int sps_limit = 9999; /* max nr * Sets "sps_flags" and "sps_limit". */ int -spell_check_sps() +spell_check_sps(void) { char_u *p; char_u *s; @@ -10205,8 +10068,7 @@ spell_check_sps() * When "count" is non-zero use that suggestion. */ void -spell_suggest(count) - int count; +spell_suggest(int count) { char_u *line; pos_T prev_cursor = curwin->w_cursor; @@ -10448,9 +10310,7 @@ skip: * capital. This uses 'spellcapcheck' of the current buffer. */ static int -check_need_cap(lnum, col) - linenr_T lnum; - colnr_T col; +check_need_cap(linenr_T lnum, colnr_T col) { int need_cap = FALSE; char_u *line; @@ -10518,8 +10378,7 @@ check_need_cap(lnum, col) * ":spellrepall" */ void -ex_spellrepall(eap) - exarg_T *eap UNUSED; +ex_spellrepall(exarg_T *eap UNUSED) { pos_T pos = curwin->w_cursor; char_u *frompat; @@ -10591,12 +10450,12 @@ ex_spellrepall(eap) * a list of allocated strings. */ void -spell_suggest_list(gap, word, maxcount, need_cap, interactive) - garray_T *gap; - char_u *word; - int maxcount; /* maximum nr of suggestions */ - int need_cap; /* 'spellcapcheck' matched */ - int interactive; +spell_suggest_list( + garray_T *gap, + char_u *word, + int maxcount, /* maximum nr of suggestions */ + int need_cap, /* 'spellcapcheck' matched */ + int interactive) { suginfo_T sug; int i; @@ -10636,14 +10495,14 @@ spell_suggest_list(gap, word, maxcount, * This is based on the mechanisms of Aspell, but completely reimplemented. */ static void -spell_find_suggest(badptr, badlen, su, maxcount, banbadword, need_cap, interactive) - char_u *badptr; - int badlen; /* length of bad word or 0 if unknown */ - suginfo_T *su; - int maxcount; - int banbadword; /* don't include badword in suggestions */ - int need_cap; /* word should start with capital */ - int interactive; +spell_find_suggest( + char_u *badptr, + int badlen, /* length of bad word or 0 if unknown */ + suginfo_T *su, + int maxcount, + int banbadword, /* don't include badword in suggestions */ + int need_cap, /* word should start with capital */ + int interactive) { hlf_T attr = HLF_COUNT; char_u buf[MAXPATHL]; @@ -10769,9 +10628,7 @@ spell_find_suggest(badptr, badlen, su, m * Find suggestions by evaluating expression "expr". */ static void -spell_suggest_expr(su, expr) - suginfo_T *su; - char_u *expr; +spell_suggest_expr(suginfo_T *su, char_u *expr) { list_T *list; listitem_T *li; @@ -10807,9 +10664,7 @@ spell_suggest_expr(su, expr) * Find suggestions in file "fname". Used for "file:" in 'spellsuggest'. */ static void -spell_suggest_file(su, fname) - suginfo_T *su; - char_u *fname; +spell_suggest_file(suginfo_T *su, char_u *fname) { FILE *fd; char_u line[MAXWLEN * 2]; @@ -10865,9 +10720,7 @@ spell_suggest_file(su, fname) * Find suggestions for the internal method indicated by "sps_flags". */ static void -spell_suggest_intern(su, interactive) - suginfo_T *su; - int interactive; +spell_suggest_intern(suginfo_T *su, int interactive) { /* * Load the .sug file(s) that are available and not done yet. @@ -10959,7 +10812,7 @@ spell_suggest_intern(su, interactive) * Load the .sug files for languages that have one and weren't loaded yet. */ static void -suggest_load_files() +suggest_load_files(void) { langp_T *lp; int lpi; @@ -11100,9 +10953,7 @@ nextone: * Returns the total number of words. */ static void -tree_count_words(byts, idxs) - char_u *byts; - idx_T *idxs; +tree_count_words(char_u *byts, idx_T *idxs) { int depth; idx_T arridx[MAXWLEN]; @@ -11163,8 +11014,7 @@ tree_count_words(byts, idxs) * Free the info put in "*su" by spell_find_suggest(). */ static void -spell_find_cleanup(su) - suginfo_T *su; +spell_find_cleanup(suginfo_T *su) { int i; @@ -11186,10 +11036,10 @@ spell_find_cleanup(su) * The result is NUL terminated. */ static void -onecap_copy(word, wcopy, upper) - char_u *word; - char_u *wcopy; - int upper; /* TRUE: first letter made upper case */ +onecap_copy( + char_u *word, + char_u *wcopy, + int upper) /* TRUE: first letter made upper case */ { char_u *p; int c; @@ -11223,9 +11073,7 @@ onecap_copy(word, wcopy, upper) * "wcopy[MAXWLEN]". The result is NUL terminated. */ static void -allcap_copy(word, wcopy) - char_u *word; - char_u *wcopy; +allcap_copy(char_u *word, char_u *wcopy) { char_u *s; char_u *d; @@ -11277,8 +11125,7 @@ allcap_copy(word, wcopy) * Try finding suggestions by recognizing specific situations. */ static void -suggest_try_special(su) - suginfo_T *su; +suggest_try_special(suginfo_T *su) { char_u *p; size_t len; @@ -11361,8 +11208,7 @@ prof_report(char *name) * Try finding suggestions by adding/removing/swapping letters. */ static void -suggest_try_change(su) - suginfo_T *su; +suggest_try_change(suginfo_T *su) { char_u fword[MAXWLEN]; /* copy of the bad word, case-folded */ int n; @@ -11434,11 +11280,11 @@ suggest_try_change(su) * use "slang->sl_repsal" instead of "lp->lp_replang->sl_rep" */ static void -suggest_trie_walk(su, lp, fword, soundfold) - suginfo_T *su; - langp_T *lp; - char_u *fword; - int soundfold; +suggest_trie_walk( + suginfo_T *su, + langp_T *lp, + char_u *fword, + int soundfold) { char_u tword[MAXWLEN]; /* good word collected so far */ trystate_T stack[MAXWLEN]; @@ -12934,10 +12780,7 @@ suggest_trie_walk(su, lp, fword, soundfo * Go one level deeper in the tree. */ static void -go_deeper(stack, depth, score_add) - trystate_T *stack; - int depth; - int score_add; +go_deeper(trystate_T *stack, int depth, int score_add) { stack[depth + 1] = stack[depth]; stack[depth + 1].ts_state = STATE_START; @@ -12952,10 +12795,7 @@ go_deeper(stack, depth, score_add) * fword[flen] and return the byte length of that many chars in "word". */ static int -nofold_len(fword, flen, word) - char_u *fword; - int flen; - char_u *word; +nofold_len(char_u *fword, int flen, char_u *word) { char_u *p; int i = 0; @@ -12975,10 +12815,7 @@ nofold_len(fword, flen, word) * same case-folded word, but we only find one... */ static void -find_keepcap_word(slang, fword, kword) - slang_T *slang; - char_u *fword; - char_u *kword; +find_keepcap_word(slang_T *slang, char_u *fword, char_u *kword) { char_u uword[MAXWLEN]; /* "fword" in upper-case */ int depth; @@ -13134,8 +12971,7 @@ find_keepcap_word(slang, fword, kword) * su->su_sga. */ static void -score_comp_sal(su) - suginfo_T *su; +score_comp_sal(suginfo_T *su) { langp_T *lp; char_u badsound[MAXWLEN]; @@ -13189,8 +13025,7 @@ score_comp_sal(su) * They are entwined. */ static void -score_combine(su) - suginfo_T *su; +score_combine(suginfo_T *su) { int i; int j; @@ -13302,11 +13137,11 @@ score_combine(su) * badword. */ static int -stp_sal_score(stp, su, slang, badsound) - suggest_T *stp; - suginfo_T *su; - slang_T *slang; - char_u *badsound; /* sound-folded badword */ +stp_sal_score( + suggest_T *stp, + suginfo_T *su, + slang_T *slang, + char_u *badsound) /* sound-folded badword */ { char_u *p; char_u *pbad; @@ -13372,7 +13207,7 @@ static sftword_T dumsft; * Prepare for calling suggest_try_soundalike(). */ static void -suggest_try_soundalike_prep() +suggest_try_soundalike_prep(void) { langp_T *lp; int lpi; @@ -13395,8 +13230,7 @@ suggest_try_soundalike_prep() * Note: This doesn't support postponed prefixes. */ static void -suggest_try_soundalike(su) - suginfo_T *su; +suggest_try_soundalike(suginfo_T *su) { char_u salword[MAXWLEN]; langp_T *lp; @@ -13432,7 +13266,7 @@ suggest_try_soundalike(su) * Finish up after calling suggest_try_soundalike(). */ static void -suggest_try_soundalike_finish() +suggest_try_soundalike_finish(void) { langp_T *lp; int lpi; @@ -13469,11 +13303,11 @@ suggest_try_soundalike_finish() * produce this soundfolded word. */ static void -add_sound_suggest(su, goodword, score, lp) - suginfo_T *su; - char_u *goodword; - int score; /* soundfold score */ - langp_T *lp; +add_sound_suggest( + suginfo_T *su, + char_u *goodword, + int score, /* soundfold score */ + langp_T *lp) { slang_T *slang = lp->lp_slang; /* language for sound folding */ int sfwordnr; @@ -13677,9 +13511,7 @@ badword: * Find word "word" in fold-case tree for "slang" and return the word number. */ static int -soundfold_find(slang, word) - slang_T *slang; - char_u *word; +soundfold_find(slang_T *slang, char_u *word) { idx_T arridx = 0; int len; @@ -13753,10 +13585,7 @@ soundfold_find(slang, word) * Copy "fword" to "cword", fixing case according to "flags". */ static void -make_case_word(fword, cword, flags) - char_u *fword; - char_u *cword; - int flags; +make_case_word(char_u *fword, char_u *cword, int flags) { if (flags & WF_ALLCAP) /* Make it all upper-case */ @@ -13773,9 +13602,7 @@ make_case_word(fword, cword, flags) * Use map string "map" for languages "lp". */ static void -set_map_str(lp, map) - slang_T *lp; - char_u *map; +set_map_str(slang_T *lp, char_u *map) { char_u *p; int headc = 0; @@ -13858,10 +13685,7 @@ set_map_str(lp, map) * lines in the .aff file. */ static int -similar_chars(slang, c1, c2) - slang_T *slang; - int c1; - int c2; +similar_chars(slang_T *slang, int c1, int c2) { int m1, m2; #ifdef FEAT_MBYTE @@ -13906,17 +13730,16 @@ similar_chars(slang, c1, c2) * For a suggestion that is already in the list the lowest score is remembered. */ static void -add_suggestion(su, gap, goodword, badlenarg, score, altscore, had_bonus, - slang, maxsf) - suginfo_T *su; - garray_T *gap; /* either su_ga or su_sga */ - char_u *goodword; - int badlenarg; /* len of bad word replaced with "goodword" */ - int score; - int altscore; - int had_bonus; /* value for st_had_bonus */ - slang_T *slang; /* language for sound folding */ - int maxsf; /* su_maxscore applies to soundfold score, +add_suggestion( + suginfo_T *su, + garray_T *gap, /* either su_ga or su_sga */ + char_u *goodword, + int badlenarg, /* len of bad word replaced with "goodword" */ + int score, + int altscore, + int had_bonus, /* value for st_had_bonus */ + slang_T *slang, /* language for sound folding */ + int maxsf) /* su_maxscore applies to soundfold score, su_sfmaxscore to the total score. */ { int goodlen; /* len of goodword changed */ @@ -14043,9 +13866,9 @@ add_suggestion(su, gap, goodword, badlen * for split words, such as "the the". Remove these from the list here. */ static void -check_suggestions(su, gap) - suginfo_T *su; - garray_T *gap; /* either su_ga or su_sga */ +check_suggestions( + suginfo_T *su, + garray_T *gap) /* either su_ga or su_sga */ { suggest_T *stp; int i; @@ -14080,9 +13903,9 @@ check_suggestions(su, gap) * Add a word to be banned. */ static void -add_banned(su, word) - suginfo_T *su; - char_u *word; +add_banned( + suginfo_T *su, + char_u *word) { char_u *s; hash_T hash; @@ -14103,8 +13926,7 @@ add_banned(su, word) * is slow, thus only done for the final results. */ static void -rescore_suggestions(su) - suginfo_T *su; +rescore_suggestions(suginfo_T *su) { int i; @@ -14117,9 +13939,7 @@ rescore_suggestions(su) * Recompute the score for one suggestion if sound-folding is possible. */ static void -rescore_one(su, stp) - suginfo_T *su; - suggest_T *stp; +rescore_one(suginfo_T *su, suggest_T *stp) { slang_T *slang = stp->st_slang; char_u sal_badword[MAXWLEN]; @@ -14159,9 +13979,7 @@ sug_compare(const void *s1, const void * #ifdef __BORLANDC__ _RTLENTRYF #endif -sug_compare(s1, s2) - const void *s1; - const void *s2; +sug_compare(const void *s1, const void *s2) { suggest_T *p1 = (suggest_T *)s1; suggest_T *p2 = (suggest_T *)s2; @@ -14183,10 +14001,10 @@ sug_compare(s1, s2) * Returns the maximum score in the list or "maxscore" unmodified. */ static int -cleanup_suggestions(gap, maxscore, keep) - garray_T *gap; - int maxscore; - int keep; /* nr of suggestions to keep */ +cleanup_suggestions( + garray_T *gap, + int maxscore, + int keep) /* nr of suggestions to keep */ { suggest_T *stp = &SUG(*gap, 0); int i; @@ -14211,8 +14029,7 @@ cleanup_suggestions(gap, maxscore, keep) * Result is in allocated memory, NULL for an error. */ char_u * -eval_soundfold(word) - char_u *word; +eval_soundfold(char_u *word) { langp_T *lp; char_u sound[MAXWLEN]; @@ -14249,11 +14066,11 @@ eval_soundfold(word) * 2. SAL items define a more advanced sound-folding (and much slower). */ static void -spell_soundfold(slang, inword, folded, res) - slang_T *slang; - char_u *inword; - int folded; /* "inword" is already case-folded */ - char_u *res; +spell_soundfold( + slang_T *slang, + char_u *inword, + int folded, /* "inword" is already case-folded */ + char_u *res) { char_u fword[MAXWLEN]; char_u *word; @@ -14286,10 +14103,7 @@ spell_soundfold(slang, inword, folded, r * SOFOTO lines. */ static void -spell_soundfold_sofo(slang, inword, res) - slang_T *slang; - char_u *inword; - char_u *res; +spell_soundfold_sofo(slang_T *slang, char_u *inword, char_u *res) { char_u *s; int ri = 0; @@ -14360,10 +14174,7 @@ spell_soundfold_sofo(slang, inword, res) } static void -spell_soundfold_sal(slang, inword, res) - slang_T *slang; - char_u *inword; - char_u *res; +spell_soundfold_sal(slang_T *slang, char_u *inword, char_u *res) { salitem_T *smp; char_u word[MAXWLEN]; @@ -14641,10 +14452,7 @@ spell_soundfold_sal(slang, inword, res) * Multi-byte version of spell_soundfold(). */ static void -spell_soundfold_wsal(slang, inword, res) - slang_T *slang; - char_u *inword; - char_u *res; +spell_soundfold_wsal(slang_T *slang, char_u *inword, char_u *res) { salitem_T *smp = (salitem_T *)slang->sl_sal.ga_data; int word[MAXWLEN]; @@ -14960,9 +14768,9 @@ spell_soundfold_wsal(slang, inword, res) * avoiding checks that will not be possible. */ static int -soundalike_score(goodstart, badstart) - char_u *goodstart; /* sound-folded good word */ - char_u *badstart; /* sound-folded bad word */ +soundalike_score( + char_u *goodstart, /* sound-folded good word */ + char_u *badstart) /* sound-folded bad word */ { char_u *goodsound = goodstart; char_u *badsound = badstart; @@ -15195,10 +15003,10 @@ soundalike_score(goodstart, badstart) * support multi-byte characters. */ static int -spell_edit_score(slang, badword, goodword) - slang_T *slang; - char_u *badword; - char_u *goodword; +spell_edit_score( + slang_T *slang, + char_u *badword, + char_u *goodword) { int *cnt; int badlen, goodlen; /* lengths including NUL */ @@ -15327,11 +15135,11 @@ typedef struct * for multi-byte characters. */ static int -spell_edit_score_limit(slang, badword, goodword, limit) - slang_T *slang; - char_u *badword; - char_u *goodword; - int limit; +spell_edit_score_limit( + slang_T *slang, + char_u *badword, + char_u *goodword, + int limit) { limitscore_T stack[10]; /* allow for over 3 * 2 edits */ int stackidx; @@ -15509,11 +15317,11 @@ pop: * Keep it in sync with the above! */ static int -spell_edit_score_limit_w(slang, badword, goodword, limit) - slang_T *slang; - char_u *badword; - char_u *goodword; - int limit; +spell_edit_score_limit_w( + slang_T *slang, + char_u *badword, + char_u *goodword, + int limit) { limitscore_T stack[10]; /* allow for over 3 * 2 edits */ int stackidx; @@ -15698,8 +15506,7 @@ pop: * ":spellinfo" */ void -ex_spellinfo(eap) - exarg_T *eap UNUSED; +ex_spellinfo(exarg_T *eap UNUSED) { int lpi; langp_T *lp; @@ -15735,8 +15542,7 @@ ex_spellinfo(eap) * ":spelldump" */ void -ex_spelldump(eap) - exarg_T *eap; +ex_spelldump(exarg_T *eap) { char_u *spl; long dummy; @@ -15772,11 +15578,11 @@ ex_spelldump(eap) * 2. When "pat" is not NULL: add matching words to insert mode completion. */ void -spell_dump_compl(pat, ic, dir, dumpflags_arg) - char_u *pat; /* leading part of the word */ - int ic; /* ignore case */ - int *dir; /* direction for adding matches */ - int dumpflags_arg; /* DUMPFLAG_* */ +spell_dump_compl( + char_u *pat, /* leading part of the word */ + int ic, /* ignore case */ + int *dir, /* direction for adding matches */ + int dumpflags_arg) /* DUMPFLAG_* */ { langp_T *lp; slang_T *slang; @@ -15973,14 +15779,14 @@ spell_dump_compl(pat, ic, dir, dumpflags * When "lnum" is zero add insert mode completion. */ static void -dump_word(slang, word, pat, dir, dumpflags, wordflags, lnum) - slang_T *slang; - char_u *word; - char_u *pat; - int *dir; - int dumpflags; - int wordflags; - linenr_T lnum; +dump_word( + slang_T *slang, + char_u *word, + char_u *pat, + int *dir, + int dumpflags, + int wordflags, + linenr_T lnum) { int keepcap = FALSE; char_u *p; @@ -16063,14 +15869,14 @@ dump_word(slang, word, pat, dir, dumpfla * Return the updated line number. */ static linenr_T -dump_prefixes(slang, word, pat, dir, dumpflags, flags, startlnum) - slang_T *slang; - char_u *word; /* case-folded word */ - char_u *pat; - int *dir; - int dumpflags; - int flags; /* flags with prefix ID */ - linenr_T startlnum; +dump_prefixes( + slang_T *slang, + char_u *word, /* case-folded word */ + char_u *pat, + int *dir, + int dumpflags, + int flags, /* flags with prefix ID */ + linenr_T startlnum) { idx_T arridx[MAXWLEN]; int curi[MAXWLEN]; @@ -16179,9 +15985,7 @@ dump_prefixes(slang, word, pat, dir, dum * Uses the spell-checking word characters. */ char_u * -spell_to_word_end(start, win) - char_u *start; - win_T *win; +spell_to_word_end(char_u *start, win_T *win) { char_u *p = start; @@ -16199,8 +16003,7 @@ spell_to_word_end(start, win) * Returns the column number of the word. */ int -spell_word_start(startcol) - int startcol; +spell_word_start(int startcol) { char_u *line; char_u *p; @@ -16238,8 +16041,7 @@ spell_word_start(startcol) static int spell_expand_need_cap; void -spell_expand_check_cap(col) - colnr_T col; +spell_expand_check_cap(colnr_T col) { spell_expand_need_cap = check_need_cap(curwin->w_cursor.lnum, col); } @@ -16251,10 +16053,10 @@ spell_expand_check_cap(col) * allocated strings. */ int -expand_spelling(lnum, pat, matchp) - linenr_T lnum UNUSED; - char_u *pat; - char_u ***matchp; +expand_spelling( + linenr_T lnum UNUSED, + char_u *pat, + char_u ***matchp) { garray_T ga; diff --git a/src/syntax.c b/src/syntax.c --- a/src/syntax.c +++ b/src/syntax.c @@ -489,9 +489,7 @@ static void syn_incl_toplevel(int id, in * window. */ void -syntax_start(wp, lnum) - win_T *wp; - linenr_T lnum; +syntax_start(win_T *wp, linenr_T lnum) { synstate_T *p; synstate_T *last_valid = NULL; @@ -668,8 +666,7 @@ syntax_start(wp, lnum) * have to manually release their extmatch pointers first. */ static void -clear_syn_state(p) - synstate_T *p; +clear_syn_state(synstate_T *p) { int i; garray_T *gap; @@ -692,7 +689,7 @@ clear_syn_state(p) * Cleanup the current_state stack. */ static void -clear_current_state() +clear_current_state(void) { int i; stateitem_T *sip; @@ -713,10 +710,10 @@ clear_current_state() * 3. Simply start on a given number of lines above "lnum". */ static void -syn_sync(wp, start_lnum, last_valid) - win_T *wp; - linenr_T start_lnum; - synstate_T *last_valid; +syn_sync( + win_T *wp, + linenr_T start_lnum, + synstate_T *last_valid) { buf_T *curbuf_save; win_T *curwin_save; @@ -1009,8 +1006,7 @@ restore_chartab(char_u *chartab) * Return TRUE if the line-continuation pattern matches in line "lnum". */ static int -syn_match_linecont(lnum) - linenr_T lnum; +syn_match_linecont(linenr_T lnum) { regmmatch_T regmatch; int r; @@ -1035,7 +1031,7 @@ syn_match_linecont(lnum) * Prepare the current state for the start of a line. */ static void -syn_start_line() +syn_start_line(void) { current_finished = FALSE; current_col = 0; @@ -1060,8 +1056,7 @@ syn_start_line() * When "startofline" is FALSE the item with "keepend" is forcefully updated. */ static void -syn_update_ends(startofline) - int startofline; +syn_update_ends(int startofline) { stateitem_T *cur_si; int i; @@ -1161,8 +1156,7 @@ syn_update_ends(startofline) */ static void -syn_stack_free_block(block) - synblock_T *block; +syn_stack_free_block(synblock_T *block) { synstate_T *p; @@ -1180,8 +1174,7 @@ syn_stack_free_block(block) * Used when syntax items changed to force resyncing everywhere. */ void -syn_stack_free_all(block) - synblock_T *block; +syn_stack_free_all(synblock_T *block) { win_T *wp; @@ -1205,7 +1198,7 @@ syn_stack_free_all(block) * Also used to allocate b_sst_array[] for the first time. */ static void -syn_stack_alloc() +syn_stack_alloc(void) { long len; synstate_T *to, *from; @@ -1284,8 +1277,7 @@ syn_stack_alloc() * displayed buffer. */ void -syn_stack_apply_changes(buf) - buf_T *buf; +syn_stack_apply_changes(buf_T *buf) { win_T *wp; @@ -1299,9 +1291,7 @@ syn_stack_apply_changes(buf) } static void -syn_stack_apply_changes_block(block, buf) - synblock_T *block; - buf_T *buf; +syn_stack_apply_changes_block(synblock_T *block, buf_T *buf) { synstate_T *p, *prev, *np; linenr_T n; @@ -1353,7 +1343,7 @@ syn_stack_apply_changes_block(block, buf * Returns TRUE if at least one entry was freed. */ static int -syn_stack_cleanup() +syn_stack_cleanup(void) { synstate_T *p, *prev; disptick_T tick; @@ -1417,9 +1407,7 @@ syn_stack_cleanup() * Move the entry into the free list. */ static void -syn_stack_free_entry(block, p) - synblock_T *block; - synstate_T *p; +syn_stack_free_entry(synblock_T *block, synstate_T *p) { clear_syn_state(p); p->sst_next = block->b_sst_firstfree; @@ -1432,8 +1420,7 @@ syn_stack_free_entry(block, p) * Returns NULL when there is no entry or the first entry is after "lnum". */ static synstate_T * -syn_stack_find_entry(lnum) - linenr_T lnum; +syn_stack_find_entry(linenr_T lnum) { synstate_T *p, *prev; @@ -1453,7 +1440,7 @@ syn_stack_find_entry(lnum) * The current state must be valid for the start of the current_lnum line! */ static synstate_T * -store_current_state() +store_current_state(void) { int i; synstate_T *p; @@ -1576,8 +1563,7 @@ store_current_state() * Copy a state stack from "from" in b_sst_array[] to current_state; */ static void -load_current_state(from) - synstate_T *from; +load_current_state(synstate_T *from) { int i; bufstate_T *bp; @@ -1624,8 +1610,7 @@ load_current_state(from) * Return TRUE when they are equal. */ static int -syn_stack_equal(sp) - synstate_T *sp; +syn_stack_equal(synstate_T *sp) { int i, j; bufstate_T *bp; @@ -1697,8 +1682,7 @@ syn_stack_equal(sp) * lnum -> line below window */ void -syntax_end_parsing(lnum) - linenr_T lnum; +syntax_end_parsing(linenr_T lnum) { synstate_T *sp; @@ -1715,7 +1699,7 @@ syntax_end_parsing(lnum) ****************************************/ static void -invalidate_current_state() +invalidate_current_state(void) { clear_current_state(); current_state.ga_itemsize = 0; /* mark current_state invalid */ @@ -1724,7 +1708,7 @@ invalidate_current_state() } static void -validate_current_state() +validate_current_state(void) { current_state.ga_itemsize = sizeof(stateitem_T); current_state.ga_growsize = 3; @@ -1736,8 +1720,7 @@ validate_current_state() * line, to check if the next line needs to be redrawn too. */ int -syntax_check_changed(lnum) - linenr_T lnum; +syntax_check_changed(linenr_T lnum) { int retval = TRUE; synstate_T *sp; @@ -1785,8 +1768,8 @@ syntax_check_changed(lnum) * is valid. */ static int -syn_finish_line(syncing) - int syncing; /* called for syncing */ +syn_finish_line( + int syncing) /* called for syncing */ { stateitem_T *cur_si; colnr_T prev_current_col; @@ -1835,10 +1818,10 @@ syn_finish_line(syncing) * done. */ int -get_syntax_attr(col, can_spell, keep_state) - colnr_T col; - int *can_spell; - int keep_state; /* keep state of char at "col" */ +get_syntax_attr( + colnr_T col, + int *can_spell, + int keep_state) /* keep state of char at "col" */ { int attr = 0; @@ -1888,11 +1871,11 @@ get_syntax_attr(col, can_spell, keep_sta * Get syntax attributes for current_lnum, current_col. */ static int -syn_current_attr(syncing, displaying, can_spell, keep_state) - int syncing; /* When 1: called for syncing */ - int displaying; /* result will be displayed */ - int *can_spell; /* return: do spell checking */ - int keep_state; /* keep syntax stack afterwards */ +syn_current_attr( + int syncing, /* When 1: called for syncing */ + int displaying, /* result will be displayed */ + int *can_spell, /* return: do spell checking */ + int keep_state) /* keep syntax stack afterwards */ { int syn_id; lpos_T endpos; /* was: char_u *endp; */ @@ -2481,9 +2464,7 @@ syn_current_attr(syncing, displaying, ca * Check if we already matched pattern "idx" at the current column. */ static int -did_match_already(idx, gap) - int idx; - garray_T *gap; +did_match_already(int idx, garray_T *gap) { int i; @@ -2506,8 +2487,7 @@ did_match_already(idx, gap) * Push the next match onto the stack. */ static stateitem_T * -push_next_match(cur_si) - stateitem_T *cur_si; +push_next_match(stateitem_T *cur_si) { synpat_T *spp; #ifdef FEAT_CONCEAL @@ -2600,7 +2580,7 @@ push_next_match(cur_si) * Check for end of current state (and the states before it). */ static void -check_state_ends() +check_state_ends(void) { stateitem_T *cur_si; int had_extend; @@ -2705,8 +2685,7 @@ check_state_ends() * fills in si_attr, si_next_list and si_cont_list. */ static void -update_si_attr(idx) - int idx; +update_si_attr(int idx) { stateitem_T *sip = &CUR_STATE(idx); synpat_T *spp; @@ -2761,7 +2740,7 @@ update_si_attr(idx) * Propagate the match-end to contained items, until a "skipend" item is found. */ static void -check_keepend() +check_keepend(void) { int i; lpos_T maxpos; @@ -2821,10 +2800,10 @@ check_keepend() * Return the flags for the matched END. */ static void -update_si_end(sip, startcol, force) - stateitem_T *sip; - int startcol; /* where to start searching for the end */ - int force; /* when TRUE overrule a previous end */ +update_si_end( + stateitem_T *sip, + int startcol, /* where to start searching for the end */ + int force) /* when TRUE overrule a previous end */ { lpos_T startpos; lpos_T endpos; @@ -2887,8 +2866,7 @@ update_si_end(sip, startcol, force) * Return FAIL if it's not possible (out of memory). */ static int -push_current_state(idx) - int idx; +push_current_state(int idx) { if (ga_grow(¤t_state, 1) == FAIL) return FAIL; @@ -2902,7 +2880,7 @@ push_current_state(idx) * Remove a state from the current_state stack. */ static void -pop_current_state() +pop_current_state(void) { if (current_state.ga_len) { @@ -2927,16 +2905,15 @@ pop_current_state() * computed. */ static void -find_endpos(idx, startpos, m_endpos, hl_endpos, flagsp, end_endpos, - end_idx, start_ext) - int idx; /* index of the pattern */ - lpos_T *startpos; /* where to start looking for an END match */ - lpos_T *m_endpos; /* return: end of match */ - lpos_T *hl_endpos; /* return: end of highlighting */ - long *flagsp; /* return: flags of matching END */ - lpos_T *end_endpos; /* return: end of end pattern match */ - int *end_idx; /* return: group ID for end pat. match, or 0 */ - reg_extmatch_T *start_ext; /* submatches from the start pattern */ +find_endpos( + int idx, /* index of the pattern */ + lpos_T *startpos, /* where to start looking for an END match */ + lpos_T *m_endpos, /* return: end of match */ + lpos_T *hl_endpos, /* return: end of highlighting */ + long *flagsp, /* return: flags of matching END */ + lpos_T *end_endpos, /* return: end of end pattern match */ + int *end_idx, /* return: group ID for end pat. match, or 0 */ + reg_extmatch_T *start_ext) /* submatches from the start pattern */ { colnr_T matchcol; synpat_T *spp, *spp_skip; @@ -3165,9 +3142,7 @@ find_endpos(idx, startpos, m_endpos, hl_ * Limit "pos" not to be after "limit". */ static void -limit_pos(pos, limit) - lpos_T *pos; - lpos_T *limit; +limit_pos(lpos_T *pos, lpos_T *limit) { if (pos->lnum > limit->lnum) *pos = *limit; @@ -3179,9 +3154,9 @@ limit_pos(pos, limit) * Limit "pos" not to be after "limit", unless pos->lnum is zero. */ static void -limit_pos_zero(pos, limit) - lpos_T *pos; - lpos_T *limit; +limit_pos_zero( + lpos_T *pos, + lpos_T *limit) { if (pos->lnum == 0) *pos = *limit; @@ -3193,12 +3168,12 @@ limit_pos_zero(pos, limit) * Add offset to matched text for end of match or highlight. */ static void -syn_add_end_off(result, regmatch, spp, idx, extra) - lpos_T *result; /* returned position */ - regmmatch_T *regmatch; /* start/end of match */ - synpat_T *spp; /* matched pattern */ - int idx; /* index of offset */ - int extra; /* extra chars for offset to start */ +syn_add_end_off( + lpos_T *result, /* returned position */ + regmmatch_T *regmatch, /* start/end of match */ + synpat_T *spp, /* matched pattern */ + int idx, /* index of offset */ + int extra) /* extra chars for offset to start */ { int col; int off; @@ -3245,12 +3220,12 @@ syn_add_end_off(result, regmatch, spp, i * Avoid resulting column to become negative. */ static void -syn_add_start_off(result, regmatch, spp, idx, extra) - lpos_T *result; /* returned position */ - regmmatch_T *regmatch; /* start/end of match */ - synpat_T *spp; - int idx; - int extra; /* extra chars for offset to end */ +syn_add_start_off( + lpos_T *result, /* returned position */ + regmmatch_T *regmatch, /* start/end of match */ + synpat_T *spp, + int idx, + int extra) /* extra chars for offset to end */ { int col; int off; @@ -3298,7 +3273,7 @@ syn_add_start_off(result, regmatch, spp, * Get current line in syntax buffer. */ static char_u * -syn_getcurline() +syn_getcurline(void) { return ml_get_buf(syn_buf, current_lnum, FALSE); } @@ -3308,11 +3283,11 @@ syn_getcurline() * Returns TRUE when there is a match. */ static int -syn_regexec(rmp, lnum, col, st) - regmmatch_T *rmp; - linenr_T lnum; - colnr_T col; - syn_time_T *st UNUSED; +syn_regexec( + regmmatch_T *rmp, + linenr_T lnum, + colnr_T col, + syn_time_T *st UNUSED) { int r; #ifdef FEAT_PROFILE @@ -3353,14 +3328,14 @@ syn_regexec(rmp, lnum, col, st) * Return it's ID if found, 0 otherwise. */ static int -check_keyword_id(line, startcol, endcolp, flagsp, next_listp, cur_si, ccharp) - char_u *line; - int startcol; /* position in line to check for keyword */ - int *endcolp; /* return: character after found keyword */ - long *flagsp; /* return: flags of matching keyword */ - short **next_listp; /* return: next_list of matching keyword */ - stateitem_T *cur_si; /* item at the top of the stack */ - int *ccharp UNUSED; /* conceal substitution char */ +check_keyword_id( + char_u *line, + int startcol, /* position in line to check for keyword */ + int *endcolp, /* return: character after found keyword */ + long *flagsp, /* return: flags of matching keyword */ + short **next_listp, /* return: next_list of matching keyword */ + stateitem_T *cur_si, /* item at the top of the stack */ + int *ccharp UNUSED) /* conceal substitution char */ { keyentry_T *kp; char_u *kwp; @@ -3442,9 +3417,7 @@ check_keyword_id(line, startcol, endcolp * Handle ":syntax conceal" command. */ static void -syn_cmd_conceal(eap, syncing) - exarg_T *eap UNUSED; - int syncing UNUSED; +syn_cmd_conceal(exarg_T *eap UNUSED, int syncing UNUSED) { #ifdef FEAT_CONCEAL char_u *arg = eap->arg; @@ -3468,9 +3441,7 @@ syn_cmd_conceal(eap, syncing) * Handle ":syntax case" command. */ static void -syn_cmd_case(eap, syncing) - exarg_T *eap; - int syncing UNUSED; +syn_cmd_case(exarg_T *eap, int syncing UNUSED) { char_u *arg = eap->arg; char_u *next; @@ -3492,9 +3463,7 @@ syn_cmd_case(eap, syncing) * Handle ":syntax spell" command. */ static void -syn_cmd_spell(eap, syncing) - exarg_T *eap; - int syncing UNUSED; +syn_cmd_spell(exarg_T *eap, int syncing UNUSED) { char_u *arg = eap->arg; char_u *next; @@ -3524,9 +3493,7 @@ syn_cmd_spell(eap, syncing) * Handle ":syntax iskeyword" command. */ static void -syn_cmd_iskeyword(eap, syncing) - exarg_T *eap; - int syncing UNUSED; +syn_cmd_iskeyword(exarg_T *eap, int syncing UNUSED) { char_u *arg = eap->arg; char_u save_chartab[32]; @@ -3575,8 +3542,7 @@ syn_cmd_iskeyword(eap, syncing) * Clear all syntax info for one buffer. */ void -syntax_clear(block) - synblock_T *block; +syntax_clear(synblock_T *block) { int i; @@ -3627,8 +3593,7 @@ syntax_clear(block) * Get rid of ownsyntax for window "wp". */ void -reset_synblock(wp) - win_T *wp; +reset_synblock(win_T *wp) { if (wp->w_s != &wp->w_buffer->b_s) { @@ -3642,7 +3607,7 @@ reset_synblock(wp) * Clear syncing info for one buffer. */ static void -syntax_sync_clear() +syntax_sync_clear(void) { int i; @@ -3669,9 +3634,9 @@ syntax_sync_clear() * Remove one pattern from the buffer's pattern list. */ static void -syn_remove_pattern(block, idx) - synblock_T *block; - int idx; +syn_remove_pattern( + synblock_T *block, + int idx) { synpat_T *spp; @@ -3691,9 +3656,7 @@ syn_remove_pattern(block, idx) * last to first! */ static void -syn_clear_pattern(block, i) - synblock_T *block; - int i; +syn_clear_pattern(synblock_T *block, int i) { vim_free(SYN_ITEMS(block)[i].sp_pattern); vim_regfree(SYN_ITEMS(block)[i].sp_prog); @@ -3710,9 +3673,7 @@ syn_clear_pattern(block, i) * Clear and free one syntax cluster. */ static void -syn_clear_cluster(block, i) - synblock_T *block; - int i; +syn_clear_cluster(synblock_T *block, int i) { vim_free(SYN_CLSTR(block)[i].scl_name); vim_free(SYN_CLSTR(block)[i].scl_name_u); @@ -3723,9 +3684,7 @@ syn_clear_cluster(block, i) * Handle ":syntax clear" command. */ static void -syn_cmd_clear(eap, syncing) - exarg_T *eap; - int syncing; +syn_cmd_clear(exarg_T *eap, int syncing) { char_u *arg = eap->arg; char_u *arg_end; @@ -3810,9 +3769,7 @@ syn_cmd_clear(eap, syncing) * Clear one syntax group for the current buffer. */ static void -syn_clear_one(id, syncing) - int id; - int syncing; +syn_clear_one(int id, int syncing) { synpat_T *spp; int idx; @@ -3838,9 +3795,7 @@ syn_clear_one(id, syncing) * Handle ":syntax on" command. */ static void -syn_cmd_on(eap, syncing) - exarg_T *eap; - int syncing UNUSED; +syn_cmd_on(exarg_T *eap, int syncing UNUSED) { syn_cmd_onoff(eap, "syntax"); } @@ -3849,9 +3804,7 @@ syn_cmd_on(eap, syncing) * Handle ":syntax enable" command. */ static void -syn_cmd_enable(eap, syncing) - exarg_T *eap; - int syncing UNUSED; +syn_cmd_enable(exarg_T *eap, int syncing UNUSED) { set_internal_string_var((char_u *)"syntax_cmd", (char_u *)"enable"); syn_cmd_onoff(eap, "syntax"); @@ -3862,9 +3815,7 @@ syn_cmd_enable(eap, syncing) * Handle ":syntax reset" command. */ static void -syn_cmd_reset(eap, syncing) - exarg_T *eap; - int syncing UNUSED; +syn_cmd_reset(exarg_T *eap, int syncing UNUSED) { eap->nextcmd = check_nextcmd(eap->arg); if (!eap->skip) @@ -3880,9 +3831,7 @@ syn_cmd_reset(eap, syncing) * Handle ":syntax manual" command. */ static void -syn_cmd_manual(eap, syncing) - exarg_T *eap; - int syncing UNUSED; +syn_cmd_manual(exarg_T *eap, int syncing UNUSED) { syn_cmd_onoff(eap, "manual"); } @@ -3891,17 +3840,13 @@ syn_cmd_manual(eap, syncing) * Handle ":syntax off" command. */ static void -syn_cmd_off(eap, syncing) - exarg_T *eap; - int syncing UNUSED; +syn_cmd_off(exarg_T *eap, int syncing UNUSED) { syn_cmd_onoff(eap, "nosyntax"); } static void -syn_cmd_onoff(eap, name) - exarg_T *eap; - char *name; +syn_cmd_onoff(exarg_T *eap, char *name) { char_u buf[100]; @@ -3918,9 +3863,9 @@ syn_cmd_onoff(eap, name) * Handle ":syntax [list]" command: list current syntax words. */ static void -syn_cmd_list(eap, syncing) - exarg_T *eap; - int syncing; /* when TRUE: list syncing items */ +syn_cmd_list( + exarg_T *eap, + int syncing) /* when TRUE: list syncing items */ { char_u *arg = eap->arg; int id; @@ -4011,7 +3956,7 @@ syn_cmd_list(eap, syncing) } static void -syn_lines_msg() +syn_lines_msg(void) { if (curwin->w_s->b_syn_sync_maxlines > 0 || curwin->w_s->b_syn_sync_minlines > 0) @@ -4034,7 +3979,7 @@ syn_lines_msg() } static void -syn_match_msg() +syn_match_msg(void) { if (curwin->w_s->b_syn_sync_linebreaks > 0) { @@ -4058,10 +4003,10 @@ static void syn_list_flags(struct name_l * List one syntax item, for ":syntax" or "syntax list syntax_name". */ static void -syn_list_one(id, syncing, link_only) - int id; - int syncing; /* when TRUE: list syncing items */ - int link_only; /* when TRUE; list link-only too */ +syn_list_one( + int id, + int syncing, /* when TRUE: list syncing items */ + int link_only) /* when TRUE; list link-only too */ { int attr; int idx; @@ -4169,10 +4114,7 @@ syn_list_one(id, syncing, link_only) } static void -syn_list_flags(nlist, flags, attr) - struct name_list *nlist; - int flags; - int attr; +syn_list_flags(struct name_list *nlist, int flags, int attr) { int i; @@ -4188,8 +4130,7 @@ syn_list_flags(nlist, flags, attr) * List one syntax cluster, for ":syntax" or "syntax list syntax_name". */ static void -syn_list_cluster(id) - int id; +syn_list_cluster(int id) { int endcol = 15; @@ -4216,10 +4157,7 @@ syn_list_cluster(id) } static void -put_id_list(name, list, attr) - char_u *name; - short *list; - int attr; +put_id_list(char_u *name, short *list, int attr) { short *p; @@ -4258,11 +4196,11 @@ put_id_list(name, list, attr) } static void -put_pattern(s, c, spp, attr) - char *s; - int c; - synpat_T *spp; - int attr; +put_pattern( + char *s, + int c, + synpat_T *spp, + int attr) { long n; int mask; @@ -4331,11 +4269,11 @@ put_pattern(s, c, spp, attr) * Return TRUE if the header has been printed. */ static int -syn_list_keywords(id, ht, did_header, attr) - int id; - hashtab_T *ht; - int did_header; /* header has already been printed */ - int attr; +syn_list_keywords( + int id, + hashtab_T *ht, + int did_header, /* header has already been printed */ + int attr) { int outlen; hashitem_T *hi; @@ -4429,9 +4367,7 @@ syn_list_keywords(id, ht, did_header, at } static void -syn_clear_keyword(id, ht) - int id; - hashtab_T *ht; +syn_clear_keyword(int id, hashtab_T *ht) { hashitem_T *hi; keyentry_T *kp; @@ -4481,8 +4417,7 @@ syn_clear_keyword(id, ht) * Clear a whole keyword table. */ static void -clear_keywtab(ht) - hashtab_T *ht; +clear_keywtab(hashtab_T *ht) { hashitem_T *hi; int todo; @@ -4512,13 +4447,13 @@ clear_keywtab(ht) * Add a keyword to the list of keywords. */ static void -add_keyword(name, id, flags, cont_in_list, next_list, conceal_char) - char_u *name; /* name of keyword */ - int id; /* group ID for this keyword */ - int flags; /* flags for this keyword */ - short *cont_in_list; /* containedin for this keyword */ - short *next_list; /* nextgroup for this keyword */ - int conceal_char; +add_keyword( + char_u *name, /* name of keyword */ + int id, /* group ID for this keyword */ + int flags, /* flags for this keyword */ + short *cont_in_list, /* containedin for this keyword */ + short *next_list, /* nextgroup for this keyword */ + int conceal_char) { keyentry_T *kp; hashtab_T *ht; @@ -4572,9 +4507,9 @@ add_keyword(name, id, flags, cont_in_lis * Return NULL if the end of the command was found instead of further args. */ static char_u * -get_group_name(arg, name_end) - char_u *arg; /* start of the argument */ - char_u **name_end; /* pointer to end of the name */ +get_group_name( + char_u *arg, /* start of the argument */ + char_u **name_end) /* pointer to end of the name */ { char_u *rest; @@ -4599,10 +4534,10 @@ get_group_name(arg, name_end) * Return NULL for any error; */ static char_u * -get_syn_options(arg, opt, conceal_char) - char_u *arg; /* next argument to be checked */ - syn_opt_arg_T *opt; /* various things */ - int *conceal_char UNUSED; +get_syn_options( + char_u *arg, /* next argument to be checked */ + syn_opt_arg_T *opt, /* various things */ + int *conceal_char UNUSED) { char_u *gname_start, *gname; int syn_id; @@ -4788,9 +4723,7 @@ get_syn_options(arg, opt, conceal_char) * to the specified top-level group, if any. */ static void -syn_incl_toplevel(id, flagsp) - int id; - int *flagsp; +syn_incl_toplevel(int id, int *flagsp) { if ((*flagsp & HL_CONTAINED) || curwin->w_s->b_syn_topgrp == 0) return; @@ -4815,9 +4748,7 @@ syn_incl_toplevel(id, flagsp) * Handle ":syntax include [@{group-name}] filename" command. */ static void -syn_cmd_include(eap, syncing) - exarg_T *eap; - int syncing UNUSED; +syn_cmd_include(exarg_T *eap, int syncing UNUSED) { char_u *arg = eap->arg; int sgl_id = 1; @@ -4892,9 +4823,7 @@ syn_cmd_include(eap, syncing) * Handle ":syntax keyword {group-name} [{option}] keyword .." command. */ static void -syn_cmd_keyword(eap, syncing) - exarg_T *eap; - int syncing UNUSED; +syn_cmd_keyword(exarg_T *eap, int syncing UNUSED) { char_u *arg = eap->arg; char_u *group_name_end; @@ -5021,9 +4950,9 @@ error: * Also ":syntax sync match {name} [[grouphere | groupthere] {group-name}] .." */ static void -syn_cmd_match(eap, syncing) - exarg_T *eap; - int syncing; /* TRUE for ":syntax sync match .. " */ +syn_cmd_match( + exarg_T *eap, + int syncing) /* TRUE for ":syntax sync match .. " */ { char_u *arg = eap->arg; char_u *group_name_end; @@ -5125,9 +5054,9 @@ syn_cmd_match(eap, syncing) * start {start} .. [skip {skip}] end {end} .. [{options}]". */ static void -syn_cmd_region(eap, syncing) - exarg_T *eap; - int syncing; /* TRUE for ":syntax sync region .." */ +syn_cmd_region( + exarg_T *eap, + int syncing) /* TRUE for ":syntax sync region .." */ { char_u *arg = eap->arg; char_u *group_name_end; @@ -5394,9 +5323,7 @@ syn_cmd_region(eap, syncing) #ifdef __BORLANDC__ _RTLENTRYF #endif -syn_compare_stub(v1, v2) - const void *v1; - const void *v2; +syn_compare_stub(const void *v1, const void *v2) { const short *s1 = v1; const short *s2 = v2; @@ -5409,10 +5336,7 @@ syn_compare_stub(v1, v2) * *clstr1 and *clstr2 must both be allocated memory; they will be consumed. */ static void -syn_combine_list(clstr1, clstr2, list_op) - short **clstr1; - short **clstr2; - int list_op; +syn_combine_list(short **clstr1, short **clstr2, int list_op) { int count1 = 0; int count2 = 0; @@ -5536,8 +5460,7 @@ syn_combine_list(clstr1, clstr2, list_op * If it is not found, 0 is returned. */ static int -syn_scl_name2id(name) - char_u *name; +syn_scl_name2id(char_u *name) { int i; char_u *name_u; @@ -5558,9 +5481,7 @@ syn_scl_name2id(name) * Like syn_scl_name2id(), but take a pointer + length argument. */ static int -syn_scl_namen2id(linep, len) - char_u *linep; - int len; +syn_scl_namen2id(char_u *linep, int len) { char_u *name; int id = 0; @@ -5581,9 +5502,7 @@ syn_scl_namen2id(linep, len) * Return 0 for failure. */ static int -syn_check_cluster(pp, len) - char_u *pp; - int len; +syn_check_cluster(char_u *pp, int len) { int id; char_u *name; @@ -5606,8 +5525,7 @@ syn_check_cluster(pp, len) * Return 0 for failure. */ static int -syn_add_cluster(name) - char_u *name; +syn_add_cluster(char_u *name) { int len; @@ -5656,9 +5574,7 @@ syn_add_cluster(name) * [add={groupname},..] [remove={groupname},..]". */ static void -syn_cmd_cluster(eap, syncing) - exarg_T *eap; - int syncing UNUSED; +syn_cmd_cluster(exarg_T *eap, int syncing UNUSED) { char_u *arg = eap->arg; char_u *group_name_end; @@ -5733,7 +5649,7 @@ syn_cmd_cluster(eap, syncing) * On first call for current buffer: Init growing array. */ static void -init_syn_patterns() +init_syn_patterns(void) { curwin->w_s->b_syn_patterns.ga_itemsize = sizeof(synpat_T); curwin->w_s->b_syn_patterns.ga_growsize = 10; @@ -5745,9 +5661,7 @@ init_syn_patterns() * Returns a pointer to the next argument, or NULL in case of an error. */ static char_u * -get_syn_pattern(arg, ci) - char_u *arg; - synpat_T *ci; +get_syn_pattern(char_u *arg, synpat_T *ci) { char_u *end; int *p; @@ -5849,9 +5763,7 @@ get_syn_pattern(arg, ci) * Handle ":syntax sync .." command. */ static void -syn_cmd_sync(eap, syncing) - exarg_T *eap; - int syncing UNUSED; +syn_cmd_sync(exarg_T *eap, int syncing UNUSED) { char_u *arg_start = eap->arg; char_u *arg_end; @@ -6010,10 +5922,10 @@ syn_cmd_sync(eap, syncing) * returns FAIL for some error, OK for success. */ static int -get_id_list(arg, keylen, list) - char_u **arg; - int keylen; /* length of keyword */ - short **list; /* where to store the resulting list, if not +get_id_list( + char_u **arg, + int keylen, /* length of keyword */ + short **list) /* where to store the resulting list, if not NULL, the list is silently skipped! */ { char_u *p = NULL; @@ -6207,8 +6119,7 @@ get_id_list(arg, keylen, list) * Make a copy of an ID list. */ static short * -copy_id_list(list) - short *list; +copy_id_list(short *list) { int len; int count; @@ -6235,11 +6146,11 @@ copy_id_list(list) * This function is called very often, keep it fast!! */ static int -in_id_list(cur_si, list, ssp, contained) - stateitem_T *cur_si; /* current item or NULL */ - short *list; /* id list */ - struct sp_syn *ssp; /* group id and ":syn include" tag of group */ - int contained; /* group id is contained */ +in_id_list( + stateitem_T *cur_si, /* current item or NULL */ + short *list, /* id list */ + struct sp_syn *ssp, /* group id and ":syn include" tag of group */ + int contained) /* group id is contained */ { int retval; short *scl_list; @@ -6367,8 +6278,7 @@ static struct subcommand subcommands[] = * syntax_subcommand() function to do the rest. */ void -ex_syntax(eap) - exarg_T *eap; +ex_syntax(exarg_T *eap) { char_u *arg = eap->arg; char_u *subcmd_end; @@ -6406,8 +6316,7 @@ ex_syntax(eap) } void -ex_ownsyntax(eap) - exarg_T *eap; +ex_ownsyntax(exarg_T *eap) { char_u *old_value; char_u *new_value; @@ -6453,8 +6362,7 @@ ex_ownsyntax(eap) } int -syntax_present(win) - win_T *win; +syntax_present(win_T *win) { return (win->w_s->b_syn_patterns.ga_len != 0 || win->w_s->b_syn_clusters.ga_len != 0 @@ -6475,7 +6383,7 @@ static enum * Called when we are done expanding. */ void -reset_expand_highlight() +reset_expand_highlight(void) { include_link = include_default = include_none = 0; } @@ -6485,9 +6393,7 @@ reset_expand_highlight() * as highlight group. */ void -set_context_in_echohl_cmd(xp, arg) - expand_T *xp; - char_u *arg; +set_context_in_echohl_cmd(expand_T *xp, char_u *arg) { xp->xp_context = EXPAND_HIGHLIGHT; xp->xp_pattern = arg; @@ -6498,9 +6404,7 @@ set_context_in_echohl_cmd(xp, arg) * Handle command line completion for :syntax command. */ void -set_context_in_syntax_cmd(xp, arg) - expand_T *xp; - char_u *arg; +set_context_in_syntax_cmd(expand_T *xp, char_u *arg) { char_u *p; @@ -6540,9 +6444,7 @@ static char *(case_args[]) = {"match", " * expansion. */ char_u * -get_syntax_name(xp, idx) - expand_T *xp UNUSED; - int idx; +get_syntax_name(expand_T *xp UNUSED, int idx) { if (expand_what == EXP_SUBCMD) return (char_u *)subcommands[idx].name; @@ -6555,13 +6457,13 @@ get_syntax_name(xp, idx) * Function called for expression evaluation: get syntax ID at file position. */ int -syn_get_id(wp, lnum, col, trans, spellp, keep_state) - win_T *wp; - long lnum; - colnr_T col; - int trans; /* remove transparency */ - int *spellp; /* return: can do spell checking */ - int keep_state; /* keep state of char at "col" */ +syn_get_id( + win_T *wp, + long lnum, + colnr_T col, + int trans, /* remove transparency */ + int *spellp, /* return: can do spell checking */ + int keep_state) /* keep state of char at "col" */ { /* When the position is not after the current position and in the same * line of the same buffer, need to restart parsing. */ @@ -6589,8 +6491,7 @@ syn_get_id(wp, lnum, col, trans, spellp, * Returns the current flags. */ int -get_syntax_info(seqnrp) - int *seqnrp; +get_syntax_info(int *seqnrp) { *seqnrp = current_seqnr; return current_flags; @@ -6600,7 +6501,7 @@ get_syntax_info(seqnrp) * Return conceal substitution character */ int -syn_get_sub_char() +syn_get_sub_char(void) { return current_sub_char; } @@ -6613,8 +6514,7 @@ syn_get_sub_char() * Returns -1 when "i" is out of range. */ int -syn_get_stack_item(i) - int i; +syn_get_stack_item(int i) { if (i >= current_state.ga_len) { @@ -6633,9 +6533,7 @@ syn_get_stack_item(i) * Function called to get folding level for line "lnum" in window "wp". */ int -syn_get_foldlevel(wp, lnum) - win_T *wp; - long lnum; +syn_get_foldlevel(win_T *wp, long lnum) { int level = 0; int i; @@ -6664,8 +6562,7 @@ syn_get_foldlevel(wp, lnum) * ":syntime". */ void -ex_syntime(eap) - exarg_T *eap; +ex_syntime(exarg_T *eap) { if (STRCMP(eap->arg, "on") == 0) syn_time_on = TRUE; @@ -6680,8 +6577,7 @@ ex_syntime(eap) } static void -syn_clear_time(st) - syn_time_T *st; +syn_clear_time(syn_time_T *st) { profile_zero(&st->total); profile_zero(&st->slowest); @@ -6693,7 +6589,7 @@ syn_clear_time(st) * Clear the syntax timing for the current buffer. */ static void -syntime_clear() +syntime_clear(void) { int idx; synpat_T *spp; @@ -6716,9 +6612,7 @@ syntime_clear() * ":syntime {on,off,clear,report}" command. */ char_u * -get_syntime_arg(xp, idx) - expand_T *xp UNUSED; - int idx; +get_syntime_arg(expand_T *xp UNUSED, int idx) { switch (idx) { @@ -6746,9 +6640,7 @@ typedef struct #ifdef __BORLANDC__ _RTLENTRYF #endif -syn_compare_syntime(v1, v2) - const void *v1; - const void *v2; +syn_compare_syntime(const void *v1, const void *v2) { const time_entry_T *s1 = v1; const time_entry_T *s2 = v2; @@ -6760,7 +6652,7 @@ syn_compare_syntime(v1, v2) * Clear the syntax timing for the current buffer. */ static void -syntime_report() +syntime_report(void) { int idx; synpat_T *spp; @@ -7095,9 +6987,9 @@ static char *(highlight_init_dark[]) = }; void -init_highlight(both, reset) - int both; /* include groups where 'bg' doesn't matter */ - int reset; /* clear group first */ +init_highlight( + int both, /* include groups where 'bg' doesn't matter */ + int reset) /* clear group first */ { int i; char **pp; @@ -7193,8 +7085,7 @@ init_highlight(both, reset) * Return OK for success, FAIL for failure. */ int -load_colors(name) - char_u *name; +load_colors(char_u *name) { char_u *buf; int retval = FAIL; @@ -7228,10 +7119,10 @@ load_colors(name) * "forceit" and "init" both TRUE. */ void -do_highlight(line, forceit, init) - char_u *line; - int forceit; - int init; /* TRUE when called for initializing */ +do_highlight( + char_u *line, + int forceit, + int init) /* TRUE when called for initializing */ { char_u *name_end; char_u *p; @@ -8143,7 +8034,7 @@ do_highlight(line, forceit, init) #if defined(EXITFREE) || defined(PROTO) void -free_highlight() +free_highlight(void) { int i; @@ -8162,7 +8053,7 @@ free_highlight() * possible. Otherwise reset them to zero. */ void -restore_cterm_colors() +restore_cterm_colors(void) { #if defined(MSDOS) || (defined(WIN3264) && !defined(FEAT_GUI_W32)) /* Since t_me has been set, this probably means that the user @@ -8181,9 +8072,7 @@ restore_cterm_colors() * When "check_link" is TRUE also check for an existing link. */ static int -hl_has_settings(idx, check_link) - int idx; - int check_link; +hl_has_settings(int idx, int check_link) { return ( HL_TABLE()[idx].sg_term_attr != 0 || HL_TABLE()[idx].sg_cterm_attr != 0 @@ -8203,8 +8092,7 @@ hl_has_settings(idx, check_link) * Clear highlighting for one group. */ static void -highlight_clear(idx) - int idx; +highlight_clear(int idx) { HL_TABLE()[idx].sg_term = 0; vim_free(HL_TABLE()[idx].sg_start); @@ -8255,7 +8143,7 @@ highlight_clear(idx) * "Tooltip" colors. */ void -set_normal_colors() +set_normal_colors(void) { if (set_group_colors((char_u *)"Normal", &gui.norm_pixel, &gui.back_pixel, @@ -8299,13 +8187,13 @@ set_normal_colors() * Set the colors for "Normal", "Menu", "Tooltip" or "Scrollbar". */ static int -set_group_colors(name, fgp, bgp, do_menu, use_norm, do_tooltip) - char_u *name; - guicolor_T *fgp; - guicolor_T *bgp; - int do_menu; - int use_norm; - int do_tooltip; +set_group_colors( + char_u *name, + guicolor_T *fgp, + guicolor_T *bgp, + int do_menu, + int use_norm, + int do_tooltip) { int idx; @@ -8332,7 +8220,7 @@ set_group_colors(name, fgp, bgp, do_menu * Returns "" when it's not found or not set. */ char_u * -hl_get_font_name() +hl_get_font_name(void) { int id; char_u *s; @@ -8352,8 +8240,7 @@ hl_get_font_name() * actually chosen to be used. */ void -hl_set_font_name(font_name) - char_u *font_name; +hl_set_font_name(char_u *font_name) { int id; @@ -8370,8 +8257,8 @@ hl_set_font_name(font_name) * when the color is known. */ void -hl_set_bg_color_name(name) - char_u *name; /* must have been allocated */ +hl_set_bg_color_name( + char_u *name) /* must have been allocated */ { int id; @@ -8391,8 +8278,8 @@ hl_set_bg_color_name(name) * when the color is known. */ void -hl_set_fg_color_name(name) - char_u *name; /* must have been allocated */ +hl_set_fg_color_name( + char_u *name) /* must have been allocated */ { int id; @@ -8412,8 +8299,7 @@ hl_set_fg_color_name(name) * Returns INVALCOLOR when failed. */ static guicolor_T -color_name2handle(name) - char_u *name; +color_name2handle(char_u *name) { if (STRCMP(name, "NONE") == 0) return INVALCOLOR; @@ -8431,8 +8317,7 @@ color_name2handle(name) * Returns NOFONT when failed. */ static GuiFont -font_name2handle(name) - char_u *name; +font_name2handle(char_u *name) { if (STRCMP(name, "NONE") == 0) return NOFONT; @@ -8446,9 +8331,7 @@ font_name2handle(name) * Returns NOFONTSET when failed. */ static GuiFontset -fontset_name2handle(name, fixed_width) - char_u *name; - int fixed_width; +fontset_name2handle(char_u *name, int fixed_width) { if (STRCMP(name, "NONE") == 0) return NOFONTSET; @@ -8461,13 +8344,13 @@ fontset_name2handle(name, fixed_width) * Get the font or fontset for one highlight group. */ static void -hl_do_font(idx, arg, do_normal, do_menu, do_tooltip, free_font) - int idx; - char_u *arg; - int do_normal; /* set normal font */ - int do_menu UNUSED; /* set menu font */ - int do_tooltip UNUSED; /* set tooltip font */ - int free_font; /* free current font/fontset */ +hl_do_font( + int idx, + char_u *arg, + int do_normal, /* set normal font */ + int do_menu UNUSED, /* set menu font */ + int do_tooltip UNUSED, /* set tooltip font */ + int free_font) /* free current font/fontset */ { # ifdef FEAT_XFONTSET /* If 'guifontset' is not empty, first try using the name as a @@ -8578,9 +8461,7 @@ static garray_T gui_attr_table = {0, 0, * Return 0 for error (no more room). */ static int -get_attr_entry(table, aep) - garray_T *table; - attrentry_T *aep; +get_attr_entry(garray_T *table, attrentry_T *aep) { int i; attrentry_T *taep; @@ -8704,7 +8585,7 @@ get_attr_entry(table, aep) * Clear all highlight tables. */ void -clear_hl_tables() +clear_hl_tables(void) { int i; attrentry_T *taep; @@ -8733,9 +8614,7 @@ clear_hl_tables() * Return the resulting attributes. */ int -hl_combine_attr(char_attr, prim_attr) - int char_attr; - int prim_attr; +hl_combine_attr(int char_attr, int prim_attr) { attrentry_T *char_aep = NULL; attrentry_T *spell_aep; @@ -8851,8 +8730,7 @@ hl_combine_attr(char_attr, prim_attr) #ifdef FEAT_GUI attrentry_T * -syn_gui_attr2entry(attr) - int attr; +syn_gui_attr2entry(int attr) { attr -= ATTR_OFF; if (attr >= gui_attr_table.ga_len) /* did ":syntax clear" */ @@ -8866,8 +8744,7 @@ syn_gui_attr2entry(attr) * Only to be used when "attr" > HL_ALL. */ int -syn_attr2attr(attr) - int attr; +syn_attr2attr(int attr) { attrentry_T *aep; @@ -8888,8 +8765,7 @@ syn_attr2attr(attr) attrentry_T * -syn_term_attr2entry(attr) - int attr; +syn_term_attr2entry(int attr) { attr -= ATTR_OFF; if (attr >= term_attr_table.ga_len) /* did ":syntax clear" */ @@ -8898,8 +8774,7 @@ syn_term_attr2entry(attr) } attrentry_T * -syn_cterm_attr2entry(attr) - int attr; +syn_cterm_attr2entry(int attr) { attr -= ATTR_OFF; if (attr >= cterm_attr_table.ga_len) /* did ":syntax clear" */ @@ -8912,8 +8787,7 @@ syn_cterm_attr2entry(attr) #define LIST_INT 3 static void -highlight_list_one(id) - int id; +highlight_list_one(int id) { struct hl_group *sgp; int didh = FALSE; @@ -8967,13 +8841,13 @@ highlight_list_one(id) } static int -highlight_list_arg(id, didh, type, iarg, sarg, name) - int id; - int didh; - int type; - int iarg; - char_u *sarg; - char *name; +highlight_list_arg( + int id, + int didh, + int type, + int iarg, + char_u *sarg, + char *name) { char_u buf[100]; char_u *ts; @@ -9025,10 +8899,10 @@ highlight_list_arg(id, didh, type, iarg, * Return NULL otherwise. */ char_u * -highlight_has_attr(id, flag, modec) - int id; - int flag; - int modec; /* 'g' for GUI, 'c' for cterm, 't' for term */ +highlight_has_attr( + int id, + int flag, + int modec) /* 'g' for GUI, 'c' for cterm, 't' for term */ { int attr; @@ -9056,10 +8930,10 @@ highlight_has_attr(id, flag, modec) * Return color name of highlight group "id". */ char_u * -highlight_color(id, what, modec) - int id; - char_u *what; /* "font", "fg", "bg", "sp", "fg#", "bg#" or "sp#" */ - int modec; /* 'g' for GUI, 'c' for cterm, 't' for term */ +highlight_color( + int id, + char_u *what, /* "font", "fg", "bg", "sp", "fg#", "bg#" or "sp#" */ + int modec) /* 'g' for GUI, 'c' for cterm, 't' for term */ { static char_u name[20]; int n; @@ -9137,9 +9011,9 @@ highlight_color(id, what, modec) * Return color name of highlight group "id" as RGB value. */ long_u -highlight_gui_color_rgb(id, fg) - int id; - int fg; /* TRUE = fg, FALSE = bg */ +highlight_gui_color_rgb( + int id, + int fg) /* TRUE = fg, FALSE = bg */ { guicolor_T color; @@ -9163,10 +9037,10 @@ highlight_gui_color_rgb(id, fg) * Return TRUE when started a new line. */ static int -syn_list_header(did_header, outlen, id) - int did_header; /* did header already */ - int outlen; /* length of string that comes */ - int id; /* highlight group id */ +syn_list_header( + int did_header, /* did header already */ + int outlen, /* length of string that comes */ + int id) /* highlight group id */ { int endcol = 19; int newline = TRUE; @@ -9213,8 +9087,8 @@ syn_list_header(did_header, outlen, id) * Called after one of the attributes has changed. */ static void -set_hl_attr(idx) - int idx; /* index in array */ +set_hl_attr( + int idx) /* index in array */ { attrentry_T at_en; struct hl_group *sgp = HL_TABLE() + idx; @@ -9286,8 +9160,7 @@ set_hl_attr(idx) * If it is not found, 0 is returned. */ int -syn_name2id(name) - char_u *name; +syn_name2id(char_u *name) { int i; char_u name_u[200]; @@ -9309,8 +9182,7 @@ syn_name2id(name) * Return TRUE if highlight group "name" exists. */ int -highlight_exists(name) - char_u *name; +highlight_exists(char_u *name) { return (syn_name2id(name) > 0); } @@ -9321,8 +9193,7 @@ highlight_exists(name) * When not a valid ID return an empty string. */ char_u * -syn_id2name(id) - int id; +syn_id2name(int id) { if (id <= 0 || id > highlight_ga.ga_len) return (char_u *)""; @@ -9335,9 +9206,7 @@ syn_id2name(id) * Like syn_name2id(), but take a pointer + length argument. */ int -syn_namen2id(linep, len) - char_u *linep; - int len; +syn_namen2id(char_u *linep, int len) { char_u *name; int id = 0; @@ -9358,9 +9227,7 @@ syn_namen2id(linep, len) * Return 0 for failure. */ int -syn_check_group(pp, len) - char_u *pp; - int len; +syn_check_group(char_u *pp, int len) { int id; char_u *name; @@ -9383,8 +9250,7 @@ syn_check_group(pp, len) * Return 0 for failure. */ static int -syn_add_group(name) - char_u *name; +syn_add_group(char_u *name) { char_u *p; @@ -9450,7 +9316,7 @@ syn_add_group(name) * function deletes the new name. */ static void -syn_unadd_group() +syn_unadd_group(void) { --highlight_ga.ga_len; vim_free(HL_TABLE()[highlight_ga.ga_len].sg_name); @@ -9461,8 +9327,7 @@ syn_unadd_group() * Translate a group ID to highlight attributes. */ int -syn_id2attr(hl_id) - int hl_id; +syn_id2attr(int hl_id) { int attr; struct hl_group *sgp; @@ -9492,10 +9357,7 @@ syn_id2attr(hl_id) * NOTE: the colors will be INVALCOLOR when not set, the color otherwise. */ int -syn_id2colors(hl_id, fgp, bgp) - int hl_id; - guicolor_T *fgp; - guicolor_T *bgp; +syn_id2colors(int hl_id, guicolor_T *fgp, guicolor_T *bgp) { struct hl_group *sgp; @@ -9512,8 +9374,7 @@ syn_id2colors(hl_id, fgp, bgp) * Translate a group ID to the final group ID (following links). */ int -syn_get_final_id(hl_id) - int hl_id; +syn_get_final_id(int hl_id) { int count; struct hl_group *sgp; @@ -9542,7 +9403,7 @@ syn_get_final_id(hl_id) * It finds the font and color handles for the highlighting groups. */ void -highlight_gui_started() +highlight_gui_started(void) { int idx; @@ -9556,10 +9417,10 @@ highlight_gui_started() } static void -gui_do_one_color(idx, do_menu, do_tooltip) - int idx; - int do_menu; /* TRUE: might set the menu font */ - int do_tooltip; /* TRUE: might set the tooltip font */ +gui_do_one_color( + int idx, + int do_menu, /* TRUE: might set the menu font */ + int do_tooltip) /* TRUE: might set the tooltip font */ { int didit = FALSE; @@ -9602,7 +9463,7 @@ gui_do_one_color(idx, do_menu, do_toolti * Return FAIL when an invalid flag is found in 'highlight'. OK otherwise. */ int -highlight_changed() +highlight_changed(void) { int hlf; int i; @@ -9813,9 +9674,7 @@ static void highlight_list_two(int cnt, * Handle command line completion for :highlight command. */ void -set_context_in_highlight_cmd(xp, arg) - expand_T *xp; - char_u *arg; +set_context_in_highlight_cmd(expand_T *xp, char_u *arg) { char_u *p; @@ -9865,7 +9724,7 @@ set_context_in_highlight_cmd(xp, arg) * List highlighting matches in a nice way. */ static void -highlight_list() +highlight_list(void) { int i; @@ -9876,9 +9735,7 @@ highlight_list() } static void -highlight_list_two(cnt, attr) - int cnt; - int attr; +highlight_list_two(int cnt, int attr) { msg_puts_attr((char_u *)&("N \bI \b! \b"[cnt / 11]), attr); msg_clr_eos(); @@ -9895,9 +9752,7 @@ highlight_list_two(cnt, attr) * Also used for synIDattr() function. */ char_u * -get_highlight_name(xp, idx) - expand_T *xp UNUSED; - int idx; +get_highlight_name(expand_T *xp UNUSED, int idx) { #ifdef FEAT_CMDL_COMPL if (idx == highlight_ga.ga_len && include_none != 0) @@ -9923,7 +9778,7 @@ get_highlight_name(xp, idx) * Used when quitting for systems which need it. */ void -free_highlight_fonts() +free_highlight_fonts(void) { int idx; diff --git a/src/tag.c b/src/tag.c --- a/src/tag.c +++ b/src/tag.c @@ -121,12 +121,12 @@ static taggy_T ptag_entry = {NULL, {INIT * for cscope, returns TRUE if we jumped to tag or aborted, FALSE otherwise */ int -do_tag(tag, type, count, forceit, verbose) - char_u *tag; /* tag (pattern) to jump to */ - int type; - int count; - int forceit; /* :ta with ! */ - int verbose; /* print "tag not found" message */ +do_tag( + char_u *tag, /* tag (pattern) to jump to */ + int type, + int count, + int forceit, /* :ta with ! */ + int verbose) /* print "tag not found" message */ { taggy_T *tagstack = curwin->w_tagstack; int tagstackidx = curwin->w_tagstackidx; @@ -1092,15 +1092,14 @@ end_do_tag: * Free cached tags. */ void -tag_freematch() +tag_freematch(void) { vim_free(tagmatchname); tagmatchname = NULL; } static void -taglen_advance(l) - int l; +taglen_advance(int l) { if (l == MAXCOL) { @@ -1115,8 +1114,7 @@ taglen_advance(l) * Print the tag stack */ void -do_tags(eap) - exarg_T *eap UNUSED; +do_tags(exarg_T *eap UNUSED) { int i; char_u *name; @@ -1169,10 +1167,7 @@ static int tag_strnicmp(char_u *s1, char * Make sure case is folded to uppercase in comparison (like for 'sort -f') */ static int -tag_strnicmp(s1, s2, len) - char_u *s1; - char_u *s2; - size_t len; +tag_strnicmp(char_u *s1, char_u *s2, size_t len) { int i; @@ -1209,9 +1204,7 @@ static void prepare_pats(pat_T *pats, in * Extract info from the tag search pattern "pats->pat". */ static void -prepare_pats(pats, has_re) - pat_T *pats; - int has_re; +prepare_pats(pat_T *pats, int has_re) { pats->head = pats->pat; pats->headlen = pats->len; @@ -1267,14 +1260,14 @@ prepare_pats(pats, has_re) * TAG_KEEP_LANG keep language */ int -find_tags(pat, num_matches, matchesp, flags, mincount, buf_ffname) - char_u *pat; /* pattern to search for */ - int *num_matches; /* return: number of matches found */ - char_u ***matchesp; /* return: array of matches found */ - int flags; - int mincount; /* MAXCOL: find all matches +find_tags( + char_u *pat, /* pattern to search for */ + int *num_matches, /* return: number of matches found */ + char_u ***matchesp, /* return: array of matches found */ + int flags, + int mincount, /* MAXCOL: find all matches other: minimal number of matches */ - char_u *buf_ffname; /* name of buffer for priority */ + char_u *buf_ffname) /* name of buffer for priority */ { FILE *fp; char_u *lbuf; /* line buffer */ @@ -2577,9 +2570,7 @@ static void found_tagfile_cb(char_u *fna * 'runtimepath' doc directories. */ static void -found_tagfile_cb(fname, cookie) - char_u *fname; - void *cookie UNUSED; +found_tagfile_cb(char_u *fname, void *cookie UNUSED) { if (ga_grow(&tag_fnames, 1) == OK) ((char_u **)(tag_fnames.ga_data))[tag_fnames.ga_len++] = @@ -2588,7 +2579,7 @@ found_tagfile_cb(fname, cookie) #if defined(EXITFREE) || defined(PROTO) void -free_tag_stuff() +free_tag_stuff(void) { ga_clear_strings(&tag_fnames); do_tag(NULL, DT_FREE, 0, 0, 0); @@ -2611,10 +2602,10 @@ free_tag_stuff() * Return FAIL if no more tag file names, OK otherwise. */ int -get_tagfname(tnp, first, buf) - tagname_T *tnp; /* holds status info */ - int first; /* TRUE when first file name is wanted */ - char_u *buf; /* pointer to buffer of MAXPATHL chars */ +get_tagfname( + tagname_T *tnp, /* holds status info */ + int first, /* TRUE when first file name is wanted */ + char_u *buf) /* pointer to buffer of MAXPATHL chars */ { char_u *fname = NULL; char_u *r_ptr; @@ -2741,8 +2732,7 @@ get_tagfname(tnp, first, buf) * Free the contents of a tagname_T that was filled by get_tagfname(). */ void -tagname_free(tnp) - tagname_T *tnp; +tagname_free(tagname_T *tnp) { vim_free(tnp->tn_tags); vim_findfile_cleanup(tnp->tn_search_ctx); @@ -2759,16 +2749,12 @@ tagname_free(tnp) * Return FAIL if there is a format error in this line, OK otherwise. */ static int -parse_tag_line(lbuf, +parse_tag_line( + char_u *lbuf, /* line to be parsed */ #ifdef FEAT_EMACS_TAGS - is_etag, + int is_etag, #endif - tagp) - char_u *lbuf; /* line to be parsed */ -#ifdef FEAT_EMACS_TAGS - int is_etag; -#endif - tagptrs_T *tagp; + tagptrs_T *tagp) { char_u *p; @@ -2895,8 +2881,7 @@ etag_fail: * Return FALSE if it is not a static tag. */ static int -test_for_static(tagp) - tagptrs_T *tagp; +test_for_static(tagptrs_T *tagp) { char_u *p; @@ -2942,9 +2927,9 @@ test_for_static(tagp) * Return OK or FAIL. */ static int -parse_match(lbuf, tagp) - char_u *lbuf; /* input: matching line */ - tagptrs_T *tagp; /* output: pointers into the line */ +parse_match( + char_u *lbuf, /* input: matching line */ + tagptrs_T *tagp) /* output: pointers into the line */ { int retval; char_u *p; @@ -3022,8 +3007,7 @@ parse_match(lbuf, tagp) * Returns an allocated string or NULL (out of memory). */ static char_u * -tag_full_fname(tagp) - tagptrs_T *tagp; +tag_full_fname(tagptrs_T *tagp) { char_u *fullname; int c; @@ -3053,10 +3037,10 @@ tag_full_fname(tagp) * returns OK for success, NOTAGFILE when file not found, FAIL otherwise. */ static int -jumpto_tag(lbuf, forceit, keep_help) - char_u *lbuf; /* line from the tags file for this tag */ - int forceit; /* :ta with ! */ - int keep_help; /* keep help flag (FALSE for cscope) */ +jumpto_tag( + char_u *lbuf, /* line from the tags file for this tag */ + int forceit, /* :ta with ! */ + int keep_help) /* keep help flag (FALSE for cscope) */ { int save_secure; int save_magic; @@ -3417,10 +3401,7 @@ erret: * Returns a pointer to allocated memory (or NULL when out of memory). */ static char_u * -expand_tag_fname(fname, tag_fname, expand) - char_u *fname; - char_u *tag_fname; - int expand; +expand_tag_fname(char_u *fname, char_u *tag_fname, int expand) { char_u *p; char_u *retval; @@ -3471,8 +3452,7 @@ expand_tag_fname(fname, tag_fname, expan * length as that supplied, or shorter. */ void -simplify_filename(filename) - char_u *filename; +simplify_filename(char_u *filename) { #ifndef AMIGA /* Amiga doesn't have "..", it uses "/" */ int components = 0; @@ -3684,16 +3664,14 @@ simplify_filename(filename) * file. */ static int +test_for_current( #ifdef FEAT_EMACS_TAGS -test_for_current(is_etag, fname, fname_end, tag_fname, buf_ffname) - int is_etag; -#else -test_for_current(fname, fname_end, tag_fname, buf_ffname) + int is_etag, #endif - char_u *fname; - char_u *fname_end; - char_u *tag_fname; - char_u *buf_ffname; + char_u *fname, + char_u *fname_end, + char_u *tag_fname, + char_u *buf_ffname) { int c; int retval = FALSE; @@ -3730,8 +3708,7 @@ test_for_current(fname, fname_end, tag_f * Return OK if ";\"" is following, FAIL otherwise. */ static int -find_extra(pp) - char_u **pp; +find_extra(char_u **pp) { char_u *str = *pp; @@ -3766,11 +3743,11 @@ find_extra(pp) #if defined(FEAT_CMDL_COMPL) || defined(PROTO) int -expand_tags(tagnames, pat, num_file, file) - int tagnames; /* expand tag names */ - char_u *pat; - int *num_file; - char_u ***file; +expand_tags( + int tagnames, /* expand tag names */ + char_u *pat, + int *num_file, + char_u ***file) { int i; int c; @@ -3822,11 +3799,11 @@ static int add_tag_field(dict_T *dict, c * Return OK or FAIL. */ static int -add_tag_field(dict, field_name, start, end) - dict_T *dict; - char *field_name; - char_u *start; /* start of the value */ - char_u *end; /* after the value; can be NULL */ +add_tag_field( + dict_T *dict, + char *field_name, + char_u *start, /* start of the value */ + char_u *end) /* after the value; can be NULL */ { char_u *buf; int len = 0; @@ -3870,9 +3847,7 @@ add_tag_field(dict, field_name, start, e * as a dictionary */ int -get_tags(list, pat) - list_T *list; - char_u *pat; +get_tags(list_T *list, char_u *pat) { int num_matches, i, ret; char_u **matches, *p; diff --git a/src/term.c b/src/term.c --- a/src/term.c +++ b/src/term.c @@ -1412,8 +1412,7 @@ static int check_for_codes = FALSE; / #endif static struct builtin_term * -find_builtin_term(term) - char_u *term; +find_builtin_term(char_u *term) { struct builtin_term *p; @@ -1448,8 +1447,7 @@ find_builtin_term(term) * The terminal's name is not set, as this is already done in termcapinit(). */ static void -parse_builtin_tcap(term) - char_u *term; +parse_builtin_tcap(char_u *term) { struct builtin_term *p; char_u name[2]; @@ -1510,8 +1508,7 @@ static void set_color_count(int nr); * Store it as a string in T_CCO (using nr_colors[]). */ static void -set_color_count(nr) - int nr; +set_color_count(int nr) { char_u nr_colors[20]; /* string for number of colors */ @@ -1548,8 +1545,7 @@ static char *(key_names[]) = * While doing this, until ttest(), some options may be NULL, be careful. */ int -set_termname(term) - char_u *term; +set_termname(char_u *term) { struct builtin_term *termp; #ifdef HAVE_TGETENT @@ -2031,9 +2027,9 @@ static int has_mouse_termcode = 0; # if (!defined(UNIX) || defined(FEAT_MOUSE_TTY)) || defined(PROTO) void -set_mouse_termcode(n, s) - int n; /* KS_MOUSE, KS_NETTERM_MOUSE or KS_DEC_MOUSE */ - char_u *s; +set_mouse_termcode( + int n, /* KS_MOUSE, KS_NETTERM_MOUSE or KS_DEC_MOUSE */ + char_u *s) { char_u name[2]; @@ -2079,8 +2075,8 @@ set_mouse_termcode(n, s) # if ((defined(UNIX) || defined(VMS)) \ && defined(FEAT_MOUSE_TTY)) || defined(PROTO) void -del_mouse_termcode(n) - int n; /* KS_MOUSE, KS_NETTERM_MOUSE or KS_DEC_MOUSE */ +del_mouse_termcode( + int n) /* KS_MOUSE, KS_NETTERM_MOUSE or KS_DEC_MOUSE */ { char_u name[2]; @@ -2130,9 +2126,7 @@ del_mouse_termcode(n) * Return error message if it fails, NULL if it's OK. */ static char_u * -tgetent_error(tbuf, term) - char_u *tbuf; - char_u *term; +tgetent_error(char_u *tbuf, char_u *term) { int i; @@ -2167,9 +2161,7 @@ tgetent_error(tbuf, term) * Fix that here. */ static char_u * -vim_tgetstr(s, pp) - char *s; - char_u **pp; +vim_tgetstr(char *s, char_u **pp) { char *p; @@ -2188,9 +2180,9 @@ vim_tgetstr(s, pp) * Errors while getting the entries are ignored. */ void -getlinecol(cp, rp) - long *cp; /* pointer to columns */ - long *rp; /* pointer to rows */ +getlinecol( + long *cp, /* pointer to columns */ + long *rp) /* pointer to rows */ { char_u tbuf[TBUFSZ]; @@ -2212,9 +2204,7 @@ getlinecol(cp, rp) * Return FAIL if the entry was not found, OK if the entry was added. */ int -add_termcap_entry(name, force) - char_u *name; - int force; +add_termcap_entry(char_u *name, int force) { char_u *term; int key; @@ -2321,8 +2311,7 @@ add_termcap_entry(name, force) } static int -term_is_builtin(name) - char_u *name; +term_is_builtin(char_u *name) { return (STRNCMP(name, "builtin_", (size_t)8) == 0); } @@ -2333,8 +2322,7 @@ term_is_builtin(name) * "8bit", like in "xterm-8bit". */ int -term_is_8bit(name) - char_u *name; +term_is_8bit(char_u *name) { return (detected_8bit || strstr((char *)name, "8bit") != NULL); } @@ -2346,8 +2334,7 @@ term_is_8bit(name) * O -> */ static int -term_7to8bit(p) - char_u *p; +term_7to8bit(char_u *p) { if (*p == ESC) { @@ -2363,8 +2350,7 @@ term_7to8bit(p) #ifdef FEAT_GUI int -term_is_gui(name) - char_u *name; +term_is_gui(char_u *name) { return (STRCMP(name, "builtin_gui") == 0 || STRCMP(name, "gui") == 0); } @@ -2373,8 +2359,7 @@ term_is_gui(name) #if !defined(HAVE_TGETENT) || defined(AMIGA) || defined(PROTO) char_u * -tltoa(i) - unsigned long i; +tltoa(unsigned long i) { static char_u buf[16]; char_u *p; @@ -2401,9 +2386,7 @@ tltoa(i) static char *tgoto(char *, int, int); static char * -tgoto(cm, x, y) - char *cm; - int x, y; +tgoto(char *cm, int x, int y) { static char buf[30]; char *p, *s, *e; @@ -2453,8 +2436,7 @@ tgoto(cm, x, y) * If that fails, use the default terminal name. */ void -termcapinit(name) - char_u *name; +termcapinit(char_u *name) { char_u *term; @@ -2511,7 +2493,7 @@ static int out_pos = 0; /* number of ch * out_flush(): flush the output buffer */ void -out_flush() +out_flush(void) { int len; @@ -2530,7 +2512,7 @@ out_flush() * To avoid flushing half of the character, call this function first. */ void -out_flush_check() +out_flush_check(void) { if (enc_dbcs != 0 && out_pos >= OUT_SIZE - MB_MAXBYTES) out_flush(); @@ -2542,7 +2524,7 @@ out_flush_check() * out_trash(): Throw away the contents of the output buffer */ void -out_trash() +out_trash(void) { out_pos = 0; } @@ -2555,8 +2537,7 @@ out_trash() * like msg_puts() and screen_putchar() for that). */ void -out_char(c) - unsigned c; +out_char(unsigned c) { #if defined(UNIX) || defined(VMS) || defined(AMIGA) || defined(MACOS_X_UNIX) if (c == '\n') /* turn LF into CR-LF (CRMOD doesn't seem to do this) */ @@ -2576,8 +2557,7 @@ static void out_char_nf(unsigned); * out_char_nf(c): like out_char(), but don't flush when p_wd is set */ static void -out_char_nf(c) - unsigned c; +out_char_nf(unsigned c) { #if defined(UNIX) || defined(VMS) || defined(AMIGA) || defined(MACOS_X_UNIX) if (c == '\n') /* turn LF into CR-LF (CRMOD doesn't seem to do this) */ @@ -2602,8 +2582,7 @@ out_char_nf(c) * normal text (use functions like msg_puts() and screen_putchar() for that). */ void -out_str_nf(s) - char_u *s; +out_str_nf(char_u *s) { if (out_pos > OUT_SIZE - 20) /* avoid terminal strings being split up */ out_flush(); @@ -2623,8 +2602,7 @@ out_str_nf(s) * normal text (use functions like msg_puts() and screen_putchar() for that). */ void -out_str(s) - char_u *s; +out_str(char_u *s) { if (s != NULL && *s) { @@ -2656,39 +2634,32 @@ out_str(s) * cursor positioning using termcap parser. (jw) */ void -term_windgoto(row, col) - int row; - int col; +term_windgoto(int row, int col) { OUT_STR(tgoto((char *)T_CM, col, row)); } void -term_cursor_right(i) - int i; +term_cursor_right(int i) { OUT_STR(tgoto((char *)T_CRI, 0, i)); } void -term_append_lines(line_count) - int line_count; +term_append_lines(int line_count) { OUT_STR(tgoto((char *)T_CAL, 0, line_count)); } void -term_delete_lines(line_count) - int line_count; +term_delete_lines(int line_count) { OUT_STR(tgoto((char *)T_CDL, 0, line_count)); } #if defined(HAVE_TGETENT) || defined(PROTO) void -term_set_winpos(x, y) - int x; - int y; +term_set_winpos(int x, int y) { /* Can't handle a negative value here */ if (x < 0) @@ -2699,17 +2670,14 @@ term_set_winpos(x, y) } void -term_set_winsize(width, height) - int width; - int height; +term_set_winsize(int width, int height) { OUT_STR(tgoto((char *)T_CWS, height, width)); } #endif void -term_fg_color(n) - int n; +term_fg_color(int n) { /* Use "AF" termcap entry if present, "Sf" entry otherwise */ if (*T_CAF) @@ -2719,8 +2687,7 @@ term_fg_color(n) } void -term_bg_color(n) - int n; +term_bg_color(int n) { /* Use "AB" termcap entry if present, "Sb" entry otherwise */ if (*T_CAB) @@ -2730,9 +2697,7 @@ term_bg_color(n) } static void -term_color(s, n) - char_u *s; - int n; +term_color(char_u *s, int n) { char buf[20]; int i = 2; /* index in s[] just after [ or CSI */ @@ -2768,8 +2733,7 @@ term_color(s, n) * Generic function to set window title, using t_ts and t_fs. */ void -term_settitle(title) - char_u *title; +term_settitle(char_u *title) { /* t_ts takes one argument: column in status line */ OUT_STR(tgoto((char *)T_TS, 0, 0)); /* set title start */ @@ -2784,8 +2748,7 @@ term_settitle(title) * Replace all entries that are NULL by empty_option */ void -ttest(pairs) - int pairs; +ttest(int pairs) { check_options(); /* make sure no options are NULL */ @@ -2884,9 +2847,7 @@ ttest(pairs) * byte first, and store them in dst. */ void -add_long_to_buf(val, dst) - long_u val; - char_u *dst; +add_long_to_buf(long_u val, char_u *dst) { int i; int shift; @@ -2909,9 +2870,7 @@ static int get_long_from_buf(char_u *buf * were present. */ static int -get_long_from_buf(buf, val) - char_u *buf; - long_u *val; +get_long_from_buf(char_u *buf, long_u *val) { int len; char_u bytes[sizeof(long_u)]; @@ -2942,10 +2901,7 @@ get_long_from_buf(buf, val) * available. */ static int -get_bytes_from_buf(buf, bytes, num_bytes) - char_u *buf; - char_u *bytes; - int num_bytes; +get_bytes_from_buf(char_u *buf, char_u *bytes, int num_bytes) { int len = 0; int i; @@ -2982,7 +2938,7 @@ get_bytes_from_buf(buf, bytes, num_bytes * too big. */ void -check_shellsize() +check_shellsize(void) { if (Rows < min_rows()) /* need room for one window and command line */ Rows = min_rows(); @@ -2993,7 +2949,7 @@ check_shellsize() * Limit Rows and Columns to avoid an overflow in Rows * Columns. */ void -limit_screen_size() +limit_screen_size(void) { if (Columns < MIN_COLUMNS) Columns = MIN_COLUMNS; @@ -3007,7 +2963,7 @@ limit_screen_size() * Invoked just before the screen structures are going to be (re)allocated. */ void -win_new_shellsize() +win_new_shellsize(void) { static int old_Rows = 0; static int old_Columns = 0; @@ -3036,7 +2992,7 @@ win_new_shellsize() * Will obtain the current size and redraw (also when size didn't change). */ void -shell_resized() +shell_resized(void) { set_shellsize(0, 0, FALSE); } @@ -3046,7 +3002,7 @@ shell_resized() * When the size didn't change, nothing happens. */ void -shell_resized_check() +shell_resized_check(void) { int old_Rows = Rows; int old_Columns = Columns; @@ -3074,9 +3030,7 @@ shell_resized_check() * it fails use 'width' and 'height'. */ void -set_shellsize(width, height, mustset) - int width, height; - int mustset; +set_shellsize(int width, int height, int mustset) { static int busy = FALSE; @@ -3192,8 +3146,7 @@ set_shellsize(width, height, mustset) * commands and Ex mode). */ void -settmode(tmode) - int tmode; +settmode(int tmode) { #ifdef FEAT_GUI /* don't set the term where gvim was started to any mode */ @@ -3248,7 +3201,7 @@ settmode(tmode) } void -starttermcap() +starttermcap(void) { if (full_screen && !termcap_active) { @@ -3273,7 +3226,7 @@ starttermcap() } void -stoptermcap() +stoptermcap(void) { screen_stop_highlight(); reset_cterm_colors(); @@ -3329,7 +3282,7 @@ stoptermcap() * The result is caught in check_termcode(). */ void -may_req_termresponse() +may_req_termresponse(void) { if (crv_status == CRV_GET && cur_tmode == TMODE_RAW @@ -3363,7 +3316,7 @@ may_req_termresponse() * it must be called immediately after entering termcap mode. */ void -may_req_ambiguous_char_width() +may_req_ambiguous_char_width(void) { if (u7_status == U7_GET && cur_tmode == TMODE_RAW @@ -3404,7 +3357,7 @@ may_req_ambiguous_char_width() * color when it is the right moment. */ void -may_req_bg_color() +may_req_bg_color(void) { if (rbg_status == RBG_GET && cur_tmode == TMODE_RAW @@ -3456,7 +3409,7 @@ log_tr(char *msg) * Return TRUE when saving and restoring the screen. */ int -swapping_screen() +swapping_screen(void) { return (full_screen && *T_TI != NUL); } @@ -3466,7 +3419,7 @@ swapping_screen() * setmouse() - switch mouse on/off depending on current mode and 'mouse' */ void -setmouse() +setmouse(void) { # ifdef FEAT_MOUSE_TTY int checkfor; @@ -3521,8 +3474,7 @@ setmouse() * normal editing mode (not at hit-return message). */ int -mouse_has(c) - int c; +mouse_has(int c) { char_u *p; @@ -3544,7 +3496,7 @@ mouse_has(c) * Return TRUE when 'mousemodel' is set to "popup" or "popup_setpos". */ int -mouse_model_popup() +mouse_model_popup(void) { return (p_mousem[0] == 'p'); } @@ -3556,7 +3508,7 @@ mouse_model_popup() * Used when starting Vim or returning from a shell. */ void -scroll_start() +scroll_start(void) { if (*T_VS != NUL) { @@ -3572,7 +3524,7 @@ static int cursor_is_off = FALSE; * Enable the cursor. */ void -cursor_on() +cursor_on(void) { if (cursor_is_off) { @@ -3585,7 +3537,7 @@ cursor_on() * Disable the cursor. */ void -cursor_off() +cursor_off(void) { if (full_screen) { @@ -3600,7 +3552,7 @@ cursor_off() * Set cursor shape to match Insert or Replace mode. */ void -term_cursor_shape() +term_cursor_shape(void) { static int showing_mode = NORMAL; char_u *p; @@ -3648,9 +3600,7 @@ term_cursor_shape() * the full width of the window, excluding the vertical separator. */ void -scroll_region_set(wp, off) - win_T *wp; - int off; +scroll_region_set(win_T *wp, int off) { OUT_STR(tgoto((char *)T_CS, W_WINROW(wp) + wp->w_height - 1, W_WINROW(wp) + off)); @@ -3666,7 +3616,7 @@ scroll_region_set(wp, off) * Reset scrolling region to the whole screen. */ void -scroll_region_reset() +scroll_region_reset(void) { OUT_STR(tgoto((char *)T_CS, (int)Rows - 1, 0)); #ifdef FEAT_VERTSPLIT @@ -3695,7 +3645,7 @@ static int tc_len = 0; /* current n static int termcode_star(char_u *code, int len); void -clear_termcodes() +clear_termcodes(void) { while (tc_len > 0) vim_free(termcodes[--tc_len].code); @@ -3722,10 +3672,7 @@ clear_termcodes() * "flags" can also be ATC_FROM_TERM for got_code_from_term(). */ void -add_termcode(name, string, flags) - char_u *name; - char_u *string; - int flags; +add_termcode(char_u *name, char_u *string, int flags) { struct termcode *new_tc; int i, j; @@ -3854,9 +3801,7 @@ add_termcode(name, string, flags) * Return 0 if not found, 2 for ;*X and 1 for O*X and *X. */ static int -termcode_star(code, len) - char_u *code; - int len; +termcode_star(char_u *code, int len) { /* Shortest is *X. With ; shortest is 1;*X */ if (len >= 3 && code[len - 2] == '*') @@ -3870,8 +3815,7 @@ termcode_star(code, len) } char_u * -find_termcode(name) - char_u *name; +find_termcode(char_u *name) { int i; @@ -3883,8 +3827,7 @@ find_termcode(name) #if defined(FEAT_CMDL_COMPL) || defined(PROTO) char_u * -get_termcode(i) - int i; +get_termcode(int i) { if (i >= tc_len) return NULL; @@ -3893,8 +3836,7 @@ get_termcode(i) #endif void -del_termcode(name) - char_u *name; +del_termcode(char_u *name) { int i; @@ -3913,8 +3855,7 @@ del_termcode(name) } static void -del_termcode_idx(idx) - int idx; +del_termcode_idx(int idx) { int i; @@ -3930,7 +3871,7 @@ del_termcode_idx(idx) * Convert all 7-bit codes to their 8-bit equivalent. */ static void -switch_to_8bit() +switch_to_8bit(void) { int i; int c; @@ -3971,8 +3912,7 @@ static int orig_topfill = 0; * click still works. */ void -set_mouse_topline(wp) - win_T *wp; +set_mouse_topline(win_T *wp) { orig_topline = wp->w_topline; # ifdef FEAT_DIFF @@ -3995,11 +3935,11 @@ set_mouse_topline(wp) * inserts and deletes. */ int -check_termcode(max_offset, buf, bufsize, buflen) - int max_offset; - char_u *buf; - int bufsize; - int *buflen; +check_termcode( + int max_offset, + char_u *buf, + int bufsize, + int *buflen) { char_u *tp; char_u *p; @@ -5459,12 +5399,12 @@ check_termcode(max_offset, buf, bufsize, * instead of a CTRL-V. */ char_u * -replace_termcodes(from, bufp, from_part, do_lt, special) - char_u *from; - char_u **bufp; - int from_part; - int do_lt; /* also translate */ - int special; /* always accept notation */ +replace_termcodes( + char_u *from, + char_u **bufp, + int from_part, + int do_lt, /* also translate */ + int special) /* always accept notation */ { int i; int slen; @@ -5673,8 +5613,7 @@ replace_termcodes(from, bufp, from_part, * Return the index in termcodes[], or -1 if not found. */ int -find_term_bykeys(src) - char_u *src; +find_term_bykeys(char_u *src) { int i; int slen = (int)STRLEN(src); @@ -5693,7 +5632,7 @@ find_term_bykeys(src) * Used to speed up check_termcode(). */ static void -gather_termleader() +gather_termleader(void) { int i; int len = 0; @@ -5724,7 +5663,7 @@ gather_termleader() * This code looks a lot like showoptions(), but is different. */ void -show_termcodes() +show_termcodes(void) { int col; int *items; @@ -5810,10 +5749,7 @@ show_termcodes() * Output goes into IObuff[] */ int -show_one_termcode(name, code, printit) - char_u *name; - char_u *code; - int printit; +show_one_termcode(char_u *name, char_u *code, int printit) { char_u *p; int len; @@ -5870,7 +5806,7 @@ static int xt_index_in = 0; static int xt_index_out = 0; static void -req_codes_from_term() +req_codes_from_term(void) { xt_index_out = 0; xt_index_in = 0; @@ -5878,7 +5814,7 @@ req_codes_from_term() } static void -req_more_codes_from_term() +req_more_codes_from_term(void) { char buf[11]; int old_idx = xt_index_out; @@ -5916,9 +5852,7 @@ req_more_codes_from_term() * "code" points to the "0" or "1". */ static void -got_code_from_term(code, len) - char_u *code; - int len; +got_code_from_term(char_u *code, int len) { #define XT_LEN 100 char_u name[3]; @@ -6006,7 +5940,7 @@ got_code_from_term(code, len) * handled as typed text. */ static void -check_for_codes_from_term() +check_for_codes_from_term(void) { int c; @@ -6058,9 +5992,9 @@ check_for_codes_from_term() * Returns NULL when there is a problem. */ char_u * -translate_mapping(str, expmap) - char_u *str; - int expmap; /* TRUE when expanding mappings on command-line */ +translate_mapping( + char_u *str, + int expmap) /* TRUE when expanding mappings on command-line */ { garray_T ga; int c; @@ -6148,8 +6082,7 @@ static char ksmd_str[20]; * For Win32 console: update termcap codes for existing console attributes. */ void -update_tcap(attr) - int attr; +update_tcap(int attr) { struct builtin_term *p; diff --git a/src/termlib.c b/src/termlib.c --- a/src/termlib.c +++ b/src/termlib.c @@ -66,9 +66,9 @@ short ospeed; /* Baud rate (1-16, #endif int -tgetent(tbuf, term) - char *tbuf; /* Buffer to hold termcap entry, TBUFSZ bytes max */ - char *term; /* Name of terminal */ +tgetent( + char *tbuf, /* Buffer to hold termcap entry, TBUFSZ bytes max */ + char *term) /* Name of terminal */ { char tcbuf[32]; /* Temp buffer to handle */ char *tcptr = tcbuf; /* extended entries */ @@ -140,10 +140,7 @@ tgetent(tbuf, term) } static int -getent(tbuf, term, termcap, buflen) - char *tbuf, *term; - FILE *termcap; - int buflen; +getent(char *tbuf, *term, FILE *termcap, int buflen) { char *tptr; int tlen = strlen(term); @@ -171,11 +168,11 @@ getent(tbuf, term, termcap, buflen) return 0; } +/* + * Read 1 entry from TERMCAP file. + */ static int -nextent(tbuf, termcap, buflen) /* Read 1 entry from TERMCAP file */ - char *tbuf; - FILE *termcap; - int buflen; +nextent(char *tbuf, FILE *termcap, int buflen) { char *lbuf = tbuf; /* lbuf=line buffer */ /* read lines straight into buffer */ @@ -218,8 +215,7 @@ nextent(tbuf, termcap, buflen) /* Read */ int -tgetflag(id) - char *id; +tgetflag(char *id) { char buf[256], *ptr = buf; @@ -237,8 +233,7 @@ tgetflag(id) */ int -tgetnum(id) - char *id; +tgetnum(char *id) { char *ptr, buf[256]; ptr = buf; @@ -277,8 +272,7 @@ tgetnum(id) */ char * -tgetstr(id, buf) - char *id, **buf; +tgetstr(char *id, char **buf) { int len = strlen(id); char *tmp=tent; @@ -387,10 +381,10 @@ tgetstr(id, buf) */ char * -tgoto(cm, col, line) - char *cm; /* cm string, from termcap */ - int col, /* column, x position */ - line; /* line, y position */ +tgoto( + char *cm, /* cm string, from termcap */ + int col, /* column, x position */ + int line) /* line, y position */ { char gx, gy, /* x, y */ *ptr, /* pointer in 'cm' */ @@ -533,10 +527,10 @@ long _bauds[16]={ 4800, 9600, 19200, 19200 }; int -tputs(cp, affcnt, outc) - char *cp; /* string to print */ - int affcnt; /* Number of lines affected */ - void (*outc)(unsigned int);/* routine to output 1 character */ +tputs( + char *cp, /* string to print */ + int affcnt, /* Number of lines affected */ + void (*outc)(unsigned int)) /* routine to output 1 character */ { long frac, /* 10^(#digits after decimal point) */ counter, /* digits */ @@ -578,11 +572,10 @@ tputs(cp, affcnt, outc) * Module: tutil.c * * Purpose: Utility routines for TERMLIB functions. - * + * Returns length of text common to s1 and s2. */ static int -_match(s1, s2) /* returns length of text common to s1 and s2 */ - char *s1, *s2; +_match(char *s1, char *s2) { int i = 0; @@ -596,8 +589,7 @@ tputs(cp, affcnt, outc) * finds next c in s that's a member of set, returns pointer */ static char * -_find(s, set) - char *s, *set; +_find(char *s, char *set) { for(; *s; s++) { @@ -617,9 +609,7 @@ tputs(cp, affcnt, outc) * add val to buf according to format fmt */ static char * -_addfmt(buf, fmt, val) - char *buf, *fmt; - int val; +_addfmt(char *buf, char *fmt, int val) { sprintf(buf, fmt, val); while (*buf) diff --git a/src/ui.c b/src/ui.c --- a/src/ui.c +++ b/src/ui.c @@ -25,9 +25,7 @@ #endif void -ui_write(s, len) - char_u *s; - int len; +ui_write(char_u *s, int len) { #ifdef FEAT_GUI if (gui.in_use && !gui.dying && !gui.starting) @@ -75,9 +73,7 @@ static int ta_off; /* offset for next ch static int ta_len; /* length of ta_str when it's not NULL*/ void -ui_inchar_undo(s, len) - char_u *s; - int len; +ui_inchar_undo(char_u *s, int len) { char_u *new; int newlen; @@ -117,11 +113,11 @@ ui_inchar_undo(s, len) * otherwise. */ int -ui_inchar(buf, maxlen, wtime, tb_change_cnt) - char_u *buf; - int maxlen; - long wtime; /* don't use "time", MIPS cannot handle it */ - int tb_change_cnt; +ui_inchar( + char_u *buf, + int maxlen, + long wtime, /* don't use "time", MIPS cannot handle it */ + int tb_change_cnt) { int retval = 0; @@ -220,7 +216,7 @@ theend: * return non-zero if a character is available */ int -ui_char_avail() +ui_char_avail(void) { #ifdef FEAT_GUI if (gui.in_use) @@ -245,9 +241,7 @@ ui_char_avail() * cancel the delay if a key is hit. */ void -ui_delay(msec, ignoreinput) - long msec; - int ignoreinput; +ui_delay(long msec, int ignoreinput) { #ifdef FEAT_GUI if (gui.in_use && !ignoreinput) @@ -263,7 +257,7 @@ ui_delay(msec, ignoreinput) * When running the GUI iconify the window. */ void -ui_suspend() +ui_suspend(void) { #ifdef FEAT_GUI if (gui.in_use) @@ -281,7 +275,7 @@ ui_suspend() * This is never called in the GUI. */ void -suspend_shell() +suspend_shell(void) { if (*p_sh == NUL) EMSG(_(e_shellempty)); @@ -299,7 +293,7 @@ suspend_shell() * Return OK when size could be determined, FAIL otherwise. */ int -ui_get_shellsize() +ui_get_shellsize(void) { int retval; @@ -327,8 +321,8 @@ ui_get_shellsize() * new size. If this is not possible, it will adjust Rows and Columns. */ void -ui_set_shellsize(mustset) - int mustset UNUSED; /* set by the user */ +ui_set_shellsize( + int mustset UNUSED) /* set by the user */ { #ifdef FEAT_GUI if (gui.in_use) @@ -343,7 +337,7 @@ ui_set_shellsize(mustset) * region. */ void -ui_new_shellsize() +ui_new_shellsize(void) { if (full_screen && !exiting) { @@ -357,7 +351,7 @@ ui_new_shellsize() } void -ui_breakcheck() +ui_breakcheck(void) { #ifdef FEAT_GUI if (gui.in_use) @@ -395,8 +389,7 @@ static void clip_copy_selection(VimClipb * the GUI starts. */ void -clip_init(can_use) - int can_use; +clip_init(int can_use) { VimClipboard *cb; @@ -425,8 +418,7 @@ clip_init(can_use) * this is called whenever VIsual mode is ended. */ void -clip_update_selection(clip) - VimClipboard *clip; +clip_update_selection(VimClipboard *clip) { pos_T start, end; @@ -463,8 +455,7 @@ clip_update_selection(clip) } void -clip_own_selection(cbd) - VimClipboard *cbd; +clip_own_selection(VimClipboard *cbd) { /* * Also want to check somehow that we are reading from the keyboard rather @@ -500,8 +491,7 @@ clip_own_selection(cbd) } void -clip_lose_selection(cbd) - VimClipboard *cbd; +clip_lose_selection(VimClipboard *cbd) { #ifdef FEAT_X11 int was_owned = cbd->owned; @@ -543,8 +533,7 @@ clip_lose_selection(cbd) } static void -clip_copy_selection(clip) - VimClipboard *clip; +clip_copy_selection(VimClipboard *clip) { if (VIsual_active && (State & NORMAL) && clip->available) { @@ -569,7 +558,7 @@ static int clipboard_needs_update; /* cl * Save clip_unnamed and reset it. */ void -start_global_changes() +start_global_changes(void) { if (++global_change_count > 1) return; @@ -587,7 +576,7 @@ start_global_changes() * Restore clip_unnamed and set the selection when needed. */ void -end_global_changes() +end_global_changes(void) { if (--global_change_count > 0) /* recursive */ @@ -619,7 +608,7 @@ end_global_changes() * Called when Visual mode is ended: update the selection. */ void -clip_auto_select() +clip_auto_select(void) { if (clip_isautosel_star()) clip_copy_selection(&clip_star); @@ -632,7 +621,7 @@ clip_auto_select() * register. */ int -clip_isautosel_star() +clip_isautosel_star(void) { return ( #ifdef FEAT_GUI @@ -646,7 +635,7 @@ clip_isautosel_star() * register. */ int -clip_isautosel_plus() +clip_isautosel_plus(void) { return ( #ifdef FEAT_GUI @@ -678,10 +667,7 @@ static void clip_update_modeless_selecti * command-line and in the cmdline window. */ void -clip_modeless(button, is_click, is_drag) - int button; - int is_click; - int is_drag; +clip_modeless(int button, int is_click, int is_drag) { int repeat; @@ -715,11 +701,11 @@ clip_modeless(button, is_click, is_drag) * Compare two screen positions ala strcmp() */ static int -clip_compare_pos(row1, col1, row2, col2) - int row1; - int col1; - int row2; - int col2; +clip_compare_pos( + int row1, + int col1, + int row2, + int col2) { if (row1 > row2) return(1); if (row1 < row2) return(-1); @@ -732,10 +718,7 @@ clip_compare_pos(row1, col1, row2, col2) * Start the selection */ void -clip_start_selection(col, row, repeated_click) - int col; - int row; - int repeated_click; +clip_start_selection(int col, int row, int repeated_click) { VimClipboard *cb = &clip_star; @@ -805,11 +788,11 @@ clip_start_selection(col, row, repeated_ * Continue processing the selection */ void -clip_process_selection(button, col, row, repeated_click) - int button; - int col; - int row; - int_u repeated_click; +clip_process_selection( + int button, + int col, + int row, + int_u repeated_click) { VimClipboard *cb = &clip_star; int diff; @@ -990,9 +973,7 @@ clip_process_selection(button, col, row, * Only used for the GUI. */ void -clip_may_redraw_selection(row, col, len) - int row, col; - int len; +clip_may_redraw_selection(int row, int col, int len) { int start = col; int end = col + len; @@ -1015,8 +996,7 @@ clip_may_redraw_selection(row, col, len) * Called from outside to clear selected region from the display */ void -clip_clear_selection(cbd) - VimClipboard *cbd; +clip_clear_selection(VimClipboard *cbd) { if (cbd->state == SELECT_CLEARED) @@ -1031,8 +1011,7 @@ clip_clear_selection(cbd) * Clear the selection if any lines from "row1" to "row2" are inside of it. */ void -clip_may_clear_selection(row1, row2) - int row1, row2; +clip_may_clear_selection(int row1, int row2) { if (clip_star.state == SELECT_DONE && row2 >= clip_star.start.lnum @@ -1045,8 +1024,8 @@ clip_may_clear_selection(row1, row2) * of the selection. Call with big number when clearing the screen. */ void -clip_scroll_selection(rows) - int rows; /* negative for scroll down */ +clip_scroll_selection( + int rows) /* negative for scroll down */ { int lnum; @@ -1079,12 +1058,12 @@ clip_scroll_selection(rows) * 0: invert (GUI only). */ static void -clip_invert_area(row1, col1, row2, col2, how) - int row1; - int col1; - int row2; - int col2; - int how; +clip_invert_area( + int row1, + int col1, + int row2, + int col2, + int how) { int invert = FALSE; @@ -1139,12 +1118,12 @@ clip_invert_area(row1, col1, row2, col2, * "invert" is true if the result is inverted. */ static void -clip_invert_rectangle(row, col, height, width, invert) - int row; - int col; - int height; - int width; - int invert; +clip_invert_rectangle( + int row, + int col, + int height, + int width, + int invert) { #ifdef FEAT_GUI if (gui.in_use) @@ -1160,8 +1139,7 @@ clip_invert_rectangle(row, col, height, * When "both" is TRUE also copy to the '+' register. */ void -clip_copy_modeless_selection(both) - int both UNUSED; +clip_copy_modeless_selection(int both UNUSED) { char_u *buffer; char_u *bufp; @@ -1344,10 +1322,7 @@ clip_copy_modeless_selection(both) #define CHAR_CLASS(c) (c <= ' ' ? ' ' : vim_iswordc(c)) static void -clip_get_word_boundaries(cb, row, col) - VimClipboard *cb; - int row; - int col; +clip_get_word_boundaries(VimClipboard *cb, int row, int col) { int start_class; int temp_col; @@ -1406,8 +1381,7 @@ clip_get_word_boundaries(cb, row, col) * line. */ static int -clip_get_line_end(row) - int row; +clip_get_line_end(int row) { int i; @@ -1424,12 +1398,12 @@ clip_get_line_end(row) * beginning or end and inverting the changed area(s). */ static void -clip_update_modeless_selection(cb, row1, col1, row2, col2) - VimClipboard *cb; - int row1; - int col1; - int row2; - int col2; +clip_update_modeless_selection( + VimClipboard *cb, + int row1, + int col1, + int row2, + int col2) { /* See if we changed at the beginning of the selection */ if (row1 != cb->start.lnum || col1 != (int)cb->start.col) @@ -1451,8 +1425,7 @@ clip_update_modeless_selection(cb, row1, } int -clip_gen_own_selection(cbd) - VimClipboard *cbd; +clip_gen_own_selection(VimClipboard *cbd) { #ifdef FEAT_XCLIPBOARD # ifdef FEAT_GUI @@ -1467,8 +1440,7 @@ clip_gen_own_selection(cbd) } void -clip_gen_lose_selection(cbd) - VimClipboard *cbd; +clip_gen_lose_selection(VimClipboard *cbd) { #ifdef FEAT_XCLIPBOARD # ifdef FEAT_GUI @@ -1483,8 +1455,7 @@ clip_gen_lose_selection(cbd) } void -clip_gen_set_selection(cbd) - VimClipboard *cbd; +clip_gen_set_selection(VimClipboard *cbd) { if (!clip_did_set_selection) { @@ -1510,8 +1481,7 @@ clip_gen_set_selection(cbd) } void -clip_gen_request_selection(cbd) - VimClipboard *cbd; +clip_gen_request_selection(VimClipboard *cbd) { #ifdef FEAT_XCLIPBOARD # ifdef FEAT_GUI @@ -1526,8 +1496,7 @@ clip_gen_request_selection(cbd) } int -clip_gen_owner_exists(cbd) - VimClipboard *cbd UNUSED; +clip_gen_owner_exists(VimClipboard *cbd UNUSED) { #ifdef FEAT_XCLIPBOARD # ifdef FEAT_GUI_GTK @@ -1584,20 +1553,20 @@ static int inbufcount = 0; /* number */ int -vim_is_input_buf_full() +vim_is_input_buf_full(void) { return (inbufcount >= INBUFLEN); } int -vim_is_input_buf_empty() +vim_is_input_buf_empty(void) { return (inbufcount == 0); } #if defined(FEAT_OLE) || defined(PROTO) int -vim_free_in_input_buf() +vim_free_in_input_buf(void) { return (INBUFLEN - inbufcount); } @@ -1605,7 +1574,7 @@ vim_free_in_input_buf() #if defined(FEAT_GUI_GTK) || defined(PROTO) int -vim_used_in_input_buf() +vim_used_in_input_buf(void) { return inbufcount; } @@ -1617,7 +1586,7 @@ vim_used_in_input_buf() * The returned pointer must be passed to set_input_buf() later. */ char_u * -get_input_buf() +get_input_buf(void) { garray_T *gap; @@ -1640,8 +1609,7 @@ get_input_buf() * The allocated memory is freed, this only works once! */ void -set_input_buf(p) - char_u *p; +set_input_buf(char_u *p) { garray_T *gap = (garray_T *)p; @@ -1669,9 +1637,7 @@ set_input_buf(p) * CSI KS_EXTRA KE_CSI. K_SPECIAL doesn't require translation. */ void -add_to_input_buf(s, len) - char_u *s; - int len; +add_to_input_buf(char_u *s, int len) { if (inbufcount + len > INBUFLEN + MAX_KEY_CODE_LEN) return; /* Shouldn't ever happen! */ @@ -1719,9 +1685,7 @@ add_to_input_buf_csi(char_u *str, int le #if defined(FEAT_HANGULIN) || defined(PROTO) void -push_raw_key(s, len) - char_u *s; - int len; +push_raw_key(char_u *s, int len) { char_u *tmpbuf; @@ -1741,7 +1705,7 @@ push_raw_key(s, len) || defined(PROTO) /* Remove everything from the input buffer. Called when ^C is found */ void -trash_input_buf() +trash_input_buf(void) { inbufcount = 0; } @@ -1753,9 +1717,7 @@ trash_input_buf() * Note: this function used to be Read() in unix.c */ int -read_from_input_buf(buf, maxlen) - char_u *buf; - long maxlen; +read_from_input_buf(char_u *buf, long maxlen) { if (inbufcount == 0) /* if the buffer is empty, fill it */ fill_input_buf(TRUE); @@ -1769,8 +1731,7 @@ read_from_input_buf(buf, maxlen) } void -fill_input_buf(exit_on_error) - int exit_on_error UNUSED; +fill_input_buf(int exit_on_error UNUSED) { #if defined(UNIX) || defined(VMS) || defined(MACOS_X_UNIX) int len; @@ -1948,7 +1909,7 @@ fill_input_buf(exit_on_error) * Exit because of an input read error. */ void -read_error_exit() +read_error_exit(void) { if (silent_mode) /* Normal way to exit for "ex -s" */ getout(0); @@ -1961,7 +1922,7 @@ read_error_exit() * May update the shape of the cursor. */ void -ui_cursor_shape() +ui_cursor_shape(void) { # ifdef FEAT_GUI if (gui.in_use) @@ -1986,8 +1947,7 @@ ui_cursor_shape() * Check bounds for column number */ int -check_col(col) - int col; +check_col(int col) { if (col < 0) return 0; @@ -2000,8 +1960,7 @@ check_col(col) * Check bounds for row number */ int -check_row(row) - int row; +check_row(int row) { if (row < 0) return 0; @@ -2024,7 +1983,7 @@ check_row(row) * Used for Motif and Athena GUI and the xterm clipboard. */ void -open_app_context() +open_app_context(void) { if (app_context == NULL) { @@ -2044,8 +2003,7 @@ static Atom targets_atom; static Atom timestamp_atom; /* Used to get a timestamp */ void -x11_setup_atoms(dpy) - Display *dpy; +x11_setup_atoms(Display *dpy) { vim_atom = XInternAtom(dpy, VIM_ATOM_NAME, False); #ifdef FEAT_MBYTE @@ -2073,11 +2031,11 @@ static void clip_x11_request_selection_ * Property callback to get a timestamp for XtOwnSelection. */ static void -clip_x11_timestamp_cb(w, n, event, cont) - Widget w; - XtPointer n UNUSED; - XEvent *event; - Boolean *cont UNUSED; +clip_x11_timestamp_cb( + Widget w, + XtPointer n UNUSED, + XEvent *event, + Boolean *cont UNUSED) { Atom actual_type; int format; @@ -2119,23 +2077,21 @@ clip_x11_timestamp_cb(w, n, event, cont) } void -x11_setup_selection(w) - Widget w; +x11_setup_selection(Widget w) { XtAddEventHandler(w, PropertyChangeMask, False, /*(XtEventHandler)*/clip_x11_timestamp_cb, (XtPointer)NULL); } static void -clip_x11_request_selection_cb(w, success, sel_atom, type, value, length, - format) - Widget w UNUSED; - XtPointer success; - Atom *sel_atom; - Atom *type; - XtPointer value; - long_u *length; - int *format; +clip_x11_request_selection_cb( + Widget w UNUSED, + XtPointer success, + Atom *sel_atom, + Atom *type, + XtPointer value, + long_u *length, + int *format) { int motion_type = MAUTO; long_u len; @@ -2241,10 +2197,10 @@ clip_x11_request_selection_cb(w, success } void -clip_x11_request_selection(myShell, dpy, cbd) - Widget myShell; - Display *dpy; - VimClipboard *cbd; +clip_x11_request_selection( + Widget myShell, + Display *dpy, + VimClipboard *cbd) { XEvent event; Atom type; @@ -2346,14 +2302,14 @@ clip_x11_request_selection(myShell, dpy, } static Boolean -clip_x11_convert_selection_cb(w, sel_atom, target, type, value, length, format) - Widget w UNUSED; - Atom *sel_atom; - Atom *target; - Atom *type; - XtPointer *value; - long_u *length; - int *format; +clip_x11_convert_selection_cb( + Widget w UNUSED, + Atom *sel_atom, + Atom *target, + Atom *type, + XtPointer *value, + long_u *length, + int *format) { char_u *string; char_u *result; @@ -2488,9 +2444,7 @@ clip_x11_convert_selection_cb(w, sel_ato } static void -clip_x11_lose_ownership_cb(w, sel_atom) - Widget w UNUSED; - Atom *sel_atom; +clip_x11_lose_ownership_cb(Widget w UNUSED, Atom *sel_atom) { if (*sel_atom == clip_plus.sel_atom) clip_lose_selection(&clip_plus); @@ -2499,18 +2453,14 @@ clip_x11_lose_ownership_cb(w, sel_atom) } void -clip_x11_lose_selection(myShell, cbd) - Widget myShell; - VimClipboard *cbd; +clip_x11_lose_selection(Widget myShell, VimClipboard *cbd) { XtDisownSelection(myShell, cbd->sel_atom, XtLastTimestampProcessed(XtDisplay(myShell))); } int -clip_x11_own_selection(myShell, cbd) - Widget myShell; - VimClipboard *cbd; +clip_x11_own_selection(Widget myShell, VimClipboard *cbd) { /* When using the GUI we have proper timestamps, use the one of the last * event. When in the console we don't get events (the terminal gets @@ -2542,14 +2492,12 @@ clip_x11_own_selection(myShell, cbd) * will fill in the selection only when requested by another app. */ void -clip_x11_set_selection(cbd) - VimClipboard *cbd UNUSED; +clip_x11_set_selection(VimClipboard *cbd UNUSED) { } int -clip_x11_owner_exists(cbd) - VimClipboard *cbd; +clip_x11_owner_exists(VimClipboard *cbd) { return XGetSelectionOwner(X_DISPLAY, cbd->sel_atom) != None; } @@ -2561,9 +2509,7 @@ clip_x11_owner_exists(cbd) * Get the contents of the X CUT_BUFFER0 and put it in "cbd". */ void -yank_cut_buffer0(dpy, cbd) - Display *dpy; - VimClipboard *cbd; +yank_cut_buffer0(Display *dpy, VimClipboard *cbd) { int nbytes = 0; char_u *buffer = (char_u *)XFetchBuffer(dpy, &nbytes, 0); @@ -2638,10 +2584,10 @@ yank_cut_buffer0(dpy, cbd) * remembered. */ int -jump_to_mouse(flags, inclusive, which_button) - int flags; - int *inclusive; /* used for inclusive operator, can be NULL */ - int which_button; /* MOUSE_LEFT, MOUSE_RIGHT, MOUSE_MIDDLE */ +jump_to_mouse( + int flags, + int *inclusive, /* used for inclusive operator, can be NULL */ + int which_button) /* MOUSE_LEFT, MOUSE_RIGHT, MOUSE_MIDDLE */ { static int on_status_line = 0; /* #lines below bottom of window */ #ifdef FEAT_VERTSPLIT @@ -3051,11 +2997,11 @@ retnomove: * Returns TRUE if the position is below the last line. */ int -mouse_comp_pos(win, rowp, colp, lnump) - win_T *win; - int *rowp; - int *colp; - linenr_T *lnump; +mouse_comp_pos( + win_T *win, + int *rowp, + int *colp, + linenr_T *lnump) { int col = *colp; int row = *rowp; @@ -3140,9 +3086,7 @@ mouse_comp_pos(win, rowp, colp, lnump) * updated to become relative to the top-left of the window. */ win_T * -mouse_find_win(rowp, colp) - int *rowp; - int *colp UNUSED; +mouse_find_win(int *rowp, int *colp UNUSED) { frame_T *fp; @@ -3184,8 +3128,7 @@ mouse_find_win(rowp, colp) * Translate window coordinates to buffer position without any side effects */ int -get_fpos_of_mouse(mpos) - pos_T *mpos; +get_fpos_of_mouse(pos_T *mpos) { win_T *wp; int row = mouse_row; @@ -3232,10 +3175,7 @@ get_fpos_of_mouse(mpos) * The first column is one. */ int -vcol2col(wp, lnum, vcol) - win_T *wp; - linenr_T lnum; - int vcol; +vcol2col(win_T *wp, linenr_T lnum, int vcol) { /* try to advance to the specified column */ int count = 0; @@ -3260,8 +3200,8 @@ vcol2col(wp, lnum, vcol) * be done in the console (Win32). */ void -ui_focus_change(in_focus) - int in_focus; /* TRUE if focus gained. */ +ui_focus_change( + int in_focus) /* TRUE if focus gained. */ { static time_t last_time = (time_t)0; int need_redraw = FALSE; @@ -3329,8 +3269,7 @@ ui_focus_change(in_focus) * Save current Input Method status to specified place. */ void -im_save_status(psave) - long *psave; +im_save_status(long *psave) { /* Don't save when 'imdisable' is set or "xic" is NULL, IM is always * disabled then (but might start later). diff --git a/src/undo.c b/src/undo.c --- a/src/undo.c +++ b/src/undo.c @@ -246,7 +246,7 @@ u_check(int newhead_may_be_NULL) * Returns OK or FAIL. */ int -u_save_cursor() +u_save_cursor(void) { return (u_save((linenr_T)(curwin->w_cursor.lnum - 1), (linenr_T)(curwin->w_cursor.lnum + 1))); @@ -259,8 +259,7 @@ u_save_cursor() * Returns FAIL when lines could not be saved, OK otherwise. */ int -u_save(top, bot) - linenr_T top, bot; +u_save(linenr_T top, linenr_T bot) { if (undo_off) return OK; @@ -283,8 +282,7 @@ u_save(top, bot) * Returns FAIL when lines could not be saved, OK otherwise. */ int -u_savesub(lnum) - linenr_T lnum; +u_savesub(linenr_T lnum) { if (undo_off) return OK; @@ -299,8 +297,7 @@ u_savesub(lnum) * Returns FAIL when lines could not be saved, OK otherwise. */ int -u_inssub(lnum) - linenr_T lnum; +u_inssub(linenr_T lnum) { if (undo_off) return OK; @@ -316,9 +313,7 @@ u_inssub(lnum) * Returns FAIL when lines could not be saved, OK otherwise. */ int -u_savedel(lnum, nlines) - linenr_T lnum; - long nlines; +u_savedel(linenr_T lnum, long nlines) { if (undo_off) return OK; @@ -332,7 +327,7 @@ u_savedel(lnum, nlines) * return FALSE. */ int -undo_allowed() +undo_allowed(void) { /* Don't allow changes when 'modifiable' is off. */ if (!curbuf->b_p_ma) @@ -365,7 +360,7 @@ undo_allowed() * Get the undolevle value for the current buffer. */ static long -get_undolevel() +get_undolevel(void) { if (curbuf->b_p_ul == NO_LOCAL_UNDOLEVEL) return p_ul; @@ -382,10 +377,11 @@ get_undolevel() * Returns FAIL when lines could not be saved, OK otherwise. */ int -u_savecommon(top, bot, newbot, reload) - linenr_T top, bot; - linenr_T newbot; - int reload; +u_savecommon( + linenr_T top, + linenr_T bot, + linenr_T newbot, + int reload) { linenr_T lnum; long i; @@ -749,8 +745,7 @@ static char_u e_not_open[] = N_("E828: C * Compute the hash for the current buffer text into hash[UNDO_HASH_SIZE]. */ void -u_compute_hash(hash) - char_u *hash; +u_compute_hash(char_u *hash) { context_sha256_T ctx; linenr_T lnum; @@ -773,9 +768,7 @@ u_compute_hash(hash) * Returns NULL when there is no place to write or no file to read. */ char_u * -u_get_undo_file_name(buf_ffname, reading) - char_u *buf_ffname; - int reading; +u_get_undo_file_name(char_u *buf_ffname, int reading) { char_u *dirp; char_u dir_name[IOSIZE + 1]; @@ -859,16 +852,13 @@ u_get_undo_file_name(buf_ffname, reading } static void -corruption_error(mesg, file_name) - char *mesg; - char_u *file_name; +corruption_error(char *mesg, char_u *file_name) { EMSG3(_("E825: Corrupted undo file (%s): %s"), mesg, file_name); } static void -u_free_uhp(uhp) - u_header_T *uhp; +u_free_uhp(u_header_T *uhp) { u_entry_T *nuep; u_entry_T *uep; @@ -889,10 +879,7 @@ u_free_uhp(uhp) * Returns OK or FAIL. */ static int -undo_write(bi, ptr, len) - bufinfo_T *bi; - char_u *ptr; - size_t len; +undo_write(bufinfo_T *bi, char_u *ptr, size_t len) { #ifdef FEAT_CRYPT if (bi->bi_buffer != NULL) @@ -926,8 +913,7 @@ undo_write(bi, ptr, len) #ifdef FEAT_CRYPT static int -undo_flush(bi) - bufinfo_T *bi; +undo_flush(bufinfo_T *bi) { if (bi->bi_buffer != NULL && bi->bi_used > 0) { @@ -945,10 +931,7 @@ undo_flush(bi) * Returns OK or FAIL. */ static int -fwrite_crypt(bi, ptr, len) - bufinfo_T *bi; - char_u *ptr; - size_t len; +fwrite_crypt(bufinfo_T *bi, char_u *ptr, size_t len) { #ifdef FEAT_CRYPT char_u *copy; @@ -982,10 +965,7 @@ fwrite_crypt(bi, ptr, len) * Returns OK or FAIL. */ static int -undo_write_bytes(bi, nr, len) - bufinfo_T *bi; - long_u nr; - int len; +undo_write_bytes(bufinfo_T *bi, long_u nr, int len) { char_u buf[8]; int i; @@ -1001,16 +981,13 @@ undo_write_bytes(bi, nr, len) * we use the sequence number of the header. This is converted back to * pointers when reading. */ static void -put_header_ptr(bi, uhp) - bufinfo_T *bi; - u_header_T *uhp; +put_header_ptr(bufinfo_T *bi, u_header_T *uhp) { undo_write_bytes(bi, (long_u)(uhp != NULL ? uhp->uh_seq : 0), 4); } static int -undo_read_4c(bi) - bufinfo_T *bi; +undo_read_4c(bufinfo_T *bi) { #ifdef FEAT_CRYPT if (bi->bi_buffer != NULL) @@ -1027,8 +1004,7 @@ undo_read_4c(bi) } static int -undo_read_2c(bi) - bufinfo_T *bi; +undo_read_2c(bufinfo_T *bi) { #ifdef FEAT_CRYPT if (bi->bi_buffer != NULL) @@ -1045,8 +1021,7 @@ undo_read_2c(bi) } static int -undo_read_byte(bi) - bufinfo_T *bi; +undo_read_byte(bufinfo_T *bi) { #ifdef FEAT_CRYPT if (bi->bi_buffer != NULL) @@ -1061,8 +1036,7 @@ undo_read_byte(bi) } static time_t -undo_read_time(bi) - bufinfo_T *bi; +undo_read_time(bufinfo_T *bi) { #ifdef FEAT_CRYPT if (bi->bi_buffer != NULL) @@ -1085,10 +1059,7 @@ undo_read_time(bi) * Return OK or FAIL. */ static int -undo_read(bi, buffer, size) - bufinfo_T *bi; - char_u *buffer; - size_t size; +undo_read(bufinfo_T *bi, char_u *buffer, size_t size) { #ifdef FEAT_CRYPT if (bi->bi_buffer != NULL) @@ -1138,9 +1109,7 @@ undo_read(bi, buffer, size) * Returns a pointer to allocated memory or NULL for failure. */ static char_u * -read_string_decrypt(bi, len) - bufinfo_T *bi; - int len; +read_string_decrypt(bufinfo_T *bi, int len) { char_u *ptr = alloc((unsigned)len + 1); @@ -1164,9 +1133,7 @@ read_string_decrypt(bi, len) * Writes the (not encrypted) header and initializes encryption if needed. */ static int -serialize_header(bi, hash) - bufinfo_T *bi; - char_u *hash; +serialize_header(bufinfo_T *bi, char_u *hash) { int len; buf_T *buf = bi->bi_buf; @@ -1252,9 +1219,7 @@ serialize_header(bi, hash) } static int -serialize_uhp(bi, uhp) - bufinfo_T *bi; - u_header_T *uhp; +serialize_uhp(bufinfo_T *bi, u_header_T *uhp) { int i; u_entry_T *uep; @@ -1301,9 +1266,7 @@ serialize_uhp(bi, uhp) } static u_header_T * -unserialize_uhp(bi, file_name) - bufinfo_T *bi; - char_u *file_name; +unserialize_uhp(bufinfo_T *bi, char_u *file_name) { u_header_T *uhp; int i; @@ -1393,9 +1356,9 @@ unserialize_uhp(bi, file_name) * Serialize "uep". */ static int -serialize_uep(bi, uep) - bufinfo_T *bi; - u_entry_T *uep; +serialize_uep( + bufinfo_T *bi, + u_entry_T *uep) { int i; size_t len; @@ -1416,10 +1379,7 @@ serialize_uep(bi, uep) } static u_entry_T * -unserialize_uep(bi, error, file_name) - bufinfo_T *bi; - int *error; - char_u *file_name; +unserialize_uep(bufinfo_T *bi, int *error, char_u *file_name) { int i; u_entry_T *uep; @@ -1476,9 +1436,7 @@ unserialize_uep(bi, error, file_name) * Serialize "pos". */ static void -serialize_pos(bi, pos) - bufinfo_T *bi; - pos_T pos; +serialize_pos(bufinfo_T *bi, pos_T pos) { undo_write_bytes(bi, (long_u)pos.lnum, 4); undo_write_bytes(bi, (long_u)pos.col, 4); @@ -1493,9 +1451,7 @@ serialize_pos(bi, pos) * Unserialize the pos_T at the current position. */ static void -unserialize_pos(bi, pos) - bufinfo_T *bi; - pos_T *pos; +unserialize_pos(bufinfo_T *bi, pos_T *pos) { pos->lnum = undo_read_4c(bi); if (pos->lnum < 0) @@ -1516,9 +1472,7 @@ unserialize_pos(bi, pos) * Serialize "info". */ static void -serialize_visualinfo(bi, info) - bufinfo_T *bi; - visualinfo_T *info; +serialize_visualinfo(bufinfo_T *bi, visualinfo_T *info) { serialize_pos(bi, info->vi_start); serialize_pos(bi, info->vi_end); @@ -1530,9 +1484,7 @@ serialize_visualinfo(bi, info) * Unserialize the visualinfo_T at the current position. */ static void -unserialize_visualinfo(bi, info) - bufinfo_T *bi; - visualinfo_T *info; +unserialize_visualinfo(bufinfo_T *bi, visualinfo_T *info) { unserialize_pos(bi, &info->vi_start); unserialize_pos(bi, &info->vi_end); @@ -1550,11 +1502,11 @@ unserialize_visualinfo(bi, info) * "hash[UNDO_HASH_SIZE]" must be the hash value of the buffer text. */ void -u_write_undo(name, forceit, buf, hash) - char_u *name; - int forceit; - buf_T *buf; - char_u *hash; +u_write_undo( + char_u *name, + int forceit, + buf_T *buf, + char_u *hash) { u_header_T *uhp; char_u *file_name; @@ -1824,10 +1776,7 @@ theend: * "hash[UNDO_HASH_SIZE]" must be the hash value of the buffer text. */ void -u_read_undo(name, hash, orig_name) - char_u *name; - char_u *hash; - char_u *orig_name; +u_read_undo(char_u *name, char_u *hash, char_u *orig_name) { char_u *file_name; FILE *fp; @@ -2188,8 +2137,7 @@ theend: * If 'cpoptions' does not contain 'u': Always undo. */ void -u_undo(count) - int count; +u_undo(int count) { /* * If we get an undo command while executing a macro, we behave like the @@ -2214,8 +2162,7 @@ u_undo(count) * If 'cpoptions' does not contain 'u': Always redo. */ void -u_redo(count) - int count; +u_redo(int count) { if (vim_strchr(p_cpo, CPO_UNDO) == NULL) undo_undoes = FALSE; @@ -2226,8 +2173,7 @@ u_redo(count) * Undo or redo, depending on 'undo_undoes', 'count' times. */ static void -u_doit(startcount) - int startcount; +u_doit(int startcount) { int count = startcount; @@ -2304,11 +2250,11 @@ u_doit(startcount) * "sec" must be FALSE then. */ void -undo_time(step, sec, file, absolute) - long step; - int sec; - int file; - int absolute; +undo_time( + long step, + int sec, + int file, + int absolute) { long target; long closest; @@ -2645,8 +2591,7 @@ undo_time(step, sec, file, absolute) * When "undo" is TRUE we go up in the tree, when FALSE we go down. */ static void -u_undoredo(undo) - int undo; +u_undoredo(int undo) { char_u **newarray = NULL; linenr_T oldsize; @@ -2933,9 +2878,9 @@ u_undoredo(undo) * in some cases, but it's better than nothing). */ static void -u_undo_end(did_undo, absolute) - int did_undo; /* just did an undo */ - int absolute; /* used ":undo N" */ +u_undo_end( + int did_undo, /* just did an undo */ + int absolute) /* used ":undo N" */ { char *msgstr; u_header_T *uhp; @@ -3016,8 +2961,8 @@ u_undo_end(did_undo, absolute) * u_sync: stop adding to the current entry list */ void -u_sync(force) - int force; /* Also sync when no_u_sync is set. */ +u_sync( + int force) /* Also sync when no_u_sync is set. */ { /* Skip it when already synced or syncing is disabled. */ if (curbuf->b_u_synced || (!force && no_u_sync > 0)) @@ -3039,8 +2984,7 @@ u_sync(force) * ":undolist": List the leafs of the undo tree */ void -ex_undolist(eap) - exarg_T *eap UNUSED; +ex_undolist(exarg_T *eap UNUSED) { garray_T ga; u_header_T *uhp; @@ -3146,10 +3090,7 @@ ex_undolist(eap) * Put the timestamp of an undo header in "buf[buflen]" in a nice format. */ static void -u_add_time(buf, buflen, tt) - char_u *buf; - size_t buflen; - time_t tt; +u_add_time(char_u *buf, size_t buflen, time_t tt) { #ifdef HAVE_STRFTIME struct tm *curtime; @@ -3174,8 +3115,7 @@ u_add_time(buf, buflen, tt) * ":undojoin": continue adding to the last entry list */ void -ex_undojoin(eap) - exarg_T *eap UNUSED; +ex_undojoin(exarg_T *eap UNUSED) { if (curbuf->b_u_newhead == NULL) return; /* nothing changed before */ @@ -3201,8 +3141,7 @@ ex_undojoin(eap) * Now an undo means that the buffer is modified. */ void -u_unchanged(buf) - buf_T *buf; +u_unchanged(buf_T *buf) { u_unch_branch(buf->b_u_oldhead); buf->b_did_warn = FALSE; @@ -3213,7 +3152,7 @@ u_unchanged(buf) * line that was changed and set the cursor there. */ void -u_find_first_changed() +u_find_first_changed(void) { u_header_T *uhp = curbuf->b_u_newhead; u_entry_T *uep; @@ -3249,8 +3188,7 @@ u_find_first_changed() * used for "u". */ void -u_update_save_nr(buf) - buf_T *buf; +u_update_save_nr(buf_T *buf) { u_header_T *uhp; @@ -3266,8 +3204,7 @@ u_update_save_nr(buf) } static void -u_unch_branch(uhp) - u_header_T *uhp; +u_unch_branch(u_header_T *uhp) { u_header_T *uh; @@ -3284,7 +3221,7 @@ u_unch_branch(uhp) * If it's not valid, give an error message and return NULL. */ static u_entry_T * -u_get_headentry() +u_get_headentry(void) { if (curbuf->b_u_newhead == NULL || curbuf->b_u_newhead->uh_entry == NULL) { @@ -3299,7 +3236,7 @@ u_get_headentry() * It is called only when b_u_synced is FALSE. */ static void -u_getbot() +u_getbot(void) { u_entry_T *uep; linenr_T extra; @@ -3337,10 +3274,10 @@ u_getbot() * Free one header "uhp" and its entry list and adjust the pointers. */ static void -u_freeheader(buf, uhp, uhpp) - buf_T *buf; - u_header_T *uhp; - u_header_T **uhpp; /* if not NULL reset when freeing this header */ +u_freeheader( + buf_T *buf, + u_header_T *uhp, + u_header_T **uhpp) /* if not NULL reset when freeing this header */ { u_header_T *uhap; @@ -3372,10 +3309,10 @@ u_freeheader(buf, uhp, uhpp) * Free an alternate branch and any following alternate branches. */ static void -u_freebranch(buf, uhp, uhpp) - buf_T *buf; - u_header_T *uhp; - u_header_T **uhpp; /* if not NULL reset when freeing this header */ +u_freebranch( + buf_T *buf, + u_header_T *uhp, + u_header_T **uhpp) /* if not NULL reset when freeing this header */ { u_header_T *tofree, *next; @@ -3407,10 +3344,10 @@ u_freebranch(buf, uhp, uhpp) * This means that "uhp" is invalid when returning. */ static void -u_freeentries(buf, uhp, uhpp) - buf_T *buf; - u_header_T *uhp; - u_header_T **uhpp; /* if not NULL reset when freeing this header */ +u_freeentries( + buf_T *buf, + u_header_T *uhp, + u_header_T **uhpp) /* if not NULL reset when freeing this header */ { u_entry_T *uep, *nuep; @@ -3439,9 +3376,7 @@ u_freeentries(buf, uhp, uhpp) * free entry 'uep' and 'n' lines in uep->ue_array[] */ static void -u_freeentry(uep, n) - u_entry_T *uep; - long n; +u_freeentry(u_entry_T *uep, long n) { while (n > 0) vim_free(uep->ue_array[--n]); @@ -3456,8 +3391,7 @@ u_freeentry(uep, n) * invalidate the undo buffer; called when storage has already been released */ void -u_clearall(buf) - buf_T *buf; +u_clearall(buf_T *buf) { buf->b_u_newhead = buf->b_u_oldhead = buf->b_u_curhead = NULL; buf->b_u_synced = TRUE; @@ -3470,8 +3404,7 @@ u_clearall(buf) * save the line "lnum" for the "U" command */ void -u_saveline(lnum) - linenr_T lnum; +u_saveline(linenr_T lnum) { if (lnum == curbuf->b_u_line_lnum) /* line is already saved */ return; @@ -3492,7 +3425,7 @@ u_saveline(lnum) * (this is used externally for crossing a line while in insert mode) */ void -u_clearline() +u_clearline(void) { if (curbuf->b_u_line_ptr != NULL) { @@ -3509,7 +3442,7 @@ u_clearline() * Careful: may trigger autocommands that reload the buffer. */ void -u_undoline() +u_undoline(void) { colnr_T t; char_u *oldp; @@ -3551,8 +3484,7 @@ u_undoline() * Free all allocated memory blocks for the buffer 'buf'. */ void -u_blockfree(buf) - buf_T *buf; +u_blockfree(buf_T *buf) { while (buf->b_u_oldhead != NULL) u_freeheader(buf, buf->b_u_oldhead, NULL); @@ -3564,8 +3496,7 @@ u_blockfree(buf) * Returns NULL when out of memory. */ static char_u * -u_save_line(lnum) - linenr_T lnum; +u_save_line(linenr_T lnum) { return vim_strsave(ml_get(lnum)); } @@ -3576,8 +3507,7 @@ u_save_line(lnum) * "nofile" and "scratch" type buffers are considered to always be unchanged. */ int -bufIsChanged(buf) - buf_T *buf; +bufIsChanged(buf_T *buf) { return #ifdef FEAT_QUICKFIX @@ -3587,7 +3517,7 @@ bufIsChanged(buf) } int -curbufIsChanged() +curbufIsChanged(void) { return #ifdef FEAT_QUICKFIX @@ -3602,9 +3532,7 @@ curbufIsChanged() * Recursive. */ void -u_eval_tree(first_uhp, list) - u_header_T *first_uhp; - list_T *list; +u_eval_tree(u_header_T *first_uhp, list_T *list) { u_header_T *uhp = first_uhp; dict_T *dict; diff --git a/src/version.c b/src/version.c --- 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 */ /**/ + 1214, +/**/ 1213, /**/ 1212,