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

View File

@@ -43,8 +43,7 @@ static void sha256_process(context_sha256_T *ctx, char_u data[64]);
} }
void void
sha256_start(ctx) sha256_start(context_sha256_T *ctx)
context_sha256_T *ctx;
{ {
ctx->total[0] = 0; ctx->total[0] = 0;
ctx->total[1] = 0; ctx->total[1] = 0;
@@ -60,9 +59,7 @@ sha256_start(ctx)
} }
static void static void
sha256_process(ctx, data) sha256_process(context_sha256_T *ctx, char_u data[64])
context_sha256_T *ctx;
char_u data[64];
{ {
UINT32_T temp1, temp2, W[64]; UINT32_T temp1, temp2, W[64];
UINT32_T A, B, C, D, E, F, G, H; UINT32_T A, B, C, D, E, F, G, H;
@@ -194,10 +191,7 @@ sha256_process(ctx, data)
} }
void void
sha256_update(ctx, input, length) sha256_update(context_sha256_T *ctx, char_u *input, UINT32_T length)
context_sha256_T *ctx;
char_u *input;
UINT32_T length;
{ {
UINT32_T left, fill; UINT32_T left, fill;
@@ -241,9 +235,7 @@ static char_u sha256_padding[64] = {
}; };
void void
sha256_finish(ctx, digest) sha256_finish(context_sha256_T *ctx, char_u digest[32])
context_sha256_T *ctx;
char_u digest[32];
{ {
UINT32_T last, padn; UINT32_T last, padn;
UINT32_T high, low; 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]". * if "salt" is not NULL also do "salt[salt_len]".
*/ */
char_u * char_u *
sha256_bytes(buf, buf_len, salt, salt_len) sha256_bytes(
char_u *buf; char_u *buf,
int buf_len; int buf_len,
char_u *salt; char_u *salt,
int salt_len; int salt_len)
{ {
char_u sha256sum[32]; char_u sha256sum[32];
static char_u hexit[65]; 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. * Returns sha256(buf) as 64 hex chars in static array.
*/ */
char_u * char_u *
sha256_key(buf, salt, salt_len) sha256_key(
char_u *buf; char_u *buf,
char_u *salt; char_u *salt,
int salt_len; int salt_len)
{ {
/* No passwd means don't encrypt */ /* No passwd means don't encrypt */
if (buf == NULL || *buf == NUL) if (buf == NULL || *buf == NUL)
@@ -344,7 +336,7 @@ static char *sha_self_test_vector[] = {
* Return FAIL or OK. * Return FAIL or OK.
*/ */
int int
sha256_self_test() sha256_self_test(void)
{ {
int i, j; int i, j;
char output[65]; char output[65];
@@ -389,7 +381,7 @@ sha256_self_test()
} }
static unsigned int static unsigned int
get_some_time() get_some_time(void)
{ {
# ifdef HAVE_GETTIMEOFDAY # ifdef HAVE_GETTIMEOFDAY
struct timeval tv; struct timeval tv;
@@ -407,11 +399,11 @@ get_some_time()
* Also "salt[salt_len]" when "salt" is not NULL. * Also "salt[salt_len]" when "salt" is not NULL.
*/ */
void void
sha2_seed(header, header_len, salt, salt_len) sha2_seed(
char_u *header; char_u *header,
int header_len; int header_len,
char_u *salt; char_u *salt,
int salt_len; int salt_len)
{ {
int i; int i;
static char_u random_data[1000]; 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 * for cscope, returns TRUE if we jumped to tag or aborted, FALSE otherwise
*/ */
int int
do_tag(tag, type, count, forceit, verbose) do_tag(
char_u *tag; /* tag (pattern) to jump to */ char_u *tag, /* tag (pattern) to jump to */
int type; int type,
int count; int count,
int forceit; /* :ta with ! */ int forceit, /* :ta with ! */
int verbose; /* print "tag not found" message */ int verbose) /* print "tag not found" message */
{ {
taggy_T *tagstack = curwin->w_tagstack; taggy_T *tagstack = curwin->w_tagstack;
int tagstackidx = curwin->w_tagstackidx; int tagstackidx = curwin->w_tagstackidx;
@@ -1092,15 +1092,14 @@ end_do_tag:
* Free cached tags. * Free cached tags.
*/ */
void void
tag_freematch() tag_freematch(void)
{ {
vim_free(tagmatchname); vim_free(tagmatchname);
tagmatchname = NULL; tagmatchname = NULL;
} }
static void static void
taglen_advance(l) taglen_advance(int l)
int l;
{ {
if (l == MAXCOL) if (l == MAXCOL)
{ {
@@ -1115,8 +1114,7 @@ taglen_advance(l)
* Print the tag stack * Print the tag stack
*/ */
void void
do_tags(eap) do_tags(exarg_T *eap UNUSED)
exarg_T *eap UNUSED;
{ {
int i; int i;
char_u *name; 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') * Make sure case is folded to uppercase in comparison (like for 'sort -f')
*/ */
static int static int
tag_strnicmp(s1, s2, len) tag_strnicmp(char_u *s1, char_u *s2, size_t len)
char_u *s1;
char_u *s2;
size_t len;
{ {
int i; 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". * Extract info from the tag search pattern "pats->pat".
*/ */
static void static void
prepare_pats(pats, has_re) prepare_pats(pat_T *pats, int has_re)
pat_T *pats;
int has_re;
{ {
pats->head = pats->pat; pats->head = pats->pat;
pats->headlen = pats->len; pats->headlen = pats->len;
@@ -1267,14 +1260,14 @@ prepare_pats(pats, has_re)
* TAG_KEEP_LANG keep language * TAG_KEEP_LANG keep language
*/ */
int int
find_tags(pat, num_matches, matchesp, flags, mincount, buf_ffname) find_tags(
char_u *pat; /* pattern to search for */ char_u *pat, /* pattern to search for */
int *num_matches; /* return: number of matches found */ int *num_matches, /* return: number of matches found */
char_u ***matchesp; /* return: array of matches found */ char_u ***matchesp, /* return: array of matches found */
int flags; int flags,
int mincount; /* MAXCOL: find all matches int mincount, /* MAXCOL: find all matches
other: minimal number of 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; FILE *fp;
char_u *lbuf; /* line buffer */ char_u *lbuf; /* line buffer */
@@ -2577,9 +2570,7 @@ static void found_tagfile_cb(char_u *fname, void *cookie);
* 'runtimepath' doc directories. * 'runtimepath' doc directories.
*/ */
static void static void
found_tagfile_cb(fname, cookie) found_tagfile_cb(char_u *fname, void *cookie UNUSED)
char_u *fname;
void *cookie UNUSED;
{ {
if (ga_grow(&tag_fnames, 1) == OK) if (ga_grow(&tag_fnames, 1) == OK)
((char_u **)(tag_fnames.ga_data))[tag_fnames.ga_len++] = ((char_u **)(tag_fnames.ga_data))[tag_fnames.ga_len++] =
@@ -2588,7 +2579,7 @@ found_tagfile_cb(fname, cookie)
#if defined(EXITFREE) || defined(PROTO) #if defined(EXITFREE) || defined(PROTO)
void void
free_tag_stuff() free_tag_stuff(void)
{ {
ga_clear_strings(&tag_fnames); ga_clear_strings(&tag_fnames);
do_tag(NULL, DT_FREE, 0, 0, 0); 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. * Return FAIL if no more tag file names, OK otherwise.
*/ */
int int
get_tagfname(tnp, first, buf) get_tagfname(
tagname_T *tnp; /* holds status info */ tagname_T *tnp, /* holds status info */
int first; /* TRUE when first file name is wanted */ int first, /* TRUE when first file name is wanted */
char_u *buf; /* pointer to buffer of MAXPATHL chars */ char_u *buf) /* pointer to buffer of MAXPATHL chars */
{ {
char_u *fname = NULL; char_u *fname = NULL;
char_u *r_ptr; 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(). * Free the contents of a tagname_T that was filled by get_tagfname().
*/ */
void void
tagname_free(tnp) tagname_free(tagname_T *tnp)
tagname_T *tnp;
{ {
vim_free(tnp->tn_tags); vim_free(tnp->tn_tags);
vim_findfile_cleanup(tnp->tn_search_ctx); 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. * Return FAIL if there is a format error in this line, OK otherwise.
*/ */
static int static int
parse_tag_line(lbuf, parse_tag_line(
char_u *lbuf, /* line to be parsed */
#ifdef FEAT_EMACS_TAGS #ifdef FEAT_EMACS_TAGS
is_etag, int is_etag,
#endif #endif
tagp) tagptrs_T *tagp)
char_u *lbuf; /* line to be parsed */
#ifdef FEAT_EMACS_TAGS
int is_etag;
#endif
tagptrs_T *tagp;
{ {
char_u *p; char_u *p;
@@ -2895,8 +2881,7 @@ etag_fail:
* Return FALSE if it is not a static tag. * Return FALSE if it is not a static tag.
*/ */
static int static int
test_for_static(tagp) test_for_static(tagptrs_T *tagp)
tagptrs_T *tagp;
{ {
char_u *p; char_u *p;
@@ -2942,9 +2927,9 @@ test_for_static(tagp)
* Return OK or FAIL. * Return OK or FAIL.
*/ */
static int static int
parse_match(lbuf, tagp) parse_match(
char_u *lbuf; /* input: matching line */ char_u *lbuf, /* input: matching line */
tagptrs_T *tagp; /* output: pointers into the line */ tagptrs_T *tagp) /* output: pointers into the line */
{ {
int retval; int retval;
char_u *p; char_u *p;
@@ -3022,8 +3007,7 @@ parse_match(lbuf, tagp)
* Returns an allocated string or NULL (out of memory). * Returns an allocated string or NULL (out of memory).
*/ */
static char_u * static char_u *
tag_full_fname(tagp) tag_full_fname(tagptrs_T *tagp)
tagptrs_T *tagp;
{ {
char_u *fullname; char_u *fullname;
int c; int c;
@@ -3053,10 +3037,10 @@ tag_full_fname(tagp)
* returns OK for success, NOTAGFILE when file not found, FAIL otherwise. * returns OK for success, NOTAGFILE when file not found, FAIL otherwise.
*/ */
static int static int
jumpto_tag(lbuf, forceit, keep_help) jumpto_tag(
char_u *lbuf; /* line from the tags file for this tag */ char_u *lbuf, /* line from the tags file for this tag */
int forceit; /* :ta with ! */ int forceit, /* :ta with ! */
int keep_help; /* keep help flag (FALSE for cscope) */ int keep_help) /* keep help flag (FALSE for cscope) */
{ {
int save_secure; int save_secure;
int save_magic; int save_magic;
@@ -3417,10 +3401,7 @@ erret:
* Returns a pointer to allocated memory (or NULL when out of memory). * Returns a pointer to allocated memory (or NULL when out of memory).
*/ */
static char_u * static char_u *
expand_tag_fname(fname, tag_fname, expand) expand_tag_fname(char_u *fname, char_u *tag_fname, int expand)
char_u *fname;
char_u *tag_fname;
int expand;
{ {
char_u *p; char_u *p;
char_u *retval; char_u *retval;
@@ -3471,8 +3452,7 @@ expand_tag_fname(fname, tag_fname, expand)
* length as that supplied, or shorter. * length as that supplied, or shorter.
*/ */
void void
simplify_filename(filename) simplify_filename(char_u *filename)
char_u *filename;
{ {
#ifndef AMIGA /* Amiga doesn't have "..", it uses "/" */ #ifndef AMIGA /* Amiga doesn't have "..", it uses "/" */
int components = 0; int components = 0;
@@ -3684,16 +3664,14 @@ simplify_filename(filename)
* file. * file.
*/ */
static int static int
test_for_current(
#ifdef FEAT_EMACS_TAGS #ifdef FEAT_EMACS_TAGS
test_for_current(is_etag, fname, fname_end, tag_fname, buf_ffname) int is_etag,
int is_etag;
#else
test_for_current(fname, fname_end, tag_fname, buf_ffname)
#endif #endif
char_u *fname; char_u *fname,
char_u *fname_end; char_u *fname_end,
char_u *tag_fname; char_u *tag_fname,
char_u *buf_ffname; char_u *buf_ffname)
{ {
int c; int c;
int retval = FALSE; int retval = FALSE;
@@ -3730,8 +3708,7 @@ test_for_current(fname, fname_end, tag_fname, buf_ffname)
* Return OK if ";\"" is following, FAIL otherwise. * Return OK if ";\"" is following, FAIL otherwise.
*/ */
static int static int
find_extra(pp) find_extra(char_u **pp)
char_u **pp;
{ {
char_u *str = *pp; char_u *str = *pp;
@@ -3766,11 +3743,11 @@ find_extra(pp)
#if defined(FEAT_CMDL_COMPL) || defined(PROTO) #if defined(FEAT_CMDL_COMPL) || defined(PROTO)
int int
expand_tags(tagnames, pat, num_file, file) expand_tags(
int tagnames; /* expand tag names */ int tagnames, /* expand tag names */
char_u *pat; char_u *pat,
int *num_file; int *num_file,
char_u ***file; char_u ***file)
{ {
int i; int i;
int c; 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. * Return OK or FAIL.
*/ */
static int static int
add_tag_field(dict, field_name, start, end) add_tag_field(
dict_T *dict; dict_T *dict,
char *field_name; char *field_name,
char_u *start; /* start of the value */ char_u *start, /* start of the value */
char_u *end; /* after the value; can be NULL */ char_u *end) /* after the value; can be NULL */
{ {
char_u *buf; char_u *buf;
int len = 0; int len = 0;
@@ -3870,9 +3847,7 @@ add_tag_field(dict, field_name, start, end)
* as a dictionary * as a dictionary
*/ */
int int
get_tags(list, pat) get_tags(list_T *list, char_u *pat)
list_T *list;
char_u *pat;
{ {
int num_matches, i, ret; int num_matches, i, ret;
char_u **matches, *p; char_u **matches, *p;

View File

@@ -1412,8 +1412,7 @@ static int check_for_codes = FALSE; /* check for key code response */
#endif #endif
static struct builtin_term * static struct builtin_term *
find_builtin_term(term) find_builtin_term(char_u *term)
char_u *term;
{ {
struct builtin_term *p; 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(). * The terminal's name is not set, as this is already done in termcapinit().
*/ */
static void static void
parse_builtin_tcap(term) parse_builtin_tcap(char_u *term)
char_u *term;
{ {
struct builtin_term *p; struct builtin_term *p;
char_u name[2]; 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[]). * Store it as a string in T_CCO (using nr_colors[]).
*/ */
static void static void
set_color_count(nr) set_color_count(int nr)
int nr;
{ {
char_u nr_colors[20]; /* string for number of colors */ 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. * While doing this, until ttest(), some options may be NULL, be careful.
*/ */
int int
set_termname(term) set_termname(char_u *term)
char_u *term;
{ {
struct builtin_term *termp; struct builtin_term *termp;
#ifdef HAVE_TGETENT #ifdef HAVE_TGETENT
@@ -2031,9 +2027,9 @@ static int has_mouse_termcode = 0;
# if (!defined(UNIX) || defined(FEAT_MOUSE_TTY)) || defined(PROTO) # if (!defined(UNIX) || defined(FEAT_MOUSE_TTY)) || defined(PROTO)
void void
set_mouse_termcode(n, s) set_mouse_termcode(
int n; /* KS_MOUSE, KS_NETTERM_MOUSE or KS_DEC_MOUSE */ int n, /* KS_MOUSE, KS_NETTERM_MOUSE or KS_DEC_MOUSE */
char_u *s; char_u *s)
{ {
char_u name[2]; char_u name[2];
@@ -2079,8 +2075,8 @@ set_mouse_termcode(n, s)
# if ((defined(UNIX) || defined(VMS)) \ # if ((defined(UNIX) || defined(VMS)) \
&& defined(FEAT_MOUSE_TTY)) || defined(PROTO) && defined(FEAT_MOUSE_TTY)) || defined(PROTO)
void void
del_mouse_termcode(n) del_mouse_termcode(
int n; /* KS_MOUSE, KS_NETTERM_MOUSE or KS_DEC_MOUSE */ int n) /* KS_MOUSE, KS_NETTERM_MOUSE or KS_DEC_MOUSE */
{ {
char_u name[2]; char_u name[2];
@@ -2130,9 +2126,7 @@ del_mouse_termcode(n)
* Return error message if it fails, NULL if it's OK. * Return error message if it fails, NULL if it's OK.
*/ */
static char_u * static char_u *
tgetent_error(tbuf, term) tgetent_error(char_u *tbuf, char_u *term)
char_u *tbuf;
char_u *term;
{ {
int i; int i;
@@ -2167,9 +2161,7 @@ tgetent_error(tbuf, term)
* Fix that here. * Fix that here.
*/ */
static char_u * static char_u *
vim_tgetstr(s, pp) vim_tgetstr(char *s, char_u **pp)
char *s;
char_u **pp;
{ {
char *p; char *p;
@@ -2188,9 +2180,9 @@ vim_tgetstr(s, pp)
* Errors while getting the entries are ignored. * Errors while getting the entries are ignored.
*/ */
void void
getlinecol(cp, rp) getlinecol(
long *cp; /* pointer to columns */ long *cp, /* pointer to columns */
long *rp; /* pointer to rows */ long *rp) /* pointer to rows */
{ {
char_u tbuf[TBUFSZ]; 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. * Return FAIL if the entry was not found, OK if the entry was added.
*/ */
int int
add_termcap_entry(name, force) add_termcap_entry(char_u *name, int force)
char_u *name;
int force;
{ {
char_u *term; char_u *term;
int key; int key;
@@ -2321,8 +2311,7 @@ add_termcap_entry(name, force)
} }
static int static int
term_is_builtin(name) term_is_builtin(char_u *name)
char_u *name;
{ {
return (STRNCMP(name, "builtin_", (size_t)8) == 0); return (STRNCMP(name, "builtin_", (size_t)8) == 0);
} }
@@ -2333,8 +2322,7 @@ term_is_builtin(name)
* "8bit", like in "xterm-8bit". * "8bit", like in "xterm-8bit".
*/ */
int int
term_is_8bit(name) term_is_8bit(char_u *name)
char_u *name;
{ {
return (detected_8bit || strstr((char *)name, "8bit") != NULL); return (detected_8bit || strstr((char *)name, "8bit") != NULL);
} }
@@ -2346,8 +2334,7 @@ term_is_8bit(name)
* <Esc>O -> <M-C-O> * <Esc>O -> <M-C-O>
*/ */
static int static int
term_7to8bit(p) term_7to8bit(char_u *p)
char_u *p;
{ {
if (*p == ESC) if (*p == ESC)
{ {
@@ -2363,8 +2350,7 @@ term_7to8bit(p)
#ifdef FEAT_GUI #ifdef FEAT_GUI
int int
term_is_gui(name) term_is_gui(char_u *name)
char_u *name;
{ {
return (STRCMP(name, "builtin_gui") == 0 || STRCMP(name, "gui") == 0); 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) #if !defined(HAVE_TGETENT) || defined(AMIGA) || defined(PROTO)
char_u * char_u *
tltoa(i) tltoa(unsigned long i)
unsigned long i;
{ {
static char_u buf[16]; static char_u buf[16];
char_u *p; char_u *p;
@@ -2401,9 +2386,7 @@ tltoa(i)
static char *tgoto(char *, int, int); static char *tgoto(char *, int, int);
static char * static char *
tgoto(cm, x, y) tgoto(char *cm, int x, int y)
char *cm;
int x, y;
{ {
static char buf[30]; static char buf[30];
char *p, *s, *e; char *p, *s, *e;
@@ -2453,8 +2436,7 @@ tgoto(cm, x, y)
* If that fails, use the default terminal name. * If that fails, use the default terminal name.
*/ */
void void
termcapinit(name) termcapinit(char_u *name)
char_u *name;
{ {
char_u *term; char_u *term;
@@ -2511,7 +2493,7 @@ static int out_pos = 0; /* number of chars in out_buf */
* out_flush(): flush the output buffer * out_flush(): flush the output buffer
*/ */
void void
out_flush() out_flush(void)
{ {
int len; int len;
@@ -2530,7 +2512,7 @@ out_flush()
* To avoid flushing half of the character, call this function first. * To avoid flushing half of the character, call this function first.
*/ */
void void
out_flush_check() out_flush_check(void)
{ {
if (enc_dbcs != 0 && out_pos >= OUT_SIZE - MB_MAXBYTES) if (enc_dbcs != 0 && out_pos >= OUT_SIZE - MB_MAXBYTES)
out_flush(); out_flush();
@@ -2542,7 +2524,7 @@ out_flush_check()
* out_trash(): Throw away the contents of the output buffer * out_trash(): Throw away the contents of the output buffer
*/ */
void void
out_trash() out_trash(void)
{ {
out_pos = 0; out_pos = 0;
} }
@@ -2555,8 +2537,7 @@ out_trash()
* like msg_puts() and screen_putchar() for that). * like msg_puts() and screen_putchar() for that).
*/ */
void void
out_char(c) out_char(unsigned c)
unsigned c;
{ {
#if defined(UNIX) || defined(VMS) || defined(AMIGA) || defined(MACOS_X_UNIX) #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) */ 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 * out_char_nf(c): like out_char(), but don't flush when p_wd is set
*/ */
static void static void
out_char_nf(c) out_char_nf(unsigned c)
unsigned c;
{ {
#if defined(UNIX) || defined(VMS) || defined(AMIGA) || defined(MACOS_X_UNIX) #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) */ 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). * normal text (use functions like msg_puts() and screen_putchar() for that).
*/ */
void void
out_str_nf(s) out_str_nf(char_u *s)
char_u *s;
{ {
if (out_pos > OUT_SIZE - 20) /* avoid terminal strings being split up */ if (out_pos > OUT_SIZE - 20) /* avoid terminal strings being split up */
out_flush(); out_flush();
@@ -2623,8 +2602,7 @@ out_str_nf(s)
* normal text (use functions like msg_puts() and screen_putchar() for that). * normal text (use functions like msg_puts() and screen_putchar() for that).
*/ */
void void
out_str(s) out_str(char_u *s)
char_u *s;
{ {
if (s != NULL && *s) if (s != NULL && *s)
{ {
@@ -2656,39 +2634,32 @@ out_str(s)
* cursor positioning using termcap parser. (jw) * cursor positioning using termcap parser. (jw)
*/ */
void void
term_windgoto(row, col) term_windgoto(int row, int col)
int row;
int col;
{ {
OUT_STR(tgoto((char *)T_CM, col, row)); OUT_STR(tgoto((char *)T_CM, col, row));
} }
void void
term_cursor_right(i) term_cursor_right(int i)
int i;
{ {
OUT_STR(tgoto((char *)T_CRI, 0, i)); OUT_STR(tgoto((char *)T_CRI, 0, i));
} }
void void
term_append_lines(line_count) term_append_lines(int line_count)
int line_count;
{ {
OUT_STR(tgoto((char *)T_CAL, 0, line_count)); OUT_STR(tgoto((char *)T_CAL, 0, line_count));
} }
void void
term_delete_lines(line_count) term_delete_lines(int line_count)
int line_count;
{ {
OUT_STR(tgoto((char *)T_CDL, 0, line_count)); OUT_STR(tgoto((char *)T_CDL, 0, line_count));
} }
#if defined(HAVE_TGETENT) || defined(PROTO) #if defined(HAVE_TGETENT) || defined(PROTO)
void void
term_set_winpos(x, y) term_set_winpos(int x, int y)
int x;
int y;
{ {
/* Can't handle a negative value here */ /* Can't handle a negative value here */
if (x < 0) if (x < 0)
@@ -2699,17 +2670,14 @@ term_set_winpos(x, y)
} }
void void
term_set_winsize(width, height) term_set_winsize(int width, int height)
int width;
int height;
{ {
OUT_STR(tgoto((char *)T_CWS, height, width)); OUT_STR(tgoto((char *)T_CWS, height, width));
} }
#endif #endif
void void
term_fg_color(n) term_fg_color(int n)
int n;
{ {
/* Use "AF" termcap entry if present, "Sf" entry otherwise */ /* Use "AF" termcap entry if present, "Sf" entry otherwise */
if (*T_CAF) if (*T_CAF)
@@ -2719,8 +2687,7 @@ term_fg_color(n)
} }
void void
term_bg_color(n) term_bg_color(int n)
int n;
{ {
/* Use "AB" termcap entry if present, "Sb" entry otherwise */ /* Use "AB" termcap entry if present, "Sb" entry otherwise */
if (*T_CAB) if (*T_CAB)
@@ -2730,9 +2697,7 @@ term_bg_color(n)
} }
static void static void
term_color(s, n) term_color(char_u *s, int n)
char_u *s;
int n;
{ {
char buf[20]; char buf[20];
int i = 2; /* index in s[] just after <Esc>[ or CSI */ 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. * Generic function to set window title, using t_ts and t_fs.
*/ */
void void
term_settitle(title) term_settitle(char_u *title)
char_u *title;
{ {
/* t_ts takes one argument: column in status line */ /* t_ts takes one argument: column in status line */
OUT_STR(tgoto((char *)T_TS, 0, 0)); /* set title start */ 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 * Replace all entries that are NULL by empty_option
*/ */
void void
ttest(pairs) ttest(int pairs)
int pairs;
{ {
check_options(); /* make sure no options are NULL */ check_options(); /* make sure no options are NULL */
@@ -2884,9 +2847,7 @@ ttest(pairs)
* byte first, and store them in dst. * byte first, and store them in dst.
*/ */
void void
add_long_to_buf(val, dst) add_long_to_buf(long_u val, char_u *dst)
long_u val;
char_u *dst;
{ {
int i; int i;
int shift; int shift;
@@ -2909,9 +2870,7 @@ static int get_long_from_buf(char_u *buf, long_u *val);
* were present. * were present.
*/ */
static int static int
get_long_from_buf(buf, val) get_long_from_buf(char_u *buf, long_u *val)
char_u *buf;
long_u *val;
{ {
int len; int len;
char_u bytes[sizeof(long_u)]; char_u bytes[sizeof(long_u)];
@@ -2942,10 +2901,7 @@ get_long_from_buf(buf, val)
* available. * available.
*/ */
static int static int
get_bytes_from_buf(buf, bytes, num_bytes) get_bytes_from_buf(char_u *buf, char_u *bytes, int num_bytes)
char_u *buf;
char_u *bytes;
int num_bytes;
{ {
int len = 0; int len = 0;
int i; int i;
@@ -2982,7 +2938,7 @@ get_bytes_from_buf(buf, bytes, num_bytes)
* too big. * too big.
*/ */
void void
check_shellsize() check_shellsize(void)
{ {
if (Rows < min_rows()) /* need room for one window and command line */ if (Rows < min_rows()) /* need room for one window and command line */
Rows = min_rows(); Rows = min_rows();
@@ -2993,7 +2949,7 @@ check_shellsize()
* Limit Rows and Columns to avoid an overflow in Rows * Columns. * Limit Rows and Columns to avoid an overflow in Rows * Columns.
*/ */
void void
limit_screen_size() limit_screen_size(void)
{ {
if (Columns < MIN_COLUMNS) if (Columns < MIN_COLUMNS)
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. * Invoked just before the screen structures are going to be (re)allocated.
*/ */
void void
win_new_shellsize() win_new_shellsize(void)
{ {
static int old_Rows = 0; static int old_Rows = 0;
static int old_Columns = 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). * Will obtain the current size and redraw (also when size didn't change).
*/ */
void void
shell_resized() shell_resized(void)
{ {
set_shellsize(0, 0, FALSE); set_shellsize(0, 0, FALSE);
} }
@@ -3046,7 +3002,7 @@ shell_resized()
* When the size didn't change, nothing happens. * When the size didn't change, nothing happens.
*/ */
void void
shell_resized_check() shell_resized_check(void)
{ {
int old_Rows = Rows; int old_Rows = Rows;
int old_Columns = Columns; int old_Columns = Columns;
@@ -3074,9 +3030,7 @@ shell_resized_check()
* it fails use 'width' and 'height'. * it fails use 'width' and 'height'.
*/ */
void void
set_shellsize(width, height, mustset) set_shellsize(int width, int height, int mustset)
int width, height;
int mustset;
{ {
static int busy = FALSE; static int busy = FALSE;
@@ -3192,8 +3146,7 @@ set_shellsize(width, height, mustset)
* commands and Ex mode). * commands and Ex mode).
*/ */
void void
settmode(tmode) settmode(int tmode)
int tmode;
{ {
#ifdef FEAT_GUI #ifdef FEAT_GUI
/* don't set the term where gvim was started to any mode */ /* don't set the term where gvim was started to any mode */
@@ -3248,7 +3201,7 @@ settmode(tmode)
} }
void void
starttermcap() starttermcap(void)
{ {
if (full_screen && !termcap_active) if (full_screen && !termcap_active)
{ {
@@ -3273,7 +3226,7 @@ starttermcap()
} }
void void
stoptermcap() stoptermcap(void)
{ {
screen_stop_highlight(); screen_stop_highlight();
reset_cterm_colors(); reset_cterm_colors();
@@ -3329,7 +3282,7 @@ stoptermcap()
* The result is caught in check_termcode(). * The result is caught in check_termcode().
*/ */
void void
may_req_termresponse() may_req_termresponse(void)
{ {
if (crv_status == CRV_GET if (crv_status == CRV_GET
&& cur_tmode == TMODE_RAW && cur_tmode == TMODE_RAW
@@ -3363,7 +3316,7 @@ may_req_termresponse()
* it must be called immediately after entering termcap mode. * it must be called immediately after entering termcap mode.
*/ */
void void
may_req_ambiguous_char_width() may_req_ambiguous_char_width(void)
{ {
if (u7_status == U7_GET if (u7_status == U7_GET
&& cur_tmode == TMODE_RAW && cur_tmode == TMODE_RAW
@@ -3404,7 +3357,7 @@ may_req_ambiguous_char_width()
* color when it is the right moment. * color when it is the right moment.
*/ */
void void
may_req_bg_color() may_req_bg_color(void)
{ {
if (rbg_status == RBG_GET if (rbg_status == RBG_GET
&& cur_tmode == TMODE_RAW && cur_tmode == TMODE_RAW
@@ -3456,7 +3409,7 @@ log_tr(char *msg)
* Return TRUE when saving and restoring the screen. * Return TRUE when saving and restoring the screen.
*/ */
int int
swapping_screen() swapping_screen(void)
{ {
return (full_screen && *T_TI != NUL); return (full_screen && *T_TI != NUL);
} }
@@ -3466,7 +3419,7 @@ swapping_screen()
* setmouse() - switch mouse on/off depending on current mode and 'mouse' * setmouse() - switch mouse on/off depending on current mode and 'mouse'
*/ */
void void
setmouse() setmouse(void)
{ {
# ifdef FEAT_MOUSE_TTY # ifdef FEAT_MOUSE_TTY
int checkfor; int checkfor;
@@ -3521,8 +3474,7 @@ setmouse()
* normal editing mode (not at hit-return message). * normal editing mode (not at hit-return message).
*/ */
int int
mouse_has(c) mouse_has(int c)
int c;
{ {
char_u *p; char_u *p;
@@ -3544,7 +3496,7 @@ mouse_has(c)
* Return TRUE when 'mousemodel' is set to "popup" or "popup_setpos". * Return TRUE when 'mousemodel' is set to "popup" or "popup_setpos".
*/ */
int int
mouse_model_popup() mouse_model_popup(void)
{ {
return (p_mousem[0] == 'p'); return (p_mousem[0] == 'p');
} }
@@ -3556,7 +3508,7 @@ mouse_model_popup()
* Used when starting Vim or returning from a shell. * Used when starting Vim or returning from a shell.
*/ */
void void
scroll_start() scroll_start(void)
{ {
if (*T_VS != NUL) if (*T_VS != NUL)
{ {
@@ -3572,7 +3524,7 @@ static int cursor_is_off = FALSE;
* Enable the cursor. * Enable the cursor.
*/ */
void void
cursor_on() cursor_on(void)
{ {
if (cursor_is_off) if (cursor_is_off)
{ {
@@ -3585,7 +3537,7 @@ cursor_on()
* Disable the cursor. * Disable the cursor.
*/ */
void void
cursor_off() cursor_off(void)
{ {
if (full_screen) if (full_screen)
{ {
@@ -3600,7 +3552,7 @@ cursor_off()
* Set cursor shape to match Insert or Replace mode. * Set cursor shape to match Insert or Replace mode.
*/ */
void void
term_cursor_shape() term_cursor_shape(void)
{ {
static int showing_mode = NORMAL; static int showing_mode = NORMAL;
char_u *p; char_u *p;
@@ -3648,9 +3600,7 @@ term_cursor_shape()
* the full width of the window, excluding the vertical separator. * the full width of the window, excluding the vertical separator.
*/ */
void void
scroll_region_set(wp, off) scroll_region_set(win_T *wp, int off)
win_T *wp;
int off;
{ {
OUT_STR(tgoto((char *)T_CS, W_WINROW(wp) + wp->w_height - 1, OUT_STR(tgoto((char *)T_CS, W_WINROW(wp) + wp->w_height - 1,
W_WINROW(wp) + off)); W_WINROW(wp) + off));
@@ -3666,7 +3616,7 @@ scroll_region_set(wp, off)
* Reset scrolling region to the whole screen. * Reset scrolling region to the whole screen.
*/ */
void void
scroll_region_reset() scroll_region_reset(void)
{ {
OUT_STR(tgoto((char *)T_CS, (int)Rows - 1, 0)); OUT_STR(tgoto((char *)T_CS, (int)Rows - 1, 0));
#ifdef FEAT_VERTSPLIT #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); static int termcode_star(char_u *code, int len);
void void
clear_termcodes() clear_termcodes(void)
{ {
while (tc_len > 0) while (tc_len > 0)
vim_free(termcodes[--tc_len].code); vim_free(termcodes[--tc_len].code);
@@ -3722,10 +3672,7 @@ clear_termcodes()
* "flags" can also be ATC_FROM_TERM for got_code_from_term(). * "flags" can also be ATC_FROM_TERM for got_code_from_term().
*/ */
void void
add_termcode(name, string, flags) add_termcode(char_u *name, char_u *string, int flags)
char_u *name;
char_u *string;
int flags;
{ {
struct termcode *new_tc; struct termcode *new_tc;
int i, j; 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. * Return 0 if not found, 2 for ;*X and 1 for O*X and <M-O>*X.
*/ */
static int static int
termcode_star(code, len) termcode_star(char_u *code, int len)
char_u *code;
int len;
{ {
/* Shortest is <M-O>*X. With ; shortest is <CSI>1;*X */ /* Shortest is <M-O>*X. With ; shortest is <CSI>1;*X */
if (len >= 3 && code[len - 2] == '*') if (len >= 3 && code[len - 2] == '*')
@@ -3870,8 +3815,7 @@ termcode_star(code, len)
} }
char_u * char_u *
find_termcode(name) find_termcode(char_u *name)
char_u *name;
{ {
int i; int i;
@@ -3883,8 +3827,7 @@ find_termcode(name)
#if defined(FEAT_CMDL_COMPL) || defined(PROTO) #if defined(FEAT_CMDL_COMPL) || defined(PROTO)
char_u * char_u *
get_termcode(i) get_termcode(int i)
int i;
{ {
if (i >= tc_len) if (i >= tc_len)
return NULL; return NULL;
@@ -3893,8 +3836,7 @@ get_termcode(i)
#endif #endif
void void
del_termcode(name) del_termcode(char_u *name)
char_u *name;
{ {
int i; int i;
@@ -3913,8 +3855,7 @@ del_termcode(name)
} }
static void static void
del_termcode_idx(idx) del_termcode_idx(int idx)
int idx;
{ {
int i; int i;
@@ -3930,7 +3871,7 @@ del_termcode_idx(idx)
* Convert all 7-bit codes to their 8-bit equivalent. * Convert all 7-bit codes to their 8-bit equivalent.
*/ */
static void static void
switch_to_8bit() switch_to_8bit(void)
{ {
int i; int i;
int c; int c;
@@ -3971,8 +3912,7 @@ static int orig_topfill = 0;
* click still works. * click still works.
*/ */
void void
set_mouse_topline(wp) set_mouse_topline(win_T *wp)
win_T *wp;
{ {
orig_topline = wp->w_topline; orig_topline = wp->w_topline;
# ifdef FEAT_DIFF # ifdef FEAT_DIFF
@@ -3995,11 +3935,11 @@ set_mouse_topline(wp)
* inserts and deletes. * inserts and deletes.
*/ */
int int
check_termcode(max_offset, buf, bufsize, buflen) check_termcode(
int max_offset; int max_offset,
char_u *buf; char_u *buf,
int bufsize; int bufsize,
int *buflen; int *buflen)
{ {
char_u *tp; char_u *tp;
char_u *p; char_u *p;
@@ -5459,12 +5399,12 @@ check_termcode(max_offset, buf, bufsize, buflen)
* instead of a CTRL-V. * instead of a CTRL-V.
*/ */
char_u * char_u *
replace_termcodes(from, bufp, from_part, do_lt, special) replace_termcodes(
char_u *from; char_u *from,
char_u **bufp; char_u **bufp,
int from_part; int from_part,
int do_lt; /* also translate <lt> */ int do_lt, /* also translate <lt> */
int special; /* always accept <key> notation */ int special) /* always accept <key> notation */
{ {
int i; int i;
int slen; 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. * Return the index in termcodes[], or -1 if not found.
*/ */
int int
find_term_bykeys(src) find_term_bykeys(char_u *src)
char_u *src;
{ {
int i; int i;
int slen = (int)STRLEN(src); int slen = (int)STRLEN(src);
@@ -5693,7 +5632,7 @@ find_term_bykeys(src)
* Used to speed up check_termcode(). * Used to speed up check_termcode().
*/ */
static void static void
gather_termleader() gather_termleader(void)
{ {
int i; int i;
int len = 0; int len = 0;
@@ -5724,7 +5663,7 @@ gather_termleader()
* This code looks a lot like showoptions(), but is different. * This code looks a lot like showoptions(), but is different.
*/ */
void void
show_termcodes() show_termcodes(void)
{ {
int col; int col;
int *items; int *items;
@@ -5810,10 +5749,7 @@ show_termcodes()
* Output goes into IObuff[] * Output goes into IObuff[]
*/ */
int int
show_one_termcode(name, code, printit) show_one_termcode(char_u *name, char_u *code, int printit)
char_u *name;
char_u *code;
int printit;
{ {
char_u *p; char_u *p;
int len; int len;
@@ -5870,7 +5806,7 @@ static int xt_index_in = 0;
static int xt_index_out = 0; static int xt_index_out = 0;
static void static void
req_codes_from_term() req_codes_from_term(void)
{ {
xt_index_out = 0; xt_index_out = 0;
xt_index_in = 0; xt_index_in = 0;
@@ -5878,7 +5814,7 @@ req_codes_from_term()
} }
static void static void
req_more_codes_from_term() req_more_codes_from_term(void)
{ {
char buf[11]; char buf[11];
int old_idx = xt_index_out; int old_idx = xt_index_out;
@@ -5916,9 +5852,7 @@ req_more_codes_from_term()
* "code" points to the "0" or "1". * "code" points to the "0" or "1".
*/ */
static void static void
got_code_from_term(code, len) got_code_from_term(char_u *code, int len)
char_u *code;
int len;
{ {
#define XT_LEN 100 #define XT_LEN 100
char_u name[3]; char_u name[3];
@@ -6006,7 +5940,7 @@ got_code_from_term(code, len)
* handled as typed text. * handled as typed text.
*/ */
static void static void
check_for_codes_from_term() check_for_codes_from_term(void)
{ {
int c; int c;
@@ -6058,9 +5992,9 @@ check_for_codes_from_term()
* Returns NULL when there is a problem. * Returns NULL when there is a problem.
*/ */
char_u * char_u *
translate_mapping(str, expmap) translate_mapping(
char_u *str; char_u *str,
int expmap; /* TRUE when expanding mappings on command-line */ int expmap) /* TRUE when expanding mappings on command-line */
{ {
garray_T ga; garray_T ga;
int c; int c;
@@ -6148,8 +6082,7 @@ static char ksmd_str[20];
* For Win32 console: update termcap codes for existing console attributes. * For Win32 console: update termcap codes for existing console attributes.
*/ */
void void
update_tcap(attr) update_tcap(int attr)
int attr;
{ {
struct builtin_term *p; struct builtin_term *p;

View File

@@ -66,9 +66,9 @@ short ospeed; /* Baud rate (1-16, 1=300, 16=19200), as in stty */
#endif #endif
int int
tgetent(tbuf, term) tgetent(
char *tbuf; /* Buffer to hold termcap entry, TBUFSZ bytes max */ char *tbuf, /* Buffer to hold termcap entry, TBUFSZ bytes max */
char *term; /* Name of terminal */ char *term) /* Name of terminal */
{ {
char tcbuf[32]; /* Temp buffer to handle */ char tcbuf[32]; /* Temp buffer to handle */
char *tcptr = tcbuf; /* extended entries */ char *tcptr = tcbuf; /* extended entries */
@@ -140,10 +140,7 @@ tgetent(tbuf, term)
} }
static int static int
getent(tbuf, term, termcap, buflen) getent(char *tbuf, *term, FILE *termcap, int buflen)
char *tbuf, *term;
FILE *termcap;
int buflen;
{ {
char *tptr; char *tptr;
int tlen = strlen(term); int tlen = strlen(term);
@@ -171,11 +168,11 @@ getent(tbuf, term, termcap, buflen)
return 0; return 0;
} }
/*
* Read 1 entry from TERMCAP file.
*/
static int static int
nextent(tbuf, termcap, buflen) /* Read 1 entry from TERMCAP file */ nextent(char *tbuf, FILE *termcap, int buflen)
char *tbuf;
FILE *termcap;
int buflen;
{ {
char *lbuf = tbuf; /* lbuf=line buffer */ char *lbuf = tbuf; /* lbuf=line buffer */
/* read lines straight into buffer */ /* read lines straight into buffer */
@@ -218,8 +215,7 @@ nextent(tbuf, termcap, buflen) /* Read 1 entry from TERMCAP file */
*/ */
int int
tgetflag(id) tgetflag(char *id)
char *id;
{ {
char buf[256], *ptr = buf; char buf[256], *ptr = buf;
@@ -237,8 +233,7 @@ tgetflag(id)
*/ */
int int
tgetnum(id) tgetnum(char *id)
char *id;
{ {
char *ptr, buf[256]; char *ptr, buf[256];
ptr = buf; ptr = buf;
@@ -277,8 +272,7 @@ tgetnum(id)
*/ */
char * char *
tgetstr(id, buf) tgetstr(char *id, char **buf)
char *id, **buf;
{ {
int len = strlen(id); int len = strlen(id);
char *tmp=tent; char *tmp=tent;
@@ -387,10 +381,10 @@ tgetstr(id, buf)
*/ */
char * char *
tgoto(cm, col, line) tgoto(
char *cm; /* cm string, from termcap */ char *cm, /* cm string, from termcap */
int col, /* column, x position */ int col, /* column, x position */
line; /* line, y position */ int line) /* line, y position */
{ {
char gx, gy, /* x, y */ char gx, gy, /* x, y */
*ptr, /* pointer in 'cm' */ *ptr, /* pointer in 'cm' */
@@ -533,10 +527,10 @@ long _bauds[16]={
4800, 9600, 19200, 19200 }; 4800, 9600, 19200, 19200 };
int int
tputs(cp, affcnt, outc) tputs(
char *cp; /* string to print */ char *cp, /* string to print */
int affcnt; /* Number of lines affected */ int affcnt, /* Number of lines affected */
void (*outc)(unsigned int);/* routine to output 1 character */ void (*outc)(unsigned int)) /* routine to output 1 character */
{ {
long frac, /* 10^(#digits after decimal point) */ long frac, /* 10^(#digits after decimal point) */
counter, /* digits */ counter, /* digits */
@@ -578,11 +572,10 @@ tputs(cp, affcnt, outc)
* Module: tutil.c * Module: tutil.c
* *
* Purpose: Utility routines for TERMLIB functions. * Purpose: Utility routines for TERMLIB functions.
* * Returns length of text common to s1 and s2.
*/ */
static int static int
_match(s1, s2) /* returns length of text common to s1 and s2 */ _match(char *s1, char *s2)
char *s1, *s2;
{ {
int i = 0; 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 * finds next c in s that's a member of set, returns pointer
*/ */
static char * static char *
_find(s, set) _find(char *s, char *set)
char *s, *set;
{ {
for(; *s; s++) for(; *s; s++)
{ {
@@ -617,9 +609,7 @@ _find(s, set)
* add val to buf according to format fmt * add val to buf according to format fmt
*/ */
static char * static char *
_addfmt(buf, fmt, val) _addfmt(char *buf, char *fmt, int val)
char *buf, *fmt;
int val;
{ {
sprintf(buf, fmt, val); sprintf(buf, fmt, val);
while (*buf) while (*buf)

327
src/ui.c
View File

@@ -25,9 +25,7 @@
#endif #endif
void void
ui_write(s, len) ui_write(char_u *s, int len)
char_u *s;
int len;
{ {
#ifdef FEAT_GUI #ifdef FEAT_GUI
if (gui.in_use && !gui.dying && !gui.starting) 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*/ static int ta_len; /* length of ta_str when it's not NULL*/
void void
ui_inchar_undo(s, len) ui_inchar_undo(char_u *s, int len)
char_u *s;
int len;
{ {
char_u *new; char_u *new;
int newlen; int newlen;
@@ -117,11 +113,11 @@ ui_inchar_undo(s, len)
* otherwise. * otherwise.
*/ */
int int
ui_inchar(buf, maxlen, wtime, tb_change_cnt) ui_inchar(
char_u *buf; char_u *buf,
int maxlen; int maxlen,
long wtime; /* don't use "time", MIPS cannot handle it */ long wtime, /* don't use "time", MIPS cannot handle it */
int tb_change_cnt; int tb_change_cnt)
{ {
int retval = 0; int retval = 0;
@@ -220,7 +216,7 @@ theend:
* return non-zero if a character is available * return non-zero if a character is available
*/ */
int int
ui_char_avail() ui_char_avail(void)
{ {
#ifdef FEAT_GUI #ifdef FEAT_GUI
if (gui.in_use) if (gui.in_use)
@@ -245,9 +241,7 @@ ui_char_avail()
* cancel the delay if a key is hit. * cancel the delay if a key is hit.
*/ */
void void
ui_delay(msec, ignoreinput) ui_delay(long msec, int ignoreinput)
long msec;
int ignoreinput;
{ {
#ifdef FEAT_GUI #ifdef FEAT_GUI
if (gui.in_use && !ignoreinput) if (gui.in_use && !ignoreinput)
@@ -263,7 +257,7 @@ ui_delay(msec, ignoreinput)
* When running the GUI iconify the window. * When running the GUI iconify the window.
*/ */
void void
ui_suspend() ui_suspend(void)
{ {
#ifdef FEAT_GUI #ifdef FEAT_GUI
if (gui.in_use) if (gui.in_use)
@@ -281,7 +275,7 @@ ui_suspend()
* This is never called in the GUI. * This is never called in the GUI.
*/ */
void void
suspend_shell() suspend_shell(void)
{ {
if (*p_sh == NUL) if (*p_sh == NUL)
EMSG(_(e_shellempty)); EMSG(_(e_shellempty));
@@ -299,7 +293,7 @@ suspend_shell()
* Return OK when size could be determined, FAIL otherwise. * Return OK when size could be determined, FAIL otherwise.
*/ */
int int
ui_get_shellsize() ui_get_shellsize(void)
{ {
int retval; int retval;
@@ -327,8 +321,8 @@ ui_get_shellsize()
* new size. If this is not possible, it will adjust Rows and Columns. * new size. If this is not possible, it will adjust Rows and Columns.
*/ */
void void
ui_set_shellsize(mustset) ui_set_shellsize(
int mustset UNUSED; /* set by the user */ int mustset UNUSED) /* set by the user */
{ {
#ifdef FEAT_GUI #ifdef FEAT_GUI
if (gui.in_use) if (gui.in_use)
@@ -343,7 +337,7 @@ ui_set_shellsize(mustset)
* region. * region.
*/ */
void void
ui_new_shellsize() ui_new_shellsize(void)
{ {
if (full_screen && !exiting) if (full_screen && !exiting)
{ {
@@ -357,7 +351,7 @@ ui_new_shellsize()
} }
void void
ui_breakcheck() ui_breakcheck(void)
{ {
#ifdef FEAT_GUI #ifdef FEAT_GUI
if (gui.in_use) if (gui.in_use)
@@ -395,8 +389,7 @@ static void clip_copy_selection(VimClipboard *clip);
* the GUI starts. * the GUI starts.
*/ */
void void
clip_init(can_use) clip_init(int can_use)
int can_use;
{ {
VimClipboard *cb; VimClipboard *cb;
@@ -425,8 +418,7 @@ clip_init(can_use)
* this is called whenever VIsual mode is ended. * this is called whenever VIsual mode is ended.
*/ */
void void
clip_update_selection(clip) clip_update_selection(VimClipboard *clip)
VimClipboard *clip;
{ {
pos_T start, end; pos_T start, end;
@@ -463,8 +455,7 @@ clip_update_selection(clip)
} }
void void
clip_own_selection(cbd) clip_own_selection(VimClipboard *cbd)
VimClipboard *cbd;
{ {
/* /*
* Also want to check somehow that we are reading from the keyboard rather * Also want to check somehow that we are reading from the keyboard rather
@@ -500,8 +491,7 @@ clip_own_selection(cbd)
} }
void void
clip_lose_selection(cbd) clip_lose_selection(VimClipboard *cbd)
VimClipboard *cbd;
{ {
#ifdef FEAT_X11 #ifdef FEAT_X11
int was_owned = cbd->owned; int was_owned = cbd->owned;
@@ -543,8 +533,7 @@ clip_lose_selection(cbd)
} }
static void static void
clip_copy_selection(clip) clip_copy_selection(VimClipboard *clip)
VimClipboard *clip;
{ {
if (VIsual_active && (State & NORMAL) && clip->available) 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. * Save clip_unnamed and reset it.
*/ */
void void
start_global_changes() start_global_changes(void)
{ {
if (++global_change_count > 1) if (++global_change_count > 1)
return; return;
@@ -587,7 +576,7 @@ start_global_changes()
* Restore clip_unnamed and set the selection when needed. * Restore clip_unnamed and set the selection when needed.
*/ */
void void
end_global_changes() end_global_changes(void)
{ {
if (--global_change_count > 0) if (--global_change_count > 0)
/* recursive */ /* recursive */
@@ -619,7 +608,7 @@ end_global_changes()
* Called when Visual mode is ended: update the selection. * Called when Visual mode is ended: update the selection.
*/ */
void void
clip_auto_select() clip_auto_select(void)
{ {
if (clip_isautosel_star()) if (clip_isautosel_star())
clip_copy_selection(&clip_star); clip_copy_selection(&clip_star);
@@ -632,7 +621,7 @@ clip_auto_select()
* register. * register.
*/ */
int int
clip_isautosel_star() clip_isautosel_star(void)
{ {
return ( return (
#ifdef FEAT_GUI #ifdef FEAT_GUI
@@ -646,7 +635,7 @@ clip_isautosel_star()
* register. * register.
*/ */
int int
clip_isautosel_plus() clip_isautosel_plus(void)
{ {
return ( return (
#ifdef FEAT_GUI #ifdef FEAT_GUI
@@ -678,10 +667,7 @@ static void clip_update_modeless_selection(VimClipboard *, int, int,
* command-line and in the cmdline window. * command-line and in the cmdline window.
*/ */
void void
clip_modeless(button, is_click, is_drag) clip_modeless(int button, int is_click, int is_drag)
int button;
int is_click;
int is_drag;
{ {
int repeat; int repeat;
@@ -715,11 +701,11 @@ clip_modeless(button, is_click, is_drag)
* Compare two screen positions ala strcmp() * Compare two screen positions ala strcmp()
*/ */
static int static int
clip_compare_pos(row1, col1, row2, col2) clip_compare_pos(
int row1; int row1,
int col1; int col1,
int row2; int row2,
int col2; int col2)
{ {
if (row1 > row2) return(1); if (row1 > row2) return(1);
if (row1 < row2) return(-1); if (row1 < row2) return(-1);
@@ -732,10 +718,7 @@ clip_compare_pos(row1, col1, row2, col2)
* Start the selection * Start the selection
*/ */
void void
clip_start_selection(col, row, repeated_click) clip_start_selection(int col, int row, int repeated_click)
int col;
int row;
int repeated_click;
{ {
VimClipboard *cb = &clip_star; VimClipboard *cb = &clip_star;
@@ -805,11 +788,11 @@ clip_start_selection(col, row, repeated_click)
* Continue processing the selection * Continue processing the selection
*/ */
void void
clip_process_selection(button, col, row, repeated_click) clip_process_selection(
int button; int button,
int col; int col,
int row; int row,
int_u repeated_click; int_u repeated_click)
{ {
VimClipboard *cb = &clip_star; VimClipboard *cb = &clip_star;
int diff; int diff;
@@ -990,9 +973,7 @@ clip_process_selection(button, col, row, repeated_click)
* Only used for the GUI. * Only used for the GUI.
*/ */
void void
clip_may_redraw_selection(row, col, len) clip_may_redraw_selection(int row, int col, int len)
int row, col;
int len;
{ {
int start = col; int start = col;
int end = col + len; 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 * Called from outside to clear selected region from the display
*/ */
void void
clip_clear_selection(cbd) clip_clear_selection(VimClipboard *cbd)
VimClipboard *cbd;
{ {
if (cbd->state == SELECT_CLEARED) 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. * Clear the selection if any lines from "row1" to "row2" are inside of it.
*/ */
void void
clip_may_clear_selection(row1, row2) clip_may_clear_selection(int row1, int row2)
int row1, row2;
{ {
if (clip_star.state == SELECT_DONE if (clip_star.state == SELECT_DONE
&& row2 >= clip_star.start.lnum && 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. * of the selection. Call with big number when clearing the screen.
*/ */
void void
clip_scroll_selection(rows) clip_scroll_selection(
int rows; /* negative for scroll down */ int rows) /* negative for scroll down */
{ {
int lnum; int lnum;
@@ -1079,12 +1058,12 @@ clip_scroll_selection(rows)
* 0: invert (GUI only). * 0: invert (GUI only).
*/ */
static void static void
clip_invert_area(row1, col1, row2, col2, how) clip_invert_area(
int row1; int row1,
int col1; int col1,
int row2; int row2,
int col2; int col2,
int how; int how)
{ {
int invert = FALSE; int invert = FALSE;
@@ -1139,12 +1118,12 @@ clip_invert_area(row1, col1, row2, col2, how)
* "invert" is true if the result is inverted. * "invert" is true if the result is inverted.
*/ */
static void static void
clip_invert_rectangle(row, col, height, width, invert) clip_invert_rectangle(
int row; int row,
int col; int col,
int height; int height,
int width; int width,
int invert; int invert)
{ {
#ifdef FEAT_GUI #ifdef FEAT_GUI
if (gui.in_use) 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. * When "both" is TRUE also copy to the '+' register.
*/ */
void void
clip_copy_modeless_selection(both) clip_copy_modeless_selection(int both UNUSED)
int both UNUSED;
{ {
char_u *buffer; char_u *buffer;
char_u *bufp; char_u *bufp;
@@ -1344,10 +1322,7 @@ clip_copy_modeless_selection(both)
#define CHAR_CLASS(c) (c <= ' ' ? ' ' : vim_iswordc(c)) #define CHAR_CLASS(c) (c <= ' ' ? ' ' : vim_iswordc(c))
static void static void
clip_get_word_boundaries(cb, row, col) clip_get_word_boundaries(VimClipboard *cb, int row, int col)
VimClipboard *cb;
int row;
int col;
{ {
int start_class; int start_class;
int temp_col; int temp_col;
@@ -1406,8 +1381,7 @@ clip_get_word_boundaries(cb, row, col)
* line. * line.
*/ */
static int static int
clip_get_line_end(row) clip_get_line_end(int row)
int row;
{ {
int i; int i;
@@ -1424,12 +1398,12 @@ clip_get_line_end(row)
* beginning or end and inverting the changed area(s). * beginning or end and inverting the changed area(s).
*/ */
static void static void
clip_update_modeless_selection(cb, row1, col1, row2, col2) clip_update_modeless_selection(
VimClipboard *cb; VimClipboard *cb,
int row1; int row1,
int col1; int col1,
int row2; int row2,
int col2; int col2)
{ {
/* See if we changed at the beginning of the selection */ /* See if we changed at the beginning of the selection */
if (row1 != cb->start.lnum || col1 != (int)cb->start.col) if (row1 != cb->start.lnum || col1 != (int)cb->start.col)
@@ -1451,8 +1425,7 @@ clip_update_modeless_selection(cb, row1, col1, row2, col2)
} }
int int
clip_gen_own_selection(cbd) clip_gen_own_selection(VimClipboard *cbd)
VimClipboard *cbd;
{ {
#ifdef FEAT_XCLIPBOARD #ifdef FEAT_XCLIPBOARD
# ifdef FEAT_GUI # ifdef FEAT_GUI
@@ -1467,8 +1440,7 @@ clip_gen_own_selection(cbd)
} }
void void
clip_gen_lose_selection(cbd) clip_gen_lose_selection(VimClipboard *cbd)
VimClipboard *cbd;
{ {
#ifdef FEAT_XCLIPBOARD #ifdef FEAT_XCLIPBOARD
# ifdef FEAT_GUI # ifdef FEAT_GUI
@@ -1483,8 +1455,7 @@ clip_gen_lose_selection(cbd)
} }
void void
clip_gen_set_selection(cbd) clip_gen_set_selection(VimClipboard *cbd)
VimClipboard *cbd;
{ {
if (!clip_did_set_selection) if (!clip_did_set_selection)
{ {
@@ -1510,8 +1481,7 @@ clip_gen_set_selection(cbd)
} }
void void
clip_gen_request_selection(cbd) clip_gen_request_selection(VimClipboard *cbd)
VimClipboard *cbd;
{ {
#ifdef FEAT_XCLIPBOARD #ifdef FEAT_XCLIPBOARD
# ifdef FEAT_GUI # ifdef FEAT_GUI
@@ -1526,8 +1496,7 @@ clip_gen_request_selection(cbd)
} }
int int
clip_gen_owner_exists(cbd) clip_gen_owner_exists(VimClipboard *cbd UNUSED)
VimClipboard *cbd UNUSED;
{ {
#ifdef FEAT_XCLIPBOARD #ifdef FEAT_XCLIPBOARD
# ifdef FEAT_GUI_GTK # ifdef FEAT_GUI_GTK
@@ -1584,20 +1553,20 @@ static int inbufcount = 0; /* number of chars in inbuf[] */
*/ */
int int
vim_is_input_buf_full() vim_is_input_buf_full(void)
{ {
return (inbufcount >= INBUFLEN); return (inbufcount >= INBUFLEN);
} }
int int
vim_is_input_buf_empty() vim_is_input_buf_empty(void)
{ {
return (inbufcount == 0); return (inbufcount == 0);
} }
#if defined(FEAT_OLE) || defined(PROTO) #if defined(FEAT_OLE) || defined(PROTO)
int int
vim_free_in_input_buf() vim_free_in_input_buf(void)
{ {
return (INBUFLEN - inbufcount); return (INBUFLEN - inbufcount);
} }
@@ -1605,7 +1574,7 @@ vim_free_in_input_buf()
#if defined(FEAT_GUI_GTK) || defined(PROTO) #if defined(FEAT_GUI_GTK) || defined(PROTO)
int int
vim_used_in_input_buf() vim_used_in_input_buf(void)
{ {
return inbufcount; return inbufcount;
} }
@@ -1617,7 +1586,7 @@ vim_used_in_input_buf()
* The returned pointer must be passed to set_input_buf() later. * The returned pointer must be passed to set_input_buf() later.
*/ */
char_u * char_u *
get_input_buf() get_input_buf(void)
{ {
garray_T *gap; garray_T *gap;
@@ -1640,8 +1609,7 @@ get_input_buf()
* The allocated memory is freed, this only works once! * The allocated memory is freed, this only works once!
*/ */
void void
set_input_buf(p) set_input_buf(char_u *p)
char_u *p;
{ {
garray_T *gap = (garray_T *)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. * CSI KS_EXTRA KE_CSI. K_SPECIAL doesn't require translation.
*/ */
void void
add_to_input_buf(s, len) add_to_input_buf(char_u *s, int len)
char_u *s;
int len;
{ {
if (inbufcount + len > INBUFLEN + MAX_KEY_CODE_LEN) if (inbufcount + len > INBUFLEN + MAX_KEY_CODE_LEN)
return; /* Shouldn't ever happen! */ 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) #if defined(FEAT_HANGULIN) || defined(PROTO)
void void
push_raw_key(s, len) push_raw_key(char_u *s, int len)
char_u *s;
int len;
{ {
char_u *tmpbuf; char_u *tmpbuf;
@@ -1741,7 +1705,7 @@ push_raw_key(s, len)
|| defined(PROTO) || defined(PROTO)
/* Remove everything from the input buffer. Called when ^C is found */ /* Remove everything from the input buffer. Called when ^C is found */
void void
trash_input_buf() trash_input_buf(void)
{ {
inbufcount = 0; inbufcount = 0;
} }
@@ -1753,9 +1717,7 @@ trash_input_buf()
* Note: this function used to be Read() in unix.c * Note: this function used to be Read() in unix.c
*/ */
int int
read_from_input_buf(buf, maxlen) read_from_input_buf(char_u *buf, long maxlen)
char_u *buf;
long maxlen;
{ {
if (inbufcount == 0) /* if the buffer is empty, fill it */ if (inbufcount == 0) /* if the buffer is empty, fill it */
fill_input_buf(TRUE); fill_input_buf(TRUE);
@@ -1769,8 +1731,7 @@ read_from_input_buf(buf, maxlen)
} }
void void
fill_input_buf(exit_on_error) fill_input_buf(int exit_on_error UNUSED)
int exit_on_error UNUSED;
{ {
#if defined(UNIX) || defined(VMS) || defined(MACOS_X_UNIX) #if defined(UNIX) || defined(VMS) || defined(MACOS_X_UNIX)
int len; int len;
@@ -1948,7 +1909,7 @@ fill_input_buf(exit_on_error)
* Exit because of an input read error. * Exit because of an input read error.
*/ */
void void
read_error_exit() read_error_exit(void)
{ {
if (silent_mode) /* Normal way to exit for "ex -s" */ if (silent_mode) /* Normal way to exit for "ex -s" */
getout(0); getout(0);
@@ -1961,7 +1922,7 @@ read_error_exit()
* May update the shape of the cursor. * May update the shape of the cursor.
*/ */
void void
ui_cursor_shape() ui_cursor_shape(void)
{ {
# ifdef FEAT_GUI # ifdef FEAT_GUI
if (gui.in_use) if (gui.in_use)
@@ -1986,8 +1947,7 @@ ui_cursor_shape()
* Check bounds for column number * Check bounds for column number
*/ */
int int
check_col(col) check_col(int col)
int col;
{ {
if (col < 0) if (col < 0)
return 0; return 0;
@@ -2000,8 +1960,7 @@ check_col(col)
* Check bounds for row number * Check bounds for row number
*/ */
int int
check_row(row) check_row(int row)
int row;
{ {
if (row < 0) if (row < 0)
return 0; return 0;
@@ -2024,7 +1983,7 @@ check_row(row)
* Used for Motif and Athena GUI and the xterm clipboard. * Used for Motif and Athena GUI and the xterm clipboard.
*/ */
void void
open_app_context() open_app_context(void)
{ {
if (app_context == NULL) if (app_context == NULL)
{ {
@@ -2044,8 +2003,7 @@ static Atom targets_atom;
static Atom timestamp_atom; /* Used to get a timestamp */ static Atom timestamp_atom; /* Used to get a timestamp */
void void
x11_setup_atoms(dpy) x11_setup_atoms(Display *dpy)
Display *dpy;
{ {
vim_atom = XInternAtom(dpy, VIM_ATOM_NAME, False); vim_atom = XInternAtom(dpy, VIM_ATOM_NAME, False);
#ifdef FEAT_MBYTE #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. * Property callback to get a timestamp for XtOwnSelection.
*/ */
static void static void
clip_x11_timestamp_cb(w, n, event, cont) clip_x11_timestamp_cb(
Widget w; Widget w,
XtPointer n UNUSED; XtPointer n UNUSED,
XEvent *event; XEvent *event,
Boolean *cont UNUSED; Boolean *cont UNUSED)
{ {
Atom actual_type; Atom actual_type;
int format; int format;
@@ -2119,23 +2077,21 @@ clip_x11_timestamp_cb(w, n, event, cont)
} }
void void
x11_setup_selection(w) x11_setup_selection(Widget w)
Widget w;
{ {
XtAddEventHandler(w, PropertyChangeMask, False, XtAddEventHandler(w, PropertyChangeMask, False,
/*(XtEventHandler)*/clip_x11_timestamp_cb, (XtPointer)NULL); /*(XtEventHandler)*/clip_x11_timestamp_cb, (XtPointer)NULL);
} }
static void static void
clip_x11_request_selection_cb(w, success, sel_atom, type, value, length, clip_x11_request_selection_cb(
format) Widget w UNUSED,
Widget w UNUSED; XtPointer success,
XtPointer success; Atom *sel_atom,
Atom *sel_atom; Atom *type,
Atom *type; XtPointer value,
XtPointer value; long_u *length,
long_u *length; int *format)
int *format;
{ {
int motion_type = MAUTO; int motion_type = MAUTO;
long_u len; long_u len;
@@ -2241,10 +2197,10 @@ clip_x11_request_selection_cb(w, success, sel_atom, type, value, length,
} }
void void
clip_x11_request_selection(myShell, dpy, cbd) clip_x11_request_selection(
Widget myShell; Widget myShell,
Display *dpy; Display *dpy,
VimClipboard *cbd; VimClipboard *cbd)
{ {
XEvent event; XEvent event;
Atom type; Atom type;
@@ -2346,14 +2302,14 @@ clip_x11_request_selection(myShell, dpy, cbd)
} }
static Boolean static Boolean
clip_x11_convert_selection_cb(w, sel_atom, target, type, value, length, format) clip_x11_convert_selection_cb(
Widget w UNUSED; Widget w UNUSED,
Atom *sel_atom; Atom *sel_atom,
Atom *target; Atom *target,
Atom *type; Atom *type,
XtPointer *value; XtPointer *value,
long_u *length; long_u *length,
int *format; int *format)
{ {
char_u *string; char_u *string;
char_u *result; char_u *result;
@@ -2488,9 +2444,7 @@ clip_x11_convert_selection_cb(w, sel_atom, target, type, value, length, format)
} }
static void static void
clip_x11_lose_ownership_cb(w, sel_atom) clip_x11_lose_ownership_cb(Widget w UNUSED, Atom *sel_atom)
Widget w UNUSED;
Atom *sel_atom;
{ {
if (*sel_atom == clip_plus.sel_atom) if (*sel_atom == clip_plus.sel_atom)
clip_lose_selection(&clip_plus); clip_lose_selection(&clip_plus);
@@ -2499,18 +2453,14 @@ clip_x11_lose_ownership_cb(w, sel_atom)
} }
void void
clip_x11_lose_selection(myShell, cbd) clip_x11_lose_selection(Widget myShell, VimClipboard *cbd)
Widget myShell;
VimClipboard *cbd;
{ {
XtDisownSelection(myShell, cbd->sel_atom, XtDisownSelection(myShell, cbd->sel_atom,
XtLastTimestampProcessed(XtDisplay(myShell))); XtLastTimestampProcessed(XtDisplay(myShell)));
} }
int int
clip_x11_own_selection(myShell, cbd) clip_x11_own_selection(Widget myShell, VimClipboard *cbd)
Widget myShell;
VimClipboard *cbd;
{ {
/* When using the GUI we have proper timestamps, use the one of the last /* 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 * 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. * will fill in the selection only when requested by another app.
*/ */
void void
clip_x11_set_selection(cbd) clip_x11_set_selection(VimClipboard *cbd UNUSED)
VimClipboard *cbd UNUSED;
{ {
} }
int int
clip_x11_owner_exists(cbd) clip_x11_owner_exists(VimClipboard *cbd)
VimClipboard *cbd;
{ {
return XGetSelectionOwner(X_DISPLAY, cbd->sel_atom) != None; 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". * Get the contents of the X CUT_BUFFER0 and put it in "cbd".
*/ */
void void
yank_cut_buffer0(dpy, cbd) yank_cut_buffer0(Display *dpy, VimClipboard *cbd)
Display *dpy;
VimClipboard *cbd;
{ {
int nbytes = 0; int nbytes = 0;
char_u *buffer = (char_u *)XFetchBuffer(dpy, &nbytes, 0); char_u *buffer = (char_u *)XFetchBuffer(dpy, &nbytes, 0);
@@ -2638,10 +2584,10 @@ yank_cut_buffer0(dpy, cbd)
* remembered. * remembered.
*/ */
int int
jump_to_mouse(flags, inclusive, which_button) jump_to_mouse(
int flags; int flags,
int *inclusive; /* used for inclusive operator, can be NULL */ int *inclusive, /* used for inclusive operator, can be NULL */
int which_button; /* MOUSE_LEFT, MOUSE_RIGHT, MOUSE_MIDDLE */ int which_button) /* MOUSE_LEFT, MOUSE_RIGHT, MOUSE_MIDDLE */
{ {
static int on_status_line = 0; /* #lines below bottom of window */ static int on_status_line = 0; /* #lines below bottom of window */
#ifdef FEAT_VERTSPLIT #ifdef FEAT_VERTSPLIT
@@ -3051,11 +2997,11 @@ retnomove:
* Returns TRUE if the position is below the last line. * Returns TRUE if the position is below the last line.
*/ */
int int
mouse_comp_pos(win, rowp, colp, lnump) mouse_comp_pos(
win_T *win; win_T *win,
int *rowp; int *rowp,
int *colp; int *colp,
linenr_T *lnump; linenr_T *lnump)
{ {
int col = *colp; int col = *colp;
int row = *rowp; 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. * updated to become relative to the top-left of the window.
*/ */
win_T * win_T *
mouse_find_win(rowp, colp) mouse_find_win(int *rowp, int *colp UNUSED)
int *rowp;
int *colp UNUSED;
{ {
frame_T *fp; frame_T *fp;
@@ -3184,8 +3128,7 @@ mouse_find_win(rowp, colp)
* Translate window coordinates to buffer position without any side effects * Translate window coordinates to buffer position without any side effects
*/ */
int int
get_fpos_of_mouse(mpos) get_fpos_of_mouse(pos_T *mpos)
pos_T *mpos;
{ {
win_T *wp; win_T *wp;
int row = mouse_row; int row = mouse_row;
@@ -3232,10 +3175,7 @@ get_fpos_of_mouse(mpos)
* The first column is one. * The first column is one.
*/ */
int int
vcol2col(wp, lnum, vcol) vcol2col(win_T *wp, linenr_T lnum, int vcol)
win_T *wp;
linenr_T lnum;
int vcol;
{ {
/* try to advance to the specified column */ /* try to advance to the specified column */
int count = 0; int count = 0;
@@ -3260,8 +3200,8 @@ vcol2col(wp, lnum, vcol)
* be done in the console (Win32). * be done in the console (Win32).
*/ */
void void
ui_focus_change(in_focus) ui_focus_change(
int in_focus; /* TRUE if focus gained. */ int in_focus) /* TRUE if focus gained. */
{ {
static time_t last_time = (time_t)0; static time_t last_time = (time_t)0;
int need_redraw = FALSE; int need_redraw = FALSE;
@@ -3329,8 +3269,7 @@ ui_focus_change(in_focus)
* Save current Input Method status to specified place. * Save current Input Method status to specified place.
*/ */
void void
im_save_status(psave) im_save_status(long *psave)
long *psave;
{ {
/* Don't save when 'imdisable' is set or "xic" is NULL, IM is always /* Don't save when 'imdisable' is set or "xic" is NULL, IM is always
* disabled then (but might start later). * disabled then (but might start later).

View File

@@ -246,7 +246,7 @@ u_check(int newhead_may_be_NULL)
* Returns OK or FAIL. * Returns OK or FAIL.
*/ */
int int
u_save_cursor() u_save_cursor(void)
{ {
return (u_save((linenr_T)(curwin->w_cursor.lnum - 1), return (u_save((linenr_T)(curwin->w_cursor.lnum - 1),
(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. * Returns FAIL when lines could not be saved, OK otherwise.
*/ */
int int
u_save(top, bot) u_save(linenr_T top, linenr_T bot)
linenr_T top, bot;
{ {
if (undo_off) if (undo_off)
return OK; return OK;
@@ -283,8 +282,7 @@ u_save(top, bot)
* Returns FAIL when lines could not be saved, OK otherwise. * Returns FAIL when lines could not be saved, OK otherwise.
*/ */
int int
u_savesub(lnum) u_savesub(linenr_T lnum)
linenr_T lnum;
{ {
if (undo_off) if (undo_off)
return OK; return OK;
@@ -299,8 +297,7 @@ u_savesub(lnum)
* Returns FAIL when lines could not be saved, OK otherwise. * Returns FAIL when lines could not be saved, OK otherwise.
*/ */
int int
u_inssub(lnum) u_inssub(linenr_T lnum)
linenr_T lnum;
{ {
if (undo_off) if (undo_off)
return OK; return OK;
@@ -316,9 +313,7 @@ u_inssub(lnum)
* Returns FAIL when lines could not be saved, OK otherwise. * Returns FAIL when lines could not be saved, OK otherwise.
*/ */
int int
u_savedel(lnum, nlines) u_savedel(linenr_T lnum, long nlines)
linenr_T lnum;
long nlines;
{ {
if (undo_off) if (undo_off)
return OK; return OK;
@@ -332,7 +327,7 @@ u_savedel(lnum, nlines)
* return FALSE. * return FALSE.
*/ */
int int
undo_allowed() undo_allowed(void)
{ {
/* Don't allow changes when 'modifiable' is off. */ /* Don't allow changes when 'modifiable' is off. */
if (!curbuf->b_p_ma) if (!curbuf->b_p_ma)
@@ -365,7 +360,7 @@ undo_allowed()
* Get the undolevle value for the current buffer. * Get the undolevle value for the current buffer.
*/ */
static long static long
get_undolevel() get_undolevel(void)
{ {
if (curbuf->b_p_ul == NO_LOCAL_UNDOLEVEL) if (curbuf->b_p_ul == NO_LOCAL_UNDOLEVEL)
return p_ul; return p_ul;
@@ -382,10 +377,11 @@ get_undolevel()
* Returns FAIL when lines could not be saved, OK otherwise. * Returns FAIL when lines could not be saved, OK otherwise.
*/ */
int int
u_savecommon(top, bot, newbot, reload) u_savecommon(
linenr_T top, bot; linenr_T top,
linenr_T newbot; linenr_T bot,
int reload; linenr_T newbot,
int reload)
{ {
linenr_T lnum; linenr_T lnum;
long i; 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]. * Compute the hash for the current buffer text into hash[UNDO_HASH_SIZE].
*/ */
void void
u_compute_hash(hash) u_compute_hash(char_u *hash)
char_u *hash;
{ {
context_sha256_T ctx; context_sha256_T ctx;
linenr_T lnum; 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. * Returns NULL when there is no place to write or no file to read.
*/ */
char_u * char_u *
u_get_undo_file_name(buf_ffname, reading) u_get_undo_file_name(char_u *buf_ffname, int reading)
char_u *buf_ffname;
int reading;
{ {
char_u *dirp; char_u *dirp;
char_u dir_name[IOSIZE + 1]; char_u dir_name[IOSIZE + 1];
@@ -859,16 +852,13 @@ u_get_undo_file_name(buf_ffname, reading)
} }
static void static void
corruption_error(mesg, file_name) corruption_error(char *mesg, char_u *file_name)
char *mesg;
char_u *file_name;
{ {
EMSG3(_("E825: Corrupted undo file (%s): %s"), mesg, file_name); EMSG3(_("E825: Corrupted undo file (%s): %s"), mesg, file_name);
} }
static void static void
u_free_uhp(uhp) u_free_uhp(u_header_T *uhp)
u_header_T *uhp;
{ {
u_entry_T *nuep; u_entry_T *nuep;
u_entry_T *uep; u_entry_T *uep;
@@ -889,10 +879,7 @@ u_free_uhp(uhp)
* Returns OK or FAIL. * Returns OK or FAIL.
*/ */
static int static int
undo_write(bi, ptr, len) undo_write(bufinfo_T *bi, char_u *ptr, size_t len)
bufinfo_T *bi;
char_u *ptr;
size_t len;
{ {
#ifdef FEAT_CRYPT #ifdef FEAT_CRYPT
if (bi->bi_buffer != NULL) if (bi->bi_buffer != NULL)
@@ -926,8 +913,7 @@ undo_write(bi, ptr, len)
#ifdef FEAT_CRYPT #ifdef FEAT_CRYPT
static int static int
undo_flush(bi) undo_flush(bufinfo_T *bi)
bufinfo_T *bi;
{ {
if (bi->bi_buffer != NULL && bi->bi_used > 0) if (bi->bi_buffer != NULL && bi->bi_used > 0)
{ {
@@ -945,10 +931,7 @@ undo_flush(bi)
* Returns OK or FAIL. * Returns OK or FAIL.
*/ */
static int static int
fwrite_crypt(bi, ptr, len) fwrite_crypt(bufinfo_T *bi, char_u *ptr, size_t len)
bufinfo_T *bi;
char_u *ptr;
size_t len;
{ {
#ifdef FEAT_CRYPT #ifdef FEAT_CRYPT
char_u *copy; char_u *copy;
@@ -982,10 +965,7 @@ fwrite_crypt(bi, ptr, len)
* Returns OK or FAIL. * Returns OK or FAIL.
*/ */
static int static int
undo_write_bytes(bi, nr, len) undo_write_bytes(bufinfo_T *bi, long_u nr, int len)
bufinfo_T *bi;
long_u nr;
int len;
{ {
char_u buf[8]; char_u buf[8];
int i; 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 * we use the sequence number of the header. This is converted back to
* pointers when reading. */ * pointers when reading. */
static void static void
put_header_ptr(bi, uhp) put_header_ptr(bufinfo_T *bi, u_header_T *uhp)
bufinfo_T *bi;
u_header_T *uhp;
{ {
undo_write_bytes(bi, (long_u)(uhp != NULL ? uhp->uh_seq : 0), 4); undo_write_bytes(bi, (long_u)(uhp != NULL ? uhp->uh_seq : 0), 4);
} }
static int static int
undo_read_4c(bi) undo_read_4c(bufinfo_T *bi)
bufinfo_T *bi;
{ {
#ifdef FEAT_CRYPT #ifdef FEAT_CRYPT
if (bi->bi_buffer != NULL) if (bi->bi_buffer != NULL)
@@ -1027,8 +1004,7 @@ undo_read_4c(bi)
} }
static int static int
undo_read_2c(bi) undo_read_2c(bufinfo_T *bi)
bufinfo_T *bi;
{ {
#ifdef FEAT_CRYPT #ifdef FEAT_CRYPT
if (bi->bi_buffer != NULL) if (bi->bi_buffer != NULL)
@@ -1045,8 +1021,7 @@ undo_read_2c(bi)
} }
static int static int
undo_read_byte(bi) undo_read_byte(bufinfo_T *bi)
bufinfo_T *bi;
{ {
#ifdef FEAT_CRYPT #ifdef FEAT_CRYPT
if (bi->bi_buffer != NULL) if (bi->bi_buffer != NULL)
@@ -1061,8 +1036,7 @@ undo_read_byte(bi)
} }
static time_t static time_t
undo_read_time(bi) undo_read_time(bufinfo_T *bi)
bufinfo_T *bi;
{ {
#ifdef FEAT_CRYPT #ifdef FEAT_CRYPT
if (bi->bi_buffer != NULL) if (bi->bi_buffer != NULL)
@@ -1085,10 +1059,7 @@ undo_read_time(bi)
* Return OK or FAIL. * Return OK or FAIL.
*/ */
static int static int
undo_read(bi, buffer, size) undo_read(bufinfo_T *bi, char_u *buffer, size_t size)
bufinfo_T *bi;
char_u *buffer;
size_t size;
{ {
#ifdef FEAT_CRYPT #ifdef FEAT_CRYPT
if (bi->bi_buffer != NULL) if (bi->bi_buffer != NULL)
@@ -1138,9 +1109,7 @@ undo_read(bi, buffer, size)
* Returns a pointer to allocated memory or NULL for failure. * Returns a pointer to allocated memory or NULL for failure.
*/ */
static char_u * static char_u *
read_string_decrypt(bi, len) read_string_decrypt(bufinfo_T *bi, int len)
bufinfo_T *bi;
int len;
{ {
char_u *ptr = alloc((unsigned)len + 1); 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. * Writes the (not encrypted) header and initializes encryption if needed.
*/ */
static int static int
serialize_header(bi, hash) serialize_header(bufinfo_T *bi, char_u *hash)
bufinfo_T *bi;
char_u *hash;
{ {
int len; int len;
buf_T *buf = bi->bi_buf; buf_T *buf = bi->bi_buf;
@@ -1252,9 +1219,7 @@ serialize_header(bi, hash)
} }
static int static int
serialize_uhp(bi, uhp) serialize_uhp(bufinfo_T *bi, u_header_T *uhp)
bufinfo_T *bi;
u_header_T *uhp;
{ {
int i; int i;
u_entry_T *uep; u_entry_T *uep;
@@ -1301,9 +1266,7 @@ serialize_uhp(bi, uhp)
} }
static u_header_T * static u_header_T *
unserialize_uhp(bi, file_name) unserialize_uhp(bufinfo_T *bi, char_u *file_name)
bufinfo_T *bi;
char_u *file_name;
{ {
u_header_T *uhp; u_header_T *uhp;
int i; int i;
@@ -1393,9 +1356,9 @@ unserialize_uhp(bi, file_name)
* Serialize "uep". * Serialize "uep".
*/ */
static int static int
serialize_uep(bi, uep) serialize_uep(
bufinfo_T *bi; bufinfo_T *bi,
u_entry_T *uep; u_entry_T *uep)
{ {
int i; int i;
size_t len; size_t len;
@@ -1416,10 +1379,7 @@ serialize_uep(bi, uep)
} }
static u_entry_T * static u_entry_T *
unserialize_uep(bi, error, file_name) unserialize_uep(bufinfo_T *bi, int *error, char_u *file_name)
bufinfo_T *bi;
int *error;
char_u *file_name;
{ {
int i; int i;
u_entry_T *uep; u_entry_T *uep;
@@ -1476,9 +1436,7 @@ unserialize_uep(bi, error, file_name)
* Serialize "pos". * Serialize "pos".
*/ */
static void static void
serialize_pos(bi, pos) serialize_pos(bufinfo_T *bi, pos_T pos)
bufinfo_T *bi;
pos_T pos;
{ {
undo_write_bytes(bi, (long_u)pos.lnum, 4); undo_write_bytes(bi, (long_u)pos.lnum, 4);
undo_write_bytes(bi, (long_u)pos.col, 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. * Unserialize the pos_T at the current position.
*/ */
static void static void
unserialize_pos(bi, pos) unserialize_pos(bufinfo_T *bi, pos_T *pos)
bufinfo_T *bi;
pos_T *pos;
{ {
pos->lnum = undo_read_4c(bi); pos->lnum = undo_read_4c(bi);
if (pos->lnum < 0) if (pos->lnum < 0)
@@ -1516,9 +1472,7 @@ unserialize_pos(bi, pos)
* Serialize "info". * Serialize "info".
*/ */
static void static void
serialize_visualinfo(bi, info) serialize_visualinfo(bufinfo_T *bi, visualinfo_T *info)
bufinfo_T *bi;
visualinfo_T *info;
{ {
serialize_pos(bi, info->vi_start); serialize_pos(bi, info->vi_start);
serialize_pos(bi, info->vi_end); serialize_pos(bi, info->vi_end);
@@ -1530,9 +1484,7 @@ serialize_visualinfo(bi, info)
* Unserialize the visualinfo_T at the current position. * Unserialize the visualinfo_T at the current position.
*/ */
static void static void
unserialize_visualinfo(bi, info) unserialize_visualinfo(bufinfo_T *bi, visualinfo_T *info)
bufinfo_T *bi;
visualinfo_T *info;
{ {
unserialize_pos(bi, &info->vi_start); unserialize_pos(bi, &info->vi_start);
unserialize_pos(bi, &info->vi_end); 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. * "hash[UNDO_HASH_SIZE]" must be the hash value of the buffer text.
*/ */
void void
u_write_undo(name, forceit, buf, hash) u_write_undo(
char_u *name; char_u *name,
int forceit; int forceit,
buf_T *buf; buf_T *buf,
char_u *hash; char_u *hash)
{ {
u_header_T *uhp; u_header_T *uhp;
char_u *file_name; char_u *file_name;
@@ -1824,10 +1776,7 @@ theend:
* "hash[UNDO_HASH_SIZE]" must be the hash value of the buffer text. * "hash[UNDO_HASH_SIZE]" must be the hash value of the buffer text.
*/ */
void void
u_read_undo(name, hash, orig_name) u_read_undo(char_u *name, char_u *hash, char_u *orig_name)
char_u *name;
char_u *hash;
char_u *orig_name;
{ {
char_u *file_name; char_u *file_name;
FILE *fp; FILE *fp;
@@ -2188,8 +2137,7 @@ theend:
* If 'cpoptions' does not contain 'u': Always undo. * If 'cpoptions' does not contain 'u': Always undo.
*/ */
void void
u_undo(count) u_undo(int count)
int count;
{ {
/* /*
* If we get an undo command while executing a macro, we behave like the * 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. * If 'cpoptions' does not contain 'u': Always redo.
*/ */
void void
u_redo(count) u_redo(int count)
int count;
{ {
if (vim_strchr(p_cpo, CPO_UNDO) == NULL) if (vim_strchr(p_cpo, CPO_UNDO) == NULL)
undo_undoes = FALSE; undo_undoes = FALSE;
@@ -2226,8 +2173,7 @@ u_redo(count)
* Undo or redo, depending on 'undo_undoes', 'count' times. * Undo or redo, depending on 'undo_undoes', 'count' times.
*/ */
static void static void
u_doit(startcount) u_doit(int startcount)
int startcount;
{ {
int count = startcount; int count = startcount;
@@ -2304,11 +2250,11 @@ u_doit(startcount)
* "sec" must be FALSE then. * "sec" must be FALSE then.
*/ */
void void
undo_time(step, sec, file, absolute) undo_time(
long step; long step,
int sec; int sec,
int file; int file,
int absolute; int absolute)
{ {
long target; long target;
long closest; 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. * When "undo" is TRUE we go up in the tree, when FALSE we go down.
*/ */
static void static void
u_undoredo(undo) u_undoredo(int undo)
int undo;
{ {
char_u **newarray = NULL; char_u **newarray = NULL;
linenr_T oldsize; linenr_T oldsize;
@@ -2933,9 +2878,9 @@ u_undoredo(undo)
* in some cases, but it's better than nothing). * in some cases, but it's better than nothing).
*/ */
static void static void
u_undo_end(did_undo, absolute) u_undo_end(
int did_undo; /* just did an undo */ int did_undo, /* just did an undo */
int absolute; /* used ":undo N" */ int absolute) /* used ":undo N" */
{ {
char *msgstr; char *msgstr;
u_header_T *uhp; u_header_T *uhp;
@@ -3016,8 +2961,8 @@ u_undo_end(did_undo, absolute)
* u_sync: stop adding to the current entry list * u_sync: stop adding to the current entry list
*/ */
void void
u_sync(force) u_sync(
int force; /* Also sync when no_u_sync is set. */ int force) /* Also sync when no_u_sync is set. */
{ {
/* Skip it when already synced or syncing is disabled. */ /* Skip it when already synced or syncing is disabled. */
if (curbuf->b_u_synced || (!force && no_u_sync > 0)) 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 * ":undolist": List the leafs of the undo tree
*/ */
void void
ex_undolist(eap) ex_undolist(exarg_T *eap UNUSED)
exarg_T *eap UNUSED;
{ {
garray_T ga; garray_T ga;
u_header_T *uhp; 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. * Put the timestamp of an undo header in "buf[buflen]" in a nice format.
*/ */
static void static void
u_add_time(buf, buflen, tt) u_add_time(char_u *buf, size_t buflen, time_t tt)
char_u *buf;
size_t buflen;
time_t tt;
{ {
#ifdef HAVE_STRFTIME #ifdef HAVE_STRFTIME
struct tm *curtime; struct tm *curtime;
@@ -3174,8 +3115,7 @@ u_add_time(buf, buflen, tt)
* ":undojoin": continue adding to the last entry list * ":undojoin": continue adding to the last entry list
*/ */
void void
ex_undojoin(eap) ex_undojoin(exarg_T *eap UNUSED)
exarg_T *eap UNUSED;
{ {
if (curbuf->b_u_newhead == NULL) if (curbuf->b_u_newhead == NULL)
return; /* nothing changed before */ return; /* nothing changed before */
@@ -3201,8 +3141,7 @@ ex_undojoin(eap)
* Now an undo means that the buffer is modified. * Now an undo means that the buffer is modified.
*/ */
void void
u_unchanged(buf) u_unchanged(buf_T *buf)
buf_T *buf;
{ {
u_unch_branch(buf->b_u_oldhead); u_unch_branch(buf->b_u_oldhead);
buf->b_did_warn = FALSE; buf->b_did_warn = FALSE;
@@ -3213,7 +3152,7 @@ u_unchanged(buf)
* line that was changed and set the cursor there. * line that was changed and set the cursor there.
*/ */
void void
u_find_first_changed() u_find_first_changed(void)
{ {
u_header_T *uhp = curbuf->b_u_newhead; u_header_T *uhp = curbuf->b_u_newhead;
u_entry_T *uep; u_entry_T *uep;
@@ -3249,8 +3188,7 @@ u_find_first_changed()
* used for "u". * used for "u".
*/ */
void void
u_update_save_nr(buf) u_update_save_nr(buf_T *buf)
buf_T *buf;
{ {
u_header_T *uhp; u_header_T *uhp;
@@ -3266,8 +3204,7 @@ u_update_save_nr(buf)
} }
static void static void
u_unch_branch(uhp) u_unch_branch(u_header_T *uhp)
u_header_T *uhp;
{ {
u_header_T *uh; u_header_T *uh;
@@ -3284,7 +3221,7 @@ u_unch_branch(uhp)
* If it's not valid, give an error message and return NULL. * If it's not valid, give an error message and return NULL.
*/ */
static u_entry_T * static u_entry_T *
u_get_headentry() u_get_headentry(void)
{ {
if (curbuf->b_u_newhead == NULL || curbuf->b_u_newhead->uh_entry == NULL) 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. * It is called only when b_u_synced is FALSE.
*/ */
static void static void
u_getbot() u_getbot(void)
{ {
u_entry_T *uep; u_entry_T *uep;
linenr_T extra; linenr_T extra;
@@ -3337,10 +3274,10 @@ u_getbot()
* Free one header "uhp" and its entry list and adjust the pointers. * Free one header "uhp" and its entry list and adjust the pointers.
*/ */
static void static void
u_freeheader(buf, uhp, uhpp) u_freeheader(
buf_T *buf; buf_T *buf,
u_header_T *uhp; u_header_T *uhp,
u_header_T **uhpp; /* if not NULL reset when freeing this header */ u_header_T **uhpp) /* if not NULL reset when freeing this header */
{ {
u_header_T *uhap; u_header_T *uhap;
@@ -3372,10 +3309,10 @@ u_freeheader(buf, uhp, uhpp)
* Free an alternate branch and any following alternate branches. * Free an alternate branch and any following alternate branches.
*/ */
static void static void
u_freebranch(buf, uhp, uhpp) u_freebranch(
buf_T *buf; buf_T *buf,
u_header_T *uhp; u_header_T *uhp,
u_header_T **uhpp; /* if not NULL reset when freeing this header */ u_header_T **uhpp) /* if not NULL reset when freeing this header */
{ {
u_header_T *tofree, *next; u_header_T *tofree, *next;
@@ -3407,10 +3344,10 @@ u_freebranch(buf, uhp, uhpp)
* This means that "uhp" is invalid when returning. * This means that "uhp" is invalid when returning.
*/ */
static void static void
u_freeentries(buf, uhp, uhpp) u_freeentries(
buf_T *buf; buf_T *buf,
u_header_T *uhp; u_header_T *uhp,
u_header_T **uhpp; /* if not NULL reset when freeing this header */ u_header_T **uhpp) /* if not NULL reset when freeing this header */
{ {
u_entry_T *uep, *nuep; u_entry_T *uep, *nuep;
@@ -3439,9 +3376,7 @@ u_freeentries(buf, uhp, uhpp)
* free entry 'uep' and 'n' lines in uep->ue_array[] * free entry 'uep' and 'n' lines in uep->ue_array[]
*/ */
static void static void
u_freeentry(uep, n) u_freeentry(u_entry_T *uep, long n)
u_entry_T *uep;
long n;
{ {
while (n > 0) while (n > 0)
vim_free(uep->ue_array[--n]); 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 * invalidate the undo buffer; called when storage has already been released
*/ */
void void
u_clearall(buf) u_clearall(buf_T *buf)
buf_T *buf;
{ {
buf->b_u_newhead = buf->b_u_oldhead = buf->b_u_curhead = NULL; buf->b_u_newhead = buf->b_u_oldhead = buf->b_u_curhead = NULL;
buf->b_u_synced = TRUE; buf->b_u_synced = TRUE;
@@ -3470,8 +3404,7 @@ u_clearall(buf)
* save the line "lnum" for the "U" command * save the line "lnum" for the "U" command
*/ */
void void
u_saveline(lnum) u_saveline(linenr_T lnum)
linenr_T lnum;
{ {
if (lnum == curbuf->b_u_line_lnum) /* line is already saved */ if (lnum == curbuf->b_u_line_lnum) /* line is already saved */
return; return;
@@ -3492,7 +3425,7 @@ u_saveline(lnum)
* (this is used externally for crossing a line while in insert mode) * (this is used externally for crossing a line while in insert mode)
*/ */
void void
u_clearline() u_clearline(void)
{ {
if (curbuf->b_u_line_ptr != NULL) if (curbuf->b_u_line_ptr != NULL)
{ {
@@ -3509,7 +3442,7 @@ u_clearline()
* Careful: may trigger autocommands that reload the buffer. * Careful: may trigger autocommands that reload the buffer.
*/ */
void void
u_undoline() u_undoline(void)
{ {
colnr_T t; colnr_T t;
char_u *oldp; char_u *oldp;
@@ -3551,8 +3484,7 @@ u_undoline()
* Free all allocated memory blocks for the buffer 'buf'. * Free all allocated memory blocks for the buffer 'buf'.
*/ */
void void
u_blockfree(buf) u_blockfree(buf_T *buf)
buf_T *buf;
{ {
while (buf->b_u_oldhead != NULL) while (buf->b_u_oldhead != NULL)
u_freeheader(buf, 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. * Returns NULL when out of memory.
*/ */
static char_u * static char_u *
u_save_line(lnum) u_save_line(linenr_T lnum)
linenr_T lnum;
{ {
return vim_strsave(ml_get(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. * "nofile" and "scratch" type buffers are considered to always be unchanged.
*/ */
int int
bufIsChanged(buf) bufIsChanged(buf_T *buf)
buf_T *buf;
{ {
return return
#ifdef FEAT_QUICKFIX #ifdef FEAT_QUICKFIX
@@ -3587,7 +3517,7 @@ bufIsChanged(buf)
} }
int int
curbufIsChanged() curbufIsChanged(void)
{ {
return return
#ifdef FEAT_QUICKFIX #ifdef FEAT_QUICKFIX
@@ -3602,9 +3532,7 @@ curbufIsChanged()
* Recursive. * Recursive.
*/ */
void void
u_eval_tree(first_uhp, list) u_eval_tree(u_header_T *first_uhp, list_T *list)
u_header_T *first_uhp;
list_T *list;
{ {
u_header_T *uhp = first_uhp; u_header_T *uhp = first_uhp;
dict_T *dict; dict_T *dict;

View File

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