1
0
forked from aniani/vim

patch 7.4.1215

Problem:    Using old style function declarations.
Solution:   Change to new style function declarations. (script by Hirohito
            Higashi)
This commit is contained in:
Bram Moolenaar 2016-01-30 21:29:58 +01:00
parent 764b23c8fd
commit b638a7be95
9 changed files with 324 additions and 458 deletions

View File

@ -14,9 +14,7 @@
#define LINELEN 200 #define LINELEN 200
int int
main(argc, argv) main(int argc, char **argv)
int argc;
char **argv;
{ {
char line[LINELEN]; char line[LINELEN];
char *p1, *p2; char *p1, *p2;

View File

@ -94,12 +94,12 @@ static int got_x_error = FALSE;
*/ */
char * char *
sendToVim(dpy, name, cmd, asKeys, code) sendToVim(
Display *dpy; /* Where to send. */ Display *dpy, /* Where to send. */
char *name; /* Where to send. */ char *name, /* Where to send. */
char *cmd; /* What to send. */ char *cmd, /* What to send. */
int asKeys; /* Interpret as keystrokes or expr ? */ int asKeys, /* Interpret as keystrokes or expr ? */
int *code; /* Return code. 0 => OK */ int *code) /* Return code. 0 => OK */
{ {
Window w; Window w;
Atom *plist; Atom *plist;
@ -245,8 +245,7 @@ sendToVim(dpy, name, cmd, asKeys, code)
*/ */
static int static int
SendInit(dpy) SendInit(Display *dpy)
Display *dpy;
{ {
XErrorHandler old_handler; XErrorHandler old_handler;
@ -289,11 +288,11 @@ SendInit(dpy)
*/ */
static Window static Window
LookupName(dpy, name, delete, loose) LookupName(
Display *dpy; /* Display whose registry to check. */ Display *dpy, /* Display whose registry to check. */
char *name; /* Name of an interpreter. */ char *name, /* Name of an interpreter. */
int delete; /* If non-zero, delete info about name. */ int delete, /* If non-zero, delete info about name. */
char **loose; /* Do another search matching -999 if not found char **loose) /* Do another search matching -999 if not found
Return result here if a match is found */ Return result here if a match is found */
{ {
unsigned char *regProp, *entry; unsigned char *regProp, *entry;
@ -396,11 +395,11 @@ LookupName(dpy, name, delete, loose)
} }
static char * static char *
SendEventProc(dpy, eventPtr, expected, code) SendEventProc(
Display *dpy; Display *dpy,
XEvent *eventPtr; /* Information about event. */ XEvent *eventPtr, /* Information about event. */
int expected; /* The one were waiting for */ int expected, /* The one were waiting for */
int *code; /* Return code. 0 => OK */ int *code) /* Return code. 0 => OK */
{ {
unsigned char *propInfo; unsigned char *propInfo;
unsigned char *p; unsigned char *p;
@ -535,13 +534,13 @@ SendEventProc(dpy, eventPtr, expected, code)
*/ */
static int static int
AppendPropCarefully(dpy, window, property, value, length) AppendPropCarefully(
Display *dpy; /* Display on which to operate. */ Display *dpy, /* Display on which to operate. */
Window window; /* Window whose property is to Window window, /* Window whose property is to
* be modified. */ * be modified. */
Atom property; /* Name of property. */ Atom property, /* Name of property. */
char *value; /* Characters to append to property. */ char *value, /* Characters to append to property. */
int length; /* How much to append */ int length) /* How much to append */
{ {
XErrorHandler old_handler; XErrorHandler old_handler;
@ -560,9 +559,7 @@ AppendPropCarefully(dpy, window, property, value, length)
*/ */
/* ARGSUSED */ /* ARGSUSED */
static int static int
x_error_check(dpy, error_event) x_error_check(Display *dpy, XErrorEvent *error_event)
Display *dpy;
XErrorEvent *error_event;
{ {
got_x_error = TRUE; got_x_error = TRUE;
return 0; return 0;
@ -573,8 +570,7 @@ x_error_check(dpy, error_event)
* Actually just checks if the name ends in a digit. * Actually just checks if the name ends in a digit.
*/ */
static int static int
IsSerialName(str) IsSerialName(char *str)
char *str;
{ {
int len = strlen(str); int len = strlen(str);

View File

@ -7,9 +7,7 @@
#include <string.h> #include <string.h>
int int
main(argc, argv) main(int argc, char **argv);
int argc;
char **argv;
{ {
char buffer[BUFSIZ]; char buffer[BUFSIZ];
char *p; char *p;

View File

@ -36,7 +36,7 @@ char longVersion[sizeof(VIM_VERSION_LONG_DATE) + sizeof(__DATE__)
+ sizeof(__TIME__) + 3]; + sizeof(__TIME__) + 3];
void void
make_version() make_version(void)
{ {
/* /*
* Construct the long version string. Necessary because * Construct the long version string. Necessary because
@ -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 */
/**/
1215,
/**/ /**/
1214, 1214,
/**/ /**/
@ -3192,7 +3194,7 @@ static char *(extra_patches[]) =
}; };
int int
highest_patch() highest_patch(void)
{ {
int i; int i;
int h = 0; int h = 0;
@ -3208,8 +3210,7 @@ highest_patch()
* Return TRUE if patch "n" has been included. * Return TRUE if patch "n" has been included.
*/ */
int int
has_patch(n) has_patch(int n)
int n;
{ {
int i; int i;
@ -3221,8 +3222,7 @@ has_patch(n)
#endif #endif
void void
ex_version(eap) ex_version(exarg_T *eap)
exarg_T *eap;
{ {
/* /*
* Ignore a ":version 9.99" command. * Ignore a ":version 9.99" command.
@ -3238,7 +3238,7 @@ ex_version(eap)
* List all features aligned in columns, dictionary style. * List all features aligned in columns, dictionary style.
*/ */
static void static void
list_features() list_features(void)
{ {
int i; int i;
int ncol; int ncol;
@ -3305,7 +3305,7 @@ list_features()
} }
void void
list_version() list_version(void)
{ {
int i; int i;
int first; int first;
@ -3598,8 +3598,7 @@ list_version()
* newline, unless the message is too long to fit on the screen anyway. * newline, unless the message is too long to fit on the screen anyway.
*/ */
static void static void
version_msg(s) version_msg(char *s)
char *s;
{ {
int len = (int)STRLEN(s); int len = (int)STRLEN(s);
@ -3616,7 +3615,7 @@ static void do_intro_line(int row, char_u *mesg, int add_version, int attr);
* Show the intro message when not editing a file. * Show the intro message when not editing a file.
*/ */
void void
maybe_intro_message() maybe_intro_message(void)
{ {
if (bufempty() if (bufempty()
&& curbuf->b_fname == NULL && curbuf->b_fname == NULL
@ -3633,8 +3632,8 @@ maybe_intro_message()
* Or with the ":intro" command (for Sven :-). * Or with the ":intro" command (for Sven :-).
*/ */
void void
intro_message(colon) intro_message(
int colon; /* TRUE for ":intro" */ int colon) /* TRUE for ":intro" */
{ {
int i; int i;
int row; int row;
@ -3765,11 +3764,11 @@ intro_message(colon)
} }
static void static void
do_intro_line(row, mesg, add_version, attr) do_intro_line(
int row; int row,
char_u *mesg; char_u *mesg,
int add_version; int add_version,
int attr; int attr)
{ {
char_u vers[20]; char_u vers[20];
int col; int col;
@ -3842,8 +3841,7 @@ do_intro_line(row, mesg, add_version, attr)
* ":intro": clear screen, display intro screen and wait for return. * ":intro": clear screen, display intro screen and wait for return.
*/ */
void void
ex_intro(eap) ex_intro(exarg_T *eap UNUSED)
exarg_T *eap UNUSED;
{ {
screenclear(); screenclear();
intro_message(TRUE); intro_message(TRUE);

View File

@ -779,11 +779,11 @@ utf16_to_enc(short_u *str, int *lenp)
* The result is in allocated memory: "out[outlen]". With terminating NUL. * The result is in allocated memory: "out[outlen]". With terminating NUL.
*/ */
void void
acp_to_enc(str, str_size, out, outlen) acp_to_enc(
char_u *str; char_u *str,
int str_size; int str_size,
char_u **out; char_u **out,
int *outlen; int *outlen)
{ {
LPWSTR widestr; LPWSTR widestr;
@ -804,11 +804,11 @@ acp_to_enc(str, str_size, out, outlen)
* The result is in allocated memory: "out[outlen]". With terminating NUL. * The result is in allocated memory: "out[outlen]". With terminating NUL.
*/ */
void void
enc_to_acp(str, str_size, out, outlen) enc_to_acp(
char_u *str; char_u *str,
int str_size; int str_size,
char_u **out; char_u **out,
int *outlen; int *outlen)
{ {
LPWSTR widestr; LPWSTR widestr;

File diff suppressed because it is too large Load Diff

View File

@ -98,7 +98,7 @@ static char *initialFileCmd; /* save command but defer doing it */
void void
workshop_init() workshop_init(void)
{ {
char_u buf[64]; char_u buf[64];
int is_dirty = FALSE; int is_dirty = FALSE;
@ -148,7 +148,7 @@ workshop_init()
} }
void void
workshop_postinit() workshop_postinit(void)
{ {
do_cmdline_cmd((char_u *)initialFileCmd); do_cmdline_cmd((char_u *)initialFileCmd);
ALT_INPUT_LOCK_OFF; ALT_INPUT_LOCK_OFF;
@ -170,7 +170,7 @@ ex_wsverb(exarg_T *eap)
* of NEdit, for example, when the connection is initiated from the editor. * of NEdit, for example, when the connection is initiated from the editor.
*/ */
char * char *
workshop_get_editor_name() workshop_get_editor_name(void)
{ {
return "gvim"; return "gvim";
} }
@ -181,7 +181,7 @@ workshop_get_editor_name()
* version to the application. * version to the application.
*/ */
char * char *
workshop_get_editor_version() workshop_get_editor_version(void)
{ {
return Version; return Version;
} }
@ -288,7 +288,7 @@ workshop_save_file(
} }
void void
workshop_save_files() workshop_save_files(void)
{ {
/* Save the given file */ /* Save the given file */
#ifdef WSDEBUG_TRACE #ifdef WSDEBUG_TRACE
@ -300,7 +300,7 @@ workshop_save_files()
} }
void void
workshop_quit() workshop_quit(void)
{ {
#ifdef WSDEBUG_TRACE #ifdef WSDEBUG_TRACE
if (WSDLEVEL(WS_TRACE_VERBOSE | WS_TRACE)) if (WSDLEVEL(WS_TRACE_VERBOSE | WS_TRACE))
@ -311,7 +311,7 @@ workshop_quit()
} }
void void
workshop_minimize() workshop_minimize(void)
{ {
#ifdef WSDEBUG_TRACE #ifdef WSDEBUG_TRACE
if (WSDLEVEL(WS_TRACE_VERBOSE | WS_TRACE)) if (WSDLEVEL(WS_TRACE_VERBOSE | WS_TRACE))
@ -320,7 +320,7 @@ workshop_minimize()
workshop_minimize_shell(vimShell); workshop_minimize_shell(vimShell);
} }
void void
workshop_maximize() workshop_maximize(void)
{ {
#ifdef WSDEBUG_TRACE #ifdef WSDEBUG_TRACE
if (WSDLEVEL(WS_TRACE_VERBOSE | WS_TRACE)) if (WSDLEVEL(WS_TRACE_VERBOSE | WS_TRACE))
@ -510,7 +510,7 @@ workshop_moved_marks(char *filename UNUSED)
} }
int int
workshop_get_font_height() workshop_get_font_height(void)
{ {
XmFontList fontList; /* fontList made from gui.norm_font */ XmFontList fontList; /* fontList made from gui.norm_font */
XmString str; XmString str;
@ -623,7 +623,7 @@ workshop_submenu_begin(
*/ */
void void
workshop_submenu_end() workshop_submenu_end(void)
{ {
char *p; char *p;
@ -720,7 +720,7 @@ workshop_menu_item(
*/ */
void void
workshop_menu_end() workshop_menu_end(void)
{ {
Boolean using_tearoff; /* set per current option setting */ Boolean using_tearoff; /* set per current option setting */
@ -734,7 +734,7 @@ workshop_menu_end()
} }
void void
workshop_toolbar_begin() workshop_toolbar_begin(void)
{ {
#ifdef WSDEBUG_TRACE #ifdef WSDEBUG_TRACE
if (WSDLEVEL(WS_TRACE_VERBOSE | WS_TRACE)) if (WSDLEVEL(WS_TRACE_VERBOSE | WS_TRACE))
@ -746,7 +746,7 @@ workshop_toolbar_begin()
} }
void void
workshop_toolbar_end() workshop_toolbar_end(void)
{ {
char_u buf[64]; char_u buf[64];
@ -1405,7 +1405,7 @@ fixup(
/* For the NoHands test suite */ /* For the NoHands test suite */
char * char *
workshop_test_getcurrentfile() workshop_test_getcurrentfile(void)
{ {
char *filename, *selection; char *filename, *selection;
int curLine, curCol, selStartLine, selStartCol, selEndLine; int curLine, curCol, selStartLine, selStartCol, selEndLine;
@ -1421,13 +1421,13 @@ workshop_test_getcurrentfile()
} }
int int
workshop_test_getcursorrow() workshop_test_getcursorrow(void)
{ {
return 0; return 0;
} }
int int
workshop_test_getcursorcol() workshop_test_getcursorcol(void)
{ {
char *filename, *selection; char *filename, *selection;
int curLine, curCol, selStartLine, selStartCol, selEndLine; int curLine, curCol, selStartLine, selStartCol, selEndLine;
@ -1443,13 +1443,13 @@ workshop_test_getcursorcol()
} }
char * char *
workshop_test_getcursorrowtext() workshop_test_getcursorrowtext(void)
{ {
return NULL; return NULL;
} }
char * char *
workshop_test_getselectedtext() workshop_test_getselectedtext(void)
{ {
char *filename, *selection; char *filename, *selection;
int curLine, curCol, selStartLine, selStartCol, selEndLine; int curLine, curCol, selStartLine, selStartCol, selEndLine;

View File

@ -28,10 +28,10 @@
* "hShape". * "hShape".
*/ */
int int
LoadXpmImage(filename, hImage, hShape) LoadXpmImage(
char *filename; char *filename,
HBITMAP *hImage; HBITMAP *hImage,
HBITMAP *hShape; HBITMAP *hShape)
{ {
XImage *img; /* loaded image */ XImage *img; /* loaded image */
XImage *shp; /* shapeimage */ XImage *shp; /* shapeimage */

View File

@ -234,7 +234,7 @@ char hexxa[] = "0123456789abcdef0123456789ABCDEF", *hexx = hexxa;
static char *pname; static char *pname;
static void static void
exit_with_usage() exit_with_usage(void)
{ {
fprintf(stderr, "Usage:\n %s [options] [infile [outfile]]\n", pname); fprintf(stderr, "Usage:\n %s [options] [infile [outfile]]\n", pname);
fprintf(stderr, " or\n %s -r [-s [-]offset] [-c cols] [-ps] [infile [outfile]]\n", pname); fprintf(stderr, " or\n %s -r [-s [-]offset] [-c cols] [-ps] [infile [outfile]]\n", pname);
@ -264,8 +264,7 @@ exit_with_usage()
} }
static void static void
die(ret) die(int ret)
int ret;
{ {
fprintf(stderr, "%s: ", pname); fprintf(stderr, "%s: ", pname);
perror(NULL); perror(NULL);
@ -280,10 +279,13 @@ die(ret)
* The name is historic and came from 'undo type opt h'. * The name is historic and came from 'undo type opt h'.
*/ */
static int static int
huntype(fpi, fpo, fperr, cols, hextype, base_off) huntype(
FILE *fpi, *fpo, *fperr; FILE *fpi,
int cols, hextype; FILE *fpo,
long base_off; FILE *fperr,
int cols,
int hextype,
long base_off)
{ {
int c, ign_garb = 1, n1 = -1, n2 = 0, n3, p = cols; int c, ign_garb = 1, n1 = -1, n2 = 0, n3, p = cols;
long have_off = 0, want_off = 0; long have_off = 0, want_off = 0;
@ -409,10 +411,7 @@ huntype(fpi, fpo, fperr, cols, hextype, base_off)
* If nz is always positive, lines are never suppressed. * If nz is always positive, lines are never suppressed.
*/ */
static void static void
xxdline(fp, l, nz) xxdline(FILE *fp, char *l, int nz)
FILE *fp;
char *l;
int nz;
{ {
static char z[LLEN+1]; static char z[LLEN+1];
static int zero_seen = 0; static int zero_seen = 0;
@ -472,9 +471,7 @@ static unsigned char etoa64[] =
}; };
int int
main(argc, argv) main(int argc, char *argv[])
int argc;
char *argv[];
{ {
FILE *fp, *fpo; FILE *fp, *fpo;
int c, e, p = 0, relseek = 1, negseek = 0, revert = 0; int c, e, p = 0, relseek = 1, negseek = 0, revert = 0;