Skip to content

Commit 52ea13d

Browse files
committed
patch 7.4.1210
Problem: Using old style function declarations. Solution: Change to new style function declarations. (script by Hirohito Higashi)
1 parent 02fdaea commit 52ea13d

9 files changed

Lines changed: 683 additions & 1111 deletions

File tree

src/main.c

Lines changed: 56 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,7 @@ VimMain
165165
# else
166166
main
167167
# endif
168-
(argc, argv)
169-
int argc;
170-
char **argv;
168+
(int argc, char **argv)
171169
{
172170
char_u *fname = NULL; /* file name from command line */
173171
mparm_T params; /* various parameters passed between
@@ -1534,10 +1532,10 @@ getout(int exitval)
15341532
* Get a (optional) count for a Vim argument.
15351533
*/
15361534
static int
1537-
get_number_arg(p, idx, def)
1538-
char_u *p; /* pointer to argument */
1539-
int *idx; /* index in argument, is incremented */
1540-
int def; /* default value */
1535+
get_number_arg(
1536+
char_u *p, /* pointer to argument */
1537+
int *idx, /* index in argument, is incremented */
1538+
int def) /* default value */
15411539
{
15421540
if (vim_isdigit(p[*idx]))
15431541
{
@@ -1553,7 +1551,7 @@ get_number_arg(p, idx, def)
15531551
* Setup to use the current locale (for ctype() and many other things).
15541552
*/
15551553
static void
1556-
init_locale()
1554+
init_locale(void)
15571555
{
15581556
setlocale(LC_ALL, "");
15591557

@@ -1609,8 +1607,7 @@ init_locale()
16091607
* by "im" use improved Ex mode.
16101608
*/
16111609
static void
1612-
parse_command_name(parmp)
1613-
mparm_T *parmp;
1610+
parse_command_name(mparm_T *parmp)
16141611
{
16151612
char_u *initstr;
16161613

@@ -1700,8 +1697,7 @@ parse_command_name(parmp)
17001697
* Also find the --server... arguments and --socketid and --windowid
17011698
*/
17021699
static void
1703-
early_arg_scan(parmp)
1704-
mparm_T *parmp UNUSED;
1700+
early_arg_scan(mparm_T *parmp UNUSED)
17051701
{
17061702
#if defined(FEAT_XCLIPBOARD) || defined(FEAT_CLIENTSERVER) \
17071703
|| !defined(FEAT_NETBEANS_INTG)
@@ -1792,8 +1788,7 @@ early_arg_scan(parmp)
17921788
* Scan the command line arguments.
17931789
*/
17941790
static void
1795-
command_line_scan(parmp)
1796-
mparm_T *parmp;
1791+
command_line_scan(mparm_T *parmp)
17971792
{
17981793
int argc = parmp->argc;
17991794
char **argv = parmp->argv;
@@ -2512,8 +2507,7 @@ command_line_scan(parmp)
25122507
* When starting in Ex mode and commands come from a file, set Silent mode.
25132508
*/
25142509
static void
2515-
check_tty(parmp)
2516-
mparm_T *parmp;
2510+
check_tty(mparm_T *parmp)
25172511
{
25182512
int input_isatty; /* is active input a terminal? */
25192513

@@ -2559,7 +2553,7 @@ check_tty(parmp)
25592553
* Read text from stdin.
25602554
*/
25612555
static void
2562-
read_stdin()
2556+
read_stdin(void)
25632557
{
25642558
int i;
25652559

@@ -2593,8 +2587,7 @@ read_stdin()
25932587
* Also does recovery if "recoverymode" set.
25942588
*/
25952589
static void
2596-
create_windows(parmp)
2597-
mparm_T *parmp UNUSED;
2590+
create_windows(mparm_T *parmp UNUSED)
25982591
{
25992592
#ifdef FEAT_WINDOWS
26002593
int dorewind;
@@ -2747,9 +2740,9 @@ create_windows(parmp)
27472740
* windows. make_windows() has already opened the windows.
27482741
*/
27492742
static void
2750-
edit_buffers(parmp, cwd)
2751-
mparm_T *parmp;
2752-
char_u *cwd; /* current working dir */
2743+
edit_buffers(
2744+
mparm_T *parmp,
2745+
char_u *cwd) /* current working dir */
27532746
{
27542747
int arg_idx; /* index in argument list */
27552748
int i;
@@ -2876,8 +2869,7 @@ edit_buffers(parmp, cwd)
28762869
* Execute the commands from --cmd arguments "cmds[cnt]".
28772870
*/
28782871
static void
2879-
exe_pre_commands(parmp)
2880-
mparm_T *parmp;
2872+
exe_pre_commands(mparm_T *parmp)
28812873
{
28822874
char_u **cmds = parmp->pre_commands;
28832875
int cnt = parmp->n_pre_commands;
@@ -2904,8 +2896,7 @@ exe_pre_commands(parmp)
29042896
* Execute "+", "-c" and "-S" arguments.
29052897
*/
29062898
static void
2907-
exe_commands(parmp)
2908-
mparm_T *parmp;
2899+
exe_commands(mparm_T *parmp)
29092900
{
29102901
int i;
29112902

@@ -2949,8 +2940,7 @@ exe_commands(parmp)
29492940
* Source startup scripts.
29502941
*/
29512942
static void
2952-
source_startup_scripts(parmp)
2953-
mparm_T *parmp;
2943+
source_startup_scripts(mparm_T *parmp)
29542944
{
29552945
int i;
29562946

@@ -3108,7 +3098,7 @@ source_startup_scripts(parmp)
31083098
* Setup to start using the GUI. Exit with an error when not available.
31093099
*/
31103100
static void
3111-
main_start_gui()
3101+
main_start_gui(void)
31123102
{
31133103
#ifdef FEAT_GUI
31143104
gui.starting = TRUE; /* start GUI a bit later */
@@ -3126,9 +3116,9 @@ main_start_gui()
31263116
* Returns FAIL if the environment variable was not executed, OK otherwise.
31273117
*/
31283118
int
3129-
process_env(env, is_viminit)
3130-
char_u *env;
3131-
int is_viminit; /* when TRUE, called for VIMINIT */
3119+
process_env(
3120+
char_u *env,
3121+
int is_viminit) /* when TRUE, called for VIMINIT */
31323122
{
31333123
char_u *initstr;
31343124
char_u *save_sourcing_name;
@@ -3167,8 +3157,7 @@ process_env(env, is_viminit)
31673157
* Use both stat() and lstat() for extra security.
31683158
*/
31693159
static int
3170-
file_owned(fname)
3171-
char *fname;
3160+
file_owned(char *fname)
31723161
{
31733162
struct stat s;
31743163
# ifdef UNIX
@@ -3189,9 +3178,9 @@ file_owned(fname)
31893178
* Give an error message main_errors["n"] and exit.
31903179
*/
31913180
static void
3192-
mainerr(n, str)
3193-
int n; /* one of the ME_ defines */
3194-
char_u *str; /* extra argument or NULL */
3181+
mainerr(
3182+
int n, /* one of the ME_ defines */
3183+
char_u *str) /* extra argument or NULL */
31953184
{
31963185
#if defined(UNIX) || defined(__EMX__) || defined(VMS)
31973186
reset_signals(); /* kill us with CTRL-C here, if you like */
@@ -3212,8 +3201,7 @@ mainerr(n, str)
32123201
}
32133202

32143203
void
3215-
mainerr_arg_missing(str)
3216-
char_u *str;
3204+
mainerr_arg_missing(char_u *str)
32173205
{
32183206
mainerr(ME_ARG_MISSING, str);
32193207
}
@@ -3223,8 +3211,7 @@ mainerr_arg_missing(str)
32233211
* print a message with three spaces prepended and '\n' appended.
32243212
*/
32253213
static void
3226-
main_msg(s)
3227-
char *s;
3214+
main_msg(char *s)
32283215
{
32293216
mch_msg(" ");
32303217
mch_msg(s);
@@ -3235,7 +3222,7 @@ main_msg(s)
32353222
* Print messages for "vim -h" or "vim --help" and exit.
32363223
*/
32373224
static void
3238-
usage()
3225+
usage(void)
32393226
{
32403227
int i;
32413228
static char *(use[]) =
@@ -3431,7 +3418,7 @@ usage()
34313418
* When "Recover" selected, recover the file.
34323419
*/
34333420
static void
3434-
check_swap_exists_action()
3421+
check_swap_exists_action(void)
34353422
{
34363423
if (swap_exists_action == SEA_QUIT)
34373424
getout(1);
@@ -3465,8 +3452,7 @@ gettimeofday(struct timeval *tv, char *dummy)
34653452
* set "*tv_rel" to the time elapsed so far.
34663453
*/
34673454
void
3468-
time_push(tv_rel, tv_start)
3469-
void *tv_rel, *tv_start;
3455+
time_push(void *tv_rel, void *tv_start)
34703456
{
34713457
*((struct timeval *)tv_rel) = prev_timeval;
34723458
gettimeofday(&prev_timeval, NULL);
@@ -3489,8 +3475,8 @@ time_push(tv_rel, tv_start)
34893475
* have struct timeval.
34903476
*/
34913477
void
3492-
time_pop(tp)
3493-
void *tp; /* actually (struct timeval *) */
3478+
time_pop(
3479+
void *tp) /* actually (struct timeval *) */
34943480
{
34953481
prev_timeval.tv_usec -= ((struct timeval *)tp)->tv_usec;
34963482
prev_timeval.tv_sec -= ((struct timeval *)tp)->tv_sec;
@@ -3502,9 +3488,7 @@ time_pop(tp)
35023488
}
35033489

35043490
static void
3505-
time_diff(then, now)
3506-
struct timeval *then;
3507-
struct timeval *now;
3491+
time_diff(struct timeval *then, struct timeval *now)
35083492
{
35093493
long usec;
35103494
long msec;
@@ -3516,9 +3500,9 @@ time_diff(then, now)
35163500
}
35173501

35183502
void
3519-
time_msg(mesg, tv_start)
3520-
char *mesg;
3521-
void *tv_start; /* only for do_source: start time; actually
3503+
time_msg(
3504+
char *mesg,
3505+
void *tv_start) /* only for do_source: start time; actually
35223506
(struct timeval *) */
35233507
{
35243508
static struct timeval start;
@@ -3562,8 +3546,7 @@ static char_u *build_drop_cmd(int filec, char **filev, int tabs, int sendReply);
35623546
* Do the client-server stuff, unless "--servername ''" was used.
35633547
*/
35643548
static void
3565-
exec_on_server(parmp)
3566-
mparm_T *parmp;
3549+
exec_on_server(mparm_T *parmp)
35673550
{
35683551
if (parmp->serverName_arg == NULL || *parmp->serverName_arg != NUL)
35693552
{
@@ -3605,8 +3588,7 @@ exec_on_server(parmp)
36053588
* Prepare for running as a Vim server.
36063589
*/
36073590
static void
3608-
prepare_server(parmp)
3609-
mparm_T *parmp;
3591+
prepare_server(mparm_T *parmp)
36103592
{
36113593
# if defined(FEAT_X11)
36123594
/*
@@ -3648,11 +3630,11 @@ prepare_server(parmp)
36483630
}
36493631

36503632
static void
3651-
cmdsrv_main(argc, argv, serverName_arg, serverStr)
3652-
int *argc;
3653-
char **argv;
3654-
char_u *serverName_arg;
3655-
char_u **serverStr;
3633+
cmdsrv_main(
3634+
int *argc,
3635+
char **argv,
3636+
char_u *serverName_arg,
3637+
char_u **serverStr)
36563638
{
36573639
char_u *res;
36583640
int i;
@@ -3924,11 +3906,11 @@ cmdsrv_main(argc, argv, serverName_arg, serverStr)
39243906
* Build a ":drop" command to send to a Vim server.
39253907
*/
39263908
static char_u *
3927-
build_drop_cmd(filec, filev, tabs, sendReply)
3928-
int filec;
3929-
char **filev;
3930-
int tabs; /* Use ":tab drop" instead of ":drop". */
3931-
int sendReply;
3909+
build_drop_cmd(
3910+
int filec,
3911+
char **filev,
3912+
int tabs, /* Use ":tab drop" instead of ":drop". */
3913+
int sendReply)
39323914
{
39333915
garray_T ga;
39343916
int i;
@@ -4044,9 +4026,7 @@ build_drop_cmd(filec, filev, tabs, sendReply)
40444026
* Return the name in allocated memory. This doesn't include a serial number.
40454027
*/
40464028
static char_u *
4047-
serverMakeName(arg, cmd)
4048-
char_u *arg;
4049-
char *cmd;
4029+
serverMakeName(char_u *arg, char *cmd)
40504030
{
40514031
char_u *p;
40524032

@@ -4068,8 +4048,7 @@ serverMakeName(arg, cmd)
40684048
* Replace termcodes such as <CR> and insert as key presses if there is room.
40694049
*/
40704050
void
4071-
server_to_input_buf(str)
4072-
char_u *str;
4051+
server_to_input_buf(char_u *str)
40734052
{
40744053
char_u *ptr = NULL;
40754054
char_u *cpo_save = p_cpo;
@@ -4110,8 +4089,7 @@ server_to_input_buf(str)
41104089
* Evaluate an expression that the client sent to a string.
41114090
*/
41124091
char_u *
4113-
eval_client_expr_to_string(expr)
4114-
char_u *expr;
4092+
eval_client_expr_to_string(char_u *expr)
41154093
{
41164094
char_u *res;
41174095
int save_dbl = debug_break_level;
@@ -4151,10 +4129,10 @@ eval_client_expr_to_string(expr)
41514129
* "*tofree" is set to the result when it needs to be freed later.
41524130
*/
41534131
char_u *
4154-
serverConvert(client_enc, data, tofree)
4155-
char_u *client_enc UNUSED;
4156-
char_u *data;
4157-
char_u **tofree;
4132+
serverConvert(
4133+
char_u *client_enc UNUSED,
4134+
char_u *data,
4135+
char_u **tofree)
41584136
{
41594137
char_u *res = data;
41604138

0 commit comments

Comments
 (0)