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

View File

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

View File

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

View File

@ -19,7 +19,7 @@
int is_photon_available; int is_photon_available;
#endif #endif
void qnx_init() void qnx_init(void)
{ {
#if defined(FEAT_GUI_PHOTON) #if defined(FEAT_GUI_PHOTON)
PhChannelParms_t parms; PhChannelParms_t parms;
@ -37,7 +37,7 @@ void qnx_init()
#define CLIP_TYPE_TEXT "TEXT" #define CLIP_TYPE_TEXT "TEXT"
/* Turn on the clipboard for a console vim when photon is running */ /* 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) if (is_photon_available == TRUE && !gui.in_use)
clip_init(TRUE); 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. * "msec" == -1 will block until a character is available.
*/ */
int int
RealWaitForChar(fd, msec, check_for_gpm) RealWaitForChar(
int fd UNUSED; /* always read from iochan */ int fd UNUSED, /* always read from iochan */
long msec; long msec,
int *check_for_gpm UNUSED; int *check_for_gpm UNUSED)
{ {
int status; int status;
struct _generic_64 time_curr; struct _generic_64 time_curr;

View File

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

View File

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

View File

@ -134,8 +134,7 @@ static void initmaster(int);
#endif #endif
static void static void
initmaster(f) initmaster(int f UNUSED)
int f UNUSED;
{ {
#ifndef VMS #ifndef VMS
# ifdef POSIX # ifdef POSIX
@ -156,8 +155,7 @@ initmaster(f)
* pty on others. Needs to be tuned... * pty on others. Needs to be tuned...
*/ */
int int
SetupSlavePTY(fd) SetupSlavePTY(int fd)
int fd;
{ {
if (fd < 0) if (fd < 0)
return 0; return 0;
@ -180,8 +178,7 @@ SetupSlavePTY(fd)
#if defined(OSX) && !defined(PTY_DONE) #if defined(OSX) && !defined(PTY_DONE)
#define PTY_DONE #define PTY_DONE
int int
OpenPTY(ttyn) OpenPTY(char **ttyn)
char **ttyn;
{ {
int f; int f;
static char TtyName[32]; 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. * Return -1 for error, number of errors for success.
*/ */
int int
qf_init(wp, efile, errorformat, newlist, qf_title) qf_init(
win_T *wp; win_T *wp,
char_u *efile; char_u *efile,
char_u *errorformat; char_u *errorformat,
int newlist; /* TRUE: start a new error list */ int newlist, /* TRUE: start a new error list */
char_u *qf_title; char_u *qf_title)
{ {
qf_info_T *qi = &ql_info; 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. * Return -1 for error, number of errors for success.
*/ */
static int static int
qf_init_ext(qi, efile, buf, tv, errorformat, newlist, lnumfirst, lnumlast, qf_init_ext(
qf_title) qf_info_T *qi,
qf_info_T *qi; char_u *efile,
char_u *efile; buf_T *buf,
buf_T *buf; typval_T *tv,
typval_T *tv; char_u *errorformat,
char_u *errorformat; int newlist, /* TRUE: start a new error list */
int newlist; /* TRUE: start a new error list */ linenr_T lnumfirst, /* first line number to use */
linenr_T lnumfirst; /* first line number to use */ linenr_T lnumlast, /* last line number to use */
linenr_T lnumlast; /* last line number to use */ char_u *qf_title)
char_u *qf_title;
{ {
char_u *namebuf; char_u *namebuf;
char_u *errmsg; char_u *errmsg;
@ -887,9 +886,7 @@ qf_init_end:
} }
static void static void
qf_store_title(qi, title) qf_store_title(qf_info_T *qi, char_u *title)
qf_info_T *qi;
char_u *title;
{ {
if (title != NULL) if (title != NULL)
{ {
@ -905,9 +902,7 @@ qf_store_title(qi, title)
* Prepare for adding a new quickfix list. * Prepare for adding a new quickfix list.
*/ */
static void static void
qf_new_list(qi, qf_title) qf_new_list(qf_info_T *qi, char_u *qf_title)
qf_info_T *qi;
char_u *qf_title;
{ {
int i; int i;
@ -940,8 +935,7 @@ qf_new_list(qi, qf_title)
* Free a location list * Free a location list
*/ */
static void static void
ll_free_all(pqi) ll_free_all(qf_info_T **pqi)
qf_info_T **pqi;
{ {
int i; int i;
qf_info_T *qi; qf_info_T *qi;
@ -962,8 +956,7 @@ ll_free_all(pqi)
} }
void void
qf_free_all(wp) qf_free_all(win_T *wp)
win_T *wp;
{ {
int i; int i;
qf_info_T *qi = &ql_info; qf_info_T *qi = &ql_info;
@ -985,21 +978,20 @@ qf_free_all(wp)
* Returns OK or FAIL. * Returns OK or FAIL.
*/ */
static int static int
qf_add_entry(qi, prevp, dir, fname, bufnum, mesg, lnum, col, vis_col, pattern, qf_add_entry(
nr, type, valid) qf_info_T *qi, /* quickfix list */
qf_info_T *qi; /* quickfix list */ qfline_T **prevp, /* pointer to previously added entry or NULL */
qfline_T **prevp; /* pointer to previously added entry or NULL */ char_u *dir, /* optional directory name */
char_u *dir; /* optional directory name */ char_u *fname, /* file name or NULL */
char_u *fname; /* file name or NULL */ int bufnum, /* buffer number or zero */
int bufnum; /* buffer number or zero */ char_u *mesg, /* message */
char_u *mesg; /* message */ long lnum, /* line number */
long lnum; /* line number */ int col, /* column */
int col; /* column */ int vis_col, /* using visual column */
int vis_col; /* using visual column */ char_u *pattern, /* search pattern */
char_u *pattern; /* search pattern */ int nr, /* error number */
int nr; /* error number */ int type, /* type character */
int type; /* type character */ int valid) /* valid entry */
int valid; /* valid entry */
{ {
qfline_T *qfp; 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 * Allocate a new location list
*/ */
static qf_info_T * static qf_info_T *
ll_new_list() ll_new_list(void)
{ {
qf_info_T *qi; qf_info_T *qi;
@ -1080,8 +1072,7 @@ ll_new_list()
* If not present, allocate a location list * If not present, allocate a location list
*/ */
static qf_info_T * static qf_info_T *
ll_get_or_alloc_list(wp) ll_get_or_alloc_list(win_T *wp)
win_T *wp;
{ {
if (IS_LL_WINDOW(wp)) if (IS_LL_WINDOW(wp))
/* For a location list window, use the referenced location list */ /* 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". * Copy the location list from window "from" to window "to".
*/ */
void void
copy_loclist(from, to) copy_loclist(win_T *from, win_T *to)
win_T *from;
win_T *to;
{ {
qf_info_T *qi; qf_info_T *qi;
int idx; int idx;
@ -1206,9 +1195,7 @@ copy_loclist(from, to)
* get buffer number for file "dir.name" * get buffer number for file "dir.name"
*/ */
static int static int
qf_get_fnum(directory, fname) qf_get_fnum(char_u *directory, char_u *fname)
char_u *directory;
char_u *fname;
{ {
if (fname == NULL || *fname == NUL) /* no file name */ if (fname == NULL || *fname == NUL) /* no file name */
return 0; return 0;
@ -1256,9 +1243,7 @@ qf_get_fnum(directory, fname)
* NULL on error * NULL on error
*/ */
static char_u * static char_u *
qf_push_dir(dirbuf, stackptr) qf_push_dir(char_u *dirbuf, struct dir_stack_T **stackptr)
char_u *dirbuf;
struct dir_stack_T **stackptr;
{ {
struct dir_stack_T *ds_new; struct dir_stack_T *ds_new;
struct dir_stack_T *ds_ptr; struct dir_stack_T *ds_ptr;
@ -1329,8 +1314,7 @@ qf_push_dir(dirbuf, stackptr)
* stack is empty * stack is empty
*/ */
static char_u * static char_u *
qf_pop_dir(stackptr) qf_pop_dir(struct dir_stack_T **stackptr)
struct dir_stack_T **stackptr;
{ {
struct dir_stack_T *ds_ptr; struct dir_stack_T *ds_ptr;
@ -1354,8 +1338,7 @@ qf_pop_dir(stackptr)
* clean up directory stack * clean up directory stack
*/ */
static void static void
qf_clean_dir_stack(stackptr) qf_clean_dir_stack(struct dir_stack_T **stackptr)
struct dir_stack_T **stackptr;
{ {
struct dir_stack_T *ds_ptr; struct dir_stack_T *ds_ptr;
@ -1388,8 +1371,7 @@ qf_clean_dir_stack(stackptr)
* qf_guess_filepath will return NULL. * qf_guess_filepath will return NULL.
*/ */
static char_u * static char_u *
qf_guess_filepath(filename) qf_guess_filepath(char_u *filename)
char_u *filename;
{ {
struct dir_stack_T *ds_ptr; struct dir_stack_T *ds_ptr;
struct dir_stack_T *ds_tmp; struct dir_stack_T *ds_tmp;
@ -1440,11 +1422,11 @@ qf_guess_filepath(filename)
* else go to entry "errornr" * else go to entry "errornr"
*/ */
void void
qf_jump(qi, dir, errornr, forceit) qf_jump(
qf_info_T *qi; qf_info_T *qi,
int dir; int dir,
int errornr; int errornr,
int forceit; int forceit)
{ {
qf_info_T *ll_ref; qf_info_T *ll_ref;
qfline_T *qf_ptr; qfline_T *qf_ptr;
@ -1954,8 +1936,7 @@ theend:
* ":llist": list all locations * ":llist": list all locations
*/ */
void void
qf_list(eap) qf_list(exarg_T *eap)
exarg_T *eap;
{ {
buf_T *buf; buf_T *buf;
char_u *fname; char_u *fname;
@ -2060,10 +2041,7 @@ qf_list(eap)
* Put the result in "buf[bufsize]". * Put the result in "buf[bufsize]".
*/ */
static void static void
qf_fmt_text(text, buf, bufsize) qf_fmt_text(char_u *text, char_u *buf, int bufsize)
char_u *text;
char_u *buf;
int bufsize;
{ {
int i; int i;
char_u *p = text; char_u *p = text;
@ -2090,8 +2068,7 @@ qf_fmt_text(text, buf, bufsize)
* ":lnewer [count]": Down in the location list stack. * ":lnewer [count]": Down in the location list stack.
*/ */
void void
qf_age(eap) qf_age(exarg_T *eap)
exarg_T *eap;
{ {
qf_info_T *qi = &ql_info; qf_info_T *qi = &ql_info;
int count; int count;
@ -2135,8 +2112,7 @@ qf_age(eap)
} }
static void static void
qf_msg(qi) qf_msg(qf_info_T *qi)
qf_info_T *qi;
{ {
smsg((char_u *)_("error list %d of %d; %d errors"), smsg((char_u *)_("error list %d of %d; %d errors"),
qi->qf_curlist + 1, qi->qf_listcount, qi->qf_curlist + 1, qi->qf_listcount,
@ -2150,9 +2126,7 @@ qf_msg(qi)
* Free error list "idx". * Free error list "idx".
*/ */
static void static void
qf_free(qi, idx) qf_free(qf_info_T *qi, int idx)
qf_info_T *qi;
int idx;
{ {
qfline_T *qfp; qfline_T *qfp;
int stop = FALSE; int stop = FALSE;
@ -2184,12 +2158,12 @@ qf_free(qi, idx)
* qf_mark_adjust: adjust marks * qf_mark_adjust: adjust marks
*/ */
void void
qf_mark_adjust(wp, line1, line2, amount, amount_after) qf_mark_adjust(
win_T *wp; win_T *wp,
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;
qfline_T *qfp; qfline_T *qfp;
@ -2237,8 +2211,7 @@ qf_mark_adjust(wp, line1, line2, amount, amount_after)
* 1 x "" :helpgrep * 1 x "" :helpgrep
*/ */
static char_u * static char_u *
qf_types(c, nr) qf_types(int c, int nr)
int c, nr;
{ {
static char_u buf[20]; static char_u buf[20];
static char_u cc[3]; static char_u cc[3];
@ -2275,8 +2248,7 @@ qf_types(c, nr)
* close it if not. * close it if not.
*/ */
void void
ex_cwindow(eap) ex_cwindow(exarg_T *eap)
exarg_T *eap;
{ {
qf_info_T *qi = &ql_info; qf_info_T *qi = &ql_info;
win_T *win; win_T *win;
@ -2312,8 +2284,7 @@ ex_cwindow(eap)
* ":lclose": close the window showing the location list * ":lclose": close the window showing the location list
*/ */
void void
ex_cclose(eap) ex_cclose(exarg_T *eap)
exarg_T *eap;
{ {
win_T *win = NULL; win_T *win = NULL;
qf_info_T *qi = &ql_info; qf_info_T *qi = &ql_info;
@ -2336,8 +2307,7 @@ ex_cclose(eap)
* ":lopen": open a window that shows the location list. * ":lopen": open a window that shows the location list.
*/ */
void void
ex_copen(eap) ex_copen(exarg_T *eap)
exarg_T *eap;
{ {
qf_info_T *qi = &ql_info; qf_info_T *qi = &ql_info;
int height; int height;
@ -2470,8 +2440,7 @@ ex_copen(eap)
* window). * window).
*/ */
linenr_T linenr_T
qf_current_entry(wp) qf_current_entry(win_T *wp)
win_T *wp;
{ {
qf_info_T *qi = &ql_info; qf_info_T *qi = &ql_info;
@ -2487,9 +2456,9 @@ qf_current_entry(wp)
* Return TRUE if there is a quickfix window. * Return TRUE if there is a quickfix window.
*/ */
static int static int
qf_win_pos_update(qi, old_qf_index) qf_win_pos_update(
qf_info_T *qi; qf_info_T *qi,
int old_qf_index; /* previous qf_index or zero */ int old_qf_index) /* previous qf_index or zero */
{ {
win_T *win; win_T *win;
int qf_index = qi->qf_lists[qi->qf_curlist].qf_index; 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 * list buffer
*/ */
static int static int
is_qf_win(win, qi) is_qf_win(win_T *win, qf_info_T *qi)
win_T *win;
qf_info_T *qi;
{ {
/* /*
* A window displaying the quickfix buffer will have the w_llist_ref field * 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. * Searches in only the windows opened in the current tab.
*/ */
static win_T * static win_T *
qf_find_win(qi) qf_find_win(qf_info_T *qi)
qf_info_T *qi;
{ {
win_T *win; win_T *win;
@ -2573,8 +2539,7 @@ qf_find_win(qi)
* Searches in windows opened in all the tabs. * Searches in windows opened in all the tabs.
*/ */
static buf_T * static buf_T *
qf_find_buf(qi) qf_find_buf(qf_info_T *qi)
qf_info_T *qi;
{ {
tabpage_T *tp; tabpage_T *tp;
win_T *win; win_T *win;
@ -2590,8 +2555,7 @@ qf_find_buf(qi)
* Find the quickfix buffer. If it exists, update the contents. * Find the quickfix buffer. If it exists, update the contents.
*/ */
static void static void
qf_update_buffer(qi) qf_update_buffer(qf_info_T *qi)
qf_info_T *qi;
{ {
buf_T *buf; buf_T *buf;
win_T *win; win_T *win;
@ -2626,8 +2590,7 @@ qf_update_buffer(qi)
* Set "w:quickfix_title" if "qi" has a title. * Set "w:quickfix_title" if "qi" has a title.
*/ */
static void static void
qf_set_title_var(qi) qf_set_title_var(qf_info_T *qi)
qf_info_T *qi;
{ {
if (qi->qf_lists[qi->qf_curlist].qf_title != NULL) if (qi->qf_lists[qi->qf_curlist].qf_title != NULL)
set_internal_string_var((char_u *)"w:quickfix_title", set_internal_string_var((char_u *)"w:quickfix_title",
@ -2639,8 +2602,7 @@ qf_set_title_var(qi)
* curbuf must be the quickfix buffer! * curbuf must be the quickfix buffer!
*/ */
static void static void
qf_fill_buffer(qi) qf_fill_buffer(qf_info_T *qi)
qf_info_T *qi;
{ {
linenr_T lnum; linenr_T lnum;
qfline_T *qfp; qfline_T *qfp;
@ -2742,8 +2704,7 @@ qf_fill_buffer(qi)
* Return TRUE if "buf" is the quickfix buffer. * Return TRUE if "buf" is the quickfix buffer.
*/ */
int int
bt_quickfix(buf) bt_quickfix(buf_T *buf)
buf_T *buf;
{ {
return buf != NULL && buf->b_p_bt[0] == 'q'; 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. * This means the buffer name is not a file name.
*/ */
int int
bt_nofile(buf) bt_nofile(buf_T *buf)
buf_T *buf;
{ {
return buf != NULL && ((buf->b_p_bt[0] == 'n' && buf->b_p_bt[2] == 'f') return buf != NULL && ((buf->b_p_bt[0] == 'n' && buf->b_p_bt[2] == 'f')
|| buf->b_p_bt[0] == 'a'); || buf->b_p_bt[0] == 'a');
@ -2764,15 +2724,13 @@ bt_nofile(buf)
* Return TRUE if "buf" is a "nowrite" or "nofile" buffer. * Return TRUE if "buf" is a "nowrite" or "nofile" buffer.
*/ */
int int
bt_dontwrite(buf) bt_dontwrite(buf_T *buf)
buf_T *buf;
{ {
return buf != NULL && buf->b_p_bt[0] == 'n'; return buf != NULL && buf->b_p_bt[0] == 'n';
} }
int int
bt_dontwrite_msg(buf) bt_dontwrite_msg(buf_T *buf)
buf_T *buf;
{ {
if (bt_dontwrite(buf)) if (bt_dontwrite(buf))
{ {
@ -2787,8 +2745,7 @@ bt_dontwrite_msg(buf)
* and 'bufhidden'. * and 'bufhidden'.
*/ */
int int
buf_hide(buf) buf_hide(buf_T *buf)
buf_T *buf;
{ {
/* 'bufhidden' overrules 'hidden' and ":hide", check it first */ /* 'bufhidden' overrules 'hidden' and ":hide", check it first */
switch (buf->b_p_bh[0]) switch (buf->b_p_bh[0])
@ -2805,8 +2762,7 @@ buf_hide(buf)
* Return TRUE when using ":vimgrep" for ":grep". * Return TRUE when using ":vimgrep" for ":grep".
*/ */
int int
grep_internal(cmdidx) grep_internal(cmdidx_T cmdidx)
cmdidx_T cmdidx;
{ {
return ((cmdidx == CMD_grep return ((cmdidx == CMD_grep
|| cmdidx == CMD_lgrep || cmdidx == CMD_lgrep
@ -2820,8 +2776,7 @@ grep_internal(cmdidx)
* Used for ":make", ":lmake", ":grep", ":lgrep", ":grepadd", and ":lgrepadd" * Used for ":make", ":lmake", ":grep", ":lgrep", ":grepadd", and ":lgrepadd"
*/ */
void void
ex_make(eap) ex_make(exarg_T *eap)
exarg_T *eap;
{ {
char_u *fname; char_u *fname;
char_u *cmd; char_u *cmd;
@ -2934,7 +2889,7 @@ ex_make(eap)
* Returns NULL for error. * Returns NULL for error.
*/ */
static char_u * static char_u *
get_mef_name() get_mef_name(void)
{ {
char_u *p; char_u *p;
char_u *name; char_u *name;
@ -2989,8 +2944,7 @@ get_mef_name()
* Returns the number of valid entries in the current quickfix/location list. * Returns the number of valid entries in the current quickfix/location list.
*/ */
int int
qf_get_size(eap) qf_get_size(exarg_T *eap)
exarg_T *eap;
{ {
qf_info_T *qi = &ql_info; qf_info_T *qi = &ql_info;
qfline_T *qfp; qfline_T *qfp;
@ -3030,8 +2984,7 @@ qf_get_size(eap)
* Returns 0 if there is an error. * Returns 0 if there is an error.
*/ */
int int
qf_get_cur_idx(eap) qf_get_cur_idx(exarg_T *eap)
exarg_T *eap;
{ {
qf_info_T *qi = &ql_info; 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. * entries). If no valid entries are in the list, then returns 1.
*/ */
int int
qf_get_cur_valid_idx(eap) qf_get_cur_valid_idx(exarg_T *eap)
exarg_T *eap;
{ {
qf_info_T *qi = &ql_info; qf_info_T *qi = &ql_info;
qf_list_T *qfl; 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. * For :cfdo and :lfdo returns the 'n'th valid file entry.
*/ */
static int static int
qf_get_nth_valid_entry(qi, n, fdo) qf_get_nth_valid_entry(qf_info_T *qi, int n, int fdo)
qf_info_T *qi;
int n;
int fdo;
{ {
qf_list_T *qfl = &qi->qf_lists[qi->qf_curlist]; qf_list_T *qfl = &qi->qf_lists[qi->qf_curlist];
qfline_T *qfp = qfl->qf_start; qfline_T *qfp = qfl->qf_start;
@ -3151,8 +3100,7 @@ qf_get_nth_valid_entry(qi, n, fdo)
* ":cdo", ":ldo", ":cfdo" and ":lfdo" * ":cdo", ":ldo", ":cfdo" and ":lfdo"
*/ */
void void
ex_cc(eap) ex_cc(exarg_T *eap)
exarg_T *eap;
{ {
qf_info_T *qi = &ql_info; qf_info_T *qi = &ql_info;
int errornr; int errornr;
@ -3203,8 +3151,7 @@ ex_cc(eap)
* Also, used by ":cdo", ":ldo", ":cfdo" and ":lfdo" commands. * Also, used by ":cdo", ":ldo", ":cfdo" and ":lfdo" commands.
*/ */
void void
ex_cnext(eap) ex_cnext(exarg_T *eap)
exarg_T *eap;
{ {
qf_info_T *qi = &ql_info; qf_info_T *qi = &ql_info;
int errornr; int errornr;
@ -3251,8 +3198,7 @@ ex_cnext(eap)
* ":lfile"/":lgetfile"/":laddfile" commands. * ":lfile"/":lgetfile"/":laddfile" commands.
*/ */
void void
ex_cfile(eap) ex_cfile(exarg_T *eap)
exarg_T *eap;
{ {
win_T *wp = NULL; win_T *wp = NULL;
qf_info_T *qi = &ql_info; qf_info_T *qi = &ql_info;
@ -3334,8 +3280,7 @@ ex_cfile(eap)
* ":lvimgrepadd {pattern} file(s)" * ":lvimgrepadd {pattern} file(s)"
*/ */
void void
ex_vimgrep(eap) ex_vimgrep(exarg_T *eap)
exarg_T *eap;
{ {
regmmatch_T regmatch; regmmatch_T regmatch;
int fcount; int fcount;
@ -3738,10 +3683,7 @@ theend:
* Return a pointer to the char just past the pattern plus flags. * Return a pointer to the char just past the pattern plus flags.
*/ */
char_u * char_u *
skip_vimgrep_pat(p, s, flags) skip_vimgrep_pat(char_u *p, char_u **s, int *flags)
char_u *p;
char_u **s;
int *flags;
{ {
int c; int c;
@ -3790,8 +3732,7 @@ skip_vimgrep_pat(p, s, flags)
* into account whether it is set locally or globally. * into account whether it is set locally or globally.
*/ */
static void static void
restore_start_dir(dirname_start) restore_start_dir(char_u *dirname_start)
char_u *dirname_start;
{ {
char_u *dirname_now = alloc(MAXPATHL); char_u *dirname_now = alloc(MAXPATHL);
@ -3825,10 +3766,10 @@ restore_start_dir(dirname_start)
* Returns NULL if it fails. * Returns NULL if it fails.
*/ */
static buf_T * static buf_T *
load_dummy_buffer(fname, dirname_start, resulting_dir) load_dummy_buffer(
char_u *fname; char_u *fname,
char_u *dirname_start; /* in: old directory */ char_u *dirname_start, /* in: old directory */
char_u *resulting_dir; /* out: new directory */ char_u *resulting_dir) /* out: new directory */
{ {
buf_T *newbuf; buf_T *newbuf;
buf_T *newbuf_to_wipe = NULL; buf_T *newbuf_to_wipe = NULL;
@ -3907,9 +3848,7 @@ load_dummy_buffer(fname, dirname_start, resulting_dir)
* 'autochdir' option have changed it. * 'autochdir' option have changed it.
*/ */
static void static void
wipe_dummy_buffer(buf, dirname_start) wipe_dummy_buffer(buf_T *buf, char_u *dirname_start)
buf_T *buf;
char_u *dirname_start;
{ {
if (curbuf != buf) /* safety check */ if (curbuf != buf) /* safety check */
{ {
@ -3940,9 +3879,7 @@ wipe_dummy_buffer(buf, dirname_start)
* 'autochdir' option have changed it. * 'autochdir' option have changed it.
*/ */
static void static void
unload_dummy_buffer(buf, dirname_start) unload_dummy_buffer(buf_T *buf, char_u *dirname_start)
buf_T *buf;
char_u *dirname_start;
{ {
if (curbuf != buf) /* safety check */ 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. * Add each quickfix error to list "list" as a dictionary.
*/ */
int int
get_errorlist(wp, list) get_errorlist(win_T *wp, list_T *list)
win_T *wp;
list_T *list;
{ {
qf_info_T *qi = &ql_info; qf_info_T *qi = &ql_info;
dict_T *dict; dict_T *dict;
@ -4018,11 +3953,11 @@ get_errorlist(wp, list)
* of dictionaries. "title" will be copied to w:quickfix_title * of dictionaries. "title" will be copied to w:quickfix_title
*/ */
int int
set_errorlist(wp, list, action, title) set_errorlist(
win_T *wp; win_T *wp,
list_T *list; list_T *list,
int action; int action,
char_u *title; char_u *title)
{ {
listitem_T *li; listitem_T *li;
dict_T *d; dict_T *d;
@ -4146,8 +4081,7 @@ set_errorlist(wp, list, action, title)
* ":[range]lgetbuffer [bufnr]" command. * ":[range]lgetbuffer [bufnr]" command.
*/ */
void void
ex_cbuffer(eap) ex_cbuffer(exarg_T *eap)
exarg_T *eap;
{ {
buf_T *buf = NULL; buf_T *buf = NULL;
qf_info_T *qi = &ql_info; qf_info_T *qi = &ql_info;
@ -4207,8 +4141,7 @@ ex_cbuffer(eap)
* ":lexpr {expr}", ":lgetexpr {expr}", ":laddexpr {expr}" command. * ":lexpr {expr}", ":lgetexpr {expr}", ":laddexpr {expr}" command.
*/ */
void void
ex_cexpr(eap) ex_cexpr(exarg_T *eap)
exarg_T *eap;
{ {
typval_T *tv; typval_T *tv;
qf_info_T *qi = &ql_info; qf_info_T *qi = &ql_info;
@ -4248,8 +4181,7 @@ ex_cexpr(eap)
* ":helpgrep {pattern}" * ":helpgrep {pattern}"
*/ */
void void
ex_helpgrep(eap) ex_helpgrep(exarg_T *eap)
exarg_T *eap;
{ {
regmatch_T regmatch; regmatch_T regmatch;
char_u *save_cpo; 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. * Return OK on success, FAIL otherwise.
*/ */
static int static int
nfa_regcomp_start(expr, re_flags) nfa_regcomp_start(
char_u *expr; char_u *expr,
int re_flags; /* see vim_regcomp() */ int re_flags) /* see vim_regcomp() */
{ {
size_t postfix_size; size_t postfix_size;
int nstate_max; int nstate_max;
@ -370,9 +370,7 @@ nfa_regcomp_start(expr, re_flags)
* of the line. * of the line.
*/ */
static int static int
nfa_get_reganch(start, depth) nfa_get_reganch(nfa_state_T *start, int depth)
nfa_state_T *start;
int depth;
{ {
nfa_state_T *p = start; nfa_state_T *p = start;
@ -434,9 +432,7 @@ nfa_get_reganch(start, depth)
* at start of the match. * at start of the match.
*/ */
static int static int
nfa_get_regstart(start, depth) nfa_get_regstart(nfa_state_T *start, int depth)
nfa_state_T *start;
int depth;
{ {
nfa_state_T *p = start; nfa_state_T *p = start;
@ -520,8 +516,7 @@ nfa_get_regstart(start, depth)
* regstart. Otherwise return NULL. * regstart. Otherwise return NULL.
*/ */
static char_u * static char_u *
nfa_get_match_text(start) nfa_get_match_text(nfa_state_T *start)
nfa_state_T *start;
{ {
nfa_state_T *p = start; nfa_state_T *p = start;
int len = 0; int len = 0;
@ -564,7 +559,7 @@ nfa_get_match_text(start)
* running above the estimated number of states. * running above the estimated number of states.
*/ */
static int static int
realloc_post_list() realloc_post_list(void)
{ {
int nstate_max = (int)(post_end - post_start); int nstate_max = (int)(post_end - post_start);
int new_max = nstate_max + 1000; int new_max = nstate_max + 1000;
@ -594,10 +589,7 @@ realloc_post_list()
* need to be interpreted as [a-zA-Z]. * need to be interpreted as [a-zA-Z].
*/ */
static int static int
nfa_recognize_char_class(start, end, extra_newl) nfa_recognize_char_class(char_u *start, char_u *end, int extra_newl)
char_u *start;
char_u *end;
int extra_newl;
{ {
# define CLASS_not 0x80 # define CLASS_not 0x80
# define CLASS_af 0x40 # 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() * NOTE! When changing this function, also update reg_equi_class()
*/ */
static int static int
nfa_emit_equi_class(c) nfa_emit_equi_class(int c)
int c;
{ {
#define EMIT2(c) EMIT(c); EMIT(NFA_CONCAT); #define EMIT2(c) EMIT(c); EMIT(NFA_CONCAT);
#ifdef FEAT_MBYTE #ifdef FEAT_MBYTE
@ -1118,7 +1109,7 @@ nfa_emit_equi_class(c)
* or \z( pattern \) * or \z( pattern \)
*/ */
static int static int
nfa_regatom() nfa_regatom(void)
{ {
int c; int c;
int charclass; int charclass;
@ -1890,7 +1881,7 @@ nfa_do_multibyte:
* or atom multi * or atom multi
*/ */
static int static int
nfa_regpiece() nfa_regpiece(void)
{ {
int i; int i;
int op; int op;
@ -2100,7 +2091,7 @@ nfa_regpiece()
* etc. * etc.
*/ */
static int static int
nfa_regconcat() nfa_regconcat(void)
{ {
int cont = TRUE; int cont = TRUE;
int first = TRUE; int first = TRUE;
@ -2178,7 +2169,7 @@ nfa_regconcat()
* etc. * etc.
*/ */
static int static int
nfa_regbranch() nfa_regbranch(void)
{ {
int ch; int ch;
int old_post_pos; int old_post_pos;
@ -2225,8 +2216,8 @@ nfa_regbranch()
* etc. * etc.
*/ */
static int static int
nfa_reg(paren) nfa_reg(
int paren; /* REG_NOPAREN, REG_PAREN, REG_NPAREN or REG_ZPAREN */ int paren) /* REG_NOPAREN, REG_PAREN, REG_NPAREN or REG_ZPAREN */
{ {
int parno = 0; int parno = 0;
@ -2293,8 +2284,7 @@ nfa_reg(paren)
static char_u code[50]; static char_u code[50];
static void static void
nfa_set_code(c) nfa_set_code(int c)
int c;
{ {
int addnl = FALSE; int addnl = FALSE;
@ -2530,9 +2520,7 @@ static FILE *log_fd;
* Print the postfix notation of the current regexp. * Print the postfix notation of the current regexp.
*/ */
static void static void
nfa_postfix_dump(expr, retval) nfa_postfix_dump(char_u *expr, int retval)
char_u *expr;
int retval;
{ {
int *p; int *p;
FILE *f; FILE *f;
@ -2563,9 +2551,7 @@ nfa_postfix_dump(expr, retval)
* Print the NFA starting with a root node "state". * Print the NFA starting with a root node "state".
*/ */
static void static void
nfa_print_state(debugf, state) nfa_print_state(FILE *debugf, nfa_state_T *state)
FILE *debugf;
nfa_state_T *state;
{ {
garray_T indent; garray_T indent;
@ -2576,10 +2562,7 @@ nfa_print_state(debugf, state)
} }
static void static void
nfa_print_state2(debugf, state, indent) nfa_print_state2(FILE *debugf, nfa_state_T *state, garray_T *indent)
FILE *debugf;
nfa_state_T *state;
garray_T *indent;
{ {
char_u *p; char_u *p;
@ -2640,8 +2623,7 @@ nfa_print_state2(debugf, state, indent)
* Print the NFA state machine. * Print the NFA state machine.
*/ */
static void static void
nfa_dump(prog) nfa_dump(nfa_regprog_T *prog)
nfa_regprog_T *prog;
{ {
FILE *debugf = fopen(NFA_REGEXP_DUMP_LOG, "a"); FILE *debugf = fopen(NFA_REGEXP_DUMP_LOG, "a");
@ -2668,7 +2650,7 @@ nfa_dump(prog)
* Return the postfix string on success, NULL otherwise. * Return the postfix string on success, NULL otherwise.
*/ */
static int * static int *
re2post() re2post(void)
{ {
if (nfa_reg(REG_NOPAREN) == FAIL) if (nfa_reg(REG_NOPAREN) == FAIL)
return NULL; return NULL;
@ -2691,10 +2673,7 @@ static nfa_state_T *state_ptr; /* points to nfa_prog->state */
* Allocate and initialize nfa_state_T. * Allocate and initialize nfa_state_T.
*/ */
static nfa_state_T * static nfa_state_T *
alloc_state(c, out, out1) alloc_state(int c, nfa_state_T *out, nfa_state_T *out1)
int c;
nfa_state_T *out;
nfa_state_T *out1;
{ {
nfa_state_T *s; 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. * Initialize a Frag_T struct and return it.
*/ */
static Frag_T static Frag_T
frag(start, out) frag(nfa_state_T *start, Ptrlist *out)
nfa_state_T *start;
Ptrlist *out;
{ {
Frag_T n; Frag_T n;
@ -2765,8 +2742,8 @@ frag(start, out)
* Create singleton list containing just outp. * Create singleton list containing just outp.
*/ */
static Ptrlist * static Ptrlist *
list1(outp) list1(
nfa_state_T **outp; nfa_state_T **outp)
{ {
Ptrlist *l; Ptrlist *l;
@ -2779,9 +2756,7 @@ list1(outp)
* Patch the list of states at out to point to start. * Patch the list of states at out to point to start.
*/ */
static void static void
patch(l, s) patch(Ptrlist *l, nfa_state_T *s)
Ptrlist *l;
nfa_state_T *s;
{ {
Ptrlist *next; Ptrlist *next;
@ -2797,9 +2772,7 @@ patch(l, s)
* Join the two lists l1 and l2, returning the combination. * Join the two lists l1 and l2, returning the combination.
*/ */
static Ptrlist * static Ptrlist *
append(l1, l2) append(Ptrlist *l1, Ptrlist *l2)
Ptrlist *l1;
Ptrlist *l2;
{ {
Ptrlist *oldl1; Ptrlist *oldl1;
@ -2816,10 +2789,7 @@ append(l1, l2)
static Frag_T empty; static Frag_T empty;
static void static void
st_error(postfix, end, p) st_error(int *postfix UNUSED, int *end UNUSED, int *p UNUSED)
int *postfix UNUSED;
int *end UNUSED;
int *p UNUSED;
{ {
#ifdef NFA_REGEXP_ERROR_LOG #ifdef NFA_REGEXP_ERROR_LOG
FILE *df; FILE *df;
@ -2868,10 +2838,7 @@ st_error(postfix, end, p)
* Push an item onto the stack. * Push an item onto the stack.
*/ */
static void static void
st_push(s, p, stack_end) st_push(Frag_T s, Frag_T **p, Frag_T *stack_end)
Frag_T s;
Frag_T **p;
Frag_T *stack_end;
{ {
Frag_T *stackp = *p; Frag_T *stackp = *p;
@ -2885,9 +2852,7 @@ st_push(s, p, stack_end)
* Pop an item from the stack. * Pop an item from the stack.
*/ */
static Frag_T static Frag_T
st_pop(p, stack) st_pop(Frag_T **p, Frag_T *stack)
Frag_T **p;
Frag_T *stack;
{ {
Frag_T *stackp; Frag_T *stackp;
@ -2903,9 +2868,7 @@ st_pop(p, stack)
* When unknown or unlimited return -1. * When unknown or unlimited return -1.
*/ */
static int static int
nfa_max_width(startstate, depth) nfa_max_width(nfa_state_T *startstate, int depth)
nfa_state_T *startstate;
int depth;
{ {
int l, r; int l, r;
nfa_state_T *state = startstate; nfa_state_T *state = startstate;
@ -3128,10 +3091,7 @@ nfa_max_width(startstate, depth)
* Return the NFA start state on success, NULL otherwise. * Return the NFA start state on success, NULL otherwise.
*/ */
static nfa_state_T * static nfa_state_T *
post2nfa(postfix, end, nfa_calc_size) post2nfa(int *postfix, int *end, int nfa_calc_size)
int *postfix;
int *end;
int nfa_calc_size;
{ {
int *p; int *p;
int mopen; int mopen;
@ -3667,8 +3627,7 @@ theend:
* After building the NFA program, inspect it to add optimization hints. * After building the NFA program, inspect it to add optimization hints.
*/ */
static void static void
nfa_postprocess(prog) nfa_postprocess(nfa_regprog_T *prog)
nfa_regprog_T *prog;
{ {
int i; int i;
int c; int c;
@ -3801,8 +3760,7 @@ static void log_subexpr(regsub_T *sub);
static char *pim_info(nfa_pim_T *pim); static char *pim_info(nfa_pim_T *pim);
static void static void
log_subsexpr(subs) log_subsexpr(regsubs_T *subs)
regsubs_T *subs;
{ {
log_subexpr(&subs->norm); log_subexpr(&subs->norm);
# ifdef FEAT_SYN_HL # ifdef FEAT_SYN_HL
@ -3812,8 +3770,7 @@ log_subsexpr(subs)
} }
static void static void
log_subexpr(sub) log_subexpr(regsub_T *sub)
regsub_T *sub;
{ {
int j; int j;
@ -3838,8 +3795,7 @@ log_subexpr(sub)
} }
static char * static char *
pim_info(pim) pim_info(nfa_pim_T *pim)
nfa_pim_T *pim;
{ {
static char buf[30]; 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". * Copy postponed invisible match info from "from" to "to".
*/ */
static void static void
copy_pim(to, from) copy_pim(nfa_pim_T *to, nfa_pim_T *from)
nfa_pim_T *to;
nfa_pim_T *from;
{ {
to->result = from->result; to->result = from->result;
to->state = from->state; to->state = from->state;
@ -3894,8 +3848,7 @@ copy_pim(to, from)
} }
static void static void
clear_sub(sub) clear_sub(regsub_T *sub)
regsub_T *sub;
{ {
if (REG_MULTI) if (REG_MULTI)
/* Use 0xff to set lnum to -1 */ /* Use 0xff to set lnum to -1 */
@ -3910,9 +3863,7 @@ clear_sub(sub)
* Copy the submatches from "from" to "to". * Copy the submatches from "from" to "to".
*/ */
static void static void
copy_sub(to, from) copy_sub(regsub_T *to, regsub_T *from)
regsub_T *to;
regsub_T *from;
{ {
to->in_use = from->in_use; to->in_use = from->in_use;
if (from->in_use > 0) if (from->in_use > 0)
@ -3933,9 +3884,7 @@ copy_sub(to, from)
* Like copy_sub() but exclude the main match. * Like copy_sub() but exclude the main match.
*/ */
static void static void
copy_sub_off(to, from) copy_sub_off(regsub_T *to, regsub_T *from)
regsub_T *to;
regsub_T *from;
{ {
if (to->in_use < from->in_use) if (to->in_use < from->in_use)
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. * Like copy_sub() but only do the end of the main match if \ze is present.
*/ */
static void static void
copy_ze_off(to, from) copy_ze_off(regsub_T *to, regsub_T *from)
regsub_T *to;
regsub_T *from;
{ {
if (nfa_has_zend) if (nfa_has_zend)
{ {
@ -3984,9 +3931,7 @@ copy_ze_off(to, from)
* When using back-references also check the end position. * When using back-references also check the end position.
*/ */
static int static int
sub_equal(sub1, sub2) sub_equal(regsub_T *sub1, regsub_T *sub2)
regsub_T *sub1;
regsub_T *sub2;
{ {
int i; int i;
int todo; int todo;
@ -4093,11 +4038,11 @@ report_state(char *action,
* positions as "subs". * positions as "subs".
*/ */
static int static int
has_state_with_pos(l, state, subs, pim) has_state_with_pos(
nfa_list_T *l; /* runtime state list */ nfa_list_T *l, /* runtime state list */
nfa_state_T *state; /* state to update */ nfa_state_T *state, /* state to update */
regsubs_T *subs; /* pointers to subexpressions */ regsubs_T *subs, /* pointers to subexpressions */
nfa_pim_T *pim; /* postponed match or NULL */ nfa_pim_T *pim) /* postponed match or NULL */
{ {
nfa_thread_T *thread; nfa_thread_T *thread;
int i; int i;
@ -4122,9 +4067,7 @@ has_state_with_pos(l, state, subs, pim)
* set. * set.
*/ */
static int static int
pim_equal(one, two) pim_equal(nfa_pim_T *one, nfa_pim_T *two)
nfa_pim_T *one;
nfa_pim_T *two;
{ {
int one_unused = (one == NULL || one->result == NFA_PIM_UNUSED); int one_unused = (one == NULL || one->result == NFA_PIM_UNUSED);
int two_unused = (two == NULL || two->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. * Return TRUE if "state" leads to a NFA_MATCH without advancing the input.
*/ */
static int static int
match_follows(startstate, depth) match_follows(nfa_state_T *startstate, int depth)
nfa_state_T *startstate;
int depth;
{ {
nfa_state_T *state = startstate; nfa_state_T *state = startstate;
@ -4244,10 +4185,10 @@ match_follows(startstate, depth)
* Return TRUE if "state" is already in list "l". * Return TRUE if "state" is already in list "l".
*/ */
static int static int
state_in_list(l, state, subs) state_in_list(
nfa_list_T *l; /* runtime state list */ nfa_list_T *l, /* runtime state list */
nfa_state_T *state; /* state to update */ nfa_state_T *state, /* state to update */
regsubs_T *subs; /* pointers to subexpressions */ regsubs_T *subs) /* pointers to subexpressions */
{ {
if (state->lastlist[nfa_ll_index] == l->id) 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. * Returns "subs_arg", possibly copied into temp_subs.
*/ */
static regsubs_T * static regsubs_T *
addstate(l, state, subs_arg, pim, off) addstate(
nfa_list_T *l; /* runtime state list */ nfa_list_T *l, /* runtime state list */
nfa_state_T *state; /* state to update */ nfa_state_T *state, /* state to update */
regsubs_T *subs_arg; /* pointers to subexpressions */ regsubs_T *subs_arg, /* pointers to subexpressions */
nfa_pim_T *pim; /* postponed look-behind match */ nfa_pim_T *pim, /* postponed look-behind match */
int off; /* byte offset, when -1 go to next line */ int off) /* byte offset, when -1 go to next line */
{ {
int subidx; int subidx;
nfa_thread_T *thread; nfa_thread_T *thread;
@ -4678,12 +4619,12 @@ skip_add:
* matters for alternatives. * matters for alternatives.
*/ */
static void static void
addstate_here(l, state, subs, pim, ip) addstate_here(
nfa_list_T *l; /* runtime state list */ nfa_list_T *l, /* runtime state list */
nfa_state_T *state; /* state to update */ nfa_state_T *state, /* state to update */
regsubs_T *subs; /* pointers to subexpressions */ regsubs_T *subs, /* pointers to subexpressions */
nfa_pim_T *pim; /* postponed look-behind match */ nfa_pim_T *pim, /* postponed look-behind match */
int *ip; int *ip)
{ {
int tlen = l->n; int tlen = l->n;
int count; int count;
@ -4749,9 +4690,7 @@ addstate_here(l, state, subs, pim, ip)
* Check character class "class" against current character c. * Check character class "class" against current character c.
*/ */
static int static int
check_char_class(class, c) check_char_class(int class, int c)
int class;
int c;
{ {
switch (class) switch (class)
{ {
@ -4833,10 +4772,10 @@ check_char_class(class, c)
* Return TRUE if it matches. * Return TRUE if it matches.
*/ */
static int static int
match_backref(sub, subidx, bytelen) match_backref(
regsub_T *sub; /* pointers to subexpressions */ regsub_T *sub, /* pointers to subexpressions */
int subidx; int subidx,
int *bytelen; /* out: length of match in bytes */ int *bytelen) /* out: length of match in bytes */
{ {
int len; int len;
@ -4900,9 +4839,9 @@ static int match_zref(int subidx, int *bytelen);
* Return TRUE if it matches. * Return TRUE if it matches.
*/ */
static int static int
match_zref(subidx, bytelen) match_zref(
int subidx; int subidx,
int *bytelen; /* out: length of match in bytes */ int *bytelen) /* out: length of match in bytes */
{ {
int len; int len;
@ -4930,9 +4869,7 @@ match_zref(subidx, bytelen)
* Only used for the recursive value lastlist[1]. * Only used for the recursive value lastlist[1].
*/ */
static void static void
nfa_save_listids(prog, list) nfa_save_listids(nfa_regprog_T *prog, int *list)
nfa_regprog_T *prog;
int *list;
{ {
int i; int i;
nfa_state_T *p; nfa_state_T *p;
@ -4951,9 +4888,7 @@ nfa_save_listids(prog, list)
* Restore list IDs from "list" to all NFA states. * Restore list IDs from "list" to all NFA states.
*/ */
static void static void
nfa_restore_listids(prog, list) nfa_restore_listids(nfa_regprog_T *prog, int *list)
nfa_regprog_T *prog;
int *list;
{ {
int i; int i;
nfa_state_T *p; nfa_state_T *p;
@ -4967,10 +4902,7 @@ nfa_restore_listids(prog, list)
} }
static int static int
nfa_re_num_cmp(val, op, pos) nfa_re_num_cmp(long_u val, int op, long_u pos)
long_u val;
int op;
long_u pos;
{ {
if (op == 1) return pos > val; if (op == 1) return pos > val;
if (op == 2) 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). * position).
*/ */
static int static int
recursive_regmatch(state, pim, prog, submatch, m, listids) recursive_regmatch(
nfa_state_T *state; nfa_state_T *state,
nfa_pim_T *pim; nfa_pim_T *pim,
nfa_regprog_T *prog; nfa_regprog_T *prog,
regsubs_T *submatch; regsubs_T *submatch,
regsubs_T *m; regsubs_T *m,
int **listids; int **listids)
{ {
int save_reginput_col = (int)(reginput - regline); int save_reginput_col = (int)(reginput - regline);
int save_reglnum = reglnum; 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 * specific character: 99
*/ */
static int static int
failure_chance(state, depth) failure_chance(nfa_state_T *state, int depth)
nfa_state_T *state;
int depth;
{ {
int c = state->c; int c = state->c;
int l, r; int l, r;
@ -5330,9 +5260,7 @@ failure_chance(state, depth)
* Skip until the char "c" we know a match must start with. * Skip until the char "c" we know a match must start with.
*/ */
static int static int
skip_to_start(c, colp) skip_to_start(int c, colnr_T *colp)
int c;
colnr_T *colp;
{ {
char_u *s; char_u *s;
@ -5357,10 +5285,7 @@ skip_to_start(c, colp)
* Returns zero for no match, 1 for a match. * Returns zero for no match, 1 for a match.
*/ */
static long static long
find_match_text(startcol, regstart, match_text) find_match_text(colnr_T startcol, int regstart, char_u *match_text)
colnr_T startcol;
int regstart;
char_u *match_text;
{ {
colnr_T col = startcol; colnr_T col = startcol;
int c1, c2; int c1, c2;
@ -5426,11 +5351,11 @@ find_match_text(startcol, regstart, match_text)
* Note: Caller must ensure that: start != NULL. * Note: Caller must ensure that: start != NULL.
*/ */
static int static int
nfa_regmatch(prog, start, submatch, m) nfa_regmatch(
nfa_regprog_T *prog; nfa_regprog_T *prog,
nfa_state_T *start; nfa_state_T *start,
regsubs_T *submatch; regsubs_T *submatch,
regsubs_T *m; regsubs_T *m)
{ {
int result; int result;
size_t size = 0; size_t size = 0;
@ -6847,10 +6772,10 @@ theend:
* Returns <= 0 for failure, number of lines contained in the match otherwise. * Returns <= 0 for failure, number of lines contained in the match otherwise.
*/ */
static long static long
nfa_regtry(prog, col, tm) nfa_regtry(
nfa_regprog_T *prog; nfa_regprog_T *prog,
colnr_T col; colnr_T col,
proftime_T *tm UNUSED; /* timeout limit or NULL */ proftime_T *tm UNUSED) /* timeout limit or NULL */
{ {
int i; int i;
regsubs_T subs, m; 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. * Returns <= 0 for failure, number of lines contained in the match otherwise.
*/ */
static long static long
nfa_regexec_both(line, startcol, tm) nfa_regexec_both(
char_u *line; char_u *line,
colnr_T startcol; /* column to start looking for match */ colnr_T startcol, /* column to start looking for match */
proftime_T *tm; /* timeout limit or NULL */ proftime_T *tm) /* timeout limit or NULL */
{ {
nfa_regprog_T *prog; nfa_regprog_T *prog;
long retval = 0L; long retval = 0L;
@ -7096,9 +7021,7 @@ theend:
* Returns the program in allocated space. Returns NULL for an error. * Returns the program in allocated space. Returns NULL for an error.
*/ */
static regprog_T * static regprog_T *
nfa_regcomp(expr, re_flags) nfa_regcomp(char_u *expr, int re_flags)
char_u *expr;
int re_flags;
{ {
nfa_regprog_T *prog = NULL; nfa_regprog_T *prog = NULL;
size_t prog_size; size_t prog_size;
@ -7208,8 +7131,7 @@ fail:
* Free a compiled regexp program, returned by nfa_regcomp(). * Free a compiled regexp program, returned by nfa_regcomp().
*/ */
static void static void
nfa_regfree(prog) nfa_regfree(regprog_T *prog)
regprog_T *prog;
{ {
if (prog != NULL) if (prog != NULL)
{ {
@ -7228,11 +7150,11 @@ nfa_regfree(prog)
* Returns <= 0 for failure, number of lines contained in the match otherwise. * Returns <= 0 for failure, number of lines contained in the match otherwise.
*/ */
static int static int
nfa_regexec_nl(rmp, line, col, line_lbr) nfa_regexec_nl(
regmatch_T *rmp; regmatch_T *rmp,
char_u *line; /* string to match against */ char_u *line, /* string to match against */
colnr_T col; /* column to start looking for match */ colnr_T col, /* column to start looking for match */
int line_lbr; int line_lbr)
{ {
reg_match = rmp; reg_match = rmp;
reg_mmatch = NULL; reg_mmatch = NULL;
@ -7275,13 +7197,13 @@ nfa_regexec_nl(rmp, line, col, line_lbr)
* FIXME if this behavior is not compatible. * FIXME if this behavior is not compatible.
*/ */
static long static long
nfa_regexec_multi(rmp, win, buf, lnum, col, tm) nfa_regexec_multi(
regmmatch_T *rmp; regmmatch_T *rmp,
win_T *win; /* window in which to search or NULL */ win_T *win, /* window in which to search or NULL */
buf_T *buf; /* buffer in which to search */ buf_T *buf, /* buffer in which to search */
linenr_T lnum; /* nr of line to start looking for match */ linenr_T lnum, /* nr of line to start looking for match */
colnr_T col; /* column to start looking for match */ colnr_T col, /* column to start looking for match */
proftime_T *tm; /* timeout limit or NULL */ proftime_T *tm) /* timeout limit or NULL */
{ {
reg_match = NULL; reg_match = NULL;
reg_mmatch = rmp; 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[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
1213,
/**/ /**/
1212, 1212,
/**/ /**/