summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-01-30 20:31:25 +0100
committerBram Moolenaar <Bram@vim.org>2016-01-30 20:31:25 +0100
commit055409764ca5f7978d4c399d2c440af0ce971c4f (patch)
treed3f9b0d26c4e371720910e462e2ec918e19d5792
parentc1ab67674aa0dfdcf9f0e9701ac248e3eb41b19c (diff)
patch 7.4.1213v7.4.1213
Problem: Using old style function declarations. Solution: Change to new style function declarations. (script by Hirohito Higashi)
-rw-r--r--src/os_amiga.c171
-rw-r--r--src/os_mac_conv.c93
-rw-r--r--src/os_mswin.c49
-rw-r--r--src/os_qnx.c4
-rw-r--r--src/os_unix.c426
-rw-r--r--src/os_vms.c8
-rw-r--r--src/os_win16.c8
-rw-r--r--src/os_win32.c4
-rw-r--r--src/popupmnu.c22
-rw-r--r--src/pty.c9
-rw-r--r--src/quickfix.c278
-rw-r--r--src/regexp.c423
-rw-r--r--src/regexp_nfa.c304
-rw-r--r--src/screen.c473
-rw-r--r--src/version.c2
15 files changed, 911 insertions, 1363 deletions
diff --git a/src/os_amiga.c b/src/os_amiga.c
index 4e95455847..13610306e9 100644
--- a/src/os_amiga.c
+++ b/src/os_amiga.c
@@ -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)
diff --git a/src/os_mac_conv.c b/src/os_mac_conv.c
index d14ce365d9..9d8a6cfdfc 100644
--- a/src/os_mac_conv.c
+++ b/src/os_mac_conv.c
@@ -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];
diff --git a/src/os_mswin.c b/src/os_mswin.c
index 16268920e3..b7e3b5e5ec 100644
--- a/src/os_mswin.c
+++ b/src/os_mswin.c
@@ -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;
diff --git a/src/os_qnx.c b/src/os_qnx.c
index a8f12fa878..a156c06a21 100644
--- a/src/os_qnx.c
+++ b/src/os_qnx.c
@@ -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);
diff --git a/src/os_unix.c b/src/os_unix.c
index 59aeddb362..8d10b14dcb 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -342,8 +342,7 @@ static struct signalinfo
};
int
-mch_chdir(path)
- char *path;
+mch_chdir(char *path)
{
if (p_verbose >= 5)
{
@@ -362,9 +361,7 @@ mch_chdir(path)
* Write s[len] to the screen.
*/
void
-mch_write(s, len)
- char_u *s;
- int len;
+mch_write(char_u *s, int len)
{
ignored = (int)write(1, (char *)s, len);
if (p_wd) /* Unix is too fast, slow down a bit more */
@@ -380,11 +377,11 @@ mch_write(s, len)
* If wtime == -1 wait forever for characters.
*/
int
-mch_inchar(buf, maxlen, wtime, tb_change_cnt)
- char_u *buf;
- int maxlen;
- long wtime; /* don't use "time", MIPS cannot handle it */
- int tb_change_cnt;
+mch_inchar(
+ char_u *buf,
+ int maxlen,
+ long wtime, /* don't use "time", MIPS cannot handle it */
+ int tb_change_cnt)
{
int len;
@@ -477,7 +474,7 @@ mch_inchar(buf, maxlen, wtime, tb_change_cnt)
}
static void
-handle_resize()
+handle_resize(void)
{
do_resize = FALSE;
shell_resized();
@@ -487,7 +484,7 @@ handle_resize()
* return non-zero if a character is available
*/
int
-mch_char_avail()
+mch_char_avail(void)
{
return WaitForChar(0L);
}
@@ -508,8 +505,7 @@ mch_char_avail()
* Doesn't change when memory has been allocated.
*/
long_u
-mch_total_mem(special)
- int special UNUSED;
+mch_total_mem(int special UNUSED)
{
# ifdef __EMX__
return ulimit(3, 0L) >> 10; /* always 32MB? */
@@ -601,9 +597,7 @@ mch_total_mem(special)
#endif
void
-mch_delay(msec, ignoreinput)
- long msec;
- int ignoreinput;
+mch_delay(long msec, int ignoreinput)
{
int old_tmode;
#ifdef FEAT_MZSCHEME
@@ -704,8 +698,7 @@ static int stack_grows_downwards;
* "p" points to a variable on the stack of the caller.
*/
static void
-check_stack_growth(p)
- char *p;
+check_stack_growth(char *p)
{
int i;
@@ -727,7 +720,7 @@ static char *stack_limit = NULL;
* deathtrap().
*/
static void
-get_stack_limit()
+get_stack_limit(void)
{
struct rlimit rlp;
int i;
@@ -781,8 +774,7 @@ get_stack_limit()
* "p" must point to any variable local to the caller that's on the stack.
*/
int
-mch_stackcheck(p)
- char *p;
+mch_stackcheck(char *p)
{
if (stack_limit != NULL)
{
@@ -824,7 +816,7 @@ static void init_signal_stack(void);
static char *signal_stack;
static void
-init_signal_stack()
+init_signal_stack(void)
{
if (signal_stack != NULL)
{
@@ -936,7 +928,7 @@ sig_alarm SIGDEFARG(sigarg)
* problem and LONGJMP() was used.
*/
void
-mch_startjmp()
+mch_startjmp(void)
{
#ifdef SIGHASARG
lc_signal = 0;
@@ -945,13 +937,13 @@ mch_startjmp()
}
void
-mch_endjmp()
+mch_endjmp(void)
{
lc_active = FALSE;
}
void
-mch_didjmp()
+mch_didjmp(void)
{
# if defined(HAVE_SIGALTSTACK) || defined(HAVE_SIGSTACK)
/* On FreeBSD the signal stack has to be reset after using siglongjmp(),
@@ -1166,7 +1158,7 @@ static void *clip_plus_save = NULL;
* other applications will hang. But first copy the text to cut buffer 0.
*/
static void
-loose_clipboard()
+loose_clipboard(void)
{
if (clip_star.owned || clip_plus.owned)
{
@@ -1185,7 +1177,7 @@ loose_clipboard()
* Save clipboard text to restore later.
*/
static void
-save_clipboard()
+save_clipboard(void)
{
if (clip_star.owned)
clip_star_save = get_register('*', TRUE);
@@ -1197,7 +1189,7 @@ save_clipboard()
* Restore clipboard text if no one own the X selection.
*/
static void
-restore_clipboard()
+restore_clipboard(void)
{
if (clip_star_save != NULL)
{
@@ -1224,7 +1216,7 @@ restore_clipboard()
* otherwise fake it by starting a new shell.
*/
void
-mch_suspend()
+mch_suspend(void)
{
/* BeOS does have SIGTSTP, but it doesn't work. */
#if defined(SIGTSTP) && !defined(__BEOS__)
@@ -1276,7 +1268,7 @@ mch_suspend()
}
void
-mch_init()
+mch_init(void)
{
Columns = 80;
Rows = 24;
@@ -1293,7 +1285,7 @@ mch_init()
}
static void
-set_signals()
+set_signals(void)
{
#if defined(SIGWINCH)
/*
@@ -1358,14 +1350,14 @@ set_signals()
* Catch CTRL-C (only works while in Cooked mode).
*/
static void
-catch_int_signal()
+catch_int_signal(void)
{
signal(SIGINT, (RETSIGTYPE (*)())catch_sigint);
}
#endif
void
-reset_signals()
+reset_signals(void)
{
catch_signals(SIG_DFL, SIG_DFL);
#if defined(_REENTRANT) && defined(SIGCONT)
@@ -1375,9 +1367,9 @@ reset_signals()
}
static void
-catch_signals(func_deadly, func_other)
- RETSIGTYPE (*func_deadly)();
- RETSIGTYPE (*func_other)();
+catch_signals(
+ RETSIGTYPE (*func_deadly)(),
+ RETSIGTYPE (*func_other)())
{
int i;
@@ -1429,8 +1421,7 @@ catch_signals(func_deadly, func_other)
* Returns TRUE when Vim should exit.
*/
int
-vim_handle_signal(sig)
- int sig;
+vim_handle_signal(int sig)
{
static int got_signal = 0;
static int blocked = TRUE;
@@ -1464,9 +1455,7 @@ vim_handle_signal(sig)
* Check_win checks whether we have an interactive stdout.
*/
int
-mch_check_win(argc, argv)
- int argc UNUSED;
- char **argv UNUSED;
+mch_check_win(int argc UNUSED, char **argv UNUSED)
{
if (isatty(1))
return OK;
@@ -1477,7 +1466,7 @@ mch_check_win(argc, argv)
* Return TRUE if the input comes from a terminal, FALSE otherwise.
*/
int
-mch_input_isatty()
+mch_input_isatty(void)
{
if (isatty(read_cmd_fd))
return TRUE;
@@ -1495,8 +1484,8 @@ static void xopen_message(struct timeval *tvp);
* Give a message about the elapsed time for opening the X window.
*/
static void
-xopen_message(tvp)
- struct timeval *tvp; /* must contain start time */
+xopen_message(
+ struct timeval *tvp) /* must contain start time */
{
struct timeval end_tv;
@@ -1524,9 +1513,7 @@ static int got_x_error = FALSE;
* X Error handler, otherwise X just exits! (very rude) -- webb
*/
static int
-x_error_handler(dpy, error_event)
- Display *dpy;
- XErrorEvent *error_event;
+x_error_handler(Display *dpy, XErrorEvent *error_event)
{
XGetErrorText(dpy, error_event->error_code, (char *)IObuff, IOSIZE);
STRCAT(IObuff, _("\nVim: Got X error\n"));
@@ -1543,9 +1530,7 @@ x_error_handler(dpy, error_event)
* Another X Error handler, just used to check for errors.
*/
static int
-x_error_check(dpy, error_event)
- Display *dpy UNUSED;
- XErrorEvent *error_event UNUSED;
+x_error_check(Display *dpy UNUSED, XErrorEvent *error_event UNUSED)
{
got_x_error = TRUE;
return 0;
@@ -1559,8 +1544,7 @@ x_error_check(dpy, error_event)
static int x_IOerror_check(Display *dpy);
static int
-x_IOerror_check(dpy)
- Display *dpy UNUSED;
+x_IOerror_check(Display *dpy UNUSED)
{
/* This function should not return, it causes exit(). Longjump instead. */
LONGJMP(lc_jump_env, 1);
@@ -1578,8 +1562,7 @@ static void may_restore_clipboard(void);
static in