0
0
mirror of https://github.com/vim/vim.git synced 2025-07-26 11:04:33 -04:00

patch 7.4.1213

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 20:31:25 +01:00
parent c1ab67674a
commit 055409764c
15 changed files with 911 additions and 1363 deletions

View File

@ -98,21 +98,19 @@ int dos2 = FALSE; /* Amiga DOS 2.0x or higher */
int size_set = FALSE; /* set to TRUE if window size was set */
void
win_resize_on()
win_resize_on(void)
{
OUT_STR_NF("\033[12{");
}
void
win_resize_off()
win_resize_off(void)
{
OUT_STR_NF("\033[12}");
}
void
mch_write(p, len)
char_u *p;
int len;
mch_write(char_u *p, int len)
{
Write(raw_out, (char *)p, (long)len);
}
@ -127,11 +125,11 @@ mch_write(p, len)
* Return number of characters read.
*/
int
mch_inchar(buf, maxlen, time, tb_change_cnt)
char_u *buf;
int maxlen;
long time; /* milli seconds */
int tb_change_cnt;
mch_inchar(
char_u *buf,
int maxlen,
long time, /* milli seconds */
int tb_change_cnt)
{
int len;
long utime;
@ -190,7 +188,7 @@ mch_inchar(buf, maxlen, time, tb_change_cnt)
* return non-zero if a character is available
*/
int
mch_char_avail()
mch_char_avail(void)
{
return (WaitForChar(raw_in, 100L) != 0);
}
@ -199,8 +197,7 @@ mch_char_avail()
* Return amount of memory still available in Kbyte.
*/
long_u
mch_avail_mem(special)
int special;
mch_avail_mem(int special)
{
#ifdef __amigaos4__
return (long_u)AvailMem(MEMF_ANY) >> 10;
@ -214,9 +211,7 @@ mch_avail_mem(special)
* ignoreinput is FALSE.
*/
void
mch_delay(msec, ignoreinput)
long msec;
int ignoreinput;
mch_delay(long msec, int ignoreinput)
{
#ifndef LATTICE /* SAS declares void Delay(ULONG) */
void Delay(long);
@ -235,7 +230,7 @@ mch_delay(msec, ignoreinput)
* We have no job control, fake it by starting a new shell.
*/
void
mch_suspend()
mch_suspend(void)
{
suspend_shell();
}
@ -245,7 +240,7 @@ mch_suspend()
#endif
void
mch_init()
mch_init(void)
{
static char intlibname[] = "intuition.library";
@ -306,9 +301,7 @@ mch_init()
#define BUF2SIZE 320 /* length of buffer for argument with complete path */
int
mch_check_win(argc, argv)
int argc;
char **argv;
mch_check_win(int argc, char **argv)
{
int i;
BPTR nilfh, fh;
@ -545,7 +538,7 @@ exit:
* We fake there is a window, because we can always open one!
*/
int
mch_input_isatty()
mch_input_isatty(void)
{
return TRUE;
}
@ -557,9 +550,9 @@ mch_input_isatty()
*/
/*ARGSUSED*/
void
fname_case(name, len)
char_u *name;
int len; /* buffer size, ignored here */
fname_case(
char_u *name,
int len) /* buffer size, ignored here */
{
struct FileInfoBlock *fib;
size_t flen;
@ -585,8 +578,7 @@ fname_case(name, len)
* Returns NULL on error.
*/
static struct FileInfoBlock *
get_fib(fname)
char_u *fname;
get_fib(char_u *fname)
{
BPTR flock;
struct FileInfoBlock *fib;
@ -618,9 +610,7 @@ get_fib(fname)
* icon name is not set
*/
void
mch_settitle(title, icon)
char_u *title;
char_u *icon;
mch_settitle(char_u *title, char_u *icon)
{
if (wb_window != NULL && title != NULL)
SetWindowTitles(wb_window, (UBYTE *)title, (UBYTE *)-1L);
@ -634,21 +624,20 @@ mch_settitle(title, icon)
* 3 Restore title and icon (which we don't have)
*/
void
mch_restore_title(which)
int which;
mch_restore_title(int which)
{
if (which & 1)
mch_settitle(oldwindowtitle, NULL);
}
int
mch_can_restore_title()
mch_can_restore_title(void)
{
return (wb_window != NULL);
}
int
mch_can_restore_icon()
mch_can_restore_icon(void)
{
return FALSE;
}
@ -658,9 +647,7 @@ mch_can_restore_icon()
* Insert user name in s[len].
*/
int
mch_get_user_name(s, len)
char_u *s;
int len;
mch_get_user_name(char_u *s, int len)
{
/* TODO: Implement this. */
*s = NUL;
@ -671,9 +658,7 @@ mch_get_user_name(s, len)
* Insert host name is s[len].
*/
void
mch_get_host_name(s, len)
char_u *s;
int len;
mch_get_host_name(char_u *s, int len)
{
#if defined(__amigaos4__) && defined(__CLIB2__)
gethostname(s, len);
@ -686,7 +671,7 @@ mch_get_host_name(s, len)
* return process ID
*/
long
mch_get_pid()
mch_get_pid(void)
{
#ifdef __amigaos4__
/* This is as close to a pid as we can come. We could use CLI numbers also,
@ -703,9 +688,7 @@ mch_get_pid()
* Return OK for success, FAIL for failure.
*/
int
mch_dirname(buf, len)
char_u *buf;
int len;
mch_dirname(char_u *buf, int len)
{
return mch_FullName((char_u *)"", buf, len, FALSE);
}
@ -716,10 +699,11 @@ mch_dirname(buf, len)
* return FAIL for failure, OK otherwise
*/
int
mch_FullName(fname, buf, len, force)
char_u *fname, *buf;
int len;
int force;
mch_FullName(
char_u *fname,
char_u *buf,
int len,
int force)
{
BPTR l;
int retval = FAIL;
@ -764,8 +748,7 @@ mch_FullName(fname, buf, len, force)
* Return TRUE if "fname" does not depend on the current directory.
*/
int
mch_isFullName(fname)
char_u *fname;
mch_isFullName(char_u *fname)
{
return (vim_strchr(fname, ':') != NULL && *fname != ':');
}
@ -777,10 +760,7 @@ mch_isFullName(fname)
* return FAIL for failure, OK otherwise
*/
static int
lock2name(lock, buf, len)
BPTR lock;
char_u *buf;
long len;
lock2name(BPTR lock, char_u *buf, long len)
{
#ifdef FEAT_ARP
if (dos2) /* use 2.0 function */
@ -797,8 +777,7 @@ lock2name(lock, buf, len)
* Returns -1 when it doesn't exist.
*/
long
mch_getperm(name)
char_u *name;
mch_getperm(char_u *name)
{
struct FileInfoBlock *fib;
long retval = -1;
@ -818,9 +797,7 @@ mch_getperm(name)
* return FAIL for failure, OK otherwise
*/
int
mch_setperm(name, perm)
char_u *name;
long perm;
mch_setperm(char_u *name, long perm)
{
perm &= ~FIBF_ARCHIVE; /* reset archived bit */
return (SetProtection((UBYTE *)name, (long)perm) ? OK : FAIL);
@ -830,8 +807,7 @@ mch_setperm(name, perm)
* Set hidden flag for "name".
*/
void
mch_hide(name)
char_u *name;
mch_hide(char_u *name)
{
/* can't hide a file */
}
@ -842,8 +818,7 @@ mch_hide(name)
* return FALSE for error.
*/
int
mch_isdir(name)
char_u *name;
mch_isdir(char_u *name)
{
struct FileInfoBlock *fib;
int retval = FALSE;
@ -865,8 +840,7 @@ mch_isdir(name)
* Create directory "name".
*/
int
mch_mkdir(name)
char_u *name;
mch_mkdir(char_u *name)
{
BPTR lock;
@ -885,10 +859,7 @@ mch_mkdir(name)
* Return -1 if unknown.
*/
int
mch_can_exe(name, path, use_path)
char_u *name;
char_u **path;
int use_path;
mch_can_exe(char_u *name, char_u **path, int use_path)
{
/* TODO */
return -1;
@ -901,15 +872,14 @@ mch_can_exe(name, path, use_path)
* NODE_OTHER: non-writable things
*/
int
mch_nodetype(name)
char_u *name;
mch_nodetype(char_u *name)
{
/* TODO */
return NODE_NORMAL;
}
void
mch_early_init()
mch_early_init(void)
{
}
@ -917,8 +887,7 @@ mch_early_init()
* Careful: mch_exit() may be called before mch_init()!
*/
void
mch_exit(r)
int r;
mch_exit(int r)
{
if (raw_in) /* put terminal in 'normal' mode */
{
@ -977,8 +946,7 @@ mch_exit(r)
* it sends a 0 to the console to make it back into a CON: from a RAW:
*/
void
mch_settmode(tmode)
int tmode;
mch_settmode(int tmode)
{
#if defined(__AROS__) || defined(__amigaos4__)
if (!SetMode(raw_in, tmode == TMODE_RAW ? 1 : 0))
@ -993,8 +961,7 @@ mch_settmode(tmode)
* set screen mode, always fails.
*/
int
mch_screenmode(arg)
char_u *arg;
mch_screenmode(char_u *arg)
{
EMSG(_(e_screenmode));
return FAIL;
@ -1021,7 +988,7 @@ mch_screenmode(arg)
* return FAIL for failure, OK otherwise
*/
int
mch_get_shellsize()
mch_get_shellsize(void)
{
struct ConUnit *conUnit;
#ifndef __amigaos4__
@ -1095,7 +1062,7 @@ out:
* Try to set the real window size to Rows and Columns.
*/
void
mch_set_shellsize()
mch_set_shellsize(void)
{
if (term_console)
{
@ -1114,7 +1081,7 @@ mch_set_shellsize()
* Rows and/or Columns has changed.
*/
void
mch_new_shellsize()
mch_new_shellsize(void)
{
/* Nothing to do. */
}
@ -1123,8 +1090,7 @@ mch_new_shellsize()
* out_num - output a (big) number fast
*/
static void
out_num(n)
long n;
out_num(long n)
{
OUT_STR_NF(tltoa((unsigned long)n));
}
@ -1154,10 +1120,10 @@ out_num(n)
*/
static long
dos_packet(pid, action, arg)
struct MsgPort *pid; /* process identifier ... (handlers message port) */
dos_packet(
struct MsgPort *pid, /* process identifier ... (handlers message port) */
long action, /* packet type ... (what you want handler to do) */
arg; /* single argument */
arg) /* single argument */
{
# ifdef FEAT_ARP
struct MsgPort *replyport;
@ -1206,9 +1172,9 @@ dos_packet(pid, action, arg)
* Return error number for failure, 0 otherwise
*/
int
mch_call_shell(cmd, options)
char_u *cmd;
int options; /* SHELL_*, see vim.h */
mch_call_shell(
char_u *cmd,
int options) /* SHELL_*, see vim.h */
{
BPTR mydir;
int x;
@ -1415,7 +1381,7 @@ mch_call_shell(cmd, options)
* trouble with lattice-c programs.
*/
void
mch_breakcheck()
mch_breakcheck(void)
{
if (SetSignal(0L, (long)(SIGBREAKF_CTRL_C|SIGBREAKF_CTRL_D|SIGBREAKF_CTRL_E|SIGBREAKF_CTRL_F)) & SIGBREAKF_CTRL_C)
got_int = TRUE;
@ -1464,10 +1430,10 @@ Chk_Abort(void)
#endif
int
mch_expandpath(gap, pat, flags)
garray_T *gap;
char_u *pat;
int flags; /* EW_* flags */
mch_expandpath(
garray_T *gap,
char_u *pat,
int flags) /* EW_* flags */
{
struct AnchorPath *Anchor;
LONG Result;
@ -1585,8 +1551,7 @@ Return:
}
static int
sortcmp(a, b)
const void *a, *b;
sortcmp(const void *a, const void *b)
{
char *s = *(char **)a;
char *t = *(char **)b;
@ -1598,8 +1563,7 @@ sortcmp(a, b)
* Return TRUE if "p" has wildcards that can be expanded by mch_expandpath().
*/
int
mch_has_exp_wildcard(p)
char_u *p;
mch_has_exp_wildcard(char_u *p)
{
for ( ; *p; mb_ptr_adv(p))
{
@ -1612,8 +1576,7 @@ mch_has_exp_wildcard(p)
}
int
mch_has_wildcard(p)
char_u *p;
mch_has_wildcard(char_u *p)
{
for ( ; *p; mb_ptr_adv(p))
{
@ -1641,8 +1604,7 @@ mch_has_wildcard(p)
* - A small one to hold the return value. It is kept until the next call.
*/
char_u *
mch_getenv(var)
char_u *var;
mch_getenv(char_u *var)
{
int len;
UBYTE *buf; /* buffer to expand in */
@ -1685,10 +1647,7 @@ mch_getenv(var)
*/
/* ARGSUSED */
int
mch_setenv(var, value, x)
char *var;
char *value;
int x;
mch_setenv(char *var, char *value, int x)
{
#ifdef FEAT_ARP
if (!dos2)

View File

@ -44,14 +44,14 @@ static TECObjectRef gUTF16ToUTF8Converter;
* A Mac version of string_convert_ext() for special cases.
*/
char_u *
mac_string_convert(ptr, len, lenp, fail_on_error, from_enc, to_enc, unconvlenp)
char_u *ptr;
int len;
int *lenp;
int fail_on_error;
int from_enc;
int to_enc;
int *unconvlenp;
mac_string_convert(
char_u *ptr,
int len,
int *lenp,
int fail_on_error,
int from_enc,
int to_enc,
int *unconvlenp)
{
char_u *retval, *d;
CFStringRef cfstr;
@ -180,10 +180,10 @@ mac_string_convert(ptr, len, lenp, fail_on_error, from_enc, to_enc, unconvlenp)
* Returns OK or FAIL.
*/
int
macroman2enc(ptr, sizep, real_size)
char_u *ptr;
long *sizep;
long real_size;
macroman2enc(
char_u *ptr,
long *sizep,
long real_size)
{
CFStringRef cfstr;
CFRange r;
@ -226,14 +226,14 @@ macroman2enc(ptr, sizep, real_size)
* Returns OK or FAIL.
*/
int
enc2macroman(from, fromlen, to, tolenp, maxtolen, rest, restlenp)
char_u *from;
size_t fromlen;
char_u *to;
int *tolenp;
int maxtolen;
char_u *rest;
int *restlenp;
enc2macroman(
char_u *from,
size_t fromlen,
char_u *to,
int *tolenp,
int maxtolen,
char_u *rest,
int *restlenp)
{
CFStringRef cfstr;
CFRange r;
@ -274,7 +274,7 @@ enc2macroman(from, fromlen, to, tolenp, maxtolen, rest, restlenp)
* Initializes text converters
*/
void
mac_conv_init()
mac_conv_init(void)
{
TextEncoding utf8_encoding;
TextEncoding utf8_hfsplus_encoding;
@ -309,7 +309,7 @@ mac_conv_init()
* Destroys text converters
*/
void
mac_conv_cleanup()
mac_conv_cleanup(void)
{
if (gUTF16ToUTF8Converter)
{
@ -330,10 +330,10 @@ mac_conv_cleanup()
* CFBase.h) to avoid clashes with X11 header files in the .pro file
*/
char_u *
mac_utf16_to_enc(from, fromLen, actualLen)
unsigned short *from;
size_t fromLen;
size_t *actualLen;
mac_utf16_to_enc(
unsigned short *from,
size_t fromLen,
size_t *actualLen)
{
/* Following code borrows somewhat from os_mswin.c */
vimconv_T conv;
@ -384,10 +384,10 @@ mac_utf16_to_enc(from, fromLen, actualLen)
* CFBase.h) to avoid clashes with X11 header files in the .pro file
*/
unsigned short *
mac_enc_to_utf16(from, fromLen, actualLen)
char_u *from;
size_t fromLen;
size_t *actualLen;
mac_enc_to_utf16(
char_u *from,
size_t fromLen,
size_t *actualLen)
{
/* Following code borrows somewhat from os_mswin.c */
vimconv_T conv;
@ -443,9 +443,9 @@ mac_enc_to_utf16(from, fromLen, actualLen)
* The void * return type is actually a CFStringRef
*/
void *
mac_enc_to_cfstring(from, fromLen)
char_u *from;
size_t fromLen;
mac_enc_to_cfstring(
char_u *from,
size_t fromLen)
{
UniChar *utf16_str;
size_t utf16_len;
@ -465,10 +465,10 @@ mac_enc_to_cfstring(from, fromLen)
* Converts a decomposed HFS+ UTF-8 path to precomposed UTF-8
*/
char_u *
mac_precompose_path(decompPath, decompLen, precompLen)
char_u *decompPath;
size_t decompLen;
size_t *precompLen;
mac_precompose_path(
char_u *decompPath,
size_t decompLen,
size_t *precompLen)
{
char_u *result = NULL;
size_t actualLen = 0;
@ -498,10 +498,10 @@ mac_precompose_path(decompPath, decompLen, precompLen)
* Converts from UTF-16 UniChars to precomposed UTF-8
*/
static char_u *
mac_utf16_to_utf8(from, fromLen, actualLen)
UniChar *from;
size_t fromLen;
size_t *actualLen;
mac_utf16_to_utf8(
UniChar *from,
size_t fromLen,
size_t *actualLen)
{
ByteCount utf8_len;
ByteCount inputRead;
@ -538,10 +538,10 @@ mac_utf16_to_utf8(from, fromLen, actualLen)
* Converts from UTF-8 to UTF-16 UniChars
*/
static UniChar *
mac_utf8_to_utf16(from, fromLen, actualLen)
char_u *from;
size_t fromLen;
size_t *actualLen;
mac_utf8_to_utf16(
char_u *from,
size_t fromLen,
size_t *actualLen)
{
CFStringRef utf8_str;
CFRange convertRange;
@ -573,7 +573,8 @@ mac_utf8_to_utf16(from, fromLen, actualLen)
* Sets LANG environment variable in Vim from Mac locale
*/
void
mac_lang_init() {
mac_lang_init(void)
{
if (mch_getenv((char_u *)"LANG") == NULL)
{
char buf[20];

View File

@ -286,7 +286,7 @@ mch_early_init(void)
* Return TRUE if the input comes from a terminal, FALSE otherwise.
*/
int
mch_input_isatty()
mch_input_isatty(void)
{
#ifdef FEAT_GUI_MSWIN
return OK; /* GUI always has a tty */
@ -355,7 +355,7 @@ mch_restore_title(
* Return TRUE if we can restore the title (we can)
*/
int
mch_can_restore_title()
mch_can_restore_title(void)
{
return TRUE;
}
@ -365,7 +365,7 @@ mch_can_restore_title()
* Return TRUE if we can restore the icon title (we can't)
*/
int
mch_can_restore_icon()
mch_can_restore_icon(void)
{
return FALSE;
}
@ -486,8 +486,7 @@ mch_isFullName(char_u *fname)
* When the path looks like a URL leave it unmodified.
*/
void
slash_adjust(p)
char_u *p;
slash_adjust(char_u *p)
{
if (path_with_url(p))
return;
@ -708,7 +707,7 @@ mch_new_shellsize(void)
* We have no job control, so fake it by starting a new shell.
*/
void
mch_suspend()
mch_suspend(void)
{
suspend_shell();
}
@ -723,7 +722,7 @@ mch_suspend()
* Display the saved error message(s).
*/
void
display_errors()
display_errors(void)
{
char *p;
@ -864,7 +863,7 @@ can_end_termcap_mode(
* return non-zero if a character is available
*/
int
mch_char_avail()
mch_char_avail(void)
{
/* never used */
return TRUE;
@ -965,8 +964,7 @@ mch_icon_load_cb(char_u *fname, void *cookie)
* Try loading an icon file from 'runtimepath'.
*/
int
mch_icon_load(iconp)
HANDLE *iconp;
mch_icon_load(HANDLE *iconp)
{
return do_in_runtimepath((char_u *)"bitmaps/vim.ico",
FALSE, mch_icon_load_cb, iconp);
@ -1831,9 +1829,7 @@ static int prt_pos_x = 0;
static int prt_pos_y = 0;
void
mch_print_start_line(margin, page_line)
int margin;
int page_line;
mch_print_start_line(int margin, int page_line)
{
if (margin)
prt_pos_x = -prt_number_width;
@ -2070,7 +2066,7 @@ shortcut_end:
* Bring ourselves to the foreground. Does work if the OS doesn't allow it.
*/
void
win32_set_foreground()
win32_set_foreground(void)
{
# ifndef FEAT_GUI
GetConsoleHwnd(); /* get value of s_hwnd */
@ -2486,9 +2482,9 @@ serverGetVimNames(void)
}
int
serverSendReply(name, reply)
char_u *name; /* Where to send. */
char_u *reply; /* What to send. */
serverSendReply(
char_u *name, /* Where to send. */
char_u *reply) /* What to send. */
{
HWND target;
COPYDATASTRUCT data;
@ -2519,13 +2515,13 @@ serverSendReply(name, reply)
}
int
serverSendToVim(name, cmd, result, ptarget, asExpr, silent)
char_u *name; /* Where to send. */
char_u *cmd; /* What to send. */
char_u **result; /* Result of eval'ed expression */
void *ptarget; /* HWND of server */
int asExpr; /* Expression or keys? */
int silent; /* don't complain about no server */
serverSendToVim(
char_u *name, /* Where to send. */
char_u *cmd, /* What to send. */
char_u **result, /* Result of eval'ed expression */
void *ptarget, /* HWND of server */
int asExpr, /* Expression or keys? */
int silent) /* don't complain about no server */
{
HWND target;
COPYDATASTRUCT data;
@ -2578,8 +2574,7 @@ serverSendToVim(name, cmd, result, ptarget, asExpr, silent)
* Bring the server to the foreground.
*/
void
serverForeground(name)
char_u *name;
serverForeground(char_u *name)
{
HWND target = findServer(name);
@ -3101,7 +3096,7 @@ theend:
* Initialize the Winsock dll.
*/
void
channel_init_winsock()
channel_init_winsock(void)
{
WSADATA wsaData;
int wsaerr;

View File

@ -19,7 +19,7 @@
int is_photon_available;
#endif
void qnx_init()
void qnx_init(void)
{
#if defined(FEAT_GUI_PHOTON)
PhChannelParms_t parms;
@ -37,7 +37,7 @@ void qnx_init()
#define CLIP_TYPE_TEXT "TEXT"
/* Turn on the clipboard for a console vim when photon is running */
void qnx_clip_init()
void qnx_clip_init(void)
{
if (is_photon_available == TRUE && !gui.in_use)
clip_init(TRUE);

File diff suppressed because it is too large Load Diff

View File

@ -723,10 +723,10 @@ struct typeahead_st {
* "msec" == -1 will block until a character is available.
*/
int
RealWaitForChar(fd, msec, check_for_gpm)
int fd UNUSED; /* always read from iochan */
long msec;
int *check_for_gpm UNUSED;
RealWaitForChar(
int fd UNUSED, /* always read from iochan */
long msec,
int *check_for_gpm UNUSED)
{
int status;
struct _generic_64 time_curr;

View File

@ -156,7 +156,7 @@ mch_setmouse(
* GUI version of mch_init().
*/
void
mch_init()
mch_init(void)
{
extern int _fmode;
@ -206,7 +206,7 @@ mch_check_win(
* return process ID
*/
long
mch_get_pid()
mch_get_pid(void)
{
return (long)GetCurrentTask();
}
@ -379,7 +379,7 @@ mch_delay(
* check for an "interrupt signal": CTRL-break or CTRL-C
*/
void
mch_breakcheck()
mch_breakcheck(void)
{
/* never used */
}
@ -417,7 +417,7 @@ mch_rename(
* Get the default shell for the current hardware platform
*/
char*
default_shell()
default_shell(void)
{
char* psz = NULL;

View File

@ -481,7 +481,7 @@ char *(*dyn_libintl_bind_textdomain_codeset)(const char *, const char *)
= null_libintl_bind_textdomain_codeset;
int
dyn_libintl_init()
dyn_libintl_init(void)
{
int i;
static struct
@ -543,7 +543,7 @@ dyn_libintl_init()
}
void
dyn_libintl_end()
dyn_libintl_end(void)
{
if (hLibintlDLL)
FreeLibrary(hLibintlDLL);

View File

@ -42,10 +42,10 @@ static int pum_set_selected(int n, int repeat);
* The menu appears above the screen line "row" or at "row" + "height" - 1.
*/
void
pum_display(array, size, selected)
pumitem_T *array;
int size;
int selected; /* index of initially selected item, none if
pum_display(
pumitem_T *array,
int size,
int selected) /* index of initially selected item, none if
out of range */
{
int w;
@ -263,7 +263,7 @@ redo:
* Redraw the popup menu, using "pum_first" and "pum_selected".
*/
void
pum_redraw()
pum_redraw(void)
{
int row = pum_row;
int col;
@ -487,9 +487,7 @@ pum_redraw()
* must be recomputed.
*/
static int
pum_set_selected(n, repeat)
int n;
int repeat;
pum_set_selected(int n, int repeat)
{
int resized = FALSE;
int context = pum_height / 2;
@ -704,7 +702,7 @@ pum_set_selected(n, repeat)
* Undisplay the popup menu (later).
*/
void
pum_undisplay()
pum_undisplay(void)
{
pum_array = NULL;
redraw_all_later(SOME_VALID);
@ -719,7 +717,7 @@ pum_undisplay()
* displayed item.
*/
void
pum_clear()
pum_clear(void)
{
pum_first = 0;
}
@ -729,7 +727,7 @@ pum_clear()
* Overruled when "pum_do_redraw" is set, used to redraw the status lines.
*/
int
pum_visible()
pum_visible(void)
{
return !pum_do_redraw && pum_array != NULL;
}
@ -739,7 +737,7 @@ pum_visible()
* Only valid when pum_visible() returns TRUE!
*/
int
pum_get_height()
pum_get_height(void)
{
return pum_height;
}

View File

@ -134,8 +134,7 @@ static void initmaster(int);
#endif
static void
initmaster(f)
int f UNUSED;
initmaster(int f UNUSED)
{
#ifndef VMS
# ifdef POSIX
@ -156,8 +155,7 @@ initmaster(f)
* pty on others. Needs to be tuned...
*/
int
SetupSlavePTY(fd)
int fd;
SetupSlavePTY(int fd)
{
if (fd < 0)
return 0;
@ -180,8 +178,7 @@ SetupSlavePTY(fd)
#if defined(OSX) && !defined(PTY_DONE)
#define PTY_DONE
int
OpenPTY(ttyn)
char **ttyn;
OpenPTY(char **ttyn)
{
int f;
static char TtyName[32];

View File

@ -153,12 +153,12 @@ static qf_info_T *ll_get_or_alloc_list(win_T *);
* Return -1 for error, number of errors for success.
*/
int
qf_init(wp, efile, errorformat, newlist, qf_title)
win_T *wp;
char_u *efile;
char_u *errorformat;
int newlist; /* TRUE: start a new error list */
char_u *qf_title;
qf_init(
win_T *wp,
char_u *efile,
char_u *errorformat,
int newlist, /* TRUE: start a new error list */
char_u *qf_title)
{
qf_info_T *qi = &ql_info;
@ -184,17 +184,16 @@ qf_init(wp, efile, errorformat, newlist, qf_title)
* Return -1 for error, number of errors for success.
*/
static int
qf_init_ext(qi, efile, buf, tv, errorformat, newlist, lnumfirst, lnumlast,
qf_title)
qf_info_T *qi;
char_u *efile;
buf_T *buf;
typval_T *tv;
char_u *errorformat;
int newlist; /* TRUE: start a new error list */
linenr_T lnumfirst; /* first line number to use */
linenr_T lnumlast; /* last line number to use */
char_u *qf_title;
qf_init_ext(
qf_info_T *qi,
char_u *efile,
buf_T *buf,
typval_T *tv,
char_u *errorformat,
int newlist, /* TRUE: start a new error list */
linenr_T lnumfirst, /* first line number to use */
linenr_T lnumlast, /* last line number to use */
char_u *qf_title)
{
char_u *namebuf;
char_u *errmsg;
@ -887,9 +886,7 @@ qf_init_end:
}
static void
qf_store_title(qi, title)
qf_info_T *qi;
char_u *title;
qf_store_title(qf_info_T *qi, char_u *title)
{
if (title != NULL)
{
@ -905,9 +902,7 @@ qf_store_title(qi, title)
* Prepare for adding a new quickfix list.
*/
static void
qf_new_list(qi, qf_title)
qf_info_T *qi;
char_u *qf_title;
qf_new_list(qf_info_T *qi, char_u *qf_title)
{
int i;
@ -940,8 +935,7 @@ qf_new_list(qi, qf_title)
* Free a location list
*/
static void
ll_free_all(pqi)
qf_info_T **pqi;
ll_free_all(qf_info_T **pqi)
{
int i;
qf_info_T *qi;
@ -962,8 +956,7 @@ ll_free_all(pqi)
}
void
qf_free_all(wp)
win_T *wp;
qf_free_all(win_T *wp)
{
int i;
qf_info_T *qi = &ql_info;
@ -985,21 +978,20 @@ qf_free_all(wp)
* Returns OK or FAIL.
*/
static int
qf_add_entry(qi, prevp, dir, fname, bufnum, mesg, lnum, col, vis_col, pattern,
nr, type, valid)
qf_info_T *qi; /* quickfix list */
qfline_T **prevp; /* pointer to previously added entry or NULL */
char_u *dir; /* optional directory name */
char_u *fname; /* file name or NULL */
int bufnum; /* buffer number or zero */
char_u *mesg; /* message */
long lnum; /* line number */
int col; /* column */
int vis_col; /* using visual column */
char_u *pattern; /* search pattern */
int nr; /* error number */
int type; /* type character */
int valid; /* valid entry */
qf_add_entry(
qf_info_T *qi, /* quickfix list */
qfline_T **prevp, /* pointer to previously added entry or NULL */
char_u *dir, /* optional directory name */
char_u *fname, /* file name or NULL */
int bufnum, /* buffer number or zero */
char_u *mesg, /* message */
long lnum, /* line number */
int col, /* column */
int vis_col, /* using visual column */
char_u *pattern, /* search pattern */
int nr, /* error number */
int type, /* type character */
int valid) /* valid entry */
{
qfline_T *qfp;
@ -1061,7 +1053,7 @@ qf_add_entry(qi, prevp, dir, fname, bufnum, mesg, lnum, col, vis_col, pattern,
* Allocate a new location list
*/
static qf_info_T *
ll_new_list()
ll_new_list(void)
{
qf_info_T *qi;
@ -1080,8 +1072,7 @@ ll_new_list()
* If not present, allocate a location list
*/
static qf_info_T *
ll_get_or_alloc_list(wp)
win_T *wp;
ll_get_or_alloc_list(win_T *wp)
{
if (IS_LL_WINDOW(wp))
/* For a location list window, use the referenced location list */
@ -1102,9 +1093,7 @@ ll_get_or_alloc_list(wp)
* Copy the location list from window "from" to window "to".
*/
void
copy_loclist(from, to)
win_T *from;
win_T *to;
copy_loclist(win_T *from, win_T *to)
{
qf_info_T *qi;
int idx;
@ -1206,9 +1195,7 @@ copy_loclist(from, to)
* get buffer number for file "dir.name"
*/
static int
qf_get_fnum(directory, fname)
char_u *directory;
char_u *fname;
qf_get_fnum(char_u *directory, char_u *fname)
{
if (fname == NULL || *fname == NUL) /* no file name */
return 0;
@ -1256,9 +1243,7 @@ qf_get_fnum(directory, fname)
* NULL on error
*/
static char_u *
qf_push_dir(dirbuf, stackptr)
char_u *dirbuf;
struct dir_stack_T **stackptr;
qf_push_dir(char_u *dirbuf, struct dir_stack_T **stackptr)
{
struct dir_stack_T *ds_new;
struct dir_stack_T *ds_ptr;
@ -1329,8 +1314,7 @@ qf_push_dir(dirbuf, stackptr)
* stack is empty
*/
static char_u *
qf_pop_dir(stackptr)
struct dir_stack_T **stackptr;
qf_pop_dir(struct dir_stack_T **stackptr)
{
struct dir_stack_T *ds_ptr;
@ -1354,8 +1338,7 @@ qf_pop_dir(stackptr)
* clean up directory stack
*/
static void
qf_clean_dir_stack(stackptr)
struct dir_stack_T **stackptr;
qf_clean_dir_stack(struct dir_stack_T **stackptr)
{
struct dir_stack_T *ds_ptr;
@ -1388,8 +1371,7 @@ qf_clean_dir_stack(stackptr)
* qf_guess_filepath will return NULL.
*/
static char_u *
qf_guess_filepath(filename)
char_u *filename;
qf_guess_filepath(char_u *filename)
{
struct dir_stack_T *ds_ptr;
struct dir_stack_T *ds_tmp;
@ -1440,11 +1422,11 @@ qf_guess_filepath(filename)
* else go to entry "errornr"
*/
void
qf_jump(qi, dir, errornr, forceit)
qf_info_T *qi;
int dir;
int errornr;
int forceit;
qf_jump(
qf_info_T *qi,
int dir,
int errornr,
int forceit)
{
qf_info_T *ll_ref;
qfline_T *qf_ptr;
@ -1954,8 +1936,7 @@ theend:
* ":llist": list all locations
*/
void
qf_list(eap)
exarg_T *eap;
qf_list(exarg_T *eap)
{
buf_T *buf;
char_u *fname;
@ -2060,10 +2041,7 @@ qf_list(eap)
* Put the result in "buf[bufsize]".
*/
static void
qf_fmt_text(text, buf, bufsize)
char_u *text;
char_u *buf;
int bufsize;
qf_fmt_text(char_u *text, char_u *buf, int bufsize)
{
int i;
char_u *p = text;
@ -2090,8 +2068,7 @@ qf_fmt_text(text, buf, bufsize)
* ":lnewer [count]": Down in the location list stack.
*/
void
qf_age(eap)
exarg_T *eap;
qf_age(exarg_T *eap)
{
qf_info_T *qi = &ql_info;
int count;
@ -2135,8 +2112,7 @@ qf_age(eap)
}
static void
qf_msg(qi)
qf_info_T *qi;
qf_msg(qf_info_T *qi)
{
smsg((char_u *)_("error list %d of %d; %d errors"),
qi->qf_curlist + 1, qi->qf_listcount,
@ -2150,9 +2126,7 @@ qf_msg(qi)
* Free error list "idx".
*/
static void
qf_free(qi, idx)
qf_info_T *qi;
int idx;
qf_free(qf_info_T *qi, int idx)
{
qfline_T *qfp;
int stop = FALSE;
@ -2184,12 +2158,12 @@ qf_free(qi, idx)
* qf_mark_adjust: adjust marks
*/
void
qf_mark_adjust(wp, line1, line2, amount, amount_after)
win_T *wp;
linenr_T line1;
linenr_T line2;
long amount;
long amount_after;
qf_mark_adjust(
win_T *wp,
linenr_T line1,
linenr_T line2,
long amount,
long amount_after)
{
int i;
qfline_T *qfp;
@ -2237,8 +2211,7 @@ qf_mark_adjust(wp, line1, line2, amount, amount_after)
* 1 x "" :helpgrep
*/
static char_u *
qf_types(c, nr)
int c, nr;
qf_types(int c, int nr)
{
static char_u buf[20];
static char_u cc[3];
@ -2275,8 +2248,7 @@ qf_types(c, nr)
* close it if not.
*/
void
ex_cwindow(eap)
exarg_T *eap;
ex_cwindow(exarg_T *eap)
{
qf_info_T *qi = &ql_info;
win_T *win;
@ -2312,8 +2284,7 @@ ex_cwindow(eap)
* ":lclose": close the window showing the location list
*/
void
ex_cclose(eap)
exarg_T *eap;
ex_cclose(exarg_T *eap)
{
win_T *win = NULL;
qf_info_T *qi = &ql_info;
@ -2336,8 +2307,7 @@ ex_cclose(eap)
* ":lopen": open a window that shows the location list.
*/
void
ex_copen(eap)
exarg_T *eap;
ex_copen(exarg_T *eap)
{
qf_info_T *qi = &ql_info;
int height;
@ -2470,8 +2440,7 @@ ex_copen(eap)
* window).
*/
linenr_T
qf_current_entry(wp)
win_T *wp;
qf_current_entry(win_T *wp)
{
qf_info_T *qi = &ql_info;
@ -2487,9 +2456,9 @@ qf_current_entry(wp)
* Return TRUE if there is a quickfix window.
*/
static int
qf_win_pos_update(qi, old_qf_index)
qf_info_T *qi;
int old_qf_index; /* previous qf_index or zero */
qf_win_pos_update(
qf_info_T *qi,
int old_qf_index) /* previous qf_index or zero */
{
win_T *win;
int qf_index = qi->qf_lists[qi->qf_curlist].qf_index;
@ -2533,9 +2502,7 @@ qf_win_pos_update(qi, old_qf_index)
* list buffer
*/
static int
is_qf_win(win, qi)
win_T *win;
qf_info_T *qi;
is_qf_win(win_T *win, qf_info_T *qi)
{
/*
* A window displaying the quickfix buffer will have the w_llist_ref field
@ -2556,8 +2523,7 @@ is_qf_win(win, qi)
* Searches in only the windows opened in the current tab.
*/
static win_T *
qf_find_win(qi)
qf_info_T *qi;
qf_find_win(qf_info_T *qi)
{
win_T *win;
@ -2573,8 +2539,7 @@ qf_find_win(qi)
* Searches in windows opened in all the tabs.
*/
static buf_T *
qf_find_buf(qi)
qf_info_T *qi;
qf_find_buf(qf_info_T *qi)
{
tabpage_T *tp;
win_T *win;
@ -2590,8 +2555,7 @@ qf_find_buf(qi)
* Find the quickfix buffer. If it exists, update the contents.
*/
static void
qf_update_buffer(qi)
qf_info_T *qi;
qf_update_buffer(qf_info_T *qi)
{
buf_T *buf;
win_T *win;
@ -2626,8 +2590,7 @@ qf_update_buffer(qi)
* Set "w:quickfix_title" if "qi" has a title.
*/
static void
qf_set_title_var(qi)
qf_info_T *qi;
qf_set_title_var(qf_info_T *qi)
{
if (qi->qf_lists[qi->qf_curlist].qf_title != NULL)
set_internal_string_var((char_u *)"w:quickfix_title",
@ -2639,8 +2602,7 @@ qf_set_title_var(qi)
* curbuf must be the quickfix buffer!
*/
static void
qf_fill_buffer(qi)
qf_info_T *qi;
qf_fill_buffer(qf_info_T *qi)
{
linenr_T lnum;
qfline_T *qfp;
@ -2742,8 +2704,7 @@ qf_fill_buffer(qi)
* Return TRUE if "buf" is the quickfix buffer.
*/
int
bt_quickfix(buf)
buf_T *buf;
bt_quickfix(buf_T *buf)
{
return buf != NULL && buf->b_p_bt[0] == 'q';
}
@ -2753,8 +2714,7 @@ bt_quickfix(buf)
* This means the buffer name is not a file name.
*/
int
bt_nofile(buf)
buf_T *buf;
bt_nofile(buf_T *buf)
{
return buf != NULL && ((buf->b_p_bt[0] == 'n' && buf->b_p_bt[2] == 'f')
|| buf->b_p_bt[0] == 'a');
@ -2764,15 +2724,13 @@ bt_nofile(buf)
* Return TRUE if "buf" is a "nowrite" or "nofile" buffer.
*/
int
bt_dontwrite(buf)
buf_T *buf;
bt_dontwrite(buf_T *buf)
{
return buf != NULL && buf->b_p_bt[0] == 'n';
}
int
bt_dontwrite_msg(buf)
buf_T *buf;
bt_dontwrite_msg(buf_T *buf)
{
if (bt_dontwrite(buf))
{
@ -2787,8 +2745,7 @@ bt_dontwrite_msg(buf)
* and 'bufhidden'.
*/
int
buf_hide(buf)
buf_T *buf;
buf_hide(buf_T *buf)
{
/* 'bufhidden' overrules 'hidden' and ":hide", check it first */
switch (buf->b_p_bh[0])
@ -2805,8 +2762,7 @@ buf_hide(buf)
* Return TRUE when using ":vimgrep" for ":grep".
*/
int
grep_internal(cmdidx)
cmdidx_T cmdidx;
grep_internal(cmdidx_T cmdidx)
{
return ((cmdidx == CMD_grep
|| cmdidx == CMD_lgrep
@ -2820,8 +2776,7 @@ grep_internal(cmdidx)
* Used for ":make", ":lmake", ":grep", ":lgrep", ":grepadd", and ":lgrepadd"
*/
void
ex_make(eap)
exarg_T *eap;
ex_make(exarg_T *eap)
{
char_u *fname;
char_u *cmd;
@ -2934,7 +2889,7 @@ ex_make(eap)
* Returns NULL for error.
*/
static char_u *
get_mef_name()
get_mef_name(void)
{
char_u *p;
char_u *name;
@ -2989,8 +2944,7 @@ get_mef_name()
* Returns the number of valid entries in the current quickfix/location list.
*/
int
qf_get_size(eap)
exarg_T *eap;
qf_get_size(exarg_T *eap)
{
qf_info_T *qi = &ql_info;
qfline_T *qfp;
@ -3030,8 +2984,7 @@ qf_get_size(eap)
* Returns 0 if there is an error.
*/
int
qf_get_cur_idx(eap)
exarg_T *eap;
qf_get_cur_idx(exarg_T *eap)
{
qf_info_T *qi = &ql_info;
@ -3051,8 +3004,7 @@ qf_get_cur_idx(eap)
* entries). If no valid entries are in the list, then returns 1.
*/
int
qf_get_cur_valid_idx(eap)
exarg_T *eap;
qf_get_cur_valid_idx(exarg_T *eap)
{
qf_info_T *qi = &ql_info;
qf_list_T *qfl;
@ -3103,10 +3055,7 @@ qf_get_cur_valid_idx(eap)
* For :cfdo and :lfdo returns the 'n'th valid file entry.
*/
static int
qf_get_nth_valid_entry(qi, n, fdo)
qf_info_T *qi;
int n;
int fdo;
qf_get_nth_valid_entry(qf_info_T *qi, int n, int fdo)
{
qf_list_T *qfl = &qi->qf_lists[qi->qf_curlist];
qfline_T *qfp = qfl->qf_start;
@ -3151,8 +3100,7 @@ qf_get_nth_valid_entry(qi, n, fdo)
* ":cdo", ":ldo", ":cfdo" and ":lfdo"
*/
void
ex_cc(eap)
exarg_T *eap;
ex_cc(exarg_T *eap)
{
qf_info_T *qi = &ql_info;
int errornr;
@ -3203,8 +3151,7 @@ ex_cc(eap)
* Also, used by ":cdo", ":ldo", ":cfdo" and ":lfdo" commands.
*/
void
ex_cnext(eap)
exarg_T *eap;
ex_cnext(exarg_T *eap)
{
qf_info_T *qi = &ql_info;
int errornr;
@ -3251,8 +3198,7 @@ ex_cnext(eap)
* ":lfile"/":lgetfile"/":laddfile" commands.
*/
void
ex_cfile(eap)
exarg_T *eap;
ex_cfile(exarg_T *eap)
{
win_T *wp = NULL;
qf_info_T *qi = &ql_info;
@ -3334,8 +3280,7 @@ ex_cfile(eap)
* ":lvimgrepadd {pattern} file(s)"
*/
void
ex_vimgrep(eap)
exarg_T *eap;
ex_vimgrep(exarg_T *eap)
{
regmmatch_T regmatch;
int fcount;
@ -3738,10 +3683,7 @@ theend:
* Return a pointer to the char just past the pattern plus flags.
*/
char_u *
skip_vimgrep_pat(p, s, flags)
char_u *p;
char_u **s;
int *flags;
skip_vimgrep_pat(char_u *p, char_u **s, int *flags)
{
int c;
@ -3790,8 +3732,7 @@ skip_vimgrep_pat(p, s, flags)
* into account whether it is set locally or globally.
*/
static void
restore_start_dir(dirname_start)
char_u *dirname_start;
restore_start_dir(char_u *dirname_start)
{
char_u *dirname_now = alloc(MAXPATHL);
@ -3825,10 +3766,10 @@ restore_start_dir(dirname_start)
* Returns NULL if it fails.
*/
static buf_T *
load_dummy_buffer(fname, dirname_start, resulting_dir)
char_u *fname;
char_u *dirname_start; /* in: old directory */
char_u *resulting_dir; /* out: new directory */
load_dummy_buffer(
char_u *fname,
char_u *dirname_start, /* in: old directory */
char_u *resulting_dir) /* out: new directory */
{
buf_T *newbuf;
buf_T *newbuf_to_wipe = NULL;
@ -3907,9 +3848,7 @@ load_dummy_buffer(fname, dirname_start, resulting_dir)
* 'autochdir' option have changed it.
*/
static void
wipe_dummy_buffer(buf, dirname_start)
buf_T *buf;
char_u *dirname_start;
wipe_dummy_buffer(buf_T *buf, char_u *dirname_start)
{
if (curbuf != buf) /* safety check */
{
@ -3940,9 +3879,7 @@ wipe_dummy_buffer(buf, dirname_start)
* 'autochdir' option have changed it.
*/
static void
unload_dummy_buffer(buf, dirname_start)
buf_T *buf;
char_u *dirname_start;
unload_dummy_buffer(buf_T *buf, char_u *dirname_start)
{
if (curbuf != buf) /* safety check */
{
@ -3958,9 +3895,7 @@ unload_dummy_buffer(buf, dirname_start)
* Add each quickfix error to list "list" as a dictionary.
*/
int
get_errorlist(wp, list)
win_T *wp;
list_T *list;
get_errorlist(win_T *wp, list_T *list)
{
qf_info_T *qi = &ql_info;
dict_T *dict;
@ -4018,11 +3953,11 @@ get_errorlist(wp, list)
* of dictionaries. "title" will be copied to w:quickfix_title
*/
int
set_errorlist(wp, list, action, title)
win_T *wp;
list_T *list;
int action;
char_u *title;
set_errorlist(
win_T *wp,
list_T *list,
int action,
char_u *title)
{
listitem_T *li;
dict_T *d;
@ -4146,8 +4081,7 @@ set_errorlist(wp, list, action, title)
* ":[range]lgetbuffer [bufnr]" command.
*/
void
ex_cbuffer(eap)
exarg_T *eap;
ex_cbuffer(exarg_T *eap)
{
buf_T *buf = NULL;
qf_info_T *qi = &ql_info;
@ -4207,8 +4141,7 @@ ex_cbuffer(eap)
* ":lexpr {expr}", ":lgetexpr {expr}", ":laddexpr {expr}" command.
*/
void
ex_cexpr(eap)
exarg_T *eap;
ex_cexpr(exarg_T *eap)
{
typval_T *tv;
qf_info_T *qi = &ql_info;
@ -4248,8 +4181,7 @@ ex_cexpr(eap)
* ":helpgrep {pattern}"
*/
void
ex_helpgrep(eap)
exarg_T *eap;
ex_helpgrep(exarg_T *eap)
{
regmatch_T regmatch;
char_u *save_cpo;

File diff suppressed because it is too large Load Diff

View File

@ -332,9 +332,9 @@ static int failure_chance(nfa_state_T *state, int depth);
* Return OK on success, FAIL otherwise.
*/
static int
nfa_regcomp_start(expr, re_flags)
char_u *expr;
int re_flags; /* see vim_regcomp() */
nfa_regcomp_start(
char_u *expr,
int re_flags) /* see vim_regcomp() */
{
size_t postfix_size;
int nstate_max;
@ -370,9 +370,7 @@ nfa_regcomp_start(expr, re_flags)
* of the line.
*/
static int
nfa_get_reganch(start, depth)
nfa_state_T *start;
int depth;
nfa_get_reganch(nfa_state_T *start, int depth)
{
nfa_state_T *p = start;
@ -434,9 +432,7 @@ nfa_get_reganch(start, depth)
* at start of the match.
*/
static int
nfa_get_regstart(start, depth)
nfa_state_T *start;
int depth;
nfa_get_regstart(nfa_state_T *start, int depth)
{
nfa_state_T *p = start;
@ -520,8 +516,7 @@ nfa_get_regstart(start, depth)
* regstart. Otherwise return NULL.
*/
static char_u *
nfa_get_match_text(start)
nfa_state_T *start;
nfa_get_match_text(nfa_state_T *start)
{
nfa_state_T *p = start;
int len = 0;
@ -564,7 +559,7 @@ nfa_get_match_text(start)
* running above the estimated number of states.
*/
static int
realloc_post_list()
realloc_post_list(void)
{
int nstate_max = (int)(post_end - post_start);
int new_max = nstate_max + 1000;
@ -594,10 +589,7 @@ realloc_post_list()
* need to be interpreted as [a-zA-Z].
*/
static int
nfa_recognize_char_class(start, end, extra_newl)
char_u *start;
char_u *end;
int extra_newl;
nfa_recognize_char_class(char_u *start, char_u *end, int extra_newl)
{
# define CLASS_not 0x80
# define CLASS_af 0x40
@ -744,8 +736,7 @@ nfa_recognize_char_class(start, end, extra_newl)
* NOTE! When changing this function, also update reg_equi_class()
*/
static int
nfa_emit_equi_class(c)
int c;
nfa_emit_equi_class(int c)
{
#define EMIT2(c) EMIT(c); EMIT(NFA_CONCAT);
#ifdef FEAT_MBYTE
@ -1118,7 +1109,7 @@ nfa_emit_equi_class(c)
* or \z( pattern \)
*/
static int
nfa_regatom()
nfa_regatom(void)
{
int c;
int charclass;
@ -1890,7 +1881,7 @@ nfa_do_multibyte:
* or atom multi
*/
static int
nfa_regpiece()
nfa_regpiece(void)
{
int i;
int op;
@ -2100,7 +2091,7 @@ nfa_regpiece()
* etc.
*/
static int
nfa_regconcat()
nfa_regconcat(void)
{
int cont = TRUE;
int first = TRUE;
@ -2178,7 +2169,7 @@ nfa_regconcat()
* etc.
*/
static int
nfa_regbranch()
nfa_regbranch(void)
{
int ch;
int old_post_pos;
@ -2225,8 +2216,8 @@ nfa_regbranch()
* etc.
*/
static int
nfa_reg(paren)
int paren; /* REG_NOPAREN, REG_PAREN, REG_NPAREN or REG_ZPAREN */
nfa_reg(
int paren) /* REG_NOPAREN, REG_PAREN, REG_NPAREN or REG_ZPAREN */
{
int parno = 0;
@ -2293,8 +2284,7 @@ nfa_reg(paren)
static char_u code[50];
static void
nfa_set_code(c)
int c;
nfa_set_code(int c)
{
int addnl = FALSE;
@ -2530,9 +2520,7 @@ static FILE *log_fd;
* Print the postfix notation of the current regexp.
*/
static void
nfa_postfix_dump(expr, retval)
char_u *expr;
int retval;
nfa_postfix_dump(char_u *expr, int retval)
{
int *p;
FILE *f;
@ -2563,9 +2551,7 @@ nfa_postfix_dump(expr, retval)
* Print the NFA starting with a root node "state".
*/
static void
nfa_print_state(debugf, state)
FILE *debugf;
nfa_state_T *state;
nfa_print_state(FILE *debugf, nfa_state_T *state)
{
garray_T indent;
@ -2576,10 +2562,7 @@ nfa_print_state(debugf, state)
}
static void
nfa_print_state2(debugf, state, indent)
FILE *debugf;
nfa_state_T *state;
garray_T *indent;
nfa_print_state2(FILE *debugf, nfa_state_T *state, garray_T *indent)
{
char_u *p;
@ -2640,8 +2623,7 @@ nfa_print_state2(debugf, state, indent)
* Print the NFA state machine.
*/
static void
nfa_dump(prog)
nfa_regprog_T *prog;
nfa_dump(nfa_regprog_T *prog)
{
FILE *debugf = fopen(NFA_REGEXP_DUMP_LOG, "a");
@ -2668,7 +2650,7 @@ nfa_dump(prog)
* Return the postfix string on success, NULL otherwise.
*/
static int *
re2post()
re2post(void)
{
if (nfa_reg(REG_NOPAREN) == FAIL)
return NULL;
@ -2691,10 +2673,7 @@ static nfa_state_T *state_ptr; /* points to nfa_prog->state */
* Allocate and initialize nfa_state_T.
*/
static nfa_state_T *
alloc_state(c, out, out1)
int c;
nfa_state_T *out;
nfa_state_T *out1;
alloc_state(int c, nfa_state_T *out, nfa_state_T *out1)
{
nfa_state_T *s;
@ -2750,9 +2729,7 @@ static Frag_T st_pop(Frag_T **p, Frag_T *stack);
* Initialize a Frag_T struct and return it.
*/
static Frag_T
frag(start, out)
nfa_state_T *start;
Ptrlist *out;
frag(nfa_state_T *start, Ptrlist *out)
{
Frag_T n;
@ -2765,8 +2742,8 @@ frag(start, out)
* Create singleton list containing just outp.
*/
static Ptrlist *
list1(outp)
nfa_state_T **outp;
list1(
nfa_state_T **outp)
{
Ptrlist *l;
@ -2779,9 +2756,7 @@ list1(outp)
* Patch the list of states at out to point to start.
*/
static void
patch(l, s)
Ptrlist *l;
nfa_state_T *s;
patch(Ptrlist *l, nfa_state_T *s)
{
Ptrlist *next;
@ -2797,9 +2772,7 @@ patch(l, s)
* Join the two lists l1 and l2, returning the combination.
*/
static Ptrlist *
append(l1, l2)
Ptrlist *l1;
Ptrlist *l2;
append(Ptrlist *l1, Ptrlist *l2)
{
Ptrlist *oldl1;
@ -2816,10 +2789,7 @@ append(l1, l2)
static Frag_T empty;
static void
st_error(postfix, end, p)
int *postfix UNUSED;
int *end UNUSED;
int *p UNUSED;
st_error(int *postfix UNUSED, int *end UNUSED, int *p UNUSED)
{
#ifdef NFA_REGEXP_ERROR_LOG
FILE *df;
@ -2868,10 +2838,7 @@ st_error(postfix, end, p)
* Push an item onto the stack.
*/
static void
st_push(s, p, stack_end)
Frag_T s;
Frag_T **p;
Frag_T *stack_end;
st_push(Frag_T s, Frag_T **p, Frag_T *stack_end)
{
Frag_T *stackp = *p;
@ -2885,9 +2852,7 @@ st_push(s, p, stack_end)
* Pop an item from the stack.
*/
static Frag_T
st_pop(p, stack)
Frag_T **p;
Frag_T *stack;
st_pop(Frag_T **p, Frag_T *stack)
{
Frag_T *stackp;
@ -2903,9 +2868,7 @@ st_pop(p, stack)
* When unknown or unlimited return -1.
*/
static int
nfa_max_width(startstate, depth)
nfa_state_T *startstate;
int depth;
nfa_max_width(nfa_state_T *startstate, int depth)
{
int l, r;
nfa_state_T *state = startstate;
@ -3128,10 +3091,7 @@ nfa_max_width(startstate, depth)
* Return the NFA start state on success, NULL otherwise.
*/
static nfa_state_T *
post2nfa(postfix, end, nfa_calc_size)
int *postfix;
int *end;
int nfa_calc_size;
post2nfa(int *postfix, int *end, int nfa_calc_size)
{
int *p;
int mopen;
@ -3667,8 +3627,7 @@ theend:
* After building the NFA program, inspect it to add optimization hints.
*/
static void
nfa_postprocess(prog)
nfa_regprog_T *prog;
nfa_postprocess(nfa_regprog_T *prog)
{
int i;
int c;
@ -3801,8 +3760,7 @@ static void log_subexpr(regsub_T *sub);
static char *pim_info(nfa_pim_T *pim);
static void
log_subsexpr(subs)
regsubs_T *subs;
log_subsexpr(regsubs_T *subs)
{
log_subexpr(&subs->norm);
# ifdef FEAT_SYN_HL
@ -3812,8 +3770,7 @@ log_subsexpr(subs)
}
static void
log_subexpr(sub)
regsub_T *sub;
log_subexpr(regsub_T *sub)
{
int j;
@ -3838,8 +3795,7 @@ log_subexpr(sub)
}
static char *
pim_info(pim)
nfa_pim_T *pim;
pim_info(nfa_pim_T *pim)
{
static char buf[30];
@ -3879,9 +3835,7 @@ static void addstate_here(nfa_list_T *l, nfa_state_T *state, regsubs_T *subs, nf
* Copy postponed invisible match info from "from" to "to".
*/
static void
copy_pim(to, from)
nfa_pim_T *to;
nfa_pim_T *from;
copy_pim(nfa_pim_T *to, nfa_pim_T *from)
{
to->result = from->result;
to->state = from->state;
@ -3894,8 +3848,7 @@ copy_pim(to, from)
}
static void
clear_sub(sub)
regsub_T *sub;
clear_sub(regsub_T *sub)
{
if (REG_MULTI)
/* Use 0xff to set lnum to -1 */
@ -3910,9 +3863,7 @@ clear_sub(sub)
* Copy the submatches from "from" to "to".
*/
static void
copy_sub(to, from)
regsub_T *to;
regsub_T *from;
copy_sub(regsub_T *to, regsub_T *from)
{
to->in_use = from->in_use;
if (from->in_use > 0)
@ -3933,9 +3884,7 @@ copy_sub(to, from)
* Like copy_sub() but exclude the main match.
*/
static void
copy_sub_off(to, from)
regsub_T *to;
regsub_T *from;
copy_sub_off(regsub_T *to, regsub_T *from)
{
if (to->in_use < from->in_use)
to->in_use = from->in_use;
@ -3957,9 +3906,7 @@ copy_sub_off(to, from)
* Like copy_sub() but only do the end of the main match if \ze is present.
*/
static void
copy_ze_off(to, from)
regsub_T *to;
regsub_T *from;
copy_ze_off(regsub_T *to, regsub_T *from)
{
if (nfa_has_zend)
{
@ -3984,9 +3931,7 @@ copy_ze_off(to, from)
* When using back-references also check the end position.
*/
static int
sub_equal(sub1, sub2)
regsub_T *sub1;
regsub_T *sub2;
sub_equal(regsub_T *sub1, regsub_T *sub2)
{
int i;
int todo;
@ -4093,11 +4038,11 @@ report_state(char *action,
* positions as "subs".
*/
static int
has_state_with_pos(l, state, subs, pim)
nfa_list_T *l; /* runtime state list */
nfa_state_T *state; /* state to update */
regsubs_T *subs; /* pointers to subexpressions */
nfa_pim_T *pim; /* postponed match or NULL */
has_state_with_pos(
nfa_list_T *l, /* runtime state list */
nfa_state_T *state, /* state to update */
regsubs_T *subs, /* pointers to subexpressions */
nfa_pim_T *pim) /* postponed match or NULL */
{
nfa_thread_T *thread;
int i;
@ -4122,9 +4067,7 @@ has_state_with_pos(l, state, subs, pim)
* set.
*/
static int
pim_equal(one, two)
nfa_pim_T *one;
nfa_pim_T *two;
pim_equal(nfa_pim_T *one, nfa_pim_T *two)
{
int one_unused = (one == NULL || one->result == NFA_PIM_UNUSED);
int two_unused = (two == NULL || two->result == NFA_PIM_UNUSED);
@ -4149,9 +4092,7 @@ pim_equal(one, two)
* Return TRUE if "state" leads to a NFA_MATCH without advancing the input.
*/
static int
match_follows(startstate, depth)
nfa_state_T *startstate;
int depth;
match_follows(nfa_state_T *startstate, int depth)
{
nfa_state_T *state = startstate;
@ -4244,10 +4185,10 @@ match_follows(startstate, depth)
* Return TRUE if "state" is already in list "l".
*/
static int
state_in_list(l, state, subs)
nfa_list_T *l; /* runtime state list */
nfa_state_T *state; /* state to update */
regsubs_T *subs; /* pointers to subexpressions */
state_in_list(
nfa_list_T *l, /* runtime state list */
nfa_state_T *state, /* state to update */
regsubs_T *subs) /* pointers to subexpressions */
{
if (state->lastlist[nfa_ll_index] == l->id)
{
@ -4262,12 +4203,12 @@ state_in_list(l, state, subs)
* Returns "subs_arg", possibly copied into temp_subs.
*/
static regsubs_T *
addstate(l, state, subs_arg, pim, off)
nfa_list_T *l; /* runtime state list */
nfa_state_T *state; /* state to update */
regsubs_T *subs_arg; /* pointers to subexpressions */
nfa_pim_T *pim; /* postponed look-behind match */
int off; /* byte offset, when -1 go to next line */
addstate(
nfa_list_T *l, /* runtime state list */
nfa_state_T *state, /* state to update */
regsubs_T *subs_arg, /* pointers to subexpressions */
nfa_pim_T *pim, /* postponed look-behind match */
int off) /* byte offset, when -1 go to next line */
{
int subidx;
nfa_thread_T *thread;
@ -4678,12 +4619,12 @@ skip_add:
* matters for alternatives.
*/
static void
addstate_here(l, state, subs, pim, ip)
nfa_list_T *l; /* runtime state list */
nfa_state_T *state; /* state to update */
regsubs_T *subs; /* pointers to subexpressions */
nfa_pim_T *pim; /* postponed look-behind match */
int *ip;
addstate_here(
nfa_list_T *l, /* runtime state list */
nfa_state_T *state, /* state to update */
regsubs_T *subs, /* pointers to subexpressions */
nfa_pim_T *pim, /* postponed look-behind match */
int *ip)
{
int tlen = l->n;
int count;
@ -4749,9 +4690,7 @@ addstate_here(l, state, subs, pim, ip)
* Check character class "class" against current character c.
*/
static int
check_char_class(class, c)
int class;
int c;
check_char_class(int class, int c)
{
switch (class)
{
@ -4833,10 +4772,10 @@ check_char_class(class, c)
* Return TRUE if it matches.
*/
static int
match_backref(sub, subidx, bytelen)
regsub_T *sub; /* pointers to subexpressions */
int subidx;
int *bytelen; /* out: length of match in bytes */
match_backref(
regsub_T *sub, /* pointers to subexpressions */
int subidx,
int *bytelen) /* out: length of match in bytes */
{
int len;
@ -4900,9 +4839,9 @@ static int match_zref(int subidx, int *bytelen);
* Return TRUE if it matches.
*/
static int
match_zref(subidx, bytelen)
int subidx;
int *bytelen; /* out: length of match in bytes */
match_zref(
int subidx,
int *bytelen) /* out: length of match in bytes */
{
int len;
@ -4930,9 +4869,7 @@ match_zref(subidx, bytelen)
* Only used for the recursive value lastlist[1].
*/
static void
nfa_save_listids(prog, list)
nfa_regprog_T *prog;
int *list;
nfa_save_listids(nfa_regprog_T *prog, int *list)
{
int i;
nfa_state_T *p;
@ -4951,9 +4888,7 @@ nfa_save_listids(prog, list)
* Restore list IDs from "list" to all NFA states.
*/
static void
nfa_restore_listids(prog, list)
nfa_regprog_T *prog;
int *list;
nfa_restore_listids(nfa_regprog_T *prog, int *list)
{
int i;
nfa_state_T *p;
@ -4967,10 +4902,7 @@ nfa_restore_listids(prog, list)
}
static int
nfa_re_num_cmp(val, op, pos)
long_u val;
int op;
long_u pos;
nfa_re_num_cmp(long_u val, int op, long_u pos)
{
if (op == 1) return pos > val;
if (op == 2) return pos < val;
@ -4986,13 +4918,13 @@ static int nfa_regmatch(nfa_regprog_T *prog, nfa_state_T *start, regsubs_T *subm
* position).
*/
static int
recursive_regmatch(state, pim, prog, submatch, m, listids)
nfa_state_T *state;
nfa_pim_T *pim;
nfa_regprog_T *prog;
regsubs_T *submatch;
regsubs_T *m;
int **listids;
recursive_regmatch(
nfa_state_T *state,
nfa_pim_T *pim,
nfa_regprog_T *prog,
regsubs_T *submatch,
regsubs_T *m,
int **listids)
{
int save_reginput_col = (int)(reginput - regline);
int save_reglnum = reglnum;
@ -5168,9 +5100,7 @@ static long find_match_text(colnr_T startcol, int regstart, char_u *match_text);
* specific character: 99
*/
static int
failure_chance(state, depth)
nfa_state_T *state;
int depth;
failure_chance(nfa_state_T *state, int depth)
{
int c = state->c;
int l, r;
@ -5330,9 +5260,7 @@ failure_chance(state, depth)
* Skip until the char "c" we know a match must start with.
*/
static int
skip_to_start(c, colp)
int c;
colnr_T *colp;
skip_to_start(int c, colnr_T *colp)
{
char_u *s;
@ -5357,10 +5285,7 @@ skip_to_start(c, colp)
* Returns zero for no match, 1 for a match.
*/
static long
find_match_text(startcol, regstart, match_text)
colnr_T startcol;
int regstart;
char_u *match_text;
find_match_text(colnr_T startcol, int regstart, char_u *match_text)
{
colnr_T col = startcol;
int c1, c2;
@ -5426,11 +5351,11 @@ find_match_text(startcol, regstart, match_text)
* Note: Caller must ensure that: start != NULL.
*/
static int
nfa_regmatch(prog, start, submatch, m)
nfa_regprog_T *prog;
nfa_state_T *start;
regsubs_T *submatch;
regsubs_T *m;
nfa_regmatch(
nfa_regprog_T *prog,
nfa_state_T *start,
regsubs_T *submatch,
regsubs_T *m)
{
int result;
size_t size = 0;
@ -6847,10 +6772,10 @@ theend:
* Returns <= 0 for failure, number of lines contained in the match otherwise.
*/
static long
nfa_regtry(prog, col, tm)
nfa_regprog_T *prog;
colnr_T col;
proftime_T *tm UNUSED; /* timeout limit or NULL */
nfa_regtry(
nfa_regprog_T *prog,
colnr_T col,
proftime_T *tm UNUSED) /* timeout limit or NULL */
{
int i;
regsubs_T subs, m;
@ -6986,10 +6911,10 @@ nfa_regtry(prog, col, tm)
* Returns <= 0 for failure, number of lines contained in the match otherwise.
*/
static long
nfa_regexec_both(line, startcol, tm)
char_u *line;
colnr_T startcol; /* column to start looking for match */
proftime_T *tm; /* timeout limit or NULL */
nfa_regexec_both(
char_u *line,
colnr_T startcol, /* column to start looking for match */
proftime_T *tm) /* timeout limit or NULL */
{
nfa_regprog_T *prog;
long retval = 0L;
@ -7096,9 +7021,7 @@ theend:
* Returns the program in allocated space. Returns NULL for an error.
*/
static regprog_T *
nfa_regcomp(expr, re_flags)
char_u *expr;
int re_flags;
nfa_regcomp(char_u *expr, int re_flags)
{
nfa_regprog_T *prog = NULL;
size_t prog_size;
@ -7208,8 +7131,7 @@ fail:
* Free a compiled regexp program, returned by nfa_regcomp().
*/
static void
nfa_regfree(prog)
regprog_T *prog;
nfa_regfree(regprog_T *prog)
{
if (prog != NULL)
{
@ -7228,11 +7150,11 @@ nfa_regfree(prog)
* Returns <= 0 for failure, number of lines contained in the match otherwise.
*/
static int
nfa_regexec_nl(rmp, line, col, line_lbr)
regmatch_T *rmp;
char_u *line; /* string to match against */
colnr_T col; /* column to start looking for match */
int line_lbr;
nfa_regexec_nl(
regmatch_T *rmp,
char_u *line, /* string to match against */
colnr_T col, /* column to start looking for match */
int line_lbr)
{
reg_match = rmp;
reg_mmatch = NULL;
@ -7275,13 +7197,13 @@ nfa_regexec_nl(rmp, line, col, line_lbr)
* FIXME if this behavior is not compatible.
*/
static long
nfa_regexec_multi(rmp, win, buf, lnum, col, tm)
regmmatch_T *rmp;
win_T *win; /* window in which to search or NULL */
buf_T *buf; /* buffer in which to search */
linenr_T lnum; /* nr of line to start looking for match */
colnr_T col; /* column to start looking for match */
proftime_T *tm; /* timeout limit or NULL */
nfa_regexec_multi(
regmmatch_T *rmp,
win_T *win, /* window in which to search or NULL */
buf_T *buf, /* buffer in which to search */
linenr_T lnum, /* nr of line to start looking for match */
colnr_T col, /* column to start looking for match */
proftime_T *tm) /* timeout limit or NULL */
{
reg_match = NULL;
reg_mmatch = rmp;

File diff suppressed because it is too large Load Diff

View File

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