1
0
forked from aniani/vim

patch 7.4.1210

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 18:51:09 +01:00
parent 02fdaeaa69
commit 52ea13da0f
9 changed files with 683 additions and 1111 deletions

View File

@ -165,9 +165,7 @@ VimMain
# else # else
main main
# endif # endif
(argc, argv) (int argc, char **argv)
int argc;
char **argv;
{ {
char_u *fname = NULL; /* file name from command line */ char_u *fname = NULL; /* file name from command line */
mparm_T params; /* various parameters passed between mparm_T params; /* various parameters passed between
@ -1534,10 +1532,10 @@ getout(int exitval)
* Get a (optional) count for a Vim argument. * Get a (optional) count for a Vim argument.
*/ */
static int static int
get_number_arg(p, idx, def) get_number_arg(
char_u *p; /* pointer to argument */ char_u *p, /* pointer to argument */
int *idx; /* index in argument, is incremented */ int *idx, /* index in argument, is incremented */
int def; /* default value */ int def) /* default value */
{ {
if (vim_isdigit(p[*idx])) if (vim_isdigit(p[*idx]))
{ {
@ -1553,7 +1551,7 @@ get_number_arg(p, idx, def)
* Setup to use the current locale (for ctype() and many other things). * Setup to use the current locale (for ctype() and many other things).
*/ */
static void static void
init_locale() init_locale(void)
{ {
setlocale(LC_ALL, ""); setlocale(LC_ALL, "");
@ -1609,8 +1607,7 @@ init_locale()
* by "im" use improved Ex mode. * by "im" use improved Ex mode.
*/ */
static void static void
parse_command_name(parmp) parse_command_name(mparm_T *parmp)
mparm_T *parmp;
{ {
char_u *initstr; char_u *initstr;
@ -1700,8 +1697,7 @@ parse_command_name(parmp)
* Also find the --server... arguments and --socketid and --windowid * Also find the --server... arguments and --socketid and --windowid
*/ */
static void static void
early_arg_scan(parmp) early_arg_scan(mparm_T *parmp UNUSED)
mparm_T *parmp UNUSED;
{ {
#if defined(FEAT_XCLIPBOARD) || defined(FEAT_CLIENTSERVER) \ #if defined(FEAT_XCLIPBOARD) || defined(FEAT_CLIENTSERVER) \
|| !defined(FEAT_NETBEANS_INTG) || !defined(FEAT_NETBEANS_INTG)
@ -1792,8 +1788,7 @@ early_arg_scan(parmp)
* Scan the command line arguments. * Scan the command line arguments.
*/ */
static void static void
command_line_scan(parmp) command_line_scan(mparm_T *parmp)
mparm_T *parmp;
{ {
int argc = parmp->argc; int argc = parmp->argc;
char **argv = parmp->argv; char **argv = parmp->argv;
@ -2512,8 +2507,7 @@ scripterror:
* When starting in Ex mode and commands come from a file, set Silent mode. * When starting in Ex mode and commands come from a file, set Silent mode.
*/ */
static void static void
check_tty(parmp) check_tty(mparm_T *parmp)
mparm_T *parmp;
{ {
int input_isatty; /* is active input a terminal? */ int input_isatty; /* is active input a terminal? */
@ -2559,7 +2553,7 @@ check_tty(parmp)
* Read text from stdin. * Read text from stdin.
*/ */
static void static void
read_stdin() read_stdin(void)
{ {
int i; int i;
@ -2593,8 +2587,7 @@ read_stdin()
* Also does recovery if "recoverymode" set. * Also does recovery if "recoverymode" set.
*/ */
static void static void
create_windows(parmp) create_windows(mparm_T *parmp UNUSED)
mparm_T *parmp UNUSED;
{ {
#ifdef FEAT_WINDOWS #ifdef FEAT_WINDOWS
int dorewind; int dorewind;
@ -2747,9 +2740,9 @@ create_windows(parmp)
* windows. make_windows() has already opened the windows. * windows. make_windows() has already opened the windows.
*/ */
static void static void
edit_buffers(parmp, cwd) edit_buffers(
mparm_T *parmp; mparm_T *parmp,
char_u *cwd; /* current working dir */ char_u *cwd) /* current working dir */
{ {
int arg_idx; /* index in argument list */ int arg_idx; /* index in argument list */
int i; int i;
@ -2876,8 +2869,7 @@ edit_buffers(parmp, cwd)
* Execute the commands from --cmd arguments "cmds[cnt]". * Execute the commands from --cmd arguments "cmds[cnt]".
*/ */
static void static void
exe_pre_commands(parmp) exe_pre_commands(mparm_T *parmp)
mparm_T *parmp;
{ {
char_u **cmds = parmp->pre_commands; char_u **cmds = parmp->pre_commands;
int cnt = parmp->n_pre_commands; int cnt = parmp->n_pre_commands;
@ -2904,8 +2896,7 @@ exe_pre_commands(parmp)
* Execute "+", "-c" and "-S" arguments. * Execute "+", "-c" and "-S" arguments.
*/ */
static void static void
exe_commands(parmp) exe_commands(mparm_T *parmp)
mparm_T *parmp;
{ {
int i; int i;
@ -2949,8 +2940,7 @@ exe_commands(parmp)
* Source startup scripts. * Source startup scripts.
*/ */
static void static void
source_startup_scripts(parmp) source_startup_scripts(mparm_T *parmp)
mparm_T *parmp;
{ {
int i; int i;
@ -3108,7 +3098,7 @@ source_startup_scripts(parmp)
* Setup to start using the GUI. Exit with an error when not available. * Setup to start using the GUI. Exit with an error when not available.
*/ */
static void static void
main_start_gui() main_start_gui(void)
{ {
#ifdef FEAT_GUI #ifdef FEAT_GUI
gui.starting = TRUE; /* start GUI a bit later */ gui.starting = TRUE; /* start GUI a bit later */
@ -3126,9 +3116,9 @@ main_start_gui()
* Returns FAIL if the environment variable was not executed, OK otherwise. * Returns FAIL if the environment variable was not executed, OK otherwise.
*/ */
int int
process_env(env, is_viminit) process_env(
char_u *env; char_u *env,
int is_viminit; /* when TRUE, called for VIMINIT */ int is_viminit) /* when TRUE, called for VIMINIT */
{ {
char_u *initstr; char_u *initstr;
char_u *save_sourcing_name; char_u *save_sourcing_name;
@ -3167,8 +3157,7 @@ process_env(env, is_viminit)
* Use both stat() and lstat() for extra security. * Use both stat() and lstat() for extra security.
*/ */
static int static int
file_owned(fname) file_owned(char *fname)
char *fname;
{ {
struct stat s; struct stat s;
# ifdef UNIX # ifdef UNIX
@ -3189,9 +3178,9 @@ file_owned(fname)
* Give an error message main_errors["n"] and exit. * Give an error message main_errors["n"] and exit.
*/ */
static void static void
mainerr(n, str) mainerr(
int n; /* one of the ME_ defines */ int n, /* one of the ME_ defines */
char_u *str; /* extra argument or NULL */ char_u *str) /* extra argument or NULL */
{ {
#if defined(UNIX) || defined(__EMX__) || defined(VMS) #if defined(UNIX) || defined(__EMX__) || defined(VMS)
reset_signals(); /* kill us with CTRL-C here, if you like */ reset_signals(); /* kill us with CTRL-C here, if you like */
@ -3212,8 +3201,7 @@ mainerr(n, str)
} }
void void
mainerr_arg_missing(str) mainerr_arg_missing(char_u *str)
char_u *str;
{ {
mainerr(ME_ARG_MISSING, str); mainerr(ME_ARG_MISSING, str);
} }
@ -3223,8 +3211,7 @@ mainerr_arg_missing(str)
* print a message with three spaces prepended and '\n' appended. * print a message with three spaces prepended and '\n' appended.
*/ */
static void static void
main_msg(s) main_msg(char *s)
char *s;
{ {
mch_msg(" "); mch_msg(" ");
mch_msg(s); mch_msg(s);
@ -3235,7 +3222,7 @@ main_msg(s)
* Print messages for "vim -h" or "vim --help" and exit. * Print messages for "vim -h" or "vim --help" and exit.
*/ */
static void static void
usage() usage(void)
{ {
int i; int i;
static char *(use[]) = static char *(use[]) =
@ -3431,7 +3418,7 @@ usage()
* When "Recover" selected, recover the file. * When "Recover" selected, recover the file.
*/ */
static void static void
check_swap_exists_action() check_swap_exists_action(void)
{ {
if (swap_exists_action == SEA_QUIT) if (swap_exists_action == SEA_QUIT)
getout(1); getout(1);
@ -3465,8 +3452,7 @@ gettimeofday(struct timeval *tv, char *dummy)
* set "*tv_rel" to the time elapsed so far. * set "*tv_rel" to the time elapsed so far.
*/ */
void void
time_push(tv_rel, tv_start) time_push(void *tv_rel, void *tv_start)
void *tv_rel, *tv_start;
{ {
*((struct timeval *)tv_rel) = prev_timeval; *((struct timeval *)tv_rel) = prev_timeval;
gettimeofday(&prev_timeval, NULL); gettimeofday(&prev_timeval, NULL);
@ -3489,8 +3475,8 @@ time_push(tv_rel, tv_start)
* have struct timeval. * have struct timeval.
*/ */
void void
time_pop(tp) time_pop(
void *tp; /* actually (struct timeval *) */ void *tp) /* actually (struct timeval *) */
{ {
prev_timeval.tv_usec -= ((struct timeval *)tp)->tv_usec; prev_timeval.tv_usec -= ((struct timeval *)tp)->tv_usec;
prev_timeval.tv_sec -= ((struct timeval *)tp)->tv_sec; prev_timeval.tv_sec -= ((struct timeval *)tp)->tv_sec;
@ -3502,9 +3488,7 @@ time_pop(tp)
} }
static void static void
time_diff(then, now) time_diff(struct timeval *then, struct timeval *now)
struct timeval *then;
struct timeval *now;
{ {
long usec; long usec;
long msec; long msec;
@ -3516,9 +3500,9 @@ time_diff(then, now)
} }
void void
time_msg(mesg, tv_start) time_msg(
char *mesg; char *mesg,
void *tv_start; /* only for do_source: start time; actually void *tv_start) /* only for do_source: start time; actually
(struct timeval *) */ (struct timeval *) */
{ {
static struct timeval start; static struct timeval start;
@ -3562,8 +3546,7 @@ static char_u *build_drop_cmd(int filec, char **filev, int tabs, int sendReply);
* Do the client-server stuff, unless "--servername ''" was used. * Do the client-server stuff, unless "--servername ''" was used.
*/ */
static void static void
exec_on_server(parmp) exec_on_server(mparm_T *parmp)
mparm_T *parmp;
{ {
if (parmp->serverName_arg == NULL || *parmp->serverName_arg != NUL) if (parmp->serverName_arg == NULL || *parmp->serverName_arg != NUL)
{ {
@ -3605,8 +3588,7 @@ exec_on_server(parmp)
* Prepare for running as a Vim server. * Prepare for running as a Vim server.
*/ */
static void static void
prepare_server(parmp) prepare_server(mparm_T *parmp)
mparm_T *parmp;
{ {
# if defined(FEAT_X11) # if defined(FEAT_X11)
/* /*
@ -3648,11 +3630,11 @@ prepare_server(parmp)
} }
static void static void
cmdsrv_main(argc, argv, serverName_arg, serverStr) cmdsrv_main(
int *argc; int *argc,
char **argv; char **argv,
char_u *serverName_arg; char_u *serverName_arg,
char_u **serverStr; char_u **serverStr)
{ {
char_u *res; char_u *res;
int i; int i;
@ -3924,11 +3906,11 @@ cmdsrv_main(argc, argv, serverName_arg, serverStr)
* Build a ":drop" command to send to a Vim server. * Build a ":drop" command to send to a Vim server.
*/ */
static char_u * static char_u *
build_drop_cmd(filec, filev, tabs, sendReply) build_drop_cmd(
int filec; int filec,
char **filev; char **filev,
int tabs; /* Use ":tab drop" instead of ":drop". */ int tabs, /* Use ":tab drop" instead of ":drop". */
int sendReply; int sendReply)
{ {
garray_T ga; garray_T ga;
int i; int i;
@ -4044,9 +4026,7 @@ build_drop_cmd(filec, filev, tabs, sendReply)
* Return the name in allocated memory. This doesn't include a serial number. * Return the name in allocated memory. This doesn't include a serial number.
*/ */
static char_u * static char_u *
serverMakeName(arg, cmd) serverMakeName(char_u *arg, char *cmd)
char_u *arg;
char *cmd;
{ {
char_u *p; char_u *p;
@ -4068,8 +4048,7 @@ serverMakeName(arg, cmd)
* Replace termcodes such as <CR> and insert as key presses if there is room. * Replace termcodes such as <CR> and insert as key presses if there is room.
*/ */
void void
server_to_input_buf(str) server_to_input_buf(char_u *str)
char_u *str;
{ {
char_u *ptr = NULL; char_u *ptr = NULL;
char_u *cpo_save = p_cpo; char_u *cpo_save = p_cpo;
@ -4110,8 +4089,7 @@ server_to_input_buf(str)
* Evaluate an expression that the client sent to a string. * Evaluate an expression that the client sent to a string.
*/ */
char_u * char_u *
eval_client_expr_to_string(expr) eval_client_expr_to_string(char_u *expr)
char_u *expr;
{ {
char_u *res; char_u *res;
int save_dbl = debug_break_level; int save_dbl = debug_break_level;
@ -4151,10 +4129,10 @@ eval_client_expr_to_string(expr)
* "*tofree" is set to the result when it needs to be freed later. * "*tofree" is set to the result when it needs to be freed later.
*/ */
char_u * char_u *
serverConvert(client_enc, data, tofree) serverConvert(
char_u *client_enc UNUSED; char_u *client_enc UNUSED,
char_u *data; char_u *data,
char_u **tofree; char_u **tofree)
{ {
char_u *res = data; char_u *res = data;

View File

@ -43,8 +43,7 @@ static void write_one_filemark(FILE *fp, xfmark_T *fm, int c1, int c2);
* Returns OK on success, FAIL if bad name given. * Returns OK on success, FAIL if bad name given.
*/ */
int int
setmark(c) setmark(int c)
int c;
{ {
return setmark_pos(c, &curwin->w_cursor, curbuf->b_fnum); return setmark_pos(c, &curwin->w_cursor, curbuf->b_fnum);
} }
@ -55,10 +54,7 @@ setmark(c)
* Returns OK on success, FAIL if bad name given. * Returns OK on success, FAIL if bad name given.
*/ */
int int
setmark_pos(c, pos, fnum) setmark_pos(int c, pos_T *pos, int fnum)
int c;
pos_T *pos;
int fnum;
{ {
int i; int i;
@ -138,7 +134,7 @@ setmark_pos(c, pos, fnum)
* jump list. * jump list.
*/ */
void void
setpcmark() setpcmark(void)
{ {
#ifdef FEAT_JUMPLIST #ifdef FEAT_JUMPLIST
int i; int i;
@ -198,7 +194,7 @@ setpcmark()
* If pcmark was deleted (with "dG") the previous mark is restored. * If pcmark was deleted (with "dG") the previous mark is restored.
*/ */
void void
checkpcmark() checkpcmark(void)
{ {
if (curwin->w_prev_pcmark.lnum != 0 if (curwin->w_prev_pcmark.lnum != 0
&& (equalpos(curwin->w_pcmark, curwin->w_cursor) && (equalpos(curwin->w_pcmark, curwin->w_cursor)
@ -214,8 +210,7 @@ checkpcmark()
* move "count" positions in the jump list (count may be negative) * move "count" positions in the jump list (count may be negative)
*/ */
pos_T * pos_T *
movemark(count) movemark(int count)
int count;
{ {
pos_T *pos; pos_T *pos;
xfmark_T *jmp; xfmark_T *jmp;
@ -274,8 +269,7 @@ movemark(count)
* Move "count" positions in the changelist (count may be negative). * Move "count" positions in the changelist (count may be negative).
*/ */
pos_T * pos_T *
movechangelist(count) movechangelist(int count)
int count;
{ {
int n; int n;
@ -314,28 +308,23 @@ movechangelist(count)
* - -1 if mark is in other file and jumped there (only if changefile is TRUE) * - -1 if mark is in other file and jumped there (only if changefile is TRUE)
*/ */
pos_T * pos_T *
getmark_buf(buf, c, changefile) getmark_buf(buf_T *buf, int c, int changefile)
buf_T *buf;
int c;
int changefile;
{ {
return getmark_buf_fnum(buf, c, changefile, NULL); return getmark_buf_fnum(buf, c, changefile, NULL);
} }
pos_T * pos_T *
getmark(c, changefile) getmark(int c, int changefile)
int c;
int changefile;
{ {
return getmark_buf_fnum(curbuf, c, changefile, NULL); return getmark_buf_fnum(curbuf, c, changefile, NULL);
} }
pos_T * pos_T *
getmark_buf_fnum(buf, c, changefile, fnum) getmark_buf_fnum(
buf_T *buf; buf_T *buf,
int c; int c,
int changefile; int changefile,
int *fnum; int *fnum)
{ {
pos_T *posp; pos_T *posp;
pos_T *startp, *endp; pos_T *startp, *endp;
@ -472,10 +461,10 @@ getmark_buf_fnum(buf, c, changefile, fnum)
* Returns pointer to pos_T of the next mark or NULL if no mark is found. * Returns pointer to pos_T of the next mark or NULL if no mark is found.
*/ */
pos_T * pos_T *
getnextmark(startpos, dir, begin_line) getnextmark(
pos_T *startpos; /* where to start */ pos_T *startpos, /* where to start */
int dir; /* direction for search */ int dir, /* direction for search */
int begin_line; int begin_line)
{ {
int i; int i;
pos_T *result = NULL; pos_T *result = NULL;
@ -520,8 +509,7 @@ getnextmark(startpos, dir, begin_line)
* until the mark is used to avoid a long startup delay. * until the mark is used to avoid a long startup delay.
*/ */
static void static void
fname2fnum(fm) fname2fnum(xfmark_T *fm)
xfmark_T *fm;
{ {
char_u *p; char_u *p;
@ -561,8 +549,7 @@ fname2fnum(fm)
* Used for marks that come from the .viminfo file. * Used for marks that come from the .viminfo file.
*/ */
void void
fmarks_check_names(buf) fmarks_check_names(buf_T *buf)
buf_T *buf;
{ {
char_u *name; char_u *name;
int i; int i;
@ -592,10 +579,7 @@ fmarks_check_names(buf)
} }
static void static void
fmarks_check_one(fm, name, buf) fmarks_check_one(xfmark_T *fm, char_u *name, buf_T *buf)
xfmark_T *fm;
char_u *name;
buf_T *buf;
{ {
if (fm->fmark.fnum == 0 if (fm->fmark.fnum == 0
&& fm->fname != NULL && fm->fname != NULL
@ -612,8 +596,7 @@ fmarks_check_one(fm, name, buf)
* Give and error message and return FAIL if not. * Give and error message and return FAIL if not.
*/ */
int int
check_mark(pos) check_mark(pos_T *pos)
pos_T *pos;
{ {
if (pos == NULL) if (pos == NULL)
{ {
@ -642,8 +625,7 @@ check_mark(pos)
* Used mainly when trashing the entire buffer during ":e" type commands * Used mainly when trashing the entire buffer during ":e" type commands
*/ */
void void
clrallmarks(buf) clrallmarks(buf_T *buf)
buf_T *buf;
{ {
static int i = -1; static int i = -1;
@ -676,9 +658,7 @@ clrallmarks(buf)
* Returns an allocated string. * Returns an allocated string.
*/ */
char_u * char_u *
fm_getname(fmark, lead_len) fm_getname(fmark_T *fmark, int lead_len)
fmark_T *fmark;
int lead_len;
{ {
if (fmark->fnum == curbuf->b_fnum) /* current buffer */ if (fmark->fnum == curbuf->b_fnum) /* current buffer */
return mark_line(&(fmark->mark), lead_len); return mark_line(&(fmark->mark), lead_len);
@ -690,9 +670,7 @@ fm_getname(fmark, lead_len)
* The returned string has been allocated. * The returned string has been allocated.
*/ */
static char_u * static char_u *
mark_line(mp, lead_len) mark_line(pos_T *mp, int lead_len)
pos_T *mp;
int lead_len;
{ {
char_u *s, *p; char_u *s, *p;
int len; int len;
@ -718,8 +696,7 @@ mark_line(mp, lead_len)
* print the marks * print the marks
*/ */
void void
do_marks(eap) do_marks(exarg_T *eap)
exarg_T *eap;
{ {
char_u *arg = eap->arg; char_u *arg = eap->arg;
int i; int i;
@ -757,12 +734,12 @@ do_marks(eap)
} }
static void static void
show_one_mark(c, arg, p, name, current) show_one_mark(
int c; int c,
char_u *arg; char_u *arg,
pos_T *p; pos_T *p,
char_u *name; char_u *name,
int current; /* in current file */ int current) /* in current file */
{ {
static int did_title = FALSE; static int did_title = FALSE;
int mustfree = FALSE; int mustfree = FALSE;
@ -815,8 +792,7 @@ show_one_mark(c, arg, p, name, current)
* ":delmarks[!] [marks]" * ":delmarks[!] [marks]"
*/ */
void void
ex_delmarks(eap) ex_delmarks(exarg_T *eap)
exarg_T *eap;
{ {
char_u *p; char_u *p;
int from, to; int from, to;
@ -899,8 +875,7 @@ ex_delmarks(eap)
* print the jumplist * print the jumplist
*/ */
void void
ex_jumps(eap) ex_jumps(exarg_T *eap UNUSED)
exarg_T *eap UNUSED;
{ {
int i; int i;
char_u *name; char_u *name;
@ -947,8 +922,7 @@ ex_jumps(eap)
* print the changelist * print the changelist
*/ */
void void
ex_changes(eap) ex_changes(exarg_T *eap UNUSED)
exarg_T *eap UNUSED;
{ {
int i; int i;
char_u *name; char_u *name;
@ -1025,11 +999,11 @@ ex_changes(eap)
* or: mark_adjust(56, 55, MAXLNUM, 2); * or: mark_adjust(56, 55, MAXLNUM, 2);
*/ */
void void
mark_adjust(line1, line2, amount, amount_after) mark_adjust(
linenr_T line1; linenr_T line1,
linenr_T line2; linenr_T line2,
long amount; long amount,
long amount_after; long amount_after)
{ {
int i; int i;
int fnum = curbuf->b_fnum; int fnum = curbuf->b_fnum;
@ -1207,11 +1181,11 @@ mark_adjust(line1, line2, amount, amount_after)
* position. * position.
*/ */
void void
mark_col_adjust(lnum, mincol, lnum_amount, col_amount) mark_col_adjust(
linenr_T lnum; linenr_T lnum,
colnr_T mincol; colnr_T mincol,
long lnum_amount; long lnum_amount,
long col_amount; long col_amount)
{ {
int i; int i;
int fnum = curbuf->b_fnum; int fnum = curbuf->b_fnum;
@ -1291,7 +1265,7 @@ mark_col_adjust(lnum, mincol, lnum_amount, col_amount)
* jumplist. They will be removed here for the current window. * jumplist. They will be removed here for the current window.
*/ */
static void static void
cleanup_jumplist() cleanup_jumplist(void)
{ {
int i; int i;
int from, to; int from, to;
@ -1323,9 +1297,7 @@ cleanup_jumplist()
* Copy the jumplist from window "from" to window "to". * Copy the jumplist from window "from" to window "to".
*/ */
void void
copy_jumplist(from, to) copy_jumplist(win_T *from, win_T *to)
win_T *from;
win_T *to;
{ {
int i; int i;
@ -1343,8 +1315,7 @@ copy_jumplist(from, to)
* Free items in the jumplist of window "wp". * Free items in the jumplist of window "wp".
*/ */
void void
free_jumplist(wp) free_jumplist(win_T *wp)
win_T *wp;
{ {
int i; int i;
@ -1355,8 +1326,7 @@ free_jumplist(wp)
#endif /* FEAT_JUMPLIST */ #endif /* FEAT_JUMPLIST */
void void
set_last_cursor(win) set_last_cursor(win_T *win)
win_T *win;
{ {
if (win->w_buffer != NULL) if (win->w_buffer != NULL)
win->w_buffer->b_last_cursor = win->w_cursor; win->w_buffer->b_last_cursor = win->w_cursor;
@ -1364,7 +1334,7 @@ set_last_cursor(win)
#if defined(EXITFREE) || defined(PROTO) #if defined(EXITFREE) || defined(PROTO)
void void
free_all_marks() free_all_marks(void)
{ {
int i; int i;
@ -1376,9 +1346,7 @@ free_all_marks()
#if defined(FEAT_VIMINFO) || defined(PROTO) #if defined(FEAT_VIMINFO) || defined(PROTO)
int int
read_viminfo_filemark(virp, force) read_viminfo_filemark(vir_T *virp, int force)
vir_T *virp;
int force;
{ {
char_u *str; char_u *str;
xfmark_T *fm; xfmark_T *fm;
@ -1438,8 +1406,7 @@ read_viminfo_filemark(virp, force)
} }
void void
write_viminfo_filemarks(fp) write_viminfo_filemarks(FILE *fp)
FILE *fp;
{ {
int i; int i;
char_u *name; char_u *name;
@ -1499,11 +1466,11 @@ write_viminfo_filemarks(fp)
} }
static void static void
write_one_filemark(fp, fm, c1, c2) write_one_filemark(
FILE *fp; FILE *fp,
xfmark_T *fm; xfmark_T *fm,
int c1; int c1,
int c2; int c2)
{ {
char_u *name; char_u *name;
@ -1529,8 +1496,7 @@ write_one_filemark(fp, fm, c1, c2)
* Return TRUE if "name" is on removable media (depending on 'viminfo'). * Return TRUE if "name" is on removable media (depending on 'viminfo').
*/ */
int int
removable(name) removable(char_u *name)
char_u *name;
{ {
char_u *p; char_u *p;
char_u part[51]; char_u part[51];
@ -1565,8 +1531,7 @@ static void write_one_mark(FILE *fp_out, int c, pos_T *pos);
* Return the number of buffers for which marks have been written. * Return the number of buffers for which marks have been written.
*/ */
int int
write_viminfo_marks(fp_out) write_viminfo_marks(FILE *fp_out)
FILE *fp_out;
{ {
int count; int count;
buf_T *buf; buf_T *buf;
@ -1632,10 +1597,7 @@ write_viminfo_marks(fp_out)
} }
static void static void
write_one_mark(fp_out, c, pos) write_one_mark(FILE *fp_out, int c, pos_T *pos)
FILE *fp_out;
int c;
pos_T *pos;
{ {
if (pos->lnum != 0) if (pos->lnum != 0)
fprintf(fp_out, "\t%c\t%ld\t%d\n", c, (long)pos->lnum, (int)pos->col); fprintf(fp_out, "\t%c\t%ld\t%d\n", c, (long)pos->lnum, (int)pos->col);
@ -1648,12 +1610,12 @@ write_one_mark(fp_out, c, pos)
* fp_out == NULL && (flags & VIF_GET_OLDFILES | VIF_FORCEIT): fill v:oldfiles * fp_out == NULL && (flags & VIF_GET_OLDFILES | VIF_FORCEIT): fill v:oldfiles
*/ */
void void
copy_viminfo_marks(virp, fp_out, count, eof, flags) copy_viminfo_marks(
vir_T *virp; vir_T *virp,
FILE *fp_out; FILE *fp_out,
int count; int count,
int eof; int eof,
int flags; int flags)
{ {
char_u *line = virp->vir_line; char_u *line = virp->vir_line;
buf_T *buf; buf_T *buf;

File diff suppressed because it is too large Load Diff

View File

@ -121,9 +121,7 @@ static int mf_hash_grow(mf_hashtab_T *);
* return value: identifier for this memory block file. * return value: identifier for this memory block file.
*/ */
memfile_T * memfile_T *
mf_open(fname, flags) mf_open(char_u *fname, int flags)
char_u *fname;
int flags;
{ {
memfile_T *mfp; memfile_T *mfp;
off_t size; off_t size;
@ -223,9 +221,7 @@ mf_open(fname, flags)
* return value: FAIL if file could not be opened, OK otherwise * return value: FAIL if file could not be opened, OK otherwise
*/ */
int int
mf_open_file(mfp, fname) mf_open_file(memfile_T *mfp, char_u *fname)
memfile_T *mfp;
char_u *fname;
{ {
mf_do_open(mfp, fname, O_RDWR|O_CREAT|O_EXCL); /* try to open the file */ mf_do_open(mfp, fname, O_RDWR|O_CREAT|O_EXCL); /* try to open the file */
@ -240,9 +236,7 @@ mf_open_file(mfp, fname)
* Close a memory file and delete the associated file if 'del_file' is TRUE. * Close a memory file and delete the associated file if 'del_file' is TRUE.
*/ */
void void
mf_close(mfp, del_file) mf_close(memfile_T *mfp, int del_file)
memfile_T *mfp;
int del_file;
{ {
bhdr_T *hp, *nextp; bhdr_T *hp, *nextp;
@ -275,9 +269,9 @@ mf_close(mfp, del_file)
* Close the swap file for a memfile. Used when 'swapfile' is reset. * Close the swap file for a memfile. Used when 'swapfile' is reset.
*/ */
void void
mf_close_file(buf, getlines) mf_close_file(
buf_T *buf; buf_T *buf,
int getlines; /* get all lines into memory? */ int getlines) /* get all lines into memory? */
{ {
memfile_T *mfp; memfile_T *mfp;
linenr_T lnum; linenr_T lnum;
@ -315,9 +309,7 @@ mf_close_file(buf, getlines)
* and the size it indicates differs from what was guessed. * and the size it indicates differs from what was guessed.
*/ */
void void
mf_new_page_size(mfp, new_size) mf_new_page_size(memfile_T *mfp, unsigned new_size)
memfile_T *mfp;
unsigned new_size;
{ {
/* Correct the memory used for block 0 to the new size, because it will be /* Correct the memory used for block 0 to the new size, because it will be
* freed with that size later on. */ * freed with that size later on. */
@ -331,10 +323,7 @@ mf_new_page_size(mfp, new_size)
* negative: TRUE if negative block number desired (data block) * negative: TRUE if negative block number desired (data block)
*/ */
bhdr_T * bhdr_T *
mf_new(mfp, negative, page_count) mf_new(memfile_T *mfp, int negative, int page_count)
memfile_T *mfp;
int negative;
int page_count;
{ {
bhdr_T *hp; /* new bhdr_T */ bhdr_T *hp; /* new bhdr_T */
bhdr_T *freep; /* first block in free list */ bhdr_T *freep; /* first block in free list */
@ -424,10 +413,7 @@ mf_new(mfp, negative, page_count)
* Note: The caller should first check a negative nr with mf_trans_del() * Note: The caller should first check a negative nr with mf_trans_del()
*/ */
bhdr_T * bhdr_T *
mf_get(mfp, nr, page_count) mf_get(memfile_T *mfp, blocknr_T nr, int page_count)
memfile_T *mfp;
blocknr_T nr;
int page_count;
{ {
bhdr_T *hp; bhdr_T *hp;
/* doesn't exist */ /* doesn't exist */
@ -485,11 +471,11 @@ mf_get(mfp, nr, page_count)
* no return value, function cannot fail * no return value, function cannot fail
*/ */
void void
mf_put(mfp, hp, dirty, infile) mf_put(
memfile_T *mfp; memfile_T *mfp,
bhdr_T *hp; bhdr_T *hp,
int dirty; int dirty,
int infile; int infile)
{ {
int flags; int flags;
@ -512,9 +498,7 @@ mf_put(mfp, hp, dirty, infile)
* block *hp is no longer in used, may put it in the free list of memfile *mfp * block *hp is no longer in used, may put it in the free list of memfile *mfp
*/ */
void void
mf_free(mfp, hp) mf_free(memfile_T *mfp, bhdr_T *hp)
memfile_T *mfp;
bhdr_T *hp;
{ {
vim_free(hp->bh_data); /* free the memory */ vim_free(hp->bh_data); /* free the memory */
mf_rem_hash(mfp, hp); /* get *hp out of the hash list */ mf_rem_hash(mfp, hp); /* get *hp out of the hash list */
@ -553,9 +537,7 @@ fdtofh(int filedescriptor)
* Return FAIL for failure, OK otherwise * Return FAIL for failure, OK otherwise
*/ */
int int
mf_sync(mfp, flags) mf_sync(memfile_T *mfp, int flags)
memfile_T *mfp;
int flags;
{ {
int status; int status;
bhdr_T *hp; bhdr_T *hp;
@ -722,8 +704,7 @@ mf_sync(mfp, flags)
* created swapfile. * created swapfile.
*/ */
void void
mf_set_dirty(mfp) mf_set_dirty(memfile_T *mfp)
memfile_T *mfp;
{ {
bhdr_T *hp; bhdr_T *hp;
@ -737,9 +718,7 @@ mf_set_dirty(mfp)
* insert block *hp in front of hashlist of memfile *mfp * insert block *hp in front of hashlist of memfile *mfp
*/ */
static void static void
mf_ins_hash(mfp, hp) mf_ins_hash(memfile_T *mfp, bhdr_T *hp)
memfile_T *mfp;
bhdr_T *hp;
{ {
mf_hash_add_item(&mfp->mf_hash, (mf_hashitem_T *)hp); mf_hash_add_item(&mfp->mf_hash, (mf_hashitem_T *)hp);
} }
@ -748,9 +727,7 @@ mf_ins_hash(mfp, hp)
* remove block *hp from hashlist of memfile list *mfp * remove block *hp from hashlist of memfile list *mfp
*/ */
static void static void
mf_rem_hash(mfp, hp) mf_rem_hash(memfile_T *mfp, bhdr_T *hp)
memfile_T *mfp;
bhdr_T *hp;
{ {
mf_hash_rem_item(&mfp->mf_hash, (mf_hashitem_T *)hp); mf_hash_rem_item(&mfp->mf_hash, (mf_hashitem_T *)hp);
} }
@ -759,9 +736,7 @@ mf_rem_hash(mfp, hp)
* look in hash lists of memfile *mfp for block header with number 'nr' * look in hash lists of memfile *mfp for block header with number 'nr'
*/ */
static bhdr_T * static bhdr_T *
mf_find_hash(mfp, nr) mf_find_hash(memfile_T *mfp, blocknr_T nr)
memfile_T *mfp;
blocknr_T nr;
{ {
return (bhdr_T *)mf_hash_find(&mfp->mf_hash, nr); return (bhdr_T *)mf_hash_find(&mfp->mf_hash, nr);
} }
@ -770,9 +745,7 @@ mf_find_hash(mfp, nr)
* insert block *hp in front of used list of memfile *mfp * insert block *hp in front of used list of memfile *mfp
*/ */
static void static void
mf_ins_used(mfp, hp) mf_ins_used(memfile_T *mfp, bhdr_T *hp)
memfile_T *mfp;
bhdr_T *hp;
{ {
hp->bh_next = mfp->mf_used_first; hp->bh_next = mfp->mf_used_first;
mfp->mf_used_first = hp; mfp->mf_used_first = hp;
@ -789,9 +762,7 @@ mf_ins_used(mfp, hp)
* remove block *hp from used list of memfile *mfp * remove block *hp from used list of memfile *mfp
*/ */
static void static void
mf_rem_used(mfp, hp) mf_rem_used(memfile_T *mfp, bhdr_T *hp)
memfile_T *mfp;
bhdr_T *hp;
{ {
if (hp->bh_next == NULL) /* last block in used list */ if (hp->bh_next == NULL) /* last block in used list */
mfp->mf_used_last = hp->bh_prev; mfp->mf_used_last = hp->bh_prev;
@ -815,9 +786,7 @@ mf_rem_used(mfp, hp)
* Returns NULL if no block is released. * Returns NULL if no block is released.
*/ */
static bhdr_T * static bhdr_T *
mf_release(mfp, page_count) mf_release(memfile_T *mfp, int page_count)
memfile_T *mfp;
int page_count;
{ {
bhdr_T *hp; bhdr_T *hp;
int need_release; int need_release;
@ -899,7 +868,7 @@ mf_release(mfp, page_count)
* return TRUE if any memory was released * return TRUE if any memory was released
*/ */
int int
mf_release_all() mf_release_all(void)
{ {
buf_T *buf; buf_T *buf;
memfile_T *mfp; memfile_T *mfp;
@ -943,9 +912,7 @@ mf_release_all()
* Allocate a block header and a block of memory for it * Allocate a block header and a block of memory for it
*/ */
static bhdr_T * static bhdr_T *
mf_alloc_bhdr(mfp, page_count) mf_alloc_bhdr(memfile_T *mfp, int page_count)
memfile_T *mfp;
int page_count;
{ {
bhdr_T *hp; bhdr_T *hp;
@ -966,8 +933,7 @@ mf_alloc_bhdr(mfp, page_count)
* Free a block header and the block of memory for it * Free a block header and the block of memory for it
*/ */
static void static void
mf_free_bhdr(hp) mf_free_bhdr(bhdr_T *hp)
bhdr_T *hp;
{ {
vim_free(hp->bh_data); vim_free(hp->bh_data);
vim_free(hp); vim_free(hp);
@ -977,9 +943,7 @@ mf_free_bhdr(hp)
* insert entry *hp in the free list * insert entry *hp in the free list
*/ */
static void static void
mf_ins_free(mfp, hp) mf_ins_free(memfile_T *mfp, bhdr_T *hp)
memfile_T *mfp;
bhdr_T *hp;
{ {
hp->bh_next = mfp->mf_free_first; hp->bh_next = mfp->mf_free_first;
mfp->mf_free_first = hp; mfp->mf_free_first = hp;
@ -990,8 +954,7 @@ mf_ins_free(mfp, hp)
* Note: caller must check that mfp->mf_free_first is not NULL! * Note: caller must check that mfp->mf_free_first is not NULL!
*/ */
static bhdr_T * static bhdr_T *
mf_rem_free(mfp) mf_rem_free(memfile_T *mfp)
memfile_T *mfp;
{ {
bhdr_T *hp; bhdr_T *hp;
@ -1006,9 +969,7 @@ mf_rem_free(mfp)
* Return FAIL for failure, OK otherwise * Return FAIL for failure, OK otherwise
*/ */
static int static int
mf_read(mfp, hp) mf_read(memfile_T *mfp, bhdr_T *hp)
memfile_T *mfp;
bhdr_T *hp;
{ {
off_t offset; off_t offset;
unsigned page_size; unsigned page_size;
@ -1047,9 +1008,7 @@ mf_read(mfp, hp)
* Return FAIL for failure, OK otherwise * Return FAIL for failure, OK otherwise
*/ */
static int static int
mf_write(mfp, hp) mf_write(memfile_T *mfp, bhdr_T *hp)
memfile_T *mfp;
bhdr_T *hp;
{ {
off_t offset; /* offset in the file */ off_t offset; /* offset in the file */
blocknr_T nr; /* block nr which is being written */ blocknr_T nr; /* block nr which is being written */
@ -1126,11 +1085,11 @@ mf_write(mfp, hp)
* Return FAIL or OK. * Return FAIL or OK.
*/ */
static int static int
mf_write_block(mfp, hp, offset, size) mf_write_block(
memfile_T *mfp; memfile_T *mfp,
bhdr_T *hp; bhdr_T *hp,
off_t offset UNUSED; off_t offset UNUSED,
unsigned size; unsigned size)
{ {
char_u *data = hp->bh_data; char_u *data = hp->bh_data;
int result = OK; int result = OK;
@ -1162,9 +1121,7 @@ mf_write_block(mfp, hp, offset, size)
* Return FAIL for failure, OK otherwise * Return FAIL for failure, OK otherwise
*/ */
static int static int
mf_trans_add(mfp, hp) mf_trans_add(memfile_T *mfp, bhdr_T *hp)
memfile_T *mfp;
bhdr_T *hp;
{ {
bhdr_T *freep; bhdr_T *freep;
blocknr_T new_bnum; blocknr_T new_bnum;
@ -1227,9 +1184,7 @@ mf_trans_add(mfp, hp)
* Return the positive new number when found, the old number when not found * Return the positive new number when found, the old number when not found
*/ */
blocknr_T blocknr_T
mf_trans_del(mfp, old_nr) mf_trans_del(memfile_T *mfp, blocknr_T old_nr)
memfile_T *mfp;
blocknr_T old_nr;
{ {
NR_TRANS *np; NR_TRANS *np;
blocknr_T new_bnum; blocknr_T new_bnum;
@ -1256,8 +1211,7 @@ mf_trans_del(mfp, old_nr)
* name so we must work out the full path name. * name so we must work out the full path name.
*/ */
void void
mf_set_ffname(mfp) mf_set_ffname(memfile_T *mfp)
memfile_T *mfp;
{ {
mfp->mf_ffname = FullName_save(mfp->mf_fname, FALSE); mfp->mf_ffname = FullName_save(mfp->mf_fname, FALSE);
} }
@ -1267,8 +1221,7 @@ mf_set_ffname(mfp)
* Used before doing a :cd * Used before doing a :cd
*/ */
void void
mf_fullname(mfp) mf_fullname(memfile_T *mfp)
memfile_T *mfp;
{ {
if (mfp != NULL && mfp->mf_fname != NULL && mfp->mf_ffname != NULL) if (mfp != NULL && mfp->mf_fname != NULL && mfp->mf_ffname != NULL)
{ {
@ -1282,8 +1235,7 @@ mf_fullname(mfp)
* return TRUE if there are any translations pending for 'mfp' * return TRUE if there are any translations pending for 'mfp'
*/ */
int int
mf_need_trans(mfp) mf_need_trans(memfile_T *mfp)
memfile_T *mfp;
{ {
return (mfp->mf_fname != NULL && mfp->mf_neg_count > 0); return (mfp->mf_fname != NULL && mfp->mf_neg_count > 0);
} }
@ -1294,10 +1246,10 @@ mf_need_trans(mfp)
* error occurs). * error occurs).
*/ */
static void static void
mf_do_open(mfp, fname, flags) mf_do_open(
memfile_T *mfp; memfile_T *mfp,
char_u *fname; char_u *fname,
int flags; /* flags for open() */ int flags) /* flags for open() */
{ {
#ifdef HAVE_LSTAT #ifdef HAVE_LSTAT
struct stat sb; struct stat sb;
@ -1385,8 +1337,7 @@ mf_do_open(mfp, fname, flags)
* Initialize an empty hash table. * Initialize an empty hash table.
*/ */
static void static void
mf_hash_init(mht) mf_hash_init(mf_hashtab_T *mht)
mf_hashtab_T *mht;
{ {
vim_memset(mht, 0, sizeof(mf_hashtab_T)); vim_memset(mht, 0, sizeof(mf_hashtab_T));
mht->mht_buckets = mht->mht_small_buckets; mht->mht_buckets = mht->mht_small_buckets;
@ -1398,8 +1349,7 @@ mf_hash_init(mht)
* The hash table must not be used again without another mf_hash_init() call. * The hash table must not be used again without another mf_hash_init() call.
*/ */
static void static void
mf_hash_free(mht) mf_hash_free(mf_hashtab_T *mht)
mf_hashtab_T *mht;
{ {
if (mht->mht_buckets != mht->mht_small_buckets) if (mht->mht_buckets != mht->mht_small_buckets)
vim_free(mht->mht_buckets); vim_free(mht->mht_buckets);
@ -1409,8 +1359,7 @@ mf_hash_free(mht)
* Free the array of a hash table and all the items it contains. * Free the array of a hash table and all the items it contains.
*/ */
static void static void
mf_hash_free_all(mht) mf_hash_free_all(mf_hashtab_T *mht)
mf_hashtab_T *mht;
{ {
long_u idx; long_u idx;
mf_hashitem_T *mhi; mf_hashitem_T *mhi;
@ -1431,9 +1380,7 @@ mf_hash_free_all(mht)
* Returns a pointer to a mf_hashitem_T or NULL if the item was not found. * Returns a pointer to a mf_hashitem_T or NULL if the item was not found.
*/ */
static mf_hashitem_T * static mf_hashitem_T *
mf_hash_find(mht, key) mf_hash_find(mf_hashtab_T *mht, blocknr_T key)
mf_hashtab_T *mht;
blocknr_T key;
{ {
mf_hashitem_T *mhi; mf_hashitem_T *mhi;
@ -1449,9 +1396,7 @@ mf_hash_find(mht, key)
* "mhi" must not be NULL. * "mhi" must not be NULL.
*/ */
static void static void
mf_hash_add_item(mht, mhi) mf_hash_add_item(mf_hashtab_T *mht, mf_hashitem_T *mhi)
mf_hashtab_T *mht;
mf_hashitem_T *mhi;
{ {
long_u idx; long_u idx;
@ -1484,9 +1429,7 @@ mf_hash_add_item(mht, mhi)
* "mhi" must not be NULL and must have been inserted into "mht". * "mhi" must not be NULL and must have been inserted into "mht".
*/ */
static void static void
mf_hash_rem_item(mht, mhi) mf_hash_rem_item(mf_hashtab_T *mht, mf_hashitem_T *mhi)
mf_hashtab_T *mht;
mf_hashitem_T *mhi;
{ {
if (mhi->mhi_prev == NULL) if (mhi->mhi_prev == NULL)
mht->mht_buckets[mhi->mhi_key & mht->mht_mask] = mhi->mhi_next; mht->mht_buckets[mhi->mhi_key & mht->mht_mask] = mhi->mhi_next;
@ -1508,8 +1451,7 @@ mf_hash_rem_item(mht, mhi)
* Returns FAIL when out of memory. * Returns FAIL when out of memory.
*/ */
static int static int
mf_hash_grow(mht) mf_hash_grow(mf_hashtab_T *mht)
mf_hashtab_T *mht;
{ {
long_u i, j; long_u i, j;
int shift; int shift;

View File

@ -31,7 +31,7 @@ static void test_mf_hash(void);
* Test mf_hash_*() functions. * Test mf_hash_*() functions.
*/ */
static void static void
test_mf_hash() test_mf_hash(void)
{ {
mf_hashtab_T ht; mf_hashtab_T ht;
mf_hashitem_T *item; mf_hashitem_T *item;
@ -138,7 +138,7 @@ test_mf_hash()
} }
int int
main() main(void)
{ {
test_mf_hash(); test_mf_hash();
return 0; return 0;

View File

@ -278,8 +278,7 @@ static void ml_updatechunk(buf_T *buf, long line, long len, int updtype);
* Return FAIL for failure, OK otherwise. * Return FAIL for failure, OK otherwise.
*/ */
int int
ml_open(buf) ml_open(buf_T *buf)
buf_T *buf;
{ {
memfile_T *mfp; memfile_T *mfp;
bhdr_T *hp = NULL; bhdr_T *hp = NULL;
@ -437,8 +436,7 @@ error:
* Prepare encryption for "buf" for the current key and method. * Prepare encryption for "buf" for the current key and method.
*/ */
static void static void
ml_set_mfp_crypt(buf) ml_set_mfp_crypt(buf_T *buf)
buf_T *buf;
{ {
if (*buf->b_p_key != NUL) if (*buf->b_p_key != NUL)
{ {
@ -456,9 +454,7 @@ ml_set_mfp_crypt(buf)
* Prepare encryption for "buf" with block 0 "b0p". * Prepare encryption for "buf" with block 0 "b0p".
*/ */
static void static void
ml_set_b0_crypt(buf, b0p) ml_set_b0_crypt(buf_T *buf, ZERO_BL *b0p)
buf_T *buf;
ZERO_BL *b0p;
{ {
if (*buf->b_p_key == NUL) if (*buf->b_p_key == NUL)
b0p->b0_id[1] = BLOCK0_ID1; b0p->b0_id[1] = BLOCK0_ID1;
@ -485,10 +481,10 @@ ml_set_b0_crypt(buf, b0p)
* 'cryptmethod' when 'key' is changed. * 'cryptmethod' when 'key' is changed.
*/ */
void void
ml_set_crypt_key(buf, old_key, old_cm) ml_set_crypt_key(
buf_T *buf; buf_T *buf,
char_u *old_key; char_u *old_key,
char_u *old_cm; char_u *old_cm)
{ {
memfile_T *mfp = buf->b_ml.ml_mfp; memfile_T *mfp = buf->b_ml.ml_mfp;
bhdr_T *hp; bhdr_T *hp;
@ -639,8 +635,7 @@ ml_set_crypt_key(buf, old_key, old_cm)
* It may rename the swap file. * It may rename the swap file.
*/ */
void void
ml_setname(buf) ml_setname(buf_T *buf)
buf_T *buf;
{ {
int success = FALSE; int success = FALSE;
memfile_T *mfp; memfile_T *mfp;
@ -747,7 +742,7 @@ ml_setname(buf)
* Used when 'updatecount' changes from zero to non-zero. * Used when 'updatecount' changes from zero to non-zero.
*/ */
void void
ml_open_files() ml_open_files(void)
{ {
buf_T *buf; buf_T *buf;
@ -762,8 +757,7 @@ ml_open_files()
* and the memfile will be in memory only (no recovery possible). * and the memfile will be in memory only (no recovery possible).
*/ */
void void
ml_open_file(buf) ml_open_file(buf_T *buf)
buf_T *buf;
{ {
memfile_T *mfp; memfile_T *mfp;
char_u *fname; char_u *fname;
@ -844,8 +838,8 @@ ml_open_file(buf)
* file, or reading into an existing buffer, create a swap file now. * file, or reading into an existing buffer, create a swap file now.
*/ */
void void
check_need_swap(newfile) check_need_swap(
int newfile; /* reading file into new buffer */ int newfile) /* reading file into new buffer */
{ {
if (curbuf->b_may_swap && (!curbuf->b_p_ro || !newfile)) if (curbuf->b_may_swap && (!curbuf->b_p_ro || !newfile))
ml_open_file(curbuf); ml_open_file(curbuf);
@ -856,9 +850,7 @@ check_need_swap(newfile)
* If 'del_file' is TRUE, delete the swap file * If 'del_file' is TRUE, delete the swap file
*/ */
void void
ml_close(buf, del_file) ml_close(buf_T *buf, int del_file)
buf_T *buf;
int del_file;
{ {
if (buf->b_ml.ml_mfp == NULL) /* not open */ if (buf->b_ml.ml_mfp == NULL) /* not open */
return; return;
@ -884,8 +876,7 @@ ml_close(buf, del_file)
* But don't delete files that were ":preserve"d when we are POSIX compatible. * But don't delete files that were ":preserve"d when we are POSIX compatible.
*/ */
void void
ml_close_all(del_file) ml_close_all(int del_file)
int del_file;
{ {
buf_T *buf; buf_T *buf;
@ -905,7 +896,7 @@ ml_close_all(del_file)
* Only use just before exiting! * Only use just before exiting!
*/ */
void void
ml_close_notmod() ml_close_notmod(void)
{ {
buf_T *buf; buf_T *buf;
@ -919,8 +910,7 @@ ml_close_notmod()
* Used when the file has been written. * Used when the file has been written.
*/ */
void void
ml_timestamp(buf) ml_timestamp(buf_T *buf)
buf_T *buf;
{ {
ml_upd_block0(buf, UB_FNAME); ml_upd_block0(buf, UB_FNAME);
} }
@ -929,8 +919,7 @@ ml_timestamp(buf)
* Return FAIL when the ID of "b0p" is wrong. * Return FAIL when the ID of "b0p" is wrong.
*/ */
static int static int
ml_check_b0_id(b0p) ml_check_b0_id(ZERO_BL *b0p)
ZERO_BL *b0p;
{ {
if (b0p->b0_id[0] != BLOCK0_ID0 if (b0p->b0_id[0] != BLOCK0_ID0
|| (b0p->b0_id[1] != BLOCK0_ID1 || (b0p->b0_id[1] != BLOCK0_ID1
@ -946,9 +935,7 @@ ml_check_b0_id(b0p)
* Update the timestamp or the B0_SAME_DIR flag of the .swp file. * Update the timestamp or the B0_SAME_DIR flag of the .swp file.
*/ */
static void static void
ml_upd_block0(buf, what) ml_upd_block0(buf_T *buf, upd_block0_T what)
buf_T *buf;
upd_block0_T what;
{ {
memfile_T *mfp; memfile_T *mfp;
bhdr_T *hp; bhdr_T *hp;
@ -991,9 +978,7 @@ ml_upd_block0(buf, what)
* Don't use NameBuff[]!!! * Don't use NameBuff[]!!!
*/ */
static void static void
set_b0_fname(b0p, buf) set_b0_fname(ZERO_BL *b0p, buf_T *buf)
ZERO_BL *b0p;
buf_T *buf;
{ {
struct stat st; struct stat st;
@ -1072,9 +1057,7 @@ set_b0_fname(b0p, buf)
* not set. * not set.
*/ */
static void static void
set_b0_dir_flag(b0p, buf) set_b0_dir_flag(ZERO_BL *b0p, buf_T *buf)
ZERO_BL *b0p;
buf_T *buf;
{ {
if (same_directory(buf->b_ml.ml_mfp->mf_fname, buf->b_ffname)) if (same_directory(buf->b_ml.ml_mfp->mf_fname, buf->b_ffname))
b0p->b0_flags |= B0_SAME_DIR; b0p->b0_flags |= B0_SAME_DIR;
@ -1087,9 +1070,9 @@ set_b0_dir_flag(b0p, buf)
* When there is room, add the 'fileencoding' to block zero. * When there is room, add the 'fileencoding' to block zero.
*/ */
static void static void
add_b0_fenc(b0p, buf) add_b0_fenc(
ZERO_BL *b0p; ZERO_BL *b0p,
buf_T *buf; buf_T *buf)
{ {
int n; int n;
int size = B0_FNAME_SIZE_NOCRYPT; int size = B0_FNAME_SIZE_NOCRYPT;
@ -1120,7 +1103,7 @@ add_b0_fenc(b0p, buf)
* Try to recover curbuf from the .swp file. * Try to recover curbuf from the .swp file.
*/ */
void void
ml_recover() ml_recover(void)
{ {
buf_T *buf = NULL; buf_T *buf = NULL;
memfile_T *mfp = NULL; memfile_T *mfp = NULL;
@ -1778,11 +1761,11 @@ theend:
* - find the name of the n'th swap file when recovering * - find the name of the n'th swap file when recovering
*/ */
int int
recover_names(fname, list, nr, fname_out) recover_names(
char_u *fname; /* base for swap file name */ char_u *fname, /* base for swap file name */
int list; /* when TRUE, list the swap file names */ int list, /* when TRUE, list the swap file names */
int nr; /* when non-zero, return nr'th swap file name */ int nr, /* when non-zero, return nr'th swap file name */
char_u **fname_out; /* result when "nr" > 0 */ char_u **fname_out) /* result when "nr" > 0 */
{ {
int num_names; int num_names;
char_u *(names[6]); char_u *(names[6]);
@ -2038,9 +2021,7 @@ recover_names(fname, list, nr, fname_out)
* signs, to dir. An unnamed buffer is handled as "" (<currentdir>/"") * signs, to dir. An unnamed buffer is handled as "" (<currentdir>/"")
*/ */
static char_u * static char_u *
make_percent_swname(dir, name) make_percent_swname(char_u *dir, char_u *name)
char_u *dir;
char_u *name;
{ {
char_u *d, *s, *f; char_u *d, *s, *f;
@ -2073,8 +2054,7 @@ static int process_still_running;
* Returns timestamp (0 when unknown). * Returns timestamp (0 when unknown).
*/ */
static time_t static time_t
swapfile_info(fname) swapfile_info(char_u *fname)
char_u *fname;
{ {
struct stat st; struct stat st;
int fd; int fd;
@ -2188,10 +2168,7 @@ swapfile_info(fname)
} }
static int static int
recov_file_names(names, path, prepend_dot) recov_file_names(char_u **names, char_u *path, int prepend_dot)
char_u **names;
char_u *path;
int prepend_dot;
{ {
int num_names; int num_names;
@ -2298,9 +2275,7 @@ end:
* always sync at least one block. * always sync at least one block.
*/ */
void void
ml_sync_all(check_file, check_char) ml_sync_all(int check_file, int check_char)
int check_file;
int check_char;
{ {
buf_T *buf; buf_T *buf;
struct stat st; struct stat st;
@ -2350,9 +2325,7 @@ ml_sync_all(check_file, check_char)
* when message is TRUE the success of preserving is reported * when message is TRUE the success of preserving is reported
*/ */
void void
ml_preserve(buf, message) ml_preserve(buf_T *buf, int message)
buf_T *buf;
int message;
{ {
bhdr_T *hp; bhdr_T *hp;
linenr_T lnum; linenr_T lnum;
@ -2436,8 +2409,7 @@ theend:
* having to check for error everywhere). * having to check for error everywhere).
*/ */
char_u * char_u *
ml_get(lnum) ml_get(linenr_T lnum)
linenr_T lnum;
{ {
return ml_get_buf(curbuf, lnum, FALSE); return ml_get_buf(curbuf, lnum, FALSE);
} }
@ -2446,8 +2418,7 @@ ml_get(lnum)
* Return pointer to position "pos". * Return pointer to position "pos".
*/ */
char_u * char_u *
ml_get_pos(pos) ml_get_pos(pos_T *pos)
pos_T *pos;
{ {
return (ml_get_buf(curbuf, pos->lnum, FALSE) + pos->col); return (ml_get_buf(curbuf, pos->lnum, FALSE) + pos->col);
} }
@ -2456,7 +2427,7 @@ ml_get_pos(pos)
* Return pointer to cursor line. * Return pointer to cursor line.
*/ */
char_u * char_u *
ml_get_curline() ml_get_curline(void)
{ {
return ml_get_buf(curbuf, curwin->w_cursor.lnum, FALSE); return ml_get_buf(curbuf, curwin->w_cursor.lnum, FALSE);
} }
@ -2465,7 +2436,7 @@ ml_get_curline()
* Return pointer to cursor position. * Return pointer to cursor position.
*/ */
char_u * char_u *
ml_get_cursor() ml_get_cursor(void)
{ {
return (ml_get_buf(curbuf, curwin->w_cursor.lnum, FALSE) + return (ml_get_buf(curbuf, curwin->w_cursor.lnum, FALSE) +
curwin->w_cursor.col); curwin->w_cursor.col);
@ -2478,10 +2449,10 @@ ml_get_cursor()
* changed) * changed)
*/ */
char_u * char_u *
ml_get_buf(buf, lnum, will_change) ml_get_buf(
buf_T *buf; buf_T *buf,
linenr_T lnum; linenr_T lnum,
int will_change; /* line will be changed */ int will_change) /* line will be changed */
{ {
bhdr_T *hp; bhdr_T *hp;
DATA_BL *dp; DATA_BL *dp;
@ -2554,7 +2525,7 @@ errorret:
* is in allocated memory. * is in allocated memory.
*/ */
int int
ml_line_alloced() ml_line_alloced(void)
{ {
return (curbuf->b_ml.ml_flags & ML_LINE_DIRTY); return (curbuf->b_ml.ml_flags & ML_LINE_DIRTY);
} }
@ -2572,11 +2543,11 @@ ml_line_alloced()
* return FAIL for failure, OK otherwise * return FAIL for failure, OK otherwise
*/ */
int int
ml_append(lnum, line, len, newfile) ml_append(
linenr_T lnum; /* append after this line (can be 0) */ linenr_T lnum, /* append after this line (can be 0) */
char_u *line; /* text of the new line */ char_u *line, /* text of the new line */
colnr_T len; /* length of new line, including NUL, or 0 */ colnr_T len, /* length of new line, including NUL, or 0 */
int newfile; /* flag, see above */ int newfile) /* flag, see above */
{ {
/* When starting up, we might still need to create the memfile */ /* When starting up, we might still need to create the memfile */
if (curbuf->b_ml.ml_mfp == NULL && open_buffer(FALSE, NULL, 0) == FAIL) if (curbuf->b_ml.ml_mfp == NULL && open_buffer(FALSE, NULL, 0) == FAIL)
@ -2593,12 +2564,12 @@ ml_append(lnum, line, len, newfile)
* a memline. * a memline.
*/ */
int int
ml_append_buf(buf, lnum, line, len, newfile) ml_append_buf(
buf_T *buf; buf_T *buf,
linenr_T lnum; /* append after this line (can be 0) */ linenr_T lnum, /* append after this line (can be 0) */
char_u *line; /* text of the new line */ char_u *line, /* text of the new line */
colnr_T len; /* length of new line, including NUL, or 0 */ colnr_T len, /* length of new line, including NUL, or 0 */
int newfile; /* flag, see above */ int newfile) /* flag, see above */
{ {
if (buf->b_ml.ml_mfp == NULL) if (buf->b_ml.ml_mfp == NULL)
return FAIL; return FAIL;
@ -2610,13 +2581,13 @@ ml_append_buf(buf, lnum, line, len, newfile)
#endif #endif
static int static int
ml_append_int(buf, lnum, line, len, newfile, mark) ml_append_int(
buf_T *buf; buf_T *buf,
linenr_T lnum; /* append after this line (can be 0) */ linenr_T lnum, /* append after this line (can be 0) */
char_u *line; /* text of the new line */ char_u *line, /* text of the new line */
colnr_T len; /* length of line, including NUL, or 0 */ colnr_T len, /* length of line, including NUL, or 0 */
int newfile; /* flag, see above */ int newfile, /* flag, see above */
int mark; /* mark the new line */ int mark) /* mark the new line */
{ {
int i; int i;
int line_count; /* number of indexes in current block */ int line_count; /* number of indexes in current block */
@ -3119,10 +3090,7 @@ ml_append_int(buf, lnum, line, len, newfile, mark)
* return FAIL for failure, OK otherwise * return FAIL for failure, OK otherwise
*/ */
int int
ml_replace(lnum, line, copy) ml_replace(linenr_T lnum, char_u *line, int copy)
linenr_T lnum;
char_u *line;
int copy;
{ {
if (line == NULL) /* just checking... */ if (line == NULL) /* just checking... */
return FAIL; return FAIL;
@ -3160,19 +3128,14 @@ ml_replace(lnum, line, copy)
* return FAIL for failure, OK otherwise * return FAIL for failure, OK otherwise
*/ */
int int
ml_delete(lnum, message) ml_delete(linenr_T lnum, int message)
linenr_T lnum;
int message;
{ {
ml_flush_line(curbuf); ml_flush_line(curbuf);
return ml_delete_int(curbuf, lnum, message); return ml_delete_int(curbuf, lnum, message);
} }
static int static int
ml_delete_int(buf, lnum, message) ml_delete_int(buf_T *buf, linenr_T lnum, int message)
buf_T *buf;
linenr_T lnum;
int message;
{ {
bhdr_T *hp; bhdr_T *hp;
memfile_T *mfp; memfile_T *mfp;
@ -3332,8 +3295,7 @@ ml_delete_int(buf, lnum, message)
* set the B_MARKED flag for line 'lnum' * set the B_MARKED flag for line 'lnum'
*/ */
void void
ml_setmarked(lnum) ml_setmarked(linenr_T lnum)
linenr_T lnum;
{ {
bhdr_T *hp; bhdr_T *hp;
DATA_BL *dp; DATA_BL *dp;
@ -3362,7 +3324,7 @@ ml_setmarked(lnum)
* find the first line with its B_MARKED flag set * find the first line with its B_MARKED flag set
*/ */
linenr_T linenr_T
ml_firstmarked() ml_firstmarked(void)
{ {
bhdr_T *hp; bhdr_T *hp;
DATA_BL *dp; DATA_BL *dp;
@ -3406,7 +3368,7 @@ ml_firstmarked()
* clear all DB_MARKED flags * clear all DB_MARKED flags
*/ */
void void
ml_clearmarked() ml_clearmarked(void)
{ {
bhdr_T *hp; bhdr_T *hp;
DATA_BL *dp; DATA_BL *dp;
@ -3448,8 +3410,7 @@ ml_clearmarked()
* flush ml_line if necessary * flush ml_line if necessary
*/ */
static void static void
ml_flush_line(buf) ml_flush_line(buf_T *buf)
buf_T *buf;
{ {
bhdr_T *hp; bhdr_T *hp;
DATA_BL *dp; DATA_BL *dp;
@ -3554,10 +3515,7 @@ ml_flush_line(buf)
* create a new, empty, data block * create a new, empty, data block
*/ */
static bhdr_T * static bhdr_T *
ml_new_data(mfp, negative, page_count) ml_new_data(memfile_T *mfp, int negative, int page_count)
memfile_T *mfp;
int negative;
int page_count;
{ {
bhdr_T *hp; bhdr_T *hp;
DATA_BL *dp; DATA_BL *dp;
@ -3578,8 +3536,7 @@ ml_new_data(mfp, negative, page_count)
* create a new, empty, pointer block * create a new, empty, pointer block
*/ */
static bhdr_T * static bhdr_T *
ml_new_ptr(mfp) ml_new_ptr(memfile_T *mfp)
memfile_T *mfp;
{ {
bhdr_T *hp; bhdr_T *hp;
PTR_BL *pp; PTR_BL *pp;
@ -3612,10 +3569,7 @@ ml_new_ptr(mfp)
* return: NULL for failure, pointer to block header otherwise * return: NULL for failure, pointer to block header otherwise
*/ */
static bhdr_T * static bhdr_T *
ml_find_line(buf, lnum, action) ml_find_line(buf_T *buf, linenr_T lnum, int action)
buf_T *buf;
linenr_T lnum;
int action;
{ {
DATA_BL *dp; DATA_BL *dp;
PTR_BL *pp; PTR_BL *pp;
@ -3817,8 +3771,7 @@ error_noblock:
* return -1 for failure, number of the new entry otherwise * return -1 for failure, number of the new entry otherwise
*/ */
static int static int
ml_add_stack(buf) ml_add_stack(buf_T *buf)
buf_T *buf;
{ {
int top; int top;
infoptr_T *newstack; infoptr_T *newstack;
@ -3857,9 +3810,7 @@ ml_add_stack(buf)
* Count is the number of lines added, negative if lines have been deleted. * Count is the number of lines added, negative if lines have been deleted.
*/ */
static void static void
ml_lineadd(buf, count) ml_lineadd(buf_T *buf, int count)
buf_T *buf;
int count;
{ {
int idx; int idx;
infoptr_T *ip; infoptr_T *ip;
@ -3894,9 +3845,7 @@ ml_lineadd(buf, count)
* Otherwise returns FAIL. * Otherwise returns FAIL.
*/ */
int int
resolve_symlink(fname, buf) resolve_symlink(char_u *fname, char_u *buf)
char_u *fname;
char_u *buf;
{ {
char_u tmp[MAXPATHL]; char_u tmp[MAXPATHL];
int ret; int ret;
@ -3970,11 +3919,11 @@ resolve_symlink(fname, buf)
* Returns pointer to allocated memory or NULL. * Returns pointer to allocated memory or NULL.
*/ */
char_u * char_u *
makeswapname(fname, ffname, buf, dir_name) makeswapname(
char_u *fname; char_u *fname,
char_u *ffname UNUSED; char_u *ffname UNUSED,
buf_T *buf; buf_T *buf,
char_u *dir_name; char_u *dir_name)
{ {
char_u *r, *s; char_u *r, *s;
char_u *fname_res = fname; char_u *fname_res = fname;
@ -4044,9 +3993,9 @@ makeswapname(fname, ffname, buf, dir_name)
* The return value is an allocated string and can be NULL. * The return value is an allocated string and can be NULL.
*/ */
char_u * char_u *
get_file_in_dir(fname, dname) get_file_in_dir(
char_u *fname; char_u *fname,
char_u *dname; /* don't use "dirname", it is a global for Alpha */ char_u *dname) /* don't use "dirname", it is a global for Alpha */
{ {
char_u *t; char_u *t;
char_u *tail; char_u *tail;
@ -4095,9 +4044,9 @@ static void attention_message(buf_T *buf, char_u *fname);
* Print the ATTENTION message: info about an existing swap file. * Print the ATTENTION message: info about an existing swap file.
*/ */
static void static void
attention_message(buf, fname) attention_message(
buf_T *buf; /* buffer being edited */ buf_T *buf, /* buffer being edited */
char_u *fname; /* swap file name */ char_u *fname) /* swap file name */
{ {
struct stat st; struct stat st;
time_t x, sx; time_t x, sx;
@ -4154,9 +4103,7 @@ static int do_swapexists(buf_T *buf, char_u *fname);
* 6: abort * 6: abort
*/ */
static int static int
do_swapexists(buf, fname) do_swapexists(buf_T *buf, char_u *fname)
buf_T *buf;
char_u *fname;
{ {
set_vim_var_string(VV_SWAPNAME, fname, -1); set_vim_var_string(VV_SWAPNAME, fname, -1);
set_vim_var_string(VV_SWAPCHOICE, NULL, -1); set_vim_var_string(VV_SWAPCHOICE, NULL, -1);
@ -4195,10 +4142,10 @@ do_swapexists(buf, fname)
* Note: May trigger SwapExists autocmd, pointers may change! * Note: May trigger SwapExists autocmd, pointers may change!
*/ */
static char_u * static char_u *
findswapname(buf, dirp, old_fname) findswapname(
buf_T *buf; buf_T *buf,
char_u **dirp; /* pointer to list of directories */ char_u **dirp, /* pointer to list of directories */
char_u *old_fname; /* don't give warning for this file name */ char_u *old_fname) /* don't give warning for this file name */
{ {
char_u *fname; char_u *fname;
int n; int n;
@ -4676,8 +4623,7 @@ findswapname(buf, dirp, old_fname)
} }
static int static int
b0_magic_wrong(b0p) b0_magic_wrong(ZERO_BL *b0p)
ZERO_BL *b0p;
{ {
return (b0p->b0_magic_long != (long)B0_MAGIC_LONG return (b0p->b0_magic_long != (long)B0_MAGIC_LONG
|| b0p->b0_magic_int != (int)B0_MAGIC_INT || b0p->b0_magic_int != (int)B0_MAGIC_INT
@ -4736,10 +4682,10 @@ b0_magic_wrong(b0p)
*/ */
static int static int
fnamecmp_ino(fname_c, fname_s, ino_block0) fnamecmp_ino(
char_u *fname_c; /* current file name */ char_u *fname_c, /* current file name */
char_u *fname_s; /* file name from swap file */ char_u *fname_s, /* file name from swap file */
long ino_block0; long ino_block0)
{ {
struct stat st; struct stat st;
ino_t ino_c = 0; /* ino of current file */ ino_t ino_c = 0; /* ino of current file */
@ -4789,9 +4735,7 @@ fnamecmp_ino(fname_c, fname_s, ino_block0)
* Used for machine independency in block zero. * Used for machine independency in block zero.
*/ */
static void static void
long_to_char(n, s) long_to_char(long n, char_u *s)
long n;
char_u *s;
{ {
s[0] = (char_u)(n & 0xff); s[0] = (char_u)(n & 0xff);
n = (unsigned)n >> 8; n = (unsigned)n >> 8;
@ -4803,8 +4747,7 @@ long_to_char(n, s)
} }
static long static long
char_to_long(s) char_to_long(char_u *s)
char_u *s;
{ {
long retval; long retval;
@ -4826,8 +4769,7 @@ char_to_long(s)
* - 'fileencoding' * - 'fileencoding'
*/ */
void void
ml_setflags(buf) ml_setflags(buf_T *buf)
buf_T *buf;
{ {
bhdr_T *hp; bhdr_T *hp;
ZERO_BL *b0p; ZERO_BL *b0p;
@ -4859,11 +4801,11 @@ ml_setflags(buf)
* Otherwise return "data". * Otherwise return "data".
*/ */
char_u * char_u *
ml_encrypt_data(mfp, data, offset, size) ml_encrypt_data(
memfile_T *mfp; memfile_T *mfp,
char_u *data; char_u *data,
off_t offset; off_t offset,
unsigned size; unsigned size)
{ {
DATA_BL *dp = (DATA_BL *)data; DATA_BL *dp = (DATA_BL *)data;
char_u *head_end; char_u *head_end;
@ -4904,11 +4846,11 @@ ml_encrypt_data(mfp, data, offset, size)
* Decrypt the text in "data" if it points to an encrypted data block. * Decrypt the text in "data" if it points to an encrypted data block.
*/ */
void void
ml_decrypt_data(mfp, data, offset, size) ml_decrypt_data(
memfile_T *mfp; memfile_T *mfp,
char_u *data; char_u *data,
off_t offset; off_t offset,
unsigned size; unsigned size)
{ {
DATA_BL *dp = (DATA_BL *)data; DATA_BL *dp = (DATA_BL *)data;
char_u *head_end; char_u *head_end;
@ -4941,10 +4883,7 @@ ml_decrypt_data(mfp, data, offset, size)
* Return an allocated cryptstate_T *. * Return an allocated cryptstate_T *.
*/ */
static cryptstate_T * static cryptstate_T *
ml_crypt_prepare(mfp, offset, reading) ml_crypt_prepare(memfile_T *mfp, off_t offset, int reading)
memfile_T *mfp;
off_t offset;
int reading;
{ {
buf_T *buf = mfp->mf_buffer; buf_T *buf = mfp->mf_buffer;
char_u salt[50]; char_u salt[50];
@ -4999,11 +4938,11 @@ ml_crypt_prepare(mfp, offset, reading)
* ML_CHNK_UPDLINE: Add len to parent chunk, as a signed entity. * ML_CHNK_UPDLINE: Add len to parent chunk, as a signed entity.
*/ */
static void static void
ml_updatechunk(buf, line, len, updtype) ml_updatechunk(
buf_T *buf; buf_T *buf,
linenr_T line; linenr_T line,
long len; long len,
int updtype; int updtype)
{ {
static buf_T *ml_upd_lastbuf = NULL; static buf_T *ml_upd_lastbuf = NULL;
static linenr_T ml_upd_lastline; static linenr_T ml_upd_lastline;
@ -5241,10 +5180,7 @@ ml_updatechunk(buf, line, len, updtype)
* return -1 if information is not available * return -1 if information is not available
*/ */
long long
ml_find_line_or_offset(buf, lnum, offp) ml_find_line_or_offset(buf_T *buf, linenr_T lnum, long *offp)
buf_T *buf;
linenr_T lnum;
long *offp;
{ {
linenr_T curline; linenr_T curline;
int curix; int curix;
@ -5371,8 +5307,7 @@ ml_find_line_or_offset(buf, lnum, offp)
* Goto byte in buffer with offset 'cnt'. * Goto byte in buffer with offset 'cnt'.
*/ */
void void
goto_byte(cnt) goto_byte(long cnt)
long cnt;
{ {
long boff = cnt; long boff = cnt;
linenr_T lnum; linenr_T lnum;

View File

@ -86,8 +86,8 @@ static const char *toolbar_names[] =
* Do the :menu command and relatives. * Do the :menu command and relatives.
*/ */
void void
ex_menu(eap) ex_menu(
exarg_T *eap; /* Ex command arguments */ exarg_T *eap) /* Ex command arguments */
{ {
char_u *menu_path; char_u *menu_path;
int modes; int modes;
@ -410,19 +410,16 @@ theend:
* Add the menu with the given name to the menu hierarchy * Add the menu with the given name to the menu hierarchy
*/ */
static int static int
add_menu_path(menu_path, menuarg, pri_tab, call_data add_menu_path(
#ifdef FEAT_GUI_W32 char_u *menu_path,
, addtearoff vimmenu_T *menuarg, /* passes modes, iconfile, iconidx,
#endif
)
char_u *menu_path;
vimmenu_T *menuarg; /* passes modes, iconfile, iconidx,
icon_builtin, silent[0], noremap[0] */ icon_builtin, silent[0], noremap[0] */
int *pri_tab; int *pri_tab,
char_u *call_data; char_u *call_data
#ifdef FEAT_GUI_W32 #ifdef FEAT_GUI_W32
int addtearoff; /* may add tearoff item */ , int addtearoff /* may add tearoff item */
#endif #endif
)
{ {
char_u *path_name; char_u *path_name;
int modes = menuarg->modes; int modes = menuarg->modes;
@ -807,11 +804,11 @@ erret:
* Called recursively. * Called recursively.
*/ */
static int static int
menu_nable_recurse(menu, name, modes, enable) menu_nable_recurse(
vimmenu_T *menu; vimmenu_T *menu,
char_u *name; char_u *name,
int modes; int modes,
int enable; int enable)
{ {
char_u *p; char_u *p;
@ -872,11 +869,11 @@ menu_nable_recurse(menu, name, modes, enable)
* Called recursively. * Called recursively.
*/ */
static int static int
remove_menu(menup, name, modes, silent) remove_menu(
vimmenu_T **menup; vimmenu_T **menup,
char_u *name; char_u *name,
int modes; int modes,
int silent; /* don't give error messages */ int silent) /* don't give error messages */
{ {
vimmenu_T *menu; vimmenu_T *menu;
vimmenu_T *child; vimmenu_T *child;
@ -992,8 +989,7 @@ remove_menu(menup, name, modes, silent)
* Free the given menu structure and remove it from the linked list. * Free the given menu structure and remove it from the linked list.
*/ */
static void static void
free_menu(menup) free_menu(vimmenu_T **menup)
vimmenu_T **menup;
{ {
int i; int i;
vimmenu_T *menu; vimmenu_T *menu;
@ -1037,9 +1033,7 @@ free_menu(menup)
* Free the menu->string with the given index. * Free the menu->string with the given index.
*/ */
static void static void
free_menu_string(menu, idx) free_menu_string(vimmenu_T *menu, int idx)
vimmenu_T *menu;
int idx;
{ {
int count = 0; int count = 0;
int i; int i;
@ -1056,9 +1050,7 @@ free_menu_string(menu, idx)
* Show the mapping associated with a menu item or hierarchy in a sub-menu. * Show the mapping associated with a menu item or hierarchy in a sub-menu.
*/ */
static int static int
show_menus(path_name, modes) show_menus(char_u *path_name, int modes)
char_u *path_name;
int modes;
{ {
char_u *p; char_u *p;
char_u *name; char_u *name;
@ -1119,10 +1111,7 @@ show_menus(path_name, modes)
* Recursively show the mappings associated with the menus under the given one * Recursively show the mappings associated with the menus under the given one
*/ */
static void static void
show_menus_recursive(menu, modes, depth) show_menus_recursive(vimmenu_T *menu, int modes, int depth)
vimmenu_T *menu;
int modes;
int depth;
{ {
int i; int i;
int bit; int bit;
@ -1208,11 +1197,11 @@ static int expand_emenu; /* TRUE for ":emenu" command */
* Work out what to complete when doing command line completion of menu names. * Work out what to complete when doing command line completion of menu names.
*/ */
char_u * char_u *
set_context_in_menu_cmd(xp, cmd, arg, forceit) set_context_in_menu_cmd(
expand_T *xp; expand_T *xp,
char_u *cmd; char_u *cmd,
char_u *arg; char_u *arg,
int forceit; int forceit)
{ {
char_u *after_dot; char_u *after_dot;
char_u *p; char_u *p;
@ -1327,9 +1316,7 @@ set_context_in_menu_cmd(xp, cmd, arg, forceit)
* entries). * entries).
*/ */
char_u * char_u *
get_menu_name(xp, idx) get_menu_name(expand_T *xp UNUSED, int idx)
expand_T *xp UNUSED;
int idx;
{ {
static vimmenu_T *menu = NULL; static vimmenu_T *menu = NULL;
char_u *str; char_u *str;
@ -1389,9 +1376,7 @@ get_menu_name(xp, idx)
* entries. * entries.
*/ */
char_u * char_u *
get_menu_names(xp, idx) get_menu_names(expand_T *xp UNUSED, int idx)
expand_T *xp UNUSED;
int idx;
{ {
static vimmenu_T *menu = NULL; static vimmenu_T *menu = NULL;
#define TBUFFER_LEN 256 #define TBUFFER_LEN 256
@ -1483,8 +1468,7 @@ get_menu_names(xp, idx)
* "name" may be modified. * "name" may be modified.
*/ */
char_u * char_u *
menu_name_skip(name) menu_name_skip(char_u *name)
char_u *name;
{ {
char_u *p; char_u *p;
@ -1507,9 +1491,7 @@ menu_name_skip(name)
* two ways: raw menu name and menu name without '&'. ignore part after a TAB. * two ways: raw menu name and menu name without '&'. ignore part after a TAB.
*/ */
static int static int
menu_name_equal(name, menu) menu_name_equal(char_u *name, vimmenu_T *menu)
char_u *name;
vimmenu_T *menu;
{ {
#ifdef FEAT_MULTI_LANG #ifdef FEAT_MULTI_LANG
if (menu->en_name != NULL if (menu->en_name != NULL
@ -1521,9 +1503,7 @@ menu_name_equal(name, menu)
} }
static int static int
menu_namecmp(name, mname) menu_namecmp(char_u *name, char_u *mname)
char_u *name;
char_u *mname;
{ {
int i; int i;
@ -1543,11 +1523,11 @@ menu_namecmp(name, mname)
* whether the command is an "unmenu" command. * whether the command is an "unmenu" command.
*/ */
static int static int
get_menu_cmd_modes(cmd, forceit, noremap, unmenu) get_menu_cmd_modes(
char_u *cmd; char_u *cmd,
int forceit; /* Was there a "!" after the command? */ int forceit, /* Was there a "!" after the command? */
int *noremap; int *noremap,
int *unmenu; int *unmenu)
{ {
int modes; int modes;
@ -1607,9 +1587,7 @@ get_menu_cmd_modes(cmd, forceit, noremap, unmenu)
* Returns the name in allocated memory (NULL for failure). * Returns the name in allocated memory (NULL for failure).
*/ */
static char_u * static char_u *
popup_mode_name(name, idx) popup_mode_name(char_u *name, int idx)
char_u *name;
int idx;
{ {
char_u *p; char_u *p;
int len = (int)STRLEN(name); int len = (int)STRLEN(name);
@ -1630,9 +1608,7 @@ popup_mode_name(name, idx)
* given menu in the current mode. * given menu in the current mode.
*/ */
int int
get_menu_index(menu, state) get_menu_index(vimmenu_T *menu, int state)
vimmenu_T *menu;
int state;
{ {
int idx; int idx;
@ -1670,10 +1646,7 @@ get_menu_index(menu, state)
* If actext != NULL, *actext is set to the text after the first TAB. * If actext != NULL, *actext is set to the text after the first TAB.
*/ */
static char_u * static char_u *
menu_text(str, mnemonic, actext) menu_text(char_u *str, int *mnemonic, char_u **actext)
char_u *str;
int *mnemonic;
char_u **actext;
{ {
char_u *p; char_u *p;
char_u *text; char_u *text;
@ -1724,8 +1697,7 @@ menu_text(str, mnemonic, actext)
* Return TRUE if "name" can be a menu in the MenuBar. * Return TRUE if "name" can be a menu in the MenuBar.
*/ */
int int
menu_is_menubar(name) menu_is_menubar(char_u *name)
char_u *name;
{ {
return (!menu_is_popup(name) return (!menu_is_popup(name)
&& !menu_is_toolbar(name) && !menu_is_toolbar(name)
@ -1736,8 +1708,7 @@ menu_is_menubar(name)
* Return TRUE if "name" is a popup menu name. * Return TRUE if "name" is a popup menu name.
*/ */
int int
menu_is_popup(name) menu_is_popup(char_u *name)
char_u *name;
{ {
return (STRNCMP(name, "PopUp", 5) == 0); return (STRNCMP(name, "PopUp", 5) == 0);
} }
@ -1747,8 +1718,7 @@ menu_is_popup(name)
* Return TRUE if "name" is part of a popup menu. * Return TRUE if "name" is part of a popup menu.
*/ */
int int
menu_is_child_of_popup(menu) menu_is_child_of_popup(vimmenu_T *menu)
vimmenu_T *menu;
{ {
while (menu->parent != NULL) while (menu->parent != NULL)
menu = menu->parent; menu = menu->parent;
@ -1760,8 +1730,7 @@ menu_is_child_of_popup(menu)
* Return TRUE if "name" is a toolbar menu name. * Return TRUE if "name" is a toolbar menu name.
*/ */
int int
menu_is_toolbar(name) menu_is_toolbar(char_u *name)
char_u *name;
{ {
return (STRNCMP(name, "ToolBar", 7) == 0); return (STRNCMP(name, "ToolBar", 7) == 0);
} }
@ -1771,8 +1740,7 @@ menu_is_toolbar(name)
* with '-' * with '-'
*/ */
int int
menu_is_separator(name) menu_is_separator(char_u *name)
char_u *name;
{ {
return (name[0] == '-' && name[STRLEN(name) - 1] == '-'); return (name[0] == '-' && name[STRLEN(name) - 1] == '-');
} }
@ -1781,8 +1749,7 @@ menu_is_separator(name)
* Return TRUE if the menu is hidden: Starts with ']' * Return TRUE if the menu is hidden: Starts with ']'
*/ */
static int static int
menu_is_hidden(name) menu_is_hidden(char_u *name)
char_u *name;
{ {
return (name[0] == ']') || (menu_is_popup(name) && name[5] != NUL); return (name[0] == ']') || (menu_is_popup(name) && name[5] != NUL);
} }
@ -1793,8 +1760,7 @@ menu_is_hidden(name)
* Return TRUE if the menu is the tearoff menu. * Return TRUE if the menu is the tearoff menu.
*/ */
static int static int
menu_is_tearoff(name) menu_is_tearoff(char_u *name UNUSED)
char_u *name UNUSED;
{ {
#ifdef FEAT_GUI #ifdef FEAT_GUI
return (STRCMP(name, TEAR_STRING) == 0); return (STRCMP(name, TEAR_STRING) == 0);
@ -1807,7 +1773,7 @@ menu_is_tearoff(name)
#ifdef FEAT_GUI #ifdef FEAT_GUI
static int static int
get_menu_mode() get_menu_mode(void)
{ {
if (VIsual_active) if (VIsual_active)
{ {
@ -1835,9 +1801,7 @@ get_menu_mode()
* Return OK or FAIL. Used recursively. * Return OK or FAIL. Used recursively.
*/ */
int int
check_menu_pointer(root, menu_to_check) check_menu_pointer(vimmenu_T *root, vimmenu_T *menu_to_check)
vimmenu_T *root;
vimmenu_T *menu_to_check;
{ {
vimmenu_T *p; vimmenu_T *p;
@ -1857,8 +1821,7 @@ check_menu_pointer(root, menu_to_check)
* gui_create_initial_menus(root_menu, NULL); * gui_create_initial_menus(root_menu, NULL);
*/ */
void void
gui_create_initial_menus(menu) gui_create_initial_menus(vimmenu_T *menu)
vimmenu_T *menu;
{ {
int idx = 0; int idx = 0;
@ -1884,9 +1847,7 @@ gui_create_initial_menus(menu)
* Used recursively by gui_update_menus (see below) * Used recursively by gui_update_menus (see below)
*/ */
static void static void
gui_update_menus_recurse(menu, mode) gui_update_menus_recurse(vimmenu_T *menu, int mode)
vimmenu_T *menu;
int mode;
{ {
int grey; int grey;
@ -1926,8 +1887,7 @@ gui_update_menus_recurse(menu, mode)
* since last time. If "modes" is not 0, then we use these modes instead. * since last time. If "modes" is not 0, then we use these modes instead.
*/ */
void void
gui_update_menus(modes) gui_update_menus(int modes)
int modes;
{ {
static int prev_mode = -1; static int prev_mode = -1;
int mode = 0; int mode = 0;
@ -1964,8 +1924,7 @@ gui_update_menus(modes)
* Case of the key is ignored. * Case of the key is ignored.
*/ */
int int
gui_is_menu_shortcut(key) gui_is_menu_shortcut(int key)
int key;
{ {
vimmenu_T *menu; vimmenu_T *menu;
@ -1985,7 +1944,7 @@ gui_is_menu_shortcut(key)
* etc. * etc.
*/ */
void void
gui_show_popupmenu() gui_show_popupmenu(void)
{ {
vimmenu_T *menu; vimmenu_T *menu;
int mode; int mode;
@ -2044,11 +2003,11 @@ gui_mch_toggle_tearoffs(int enable)
* Recursively add tearoff items * Recursively add tearoff items
*/ */
static void static void
gui_create_tearoffs_recurse(menu, pname, pri_tab, pri_idx) gui_create_tearoffs_recurse(
vimmenu_T *menu; vimmenu_T *menu,
const char_u *pname; const char_u *pname,
int *pri_tab; int *pri_tab,
int pri_idx; int pri_idx)
{ {
char_u *newpname = NULL; char_u *newpname = NULL;
int len; int len;
@ -2102,10 +2061,7 @@ gui_create_tearoffs_recurse(menu, pname, pri_tab, pri_idx)
* "tearpath" is the menu path, and must have room to add TEAR_STRING. * "tearpath" is the menu path, and must have room to add TEAR_STRING.
*/ */
static void static void
gui_add_tearoff(tearpath, pri_tab, pri_idx) gui_add_tearoff(char_u *tearpath, int *pri_tab, int pri_idx)
char_u *tearpath;
int *pri_tab;
int pri_idx;
{ {
char_u *tbuf; char_u *tbuf;
int t; int t;
@ -2151,8 +2107,7 @@ gui_add_tearoff(tearpath, pri_tab, pri_idx)
* Recursively destroy tearoff items * Recursively destroy tearoff items
*/ */
static void static void
gui_destroy_tearoffs_recurse(menu) gui_destroy_tearoffs_recurse(vimmenu_T *menu)
vimmenu_T *menu;
{ {
while (menu) while (menu)
{ {
@ -2178,8 +2133,7 @@ gui_destroy_tearoffs_recurse(menu)
* execute it. * execute it.
*/ */
void void
ex_emenu(eap) ex_emenu(exarg_T *eap)
exarg_T *eap;
{ {
vimmenu_T *menu; vimmenu_T *menu;
char_u *name; char_u *name;
@ -2317,8 +2271,7 @@ ex_emenu(eap)
* Given a menu descriptor, e.g. "File.New", find it in the menu hierarchy. * Given a menu descriptor, e.g. "File.New", find it in the menu hierarchy.
*/ */
vimmenu_T * vimmenu_T *
gui_find_menu(path_name) gui_find_menu(char_u *path_name)
char_u *path_name;
{ {
vimmenu_T *menu = NULL; vimmenu_T *menu = NULL;
char_u *name; char_u *name;
@ -2394,8 +2347,7 @@ static garray_T menutrans_ga = {0, 0, 0, 0, NULL};
* case the commands are ignored. * case the commands are ignored.
*/ */
void void
ex_menutranslate(eap) ex_menutranslate(exarg_T *eap UNUSED)
exarg_T *eap UNUSED;
{ {
#ifdef FEAT_MULTI_LANG #ifdef FEAT_MULTI_LANG
char_u *arg = eap->arg; char_u *arg = eap->arg;
@ -2473,8 +2425,7 @@ ex_menutranslate(eap)
* Find the character just after one part of a menu name. * Find the character just after one part of a menu name.
*/ */
static char_u * static char_u *
menu_skip_part(p) menu_skip_part(char_u *p)
char_u *p;
{ {
while (*p != NUL && *p != '.' && !vim_iswhite(*p)) while (*p != NUL && *p != '.' && !vim_iswhite(*p))
{ {
@ -2492,9 +2443,7 @@ menu_skip_part(p)
* Return a pointer to the translation or NULL if not found. * Return a pointer to the translation or NULL if not found.
*/ */
static char_u * static char_u *
menutrans_lookup(name, len) menutrans_lookup(char_u *name, int len)
char_u *name;
int len;
{ {
menutrans_T *tp = (menutrans_T *)menutrans_ga.ga_data; menutrans_T *tp = (menutrans_T *)menutrans_ga.ga_data;
int i; int i;
@ -2527,8 +2476,7 @@ menutrans_lookup(name, len)
* Unescape the name in the translate dictionary table. * Unescape the name in the translate dictionary table.
*/ */
static void static void
menu_unescape_name(name) menu_unescape_name(char_u *name)
char_u *name;
{ {
char_u *p; char_u *p;
@ -2543,8 +2491,7 @@ menu_unescape_name(name)
* Skip the menu name, and translate <Tab> into a real TAB. * Skip the menu name, and translate <Tab> into a real TAB.
*/ */
static char_u * static char_u *
menu_translate_tab_and_shift(arg_start) menu_translate_tab_and_shift(char_u *arg_start)
char_u *arg_start;
{ {
char_u *arg = arg_start; char_u *arg = arg_start;

View File

@ -102,8 +102,7 @@ static int verbose_did_open = FALSE;
* return TRUE if wait_return not called * return TRUE if wait_return not called
*/ */
int int
msg(s) msg(char_u *s)
char_u *s;
{ {
return msg_attr_keep(s, 0, FALSE); return msg_attr_keep(s, 0, FALSE);
} }
@ -114,8 +113,7 @@ msg(s)
* Like msg() but keep it silent when 'verbosefile' is set. * Like msg() but keep it silent when 'verbosefile' is set.
*/ */
int int
verb_msg(s) verb_msg(char_u *s)
char_u *s;
{ {
int n; int n;
@ -128,18 +126,16 @@ verb_msg(s)
#endif #endif
int int
msg_attr(s, attr) msg_attr(char_u *s, int attr)
char_u *s;
int attr;
{ {
return msg_attr_keep(s, attr, FALSE); return msg_attr_keep(s, attr, FALSE);
} }
int int
msg_attr_keep(s, attr, keep) msg_attr_keep(
char_u *s; char_u *s,
int attr; int attr,
int keep; /* TRUE: set keep_msg if it doesn't scroll */ int keep) /* TRUE: set keep_msg if it doesn't scroll */
{ {
static int entered = 0; static int entered = 0;
int retval; int retval;
@ -197,9 +193,9 @@ msg_attr_keep(s, attr, keep)
* Returns an allocated string or NULL when no truncating is done. * Returns an allocated string or NULL when no truncating is done.
*/ */
char_u * char_u *
msg_strtrunc(s, force) msg_strtrunc(
char_u *s; char_u *s,
int force; /* always truncate */ int force) /* always truncate */
{ {
char_u *buf = NULL; char_u *buf = NULL;
int len; int len;
@ -242,11 +238,11 @@ msg_strtrunc(s, force)
* "s" and "buf" may be equal. * "s" and "buf" may be equal.
*/ */
void void
trunc_string(s, buf, room, buflen) trunc_string(
char_u *s; char_u *s,
char_u *buf; char_u *buf,
int room; int room,
int buflen; int buflen)
{ {
int half; int half;
int len; int len;
@ -388,7 +384,7 @@ static char_u *last_sourcing_name = NULL;
* for the next error message; * for the next error message;
*/ */
void void
reset_last_sourcing() reset_last_sourcing(void)
{ {
vim_free(last_sourcing_name); vim_free(last_sourcing_name);
last_sourcing_name = NULL; last_sourcing_name = NULL;
@ -399,7 +395,7 @@ reset_last_sourcing()
* Return TRUE if "sourcing_name" differs from "last_sourcing_name". * Return TRUE if "sourcing_name" differs from "last_sourcing_name".
*/ */
static int static int
other_sourcing_name() other_sourcing_name(void)
{ {
if (sourcing_name != NULL) if (sourcing_name != NULL)
{ {
@ -416,7 +412,7 @@ other_sourcing_name()
* Returns NULL when no message is to be given. * Returns NULL when no message is to be given.
*/ */
static char_u * static char_u *
get_emsg_source() get_emsg_source(void)
{ {
char_u *Buf, *p; char_u *Buf, *p;
@ -437,7 +433,7 @@ get_emsg_source()
* Returns NULL when no message is to be given. * Returns NULL when no message is to be given.
*/ */
static char_u * static char_u *
get_emsg_lnum() get_emsg_lnum(void)
{ {
char_u *Buf, *p; char_u *Buf, *p;
@ -462,8 +458,7 @@ get_emsg_lnum()
* is only displayed if it changed. * is only displayed if it changed.
*/ */
void void
msg_source(attr) msg_source(int attr)
int attr;
{ {
char_u *p; char_u *p;
@ -501,7 +496,7 @@ msg_source(attr)
* If "emsg_skip" is set: never do error messages. * If "emsg_skip" is set: never do error messages.
*/ */
int int
emsg_not_now() emsg_not_now(void)
{ {
if ((emsg_off > 0 && vim_strchr(p_debug, 'm') == NULL if ((emsg_off > 0 && vim_strchr(p_debug, 'm') == NULL
&& vim_strchr(p_debug, 't') == NULL) && vim_strchr(p_debug, 't') == NULL)
@ -522,8 +517,7 @@ emsg_not_now()
* return TRUE if wait_return not called * return TRUE if wait_return not called
*/ */
int int
emsg(s) emsg(char_u *s)
char_u *s;
{ {
int attr; int attr;
char_u *p; char_u *p;
@ -633,8 +627,7 @@ emsg(s)
* Print an error message with one "%s" and one string argument. * Print an error message with one "%s" and one string argument.
*/ */
int int
emsg2(s, a1) emsg2(char_u *s, char_u *a1)
char_u *s, *a1;
{ {
return emsg3(s, a1, NULL); return emsg3(s, a1, NULL);
} }
@ -642,8 +635,7 @@ emsg2(s, a1)
/* emsg3() and emsgn() are in misc2.c to avoid warnings for the prototypes. */ /* emsg3() and emsgn() are in misc2.c to avoid warnings for the prototypes. */
void void
emsg_invreg(name) emsg_invreg(int name)
int name;
{ {
EMSG2(_("E354: Invalid register name: '%s'"), transchar(name)); EMSG2(_("E354: Invalid register name: '%s'"), transchar(name));
} }
@ -655,10 +647,7 @@ emsg_invreg(name)
* Returns a pointer to the printed message, if wait_return() not called. * Returns a pointer to the printed message, if wait_return() not called.
*/ */
char_u * char_u *
msg_trunc_attr(s, force, attr) msg_trunc_attr(char_u *s, int force, int attr)
char_u *s;
int force;
int attr;
{ {
int n; int n;
@ -682,9 +671,7 @@ msg_trunc_attr(s, force, attr)
* Note: May change the message by replacing a character with '<'. * Note: May change the message by replacing a character with '<'.
*/ */
char_u * char_u *
msg_may_trunc(force, s) msg_may_trunc(int force, char_u *s)
int force;
char_u *s;
{ {
int n; int n;
int room; int room;
@ -717,10 +704,10 @@ msg_may_trunc(force, s)
} }
static void static void
add_msg_hist(s, len, attr) add_msg_hist(
char_u *s; char_u *s,
int len; /* -1 for undetermined length */ int len, /* -1 for undetermined length */
int attr; int attr)
{ {
struct msg_hist *p; struct msg_hist *p;
@ -762,7 +749,7 @@ add_msg_hist(s, len, attr)
* Returns FAIL if there are no messages. * Returns FAIL if there are no messages.
*/ */
int int
delete_first_msg() delete_first_msg(void)
{ {
struct msg_hist *p; struct msg_hist *p;
@ -782,8 +769,7 @@ delete_first_msg()
* ":messages" command. * ":messages" command.
*/ */
void void
ex_messages(eap) ex_messages(exarg_T *eap UNUSED)
exarg_T *eap UNUSED;
{ {
struct msg_hist *p; struct msg_hist *p;
char_u *s; char_u *s;
@ -809,7 +795,7 @@ ex_messages(eap)
* and a delay. * and a delay.
*/ */
void void
msg_end_prompt() msg_end_prompt(void)
{ {
need_wait_return = FALSE; need_wait_return = FALSE;
emsg_on_display = FALSE; emsg_on_display = FALSE;
@ -827,8 +813,7 @@ msg_end_prompt()
* if 'redraw' is -1, don't redraw at all * if 'redraw' is -1, don't redraw at all
*/ */
void void
wait_return(redraw) wait_return(int redraw)
int redraw;
{ {
int c; int c;
int oldState; int oldState;
@ -1076,7 +1061,7 @@ wait_return(redraw)
* Write the hit-return prompt. * Write the hit-return prompt.
*/ */
static void static void
hit_return_msg() hit_return_msg(void)
{ {
int save_p_more = p_more; int save_p_more = p_more;
@ -1096,9 +1081,7 @@ hit_return_msg()
* Set "keep_msg" to "s". Free the old value and check for NULL pointer. * Set "keep_msg" to "s". Free the old value and check for NULL pointer.
*/ */
void void
set_keep_msg(s, attr) set_keep_msg(char_u *s, int attr)
char_u *s;
int attr;
{ {
vim_free(keep_msg); vim_free(keep_msg);
if (s != NULL && msg_silent == 0) if (s != NULL && msg_silent == 0)
@ -1115,7 +1098,7 @@ set_keep_msg(s, attr)
* that it will be displayed again after redraw. * that it will be displayed again after redraw.
*/ */
void void
set_keep_msg_from_hist() set_keep_msg_from_hist(void)
{ {
if (keep_msg == NULL && last_msg_hist != NULL && msg_scrolled == 0 if (keep_msg == NULL && last_msg_hist != NULL && msg_scrolled == 0
&& (State & NORMAL)) && (State & NORMAL))
@ -1127,7 +1110,7 @@ set_keep_msg_from_hist()
* Prepare for outputting characters in the command line. * Prepare for outputting characters in the command line.
*/ */
void void
msg_start() msg_start(void)
{ {
int did_return = FALSE; int did_return = FALSE;
@ -1180,23 +1163,20 @@ msg_start()
* Note that the current msg position is where messages start. * Note that the current msg position is where messages start.
*/ */
void void
msg_starthere() msg_starthere(void)
{ {
lines_left = cmdline_row; lines_left = cmdline_row;
msg_didany = FALSE; msg_didany = FALSE;
} }
void void
msg_putchar(c) msg_putchar(int c)
int c;
{ {
msg_putchar_attr(c, 0); msg_putchar_attr(c, 0);
} }
void void
msg_putchar_attr(c, attr) msg_putchar_attr(int c, int attr)
int c;
int attr;
{ {
#ifdef FEAT_MBYTE #ifdef FEAT_MBYTE
char_u buf[MB_MAXBYTES + 1]; char_u buf[MB_MAXBYTES + 1];
@ -1224,8 +1204,7 @@ msg_putchar_attr(c, attr)
} }
void void
msg_outnum(n) msg_outnum(long n)
long n;
{ {
char_u buf[20]; char_u buf[20];
@ -1234,25 +1213,21 @@ msg_outnum(n)
} }
void void
msg_home_replace(fname) msg_home_replace(char_u *fname)
char_u *fname;
{ {
msg_home_replace_attr(fname, 0); msg_home_replace_attr(fname, 0);
} }
#if defined(FEAT_FIND_ID) || defined(PROTO) #if defined(FEAT_FIND_ID) || defined(PROTO)
void void
msg_home_replace_hl(fname) msg_home_replace_hl(char_u *fname)
char_u *fname;
{ {
msg_home_replace_attr(fname, hl_attr(HLF_D)); msg_home_replace_attr(fname, hl_attr(HLF_D));
} }
#endif #endif
static void static void
msg_home_replace_attr(fname, attr) msg_home_replace_attr(char_u *fname, int attr)
char_u *fname;
int attr;
{ {
char_u *name; char_u *name;
@ -1269,24 +1244,19 @@ msg_home_replace_attr(fname, attr)
* Return the number of characters it takes on the screen. * Return the number of characters it takes on the screen.
*/ */
int int
msg_outtrans(str) msg_outtrans(char_u *str)
char_u *str;
{ {
return msg_outtrans_attr(str, 0); return msg_outtrans_attr(str, 0);
} }
int int
msg_outtrans_attr(str, attr) msg_outtrans_attr(char_u *str, int attr)
char_u *str;
int attr;
{ {
return msg_outtrans_len_attr(str, (int)STRLEN(str), attr); return msg_outtrans_len_attr(str, (int)STRLEN(str), attr);
} }
int int
msg_outtrans_len(str, len) msg_outtrans_len(char_u *str, int len)
char_u *str;
int len;
{ {
return msg_outtrans_len_attr(str, len, 0); return msg_outtrans_len_attr(str, len, 0);
} }
@ -1296,9 +1266,7 @@ msg_outtrans_len(str, len)
* Handles multi-byte characters. * Handles multi-byte characters.
*/ */
char_u * char_u *
msg_outtrans_one(p, attr) msg_outtrans_one(char_u *p, int attr)
char_u *p;
int attr;
{ {
#ifdef FEAT_MBYTE #ifdef FEAT_MBYTE
int l; int l;
@ -1314,10 +1282,7 @@ msg_outtrans_one(p, attr)
} }
int int
msg_outtrans_len_attr(msgstr, len, attr) msg_outtrans_len_attr(char_u *msgstr, int len, int attr)
char_u *msgstr;
int len;
int attr;
{ {
int retval = 0; int retval = 0;
char_u *str = msgstr; char_u *str = msgstr;
@ -1406,8 +1371,7 @@ msg_outtrans_len_attr(msgstr, len, attr)
#if defined(FEAT_QUICKFIX) || defined(PROTO) #if defined(FEAT_QUICKFIX) || defined(PROTO)
void void
msg_make(arg) msg_make(char_u *arg)
char_u *arg;
{ {
int i; int i;
static char_u *str = (char_u *)"eeffoc", *rs = (char_u *)"Plon#dqg#vxjduB"; static char_u *str = (char_u *)"eeffoc", *rs = (char_u *)"Plon#dqg#vxjduB";
@ -1440,9 +1404,9 @@ msg_make(arg)
* the character/string -- webb * the character/string -- webb
*/ */
int int
msg_outtrans_special(strstart, from) msg_outtrans_special(
char_u *strstart; char_u *strstart,
int from; /* TRUE for lhs of a mapping */ int from) /* TRUE for lhs of a mapping */
{ {
char_u *str = strstart; char_u *str = strstart;
int retval = 0; int retval = 0;
@ -1479,9 +1443,9 @@ msg_outtrans_special(strstart, from)
* strings, in an allocated string. * strings, in an allocated string.
*/ */
char_u * char_u *
str2special_save(str, is_lhs) str2special_save(
char_u *str; char_u *str,
int is_lhs; /* TRUE for lhs, FALSE for rhs */ int is_lhs) /* TRUE for lhs, FALSE for rhs */
{ {
garray_T ga; garray_T ga;
char_u *p = str; char_u *p = str;
@ -1500,9 +1464,9 @@ str2special_save(str, is_lhs)
* Advances "sp" to the next code. * Advances "sp" to the next code.
*/ */
char_u * char_u *
str2special(sp, from) str2special(
char_u **sp; char_u **sp,
int from; /* TRUE for lhs of mapping */ int from) /* TRUE for lhs of mapping */
{ {
int c; int c;
static char_u buf[7]; static char_u buf[7];
@ -1577,10 +1541,7 @@ str2special(sp, from)
* Translate a key sequence into special key names. * Translate a key sequence into special key names.
*/ */
void void
str2specialbuf(sp, buf, len) str2specialbuf(char_u *sp, char_u *buf, int len)
char_u *sp;
char_u *buf;
int len;
{ {
char_u *s; char_u *s;
@ -1597,9 +1558,7 @@ str2specialbuf(sp, buf, len)
* print line for :print or :list command * print line for :print or :list command
*/ */
void void
msg_prt_line(s, list) msg_prt_line(char_u *s, int list)
char_u *s;
int list;
{ {
int c; int c;
int col = 0; int col = 0;
@ -1732,10 +1691,7 @@ msg_prt_line(s, list)
* Return the pointer "s" advanced to the next character. * Return the pointer "s" advanced to the next character.
*/ */
static char_u * static char_u *
screen_puts_mbyte(s, l, attr) screen_puts_mbyte(char_u *s, int l, int attr)
char_u *s;
int l;
int attr;
{ {
int cw; int cw;
@ -1782,15 +1738,14 @@ screen_puts_mbyte(s, l, attr)
* Update msg_row and msg_col for the next message. * Update msg_row and msg_col for the next message.
*/ */
void void
msg_puts(s) msg_puts(char_u *s)
char_u *s;
{ {
msg_puts_attr(s, 0); msg_puts_attr(s, 0);
} }
void void
msg_puts_title(s) msg_puts_title(
char_u *s; char_u *s)
{ {
msg_puts_attr(s, hl_attr(HLF_T)); msg_puts_attr(s, hl_attr(HLF_T));
} }
@ -1801,18 +1756,13 @@ msg_puts_title(s)
* Does not handle multi-byte characters! * Does not handle multi-byte characters!
*/ */
void void
msg_puts_long_attr(longstr, attr) msg_puts_long_attr(char_u *longstr, int attr)
char_u *longstr;
int attr;
{ {
msg_puts_long_len_attr(longstr, (int)STRLEN(longstr), attr); msg_puts_long_len_attr(longstr, (int)STRLEN(longstr), attr);
} }
void void
msg_puts_long_len_attr(longstr, len, attr) msg_puts_long_len_attr(char_u *longstr, int len, int attr)
char_u *longstr;
int len;
int attr;
{ {
int slen = len; int slen = len;
int room; int room;
@ -1831,9 +1781,7 @@ msg_puts_long_len_attr(longstr, len, attr)
* Basic function for writing a message with highlight attributes. * Basic function for writing a message with highlight attributes.
*/ */
void void
msg_puts_attr(s, attr) msg_puts_attr(char_u *s, int attr)
char_u *s;
int attr;
{ {
msg_puts_attr_len(s, -1, attr); msg_puts_attr_len(s, -1, attr);
} }
@ -1844,10 +1792,7 @@ msg_puts_attr(s, attr)
* When "maxlen" is >= 0 the message is not put in the history. * When "maxlen" is >= 0 the message is not put in the history.
*/ */
static void static void
msg_puts_attr_len(str, maxlen, attr) msg_puts_attr_len(char_u *str, int maxlen, int attr)
char_u *str;
int maxlen;
int attr;
{ {
/* /*
* If redirection is on, also write to the redirection file. * If redirection is on, also write to the redirection file.
@ -1895,11 +1840,11 @@ msg_puts_attr_len(str, maxlen, attr)
* May be called recursively to display scroll-back text. * May be called recursively to display scroll-back text.
*/ */
static void static void
msg_puts_display(str, maxlen, attr, recurse) msg_puts_display(
char_u *str; char_u *str,
int maxlen; int maxlen,
int attr; int attr,
int recurse; int recurse)
{ {
char_u *s = str; char_u *s = str;
char_u *t_s = str; /* string from "t_s" to "s" is still todo */ char_u *t_s = str; /* string from "t_s" to "s" is still todo */
@ -2139,7 +2084,7 @@ msg_puts_display(str, maxlen, attr, recurse)
* Scroll the screen up one line for displaying the next message line. * Scroll the screen up one line for displaying the next message line.
*/ */
static void static void
msg_scroll_up() msg_scroll_up(void)
{ {
#ifdef FEAT_GUI #ifdef FEAT_GUI
/* Remove the cursor before scrolling, ScreenLines[] is going /* Remove the cursor before scrolling, ScreenLines[] is going
@ -2169,7 +2114,7 @@ msg_scroll_up()
* Increment "msg_scrolled". * Increment "msg_scrolled".
*/ */
static void static void
inc_msg_scrolled() inc_msg_scrolled(void)
{ {
#ifdef FEAT_EVAL #ifdef FEAT_EVAL
if (*get_vim_var_str(VV_SCROLLSTART) == NUL) if (*get_vim_var_str(VV_SCROLLSTART) == NUL)
@ -2226,12 +2171,12 @@ static int do_clear_sb_text = FALSE; /* clear text on next msg */
* Store part of a printed message for displaying when scrolling back. * Store part of a printed message for displaying when scrolling back.
*/ */
static void static void
store_sb_text(sb_str, s, attr, sb_col, finish) store_sb_text(
char_u **sb_str; /* start of string */ char_u **sb_str, /* start of string */
char_u *s; /* just after string */ char_u *s, /* just after string */
int attr; int attr,
int *sb_col; int *sb_col,
int finish; /* line ends */ int finish) /* line ends */
{ {
msgchunk_T *mp; msgchunk_T *mp;
@ -2276,7 +2221,7 @@ store_sb_text(sb_str, s, attr, sb_col, finish)
* Finished showing messages, clear the scroll-back text on the next message. * Finished showing messages, clear the scroll-back text on the next message.
*/ */
void void
may_clear_sb_text() may_clear_sb_text(void)
{ {
do_clear_sb_text = TRUE; do_clear_sb_text = TRUE;
} }
@ -2286,7 +2231,7 @@ may_clear_sb_text()
* Called when redrawing the screen. * Called when redrawing the screen.
*/ */
void void
clear_sb_text() clear_sb_text(void)
{ {
msgchunk_T *mp; msgchunk_T *mp;
@ -2302,7 +2247,7 @@ clear_sb_text()
* "g<" command. * "g<" command.
*/ */
void void
show_sb_text() show_sb_text(void)
{ {
msgchunk_T *mp; msgchunk_T *mp;
@ -2322,8 +2267,7 @@ show_sb_text()
* Move to the start of screen line in already displayed text. * Move to the start of screen line in already displayed text.
*/ */
static msgchunk_T * static msgchunk_T *
msg_sb_start(mps) msg_sb_start(msgchunk_T *mps)
msgchunk_T *mps;
{ {
msgchunk_T *mp = mps; msgchunk_T *mp = mps;
@ -2336,7 +2280,7 @@ msg_sb_start(mps)
* Mark the last message chunk as finishing the line. * Mark the last message chunk as finishing the line.
*/ */
void void
msg_sb_eol() msg_sb_eol(void)
{ {
if (last_msgchunk != NULL) if (last_msgchunk != NULL)
last_msgchunk->sb_eol = TRUE; last_msgchunk->sb_eol = TRUE;
@ -2347,9 +2291,7 @@ msg_sb_eol()
* Returns a pointer to the text for the next line (can be NULL). * Returns a pointer to the text for the next line (can be NULL).
*/ */
static msgchunk_T * static msgchunk_T *
disp_sb_line(row, smp) disp_sb_line(int row, msgchunk_T *smp)
int row;
msgchunk_T *smp;
{ {
msgchunk_T *mp = smp; msgchunk_T *mp = smp;
char_u *p; char_u *p;
@ -2373,11 +2315,11 @@ disp_sb_line(row, smp)
* Output any postponed text for msg_puts_attr_len(). * Output any postponed text for msg_puts_attr_len().
*/ */
static void static void
t_puts(t_col, t_s, s, attr) t_puts(
int *t_col; int *t_col,
char_u *t_s; char_u *t_s,
char_u *s; char_u *s,
int attr; int attr)
{ {
/* output postponed text */ /* output postponed text */
msg_didout = TRUE; /* remember that line is not empty */ msg_didout = TRUE; /* remember that line is not empty */
@ -2406,7 +2348,7 @@ t_puts(t_col, t_s, s, attr)
* cursor is. * cursor is.
*/ */
int int
msg_use_printf() msg_use_printf(void)
{ {
return (!msg_check_screen() return (!msg_check_screen()
#if defined(WIN3264) && !defined(FEAT_GUI_MSWIN) #if defined(WIN3264) && !defined(FEAT_GUI_MSWIN)
@ -2420,9 +2362,7 @@ msg_use_printf()
* Print a message when there is no valid screen. * Print a message when there is no valid screen.
*/ */
static void static void
msg_puts_printf(str, maxlen) msg_puts_printf(char_u *str, int maxlen)
char_u *str;
int maxlen;
{ {
char_u *s = str; char_u *s = str;
char_u buf[4]; char_u buf[4];
@ -2487,8 +2427,7 @@ msg_puts_printf(str, maxlen)
* Returns TRUE when jumping ahead to "confirm_msg_tail". * Returns TRUE when jumping ahead to "confirm_msg_tail".
*/ */
static int static int
do_more_prompt(typed_char) do_more_prompt(int typed_char)
int typed_char;
{ {
int used_typed_char = typed_char; int used_typed_char = typed_char;
int oldState = State; int oldState = State;
@ -2761,8 +2700,7 @@ do_more_prompt(typed_char)
* started and they can be displayed in a message box. * started and they can be displayed in a message box.
*/ */
void void
mch_errmsg(str) mch_errmsg(char *str)
char *str;
{ {
int len; int len;
@ -2830,8 +2768,7 @@ mch_errmsg(str)
* can be displayed in a message box. * can be displayed in a message box.
*/ */
void void
mch_msg(str) mch_msg(char *str)
char *str;
{ {
#if (defined(UNIX) || defined(FEAT_GUI)) && !defined(ALWAYS_USE_GUI) #if (defined(UNIX) || defined(FEAT_GUI)) && !defined(ALWAYS_USE_GUI)
/* On Unix use stdout if we have a tty. This allows "vim -h | more" and /* On Unix use stdout if we have a tty. This allows "vim -h | more" and
@ -2867,9 +2804,7 @@ mch_msg(str)
* to the next position. Only for printable ASCII! * to the next position. Only for printable ASCII!
*/ */
static void static void
msg_screen_putchar(c, attr) msg_screen_putchar(int c, int attr)
int c;
int attr;
{ {
msg_didout = TRUE; /* remember that line is not empty */ msg_didout = TRUE; /* remember that line is not empty */
screen_putchar(c, msg_row, msg_col, attr); screen_putchar(c, msg_row, msg_col, attr);
@ -2894,8 +2829,7 @@ msg_screen_putchar(c, attr)
} }
void void
msg_moremsg(full) msg_moremsg(int full)
int full;
{ {
int attr; int attr;
char_u *s = (char_u *)_("-- More --"); char_u *s = (char_u *)_("-- More --");
@ -2913,7 +2847,7 @@ msg_moremsg(full)
* exmode_active. * exmode_active.
*/ */
void void
repeat_message() repeat_message(void)
{ {
if (State == ASKMORE) if (State == ASKMORE)
{ {
@ -2954,7 +2888,7 @@ repeat_message()
* output goes to the terminal. Don't use the terminal codes then. * output goes to the terminal. Don't use the terminal codes then.
*/ */
static int static int
msg_check_screen() msg_check_screen(void)
{ {
if (!full_screen || !screen_valid(FALSE)) if (!full_screen || !screen_valid(FALSE))
return FALSE; return FALSE;
@ -2971,7 +2905,7 @@ msg_check_screen()
* Skip this when ":silent" was used, no need to clear for redirection. * Skip this when ":silent" was used, no need to clear for redirection.
*/ */
void void
msg_clr_eos() msg_clr_eos(void)
{ {
if (msg_silent == 0) if (msg_silent == 0)
msg_clr_eos_force(); msg_clr_eos_force();
@ -2983,7 +2917,7 @@ msg_clr_eos()
* for msg_check(). * for msg_check().
*/ */
void void
msg_clr_eos_force() msg_clr_eos_force(void)
{ {
if (msg_use_printf()) if (msg_use_printf())
{ {
@ -3017,7 +2951,7 @@ msg_clr_eos_force()
* Clear the command line. * Clear the command line.
*/ */
void void
msg_clr_cmdline() msg_clr_cmdline(void)
{ {
msg_row = cmdline_row; msg_row = cmdline_row;
msg_col = 0; msg_col = 0;
@ -3030,7 +2964,7 @@ msg_clr_cmdline()
* return TRUE if wait_return not called. * return TRUE if wait_return not called.
*/ */
int int
msg_end() msg_end(void)
{ {
/* /*
* If the string is larger than the window, * If the string is larger than the window,
@ -3052,7 +2986,7 @@ msg_end()
* wait for hit-return and redraw the window later. * wait for hit-return and redraw the window later.
*/ */
void void
msg_check() msg_check(void)
{ {
if (msg_row == Rows - 1 && msg_col >= sc_col) if (msg_row == Rows - 1 && msg_col >= sc_col)
{ {
@ -3066,9 +3000,7 @@ msg_check()
* When "maxlen" is -1 write the whole string, otherwise up to "maxlen" bytes. * When "maxlen" is -1 write the whole string, otherwise up to "maxlen" bytes.
*/ */
static void static void
redir_write(str, maxlen) redir_write(char_u *str, int maxlen)
char_u *str;
int maxlen;
{ {
char_u *s = str; char_u *s = str;
static int cur_col = 0; static int cur_col = 0;
@ -3135,7 +3067,7 @@ redir_write(str, maxlen)
} }
int int
redirecting() redirecting(void)
{ {
return redir_fd != NULL || *p_vfile != NUL return redir_fd != NULL || *p_vfile != NUL
#ifdef FEAT_EVAL #ifdef FEAT_EVAL
@ -3149,7 +3081,7 @@ redirecting()
* Must always be called paired with verbose_leave()! * Must always be called paired with verbose_leave()!
*/ */
void void
verbose_enter() verbose_enter(void)
{ {
if (*p_vfile != NUL) if (*p_vfile != NUL)
++msg_silent; ++msg_silent;
@ -3160,7 +3092,7 @@ verbose_enter()
* Must always be called paired with verbose_enter()! * Must always be called paired with verbose_enter()!
*/ */
void void
verbose_leave() verbose_leave(void)
{ {
if (*p_vfile != NUL) if (*p_vfile != NUL)
if (--msg_silent < 0) if (--msg_silent < 0)
@ -3171,7 +3103,7 @@ verbose_leave()
* Like verbose_enter() and set msg_scroll when displaying the message. * Like verbose_enter() and set msg_scroll when displaying the message.
*/ */
void void
verbose_enter_scroll() verbose_enter_scroll(void)
{ {
if (*p_vfile != NUL) if (*p_vfile != NUL)
++msg_silent; ++msg_silent;
@ -3184,7 +3116,7 @@ verbose_enter_scroll()
* Like verbose_leave() and set cmdline_row when displaying the message. * Like verbose_leave() and set cmdline_row when displaying the message.
*/ */
void void
verbose_leave_scroll() verbose_leave_scroll(void)
{ {
if (*p_vfile != NUL) if (*p_vfile != NUL)
{ {
@ -3199,7 +3131,7 @@ verbose_leave_scroll()
* Called when 'verbosefile' is set: stop writing to the file. * Called when 'verbosefile' is set: stop writing to the file.
*/ */
void void
verbose_stop() verbose_stop(void)
{ {
if (verbose_fd != NULL) if (verbose_fd != NULL)
{ {
@ -3214,7 +3146,7 @@ verbose_stop()
* Return FAIL or OK. * Return FAIL or OK.
*/ */
int int
verbose_open() verbose_open(void)
{ {
if (verbose_fd == NULL && !verbose_did_open) if (verbose_fd == NULL && !verbose_did_open)
{ {
@ -3236,9 +3168,7 @@ verbose_open()
* Use 'w' highlighting and may repeat the message after redrawing * Use 'w' highlighting and may repeat the message after redrawing
*/ */
void void
give_warning(message, hl) give_warning(char_u *message, int hl)
char_u *message;
int hl;
{ {
/* Don't do this for ":silent". */ /* Don't do this for ":silent". */
if (msg_silent != 0) if (msg_silent != 0)
@ -3269,8 +3199,7 @@ give_warning(message, hl)
* Advance msg cursor to column "col". * Advance msg cursor to column "col".
*/ */
void void
msg_advance(col) msg_advance(int col)
int col;
{ {
if (msg_silent != 0) /* nothing to advance to */ if (msg_silent != 0) /* nothing to advance to */
{ {
@ -3309,15 +3238,15 @@ msg_advance(col)
* different letter. * different letter.
*/ */
int int
do_dialog(type, title, message, buttons, dfltbutton, textfield, ex_cmd) do_dialog(
int type UNUSED; int type UNUSED,
char_u *title UNUSED; char_u *title UNUSED,
char_u *message; char_u *message,
char_u *buttons; char_u *buttons,
int dfltbutton; int dfltbutton,
char_u *textfield UNUSED; /* IObuff for inputdialog(), NULL char_u *textfield UNUSED, /* IObuff for inputdialog(), NULL
otherwise */ otherwise */
int ex_cmd; /* when TRUE pressing : accepts default and starts int ex_cmd) /* when TRUE pressing : accepts default and starts
Ex command */ Ex command */
{ {
int oldState; int oldState;
@ -3437,10 +3366,10 @@ static int copy_char(char_u *from, char_u *to, int lowercase);
* characters. Return the length of the character in bytes. * characters. Return the length of the character in bytes.
*/ */
static int static int
copy_char(from, to, lowercase) copy_char(
char_u *from; char_u *from,
char_u *to; char_u *to,
int lowercase; /* make character lower case */ int lowercase) /* make character lower case */
{ {
#ifdef FEAT_MBYTE #ifdef FEAT_MBYTE
int len; int len;
@ -3481,10 +3410,10 @@ copy_char(from, to, lowercase)
* Returns an allocated string with hotkeys, or NULL for error. * Returns an allocated string with hotkeys, or NULL for error.
*/ */
static char_u * static char_u *
msg_show_console_dialog(message, buttons, dfltbutton) msg_show_console_dialog(
char_u *message; char_u *message,
char_u *buttons; char_u *buttons,
int dfltbutton; int dfltbutton)
{ {
int len = 0; int len = 0;
#ifdef FEAT_MBYTE #ifdef FEAT_MBYTE
@ -3641,7 +3570,7 @@ msg_show_console_dialog(message, buttons, dfltbutton)
* Display the ":confirm" message. Also called when screen resized. * Display the ":confirm" message. Also called when screen resized.
*/ */
void void
display_confirm_msg() display_confirm_msg(void)
{ {
/* avoid that 'q' at the more prompt truncates the message here */ /* avoid that 'q' at the more prompt truncates the message here */
++confirm_msg_used; ++confirm_msg_used;
@ -3655,11 +3584,11 @@ display_confirm_msg()
#if defined(FEAT_CON_DIALOG) || defined(FEAT_GUI_DIALOG) #if defined(FEAT_CON_DIALOG) || defined(FEAT_GUI_DIALOG)
int int
vim_dialog_yesno(type, title, message, dflt) vim_dialog_yesno(
int type; int type,
char_u *title; char_u *title,
char_u *message; char_u *message,
int dflt; int dflt)
{ {
if (do_dialog(type, if (do_dialog(type,
title == NULL ? (char_u *)_("Question") : title, title == NULL ? (char_u *)_("Question") : title,
@ -3670,11 +3599,11 @@ vim_dialog_yesno(type, title, message, dflt)
} }
int int
vim_dialog_yesnocancel(type, title, message, dflt) vim_dialog_yesnocancel(
int type; int type,
char_u *title; char_u *title,
char_u *message; char_u *message,
int dflt; int dflt)
{ {
switch (do_dialog(type, switch (do_dialog(type,
title == NULL ? (char_u *)_("Question") : title, title == NULL ? (char_u *)_("Question") : title,
@ -3688,11 +3617,11 @@ vim_dialog_yesnocancel(type, title, message, dflt)
} }
int int
vim_dialog_yesnoallcancel(type, title, message, dflt) vim_dialog_yesnoallcancel(
int type; int type,
char_u *title; char_u *title,
char_u *message; char_u *message,
int dflt; int dflt)
{ {
switch (do_dialog(type, switch (do_dialog(type,
title == NULL ? (char_u *)"Question" : title, title == NULL ? (char_u *)"Question" : title,
@ -3716,15 +3645,15 @@ vim_dialog_yesnoallcancel(type, title, message, dflt)
* Later this may pop-up a non-GUI file selector (external command?). * Later this may pop-up a non-GUI file selector (external command?).
*/ */
char_u * char_u *
do_browse(flags, title, dflt, ext, initdir, filter, buf) do_browse(
int flags; /* BROWSE_SAVE and BROWSE_DIR */ int flags, /* BROWSE_SAVE and BROWSE_DIR */
char_u *title; /* title for the window */ char_u *title, /* title for the window */
char_u *dflt; /* default file name (may include directory) */ char_u *dflt, /* default file name (may include directory) */
char_u *ext; /* extension added */ char_u *ext, /* extension added */
char_u *initdir; /* initial directory, NULL for current dir or char_u *initdir, /* initial directory, NULL for current dir or
when using path from "dflt" */ when using path from "dflt" */
char_u *filter; /* file name filter */ char_u *filter, /* file name filter */
buf_T *buf; /* buffer to read/write for */ buf_T *buf) /* buffer to read/write for */
{ {
char_u *fname; char_u *fname;
static char_u *last_dir = NULL; /* last used directory */ static char_u *last_dir = NULL; /* last used directory */
@ -3885,9 +3814,7 @@ static double tv_float(typval_T *tvs, int *idxp);
* Get number argument from "idxp" entry in "tvs". First entry is 1. * Get number argument from "idxp" entry in "tvs". First entry is 1.
*/ */
static long static long
tv_nr(tvs, idxp) tv_nr(typval_T *tvs, int *idxp)
typval_T *tvs;
int *idxp;
{ {
int idx = *idxp - 1; int idx = *idxp - 1;
long n = 0; long n = 0;
@ -3910,9 +3837,7 @@ tv_nr(tvs, idxp)
* Returns NULL for an error. * Returns NULL for an error.
*/ */
static char * static char *
tv_str(tvs, idxp) tv_str(typval_T *tvs, int *idxp)
typval_T *tvs;
int *idxp;
{ {
int idx = *idxp - 1; int idx = *idxp - 1;
char *s = NULL; char *s = NULL;
@ -3932,9 +3857,7 @@ tv_str(tvs, idxp)
* Get float argument from "idxp" entry in "tvs". First entry is 1. * Get float argument from "idxp" entry in "tvs". First entry is 1.
*/ */
static double static double
tv_float(tvs, idxp) tv_float(typval_T *tvs, int *idxp)
typval_T *tvs;
int *idxp;
{ {
int idx = *idxp - 1; int idx = *idxp - 1;
double f = 0; double f = 0;
@ -4034,12 +3957,12 @@ vim_snprintf(char *str, size_t str_m, char *fmt, ...)
} }
int int
vim_vsnprintf(str, str_m, fmt, ap, tvs) vim_vsnprintf(
char *str; char *str,
size_t str_m; size_t str_m,
char *fmt; char *fmt,
va_list ap; va_list ap,
typval_T *tvs; typval_T *tvs)
{ {
size_t str_l = 0; size_t str_l = 0;
char *p = fmt; char *p = fmt;

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 */
/**/
1210,
/**/ /**/
1209, 1209,
/**/ /**/