1
0
forked from aniani/vim

patch 7.4.1214

Problem:    Using old style function declarations.
Solution:   Change to new style function declarations. (script by Hirohito
            Higashi)
This commit is contained in:
Bram Moolenaar
2016-01-30 21:10:09 +01:00
parent 055409764c
commit 764b23c8fd
10 changed files with 1260 additions and 1889 deletions

View File

@@ -140,12 +140,12 @@ typedef struct SearchedFile
* returns FAIL if failed, OK otherwise.
*/
int
search_regcomp(pat, pat_save, pat_use, options, regmatch)
char_u *pat;
int pat_save;
int pat_use;
int options;
regmmatch_T *regmatch; /* return: pattern and ignore-case flag */
search_regcomp(
char_u *pat,
int pat_save,
int pat_use,
int options,
regmmatch_T *regmatch) /* return: pattern and ignore-case flag */
{
int magic;
int i;
@@ -230,7 +230,7 @@ search_regcomp(pat, pat_save, pat_use, options, regmatch)
* Get search pattern used by search_regcomp().
*/
char_u *
get_search_pat()
get_search_pat(void)
{
return mr_pattern;
}
@@ -241,8 +241,7 @@ get_search_pat()
* Returns the allocated string, NULL when out of memory.
*/
char_u *
reverse_text(s)
char_u *s;
reverse_text(char_u *s)
{
unsigned len;
unsigned s_i, rev_i;
@@ -280,10 +279,7 @@ reverse_text(s)
#endif
void
save_re_pat(idx, pat, magic)
int idx;
char_u *pat;
int magic;
save_re_pat(int idx, char_u *pat, int magic)
{
if (spats[idx].pat != pat)
{
@@ -309,7 +305,7 @@ save_re_pat(idx, pat, magic)
static int save_level = 0;
void
save_search_patterns()
save_search_patterns(void)
{
if (save_level++ == 0)
{
@@ -327,7 +323,7 @@ save_search_patterns()
}
void
restore_search_patterns()
restore_search_patterns(void)
{
if (--save_level == 0)
{
@@ -348,7 +344,7 @@ restore_search_patterns()
#if defined(EXITFREE) || defined(PROTO)
void
free_search_patterns()
free_search_patterns(void)
{
vim_free(spats[0].pat);
vim_free(spats[1].pat);
@@ -369,8 +365,7 @@ free_search_patterns()
* Uses the 'ignorecase' and 'smartcase' options.
*/
int
ignorecase(pat)
char_u *pat;
ignorecase(char_u *pat)
{
int ic = p_ic;
@@ -389,8 +384,7 @@ ignorecase(pat)
* Return TRUE if pattern "pat" has an uppercase character.
*/
int
pat_has_uppercase(pat)
char_u *pat;
pat_has_uppercase(char_u *pat)
{
char_u *p = pat;
@@ -427,7 +421,7 @@ pat_has_uppercase(pat)
}
char_u *
last_csearch()
last_csearch(void)
{
#ifdef FEAT_MBYTE
return lastc_bytes;
@@ -437,22 +431,19 @@ last_csearch()
}
int
last_csearch_forward()
last_csearch_forward(void)
{
return lastcdir == FORWARD;
}
int
last_csearch_until()
last_csearch_until(void)
{
return last_t_cmd == TRUE;
}
void
set_last_csearch(c, s, len)
int c;
char_u *s UNUSED;
int len UNUSED;
set_last_csearch(int c, char_u *s UNUSED, int len UNUSED)
{
*lastc = c;
#ifdef FEAT_MBYTE
@@ -465,21 +456,19 @@ set_last_csearch(c, s, len)
}
void
set_csearch_direction(cdir)
int cdir;
set_csearch_direction(int cdir)
{
lastcdir = cdir;
}
void
set_csearch_until(t_cmd)
int t_cmd;
set_csearch_until(int t_cmd)
{
last_t_cmd = t_cmd;
}
char_u *
last_search_pat()
last_search_pat(void)
{
return spats[last_idx].pat;
}
@@ -488,7 +477,7 @@ last_search_pat()
* Reset search direction to forward. For "gd" and "gD" commands.
*/
void
reset_search_dir()
reset_search_dir(void)
{
spats[0].off.dir = '/';
#if defined(FEAT_EVAL)
@@ -502,11 +491,11 @@ reset_search_dir()
* Also set the saved search pattern, so that this works in an autocommand.
*/
void
set_last_search_pat(s, idx, magic, setlast)
char_u *s;
int idx;
int magic;
int setlast;
set_last_search_pat(
char_u *s,
int idx,
int magic,
int setlast)
{
vim_free(spats[idx].pat);
/* An empty string means that nothing should be matched. */
@@ -550,8 +539,7 @@ set_last_search_pat(s, idx, magic, setlast)
* Values returned in regmatch->regprog and regmatch->rmm_ic.
*/
void
last_pat_prog(regmatch)
regmmatch_T *regmatch;
last_pat_prog(regmmatch_T *regmatch)
{
if (spats[last_idx].pat == NULL)
{
@@ -585,18 +573,18 @@ last_pat_prog(regmatch)
* subpattern plus one; one if there was none.
*/
int
searchit(win, buf, pos, dir, pat, count, options, pat_use, stop_lnum, tm)
win_T *win; /* window to search in; can be NULL for a
searchit(
win_T *win, /* window to search in; can be NULL for a
buffer without a window! */
buf_T *buf;
pos_T *pos;
int dir;
char_u *pat;
long count;
int options;
int pat_use; /* which pattern to use when "pat" is empty */
linenr_T stop_lnum; /* stop after this line number when != 0 */
proftime_T *tm UNUSED; /* timeout limit or NULL */
buf_T *buf,
pos_T *pos,
int dir,
char_u *pat,
long count,
int options,
int pat_use, /* which pattern to use when "pat" is empty */
linenr_T stop_lnum, /* stop after this line number when != 0 */
proftime_T *tm UNUSED) /* timeout limit or NULL */
{
int found;
linenr_T lnum; /* no init to shut up Apollo cc */
@@ -1088,14 +1076,13 @@ searchit(win, buf, pos, dir, pat, count, options, pat_use, stop_lnum, tm)
#ifdef FEAT_EVAL
void
set_search_direction(cdir)
int cdir;
set_search_direction(int cdir)
{
spats[0].off.dir = cdir;
}
static void
set_vv_searchforward()
set_vv_searchforward(void)
{
set_vim_var_nr(VV_SEARCHFORWARD, (long)(spats[0].off.dir == '/'));
}
@@ -1105,8 +1092,7 @@ set_vv_searchforward()
* Return zero if none of them matched.
*/
static int
first_submatch(rp)
regmmatch_T *rp;
first_submatch(regmmatch_T *rp)
{
int submatch;
@@ -1146,13 +1132,13 @@ first_submatch(rp)
* Return 0 for failure, 1 for found, 2 for found and line offset added.
*/
int
do_search(oap, dirc, pat, count, options, tm)
oparg_T *oap; /* can be NULL */
int dirc; /* '/' or '?' */
char_u *pat;
long count;
int options;
proftime_T *tm; /* timeout limit or NULL */
do_search(
oparg_T *oap, /* can be NULL */
int dirc, /* '/' or '?' */
char_u *pat,
long count,
int options,
proftime_T *tm) /* timeout limit or NULL */
{
pos_T pos; /* position of the last match */
char_u *searchstr;
@@ -1536,11 +1522,11 @@ end_do_search:
* Return OK for success, or FAIL if no line found.
*/
int
search_for_exact_line(buf, pos, dir, pat)
buf_T *buf;
pos_T *pos;
int dir;
char_u *pat;
search_for_exact_line(
buf_T *buf,
pos_T *pos,
int dir,
char_u *pat)
{
linenr_T start = 0;
char_u *ptr;
@@ -1617,9 +1603,7 @@ search_for_exact_line(buf, pos, dir, pat)
* Return FAIL or OK.
*/
int
searchc(cap, t_cmd)
cmdarg_T *cap;
int t_cmd;
searchc(cmdarg_T *cap, int t_cmd)
{
int c = cap->nchar; /* char to search for */
int dir = cap->arg; /* TRUE for searching forward */
@@ -1754,9 +1738,7 @@ searchc(cap, t_cmd)
* Improvement over vi: Braces inside quotes are ignored.
*/
pos_T *
findmatch(oap, initc)
oparg_T *oap;
int initc;
findmatch(oparg_T *oap, int initc)
{
return findmatchlimit(oap, initc, 0, 0);
}
@@ -1769,11 +1751,11 @@ findmatch(oap, initc)
* Handles multibyte string correctly.
*/
static int
check_prevcol(linep, col, ch, prevcol)
char_u *linep;
int col;
int ch;
int *prevcol;
check_prevcol(
char_u *linep,
int col,
int ch,
int *prevcol)
{
--col;
#ifdef FEAT_MBYTE
@@ -1792,10 +1774,7 @@ static int find_rawstring_end(char_u *linep, pos_T *startpos, pos_T *endpos);
* Return TRUE if the matching end can be found between startpos and endpos.
*/
static int
find_rawstring_end(linep, startpos, endpos)
char_u *linep;
pos_T *startpos;
pos_T *endpos;
find_rawstring_end(char_u *linep, pos_T *startpos, pos_T *endpos)
{
char_u *p;
char_u *delim_copy;
@@ -1854,11 +1833,11 @@ find_rawstring_end(linep, startpos, endpos)
*/
pos_T *
findmatchlimit(oap, initc, flags, maxtravel)
oparg_T *oap;
int initc;
int flags;
int maxtravel;
findmatchlimit(
oparg_T *oap,
int initc,
int flags,
int maxtravel)
{
static pos_T pos; /* current search position */
int findc = 0; /* matching brace */
@@ -2504,8 +2483,7 @@ findmatchlimit(oap, initc, flags, maxtravel)
* TODO: skip strings.
*/
static int
check_linecomment(line)
char_u *line;
check_linecomment(char_u *line)
{
char_u *p;
@@ -2565,8 +2543,8 @@ check_linecomment(line)
* If there isn't a match, then beep.
*/
void
showmatch(c)
int c; /* char to show match for */
showmatch(
int c) /* char to show match for */
{
pos_T *lpos, save_cursor;
pos_T mpos;
@@ -2672,9 +2650,7 @@ showmatch(c)
* Return OK if the next sentence was found.
*/
int
findsent(dir, count)
int dir;
long count;
findsent(int dir, long count)
{
pos_T pos, tpos;
int c;
@@ -2801,12 +2777,12 @@ found:
* Return TRUE if the next paragraph or section was found.
*/
int
findpar(pincl, dir, count, what, both)
int *pincl; /* Return: TRUE if last char is to be included */
int dir;
long count;
int what;
int both;
findpar(
int *pincl, /* Return: TRUE if last char is to be included */
int dir,
long count,
int what,
int both)
{
linenr_T curr;
int did_skip; /* TRUE after separating lines have been skipped */
@@ -2880,9 +2856,7 @@ findpar(pincl, dir, count, what, both)
* check if the string 's' is a nroff macro that is in option 'opt'
*/
static int
inmacro(opt, s)
char_u *opt;
char_u *s;
inmacro(char_u *opt, char_u *s)
{
char_u *macro;
@@ -2911,10 +2885,7 @@ inmacro(opt, s)
* If 'both' is TRUE also stop at '}'
*/
int
startPS(lnum, para, both)
linenr_T lnum;
int para;
int both;
startPS(linenr_T lnum, int para, int both)
{
char_u *s;
@@ -2953,7 +2924,7 @@ static int cls_bigword; /* TRUE for "W", "B" or "E" */
* boundaries are of interest.
*/
static int
cls()
cls(void)
{
int c;
@@ -3000,10 +2971,10 @@ cls()
* If eol is TRUE, last word stops at end of line (for operators).
*/
int
fwd_word(count, bigword, eol)
long count;
int bigword; /* "W", "E" or "B" */
int eol;
fwd_word(
long count,
int bigword, /* "W", "E" or "B" */
int eol)
{
int sclass; /* starting class */
int i;
@@ -3072,10 +3043,7 @@ fwd_word(count, bigword, eol)
* Returns FAIL if top of the file was reached.
*/
int
bck_word(count, bigword, stop)
long count;
int bigword;
int stop;
bck_word(long count, int bigword, int stop)
{
int sclass; /* starting class */
@@ -3140,11 +3108,11 @@ finished:
* If empty is TRUE stop on an empty line.
*/
int
end_word(count, bigword, stop, empty)
long count;
int bigword;
int stop;
int empty;
end_word(
long count,
int bigword,
int stop,
int empty)
{
int sclass; /* starting class */
@@ -3210,10 +3178,10 @@ finished:
* Returns FAIL if start of the file was reached.
*/
int
bckend_word(count, bigword, eol)
long count;
int bigword; /* TRUE for "B" */
int eol; /* TRUE: stop at end of line. */
bckend_word(
long count,
int bigword, /* TRUE for "B" */
int eol) /* TRUE: stop at end of line. */
{
int sclass; /* starting class */
int i;
@@ -3259,9 +3227,7 @@ bckend_word(count, bigword, eol)
* Return TRUE when end-of-file reached, FALSE otherwise.
*/
static int
skip_chars(cclass, dir)
int cclass;
int dir;
skip_chars(int cclass, int dir)
{
while (cls() == cclass)
if ((dir == FORWARD ? inc_cursor() : dec_cursor()) == -1)
@@ -3274,7 +3240,7 @@ skip_chars(cclass, dir)
* Go back to the start of the word or the start of white space
*/
static void
back_in_line()
back_in_line(void)
{
int sclass; /* starting class */
@@ -3293,8 +3259,7 @@ back_in_line()
}
static void
find_first_blank(posp)
pos_T *posp;
find_first_blank(pos_T *posp)
{
int c;
@@ -3313,9 +3278,9 @@ find_first_blank(posp)
* Skip count/2 sentences and count/2 separating white spaces.
*/
static void
findsent_forward(count, at_start_sent)
long count;
int at_start_sent; /* cursor is at start of sentence */
findsent_forward(
long count,
int at_start_sent) /* cursor is at start of sentence */
{
while (count--)
{
@@ -3333,11 +3298,11 @@ findsent_forward(count, at_start_sent)
* Used while an operator is pending, and in Visual mode.
*/
int
current_word(oap, count, include, bigword)
oparg_T *oap;
long count;
int include; /* TRUE: include word and white space */
int bigword; /* FALSE == word, TRUE == WORD */
current_word(
oparg_T *oap,
long count,
int include, /* TRUE: include word and white space */
int bigword) /* FALSE == word, TRUE == WORD */
{
pos_T start_pos;
pos_T pos;
@@ -3507,10 +3472,7 @@ current_word(oap, count, include, bigword)
* When Visual active, extend it by one or more sentences.
*/
int
current_sent(oap, count, include)
oparg_T *oap;
long count;
int include;
current_sent(oparg_T *oap, long count, int include)
{
pos_T start_pos;
pos_T pos;
@@ -3687,12 +3649,12 @@ extend:
* "what" and "other" are two matching parenthesis/brace/etc.
*/
int
current_block(oap, count, include, what, other)
oparg_T *oap;
long count;
int include; /* TRUE == include white space */
int what; /* '(', '{', etc. */
int other; /* ')', '}', etc. */
current_block(
oparg_T *oap,
long count,
int include, /* TRUE == include white space */
int what, /* '(', '{', etc. */
int other) /* ')', '}', etc. */
{
pos_T old_pos;
pos_T *pos = NULL;
@@ -3838,8 +3800,8 @@ static int in_html_tag(int);
* When "end_tag" is TRUE return TRUE if the cursor is on "</aaa>".
*/
static int
in_html_tag(end_tag)
int end_tag;
in_html_tag(
int end_tag)
{
char_u *line = ml_get_curline();
char_u *p;
@@ -3911,10 +3873,10 @@ in_html_tag(end_tag)
* Find tag block under the cursor, cursor at end.
*/
int
current_tagblock(oap, count_arg, include)
oparg_T *oap;
long count_arg;
int include; /* TRUE == include white space */
current_tagblock(
oparg_T *oap,
long count_arg,
int include) /* TRUE == include white space */
{
long count = count_arg;
long n;
@@ -4117,11 +4079,11 @@ theend:
}
int
current_par(oap, count, include, type)
oparg_T *oap;
long count;
int include; /* TRUE == include white space */
int type; /* 'p' for paragraph, 'S' for section */
current_par(
oparg_T *oap,
long count,
int include, /* TRUE == include white space */
int type) /* 'p' for paragraph, 'S' for section */
{
linenr_T start_lnum;
linenr_T end_lnum;
@@ -4296,11 +4258,11 @@ static int find_prev_quote(char_u *line, int col_start, int quotechar, char_u *e
* Returns column number of "quotechar" or -1 when not found.
*/
static int
find_next_quote(line, col, quotechar, escape)
char_u *line;
int col;
int quotechar;
char_u *escape; /* escape characters, can be NULL */
find_next_quote(
char_u *line,
int col,
int quotechar,
char_u *escape) /* escape characters, can be NULL */
{
int c;
@@ -4330,11 +4292,11 @@ find_next_quote(line, col, quotechar, escape)
* Return the found column or zero.
*/
static int
find_prev_quote(line, col_start, quotechar, escape)
char_u *line;
int col_start;
int quotechar;
char_u *escape; /* escape characters, can be NULL */
find_prev_quote(
char_u *line,
int col_start,
int quotechar,
char_u *escape) /* escape characters, can be NULL */
{
int n;
@@ -4362,11 +4324,11 @@ find_prev_quote(line, col_start, quotechar, escape)
* Returns TRUE if found, else FALSE.
*/
int
current_quote(oap, count, include, quotechar)
oparg_T *oap;
long count;
int include; /* TRUE == include quote char */
int quotechar; /* Quote character */
current_quote(
oparg_T *oap,
long count,
int include, /* TRUE == include quote char */
int quotechar) /* Quote character */
{
char_u *line = ml_get_curline();
int col_end;
@@ -4605,9 +4567,9 @@ static int is_one_char(char_u *pattern, int move);
* Used while an operator is pending, and in Visual mode.
*/
int
current_search(count, forward)
long count;
int forward; /* move forward or backwards */
current_search(
long count,
int forward) /* move forward or backwards */
{
pos_T start_pos; /* position before the pattern */
pos_T orig_pos; /* position of the cursor at beginning */
@@ -4764,9 +4726,7 @@ current_search(count, forward)
* Returns TRUE, FALSE or -1 for failure.
*/
static int
is_one_char(pattern, move)
char_u *pattern;
int move;
is_one_char(char_u *pattern, int move)
{
regmmatch_T regmatch;
int nmatched = 0;
@@ -4818,8 +4778,7 @@ is_one_char(pattern, move)
* return TRUE if line 'lnum' is empty or has white chars only.
*/
int
linewhite(lnum)
linenr_T lnum;
linewhite(linenr_T lnum)
{
char_u *p;
@@ -4834,19 +4793,18 @@ linewhite(lnum)
* If p_ic && (compl_cont_status & CONT_SOL) then ptr must be in lowercase.
*/
void
find_pattern_in_path(ptr, dir, len, whole, skip_comments,
type, count, action, start_lnum, end_lnum)
char_u *ptr; /* pointer to search pattern */
int dir UNUSED; /* direction of expansion */
int len; /* length of search pattern */
int whole; /* match whole words only */
int skip_comments; /* don't match inside comments */
int type; /* Type of search; are we looking for a type?
find_pattern_in_path(
char_u *ptr, /* pointer to search pattern */
int dir UNUSED, /* direction of expansion */
int len, /* length of search pattern */
int whole, /* match whole words only */
int skip_comments, /* don't match inside comments */
int type, /* Type of search; are we looking for a type?
a macro? */
long count;
int action; /* What to do when we find it */
linenr_T start_lnum; /* first line to start searching */
linenr_T end_lnum; /* last line for searching */
long count,
int action, /* What to do when we find it */
linenr_T start_lnum, /* first line to start searching */
linenr_T end_lnum) /* last line for searching */
{
SearchedFile *files; /* Stack of included files */
SearchedFile *bigger; /* When we need more space */
@@ -5543,14 +5501,14 @@ fpip_end:
}
static void
show_pat_in_path(line, type, did_show, action, fp, lnum, count)
char_u *line;
int type;
int did_show;
int action;
FILE *fp;
linenr_T *lnum;
long count;
show_pat_in_path(
char_u *line,
int type,
int did_show,
int action,
FILE *fp,
linenr_T *lnum,
long count)
{
char_u *p;
@@ -5607,9 +5565,7 @@ show_pat_in_path(line, type, did_show, action, fp, lnum, count)
#ifdef FEAT_VIMINFO
int
read_viminfo_search_pattern(virp, force)
vir_T *virp;
int force;
read_viminfo_search_pattern(vir_T *virp, int force)
{
char_u *lp;
int idx = -1;
@@ -5695,8 +5651,7 @@ read_viminfo_search_pattern(virp, force)
}
void
write_viminfo_search_pattern(fp)
FILE *fp;
write_viminfo_search_pattern(FILE *fp)
{
if (get_viminfo_parameter('/') != 0)
{
@@ -5710,11 +5665,11 @@ write_viminfo_search_pattern(fp)
}
static void
wvsp_one(fp, idx, s, sc)
FILE *fp; /* file to write to */
int idx; /* spats[] index */
char *s; /* search pat */
int sc; /* dir char */
wvsp_one(
FILE *fp, /* file to write to */
int idx, /* spats[] index */
char *s, /* search pat */
int sc) /* dir char */
{
if (spats[idx].pat != NULL)
{

View File

@@ -43,8 +43,7 @@ static void sha256_process(context_sha256_T *ctx, char_u data[64]);
}
void
sha256_start(ctx)
context_sha256_T *ctx;
sha256_start(context_sha256_T *ctx)
{
ctx->total[0] = 0;
ctx->total[1] = 0;
@@ -60,9 +59,7 @@ sha256_start(ctx)
}
static void
sha256_process(ctx, data)
context_sha256_T *ctx;
char_u data[64];
sha256_process(context_sha256_T *ctx, char_u data[64])
{
UINT32_T temp1, temp2, W[64];
UINT32_T A, B, C, D, E, F, G, H;
@@ -194,10 +191,7 @@ sha256_process(ctx, data)
}
void
sha256_update(ctx, input, length)
context_sha256_T *ctx;
char_u *input;
UINT32_T length;
sha256_update(context_sha256_T *ctx, char_u *input, UINT32_T length)
{
UINT32_T left, fill;
@@ -241,9 +235,7 @@ static char_u sha256_padding[64] = {
};
void
sha256_finish(ctx, digest)
context_sha256_T *ctx;
char_u digest[32];
sha256_finish(context_sha256_T *ctx, char_u digest[32])
{
UINT32_T last, padn;
UINT32_T high, low;
@@ -280,11 +272,11 @@ static unsigned int get_some_time(void);
* if "salt" is not NULL also do "salt[salt_len]".
*/
char_u *
sha256_bytes(buf, buf_len, salt, salt_len)
char_u *buf;
int buf_len;
char_u *salt;
int salt_len;
sha256_bytes(
char_u *buf,
int buf_len,
char_u *salt,
int salt_len)
{
char_u sha256sum[32];
static char_u hexit[65];
@@ -308,10 +300,10 @@ sha256_bytes(buf, buf_len, salt, salt_len)
* Returns sha256(buf) as 64 hex chars in static array.
*/
char_u *
sha256_key(buf, salt, salt_len)
char_u *buf;
char_u *salt;
int salt_len;
sha256_key(
char_u *buf,
char_u *salt,
int salt_len)
{
/* No passwd means don't encrypt */
if (buf == NULL || *buf == NUL)
@@ -344,7 +336,7 @@ static char *sha_self_test_vector[] = {
* Return FAIL or OK.
*/
int
sha256_self_test()
sha256_self_test(void)
{
int i, j;
char output[65];
@@ -389,7 +381,7 @@ sha256_self_test()
}
static unsigned int
get_some_time()
get_some_time(void)
{
# ifdef HAVE_GETTIMEOFDAY
struct timeval tv;
@@ -407,11 +399,11 @@ get_some_time()
* Also "salt[salt_len]" when "salt" is not NULL.
*/
void
sha2_seed(header, header_len, salt, salt_len)
char_u *header;
int header_len;
char_u *salt;
int salt_len;
sha2_seed(
char_u *header,
int header_len,
char_u *salt,
int salt_len)
{
int i;
static char_u random_data[1000];

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

141
src/tag.c
View File

@@ -121,12 +121,12 @@ static taggy_T ptag_entry = {NULL, {INIT_POS_T(0, 0, 0), 0}, 0, 0};
* 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_u *s2, size_t len);
* 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, int has_re);
* 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 *fname, void *cookie);
* '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, expand)
* 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_fname, buf_ffname)
* 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, char *field_name, char_u *start, char_u *
* 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, end)
* 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;

View File

@@ -1412,8 +1412,7 @@ static int check_for_codes = FALSE; /* check for key code response */
#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)
* <Esc>O -> <M-C-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 chars in out_buf */
* 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 <Esc>[ 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, long_u *val);
* 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 number of entries in termcodes[] */
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 <M-O>*X.
*/
static int
termcode_star(code, len)
char_u *code;
int len;
termcode_star(char_u *code, int len)
{
/* Shortest is <M-O>*X. With ; shortest is <CSI>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, buflen)
* 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 <lt> */
int special; /* always accept <key> notation */
replace_termcodes(
char_u *from,
char_u **bufp,
int from_part,
int do_lt, /* also translate <lt> */
int special) /* always accept <key> notation */
{
int i;
int slen;
@@ -5673,8 +5613,7 @@ replace_termcodes(from, bufp, from_part, do_lt, special)
* 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;

View File

@@ -66,9 +66,9 @@ short ospeed; /* Baud rate (1-16, 1=300, 16=19200), as in stty */
#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 1 entry from TERMCAP file */
*/
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 */
tgoto(
char *cm, /* cm string, from termcap */
int col, /* column, x position */
line; /* line, y 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 @@ _match(s1, s2) /* returns length of text common to s1 and s2 */
* 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 @@ _find(s, set)
* 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)

327
src/ui.c
View File

@@ -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 char to use when ta_str != NULL */
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(VimClipboard *clip);
* 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; /* clipboard needs to be updated */
* 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_selection(VimClipboard *, int, int,
* 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_click)
* 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, repeated_click)
* 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, how)
* "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, width, invert)
* 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, col1, row2, col2)
}
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 of chars in inbuf[] */
*/
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 len)
#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_cb(Widget, XtPointer, Atom *, Atom *, Xt
* 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, sel_atom, type, value, length,
}
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, cbd)
}
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_atom, target, type, value, length, format)
}
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).

View File

@@ -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: Cannot open undo file for writing: %s");
* 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;

View File

@@ -746,6 +746,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1214,
/**/
1213,
/**/