Skip to content

Commit b7604cc

Browse files
committed
patch 7.4.1098
Problem: Still using old style C function declarations. Solution: Always define __ARGS() to include types. Turn a few functions into ANSI style to find out if this causes problems for anyone.
1 parent 345efa0 commit b7604cc

5 files changed

Lines changed: 21 additions & 55 deletions

File tree

src/eval.c

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -973,8 +973,7 @@ eval_clear()
973973
* Return the name of the executed function.
974974
*/
975975
char_u *
976-
func_name(cookie)
977-
void *cookie;
976+
func_name(void *cookie)
978977
{
979978
return ((funccall_T *)cookie)->func->uf_name;
980979
}
@@ -993,8 +992,7 @@ func_breakpoint(cookie)
993992
* Return the address holding the debug tick for a funccall cookie.
994993
*/
995994
int *
996-
func_dbg_tick(cookie)
997-
void *cookie;
995+
func_dbg_tick(void *cookie)
998996
{
999997
return &((funccall_T *)cookie)->dbg_tick;
1000998
}
@@ -1003,8 +1001,7 @@ func_dbg_tick(cookie)
10031001
* Return the nesting level for a funccall cookie.
10041002
*/
10051003
int
1006-
func_level(cookie)
1007-
void *cookie;
1004+
func_level(void *cookie)
10081005
{
10091006
return ((funccall_T *)cookie)->level;
10101007
}
@@ -1031,9 +1028,7 @@ current_func_returned()
10311028
* not already exist.
10321029
*/
10331030
void
1034-
set_internal_string_var(name, value)
1035-
char_u *name;
1036-
char_u *value;
1031+
set_internal_string_var(char_u *name, char_u *value)
10371032
{
10381033
char_u *val;
10391034
typval_T *tvp;
@@ -1057,12 +1052,11 @@ static char_u *redir_varname = NULL;
10571052

10581053
/*
10591054
* Start recording command output to a variable
1055+
* When "append" is TRUE append to an existing variable.
10601056
* Returns OK if successfully completed the setup. FAIL otherwise.
10611057
*/
10621058
int
1063-
var_redir_start(name, append)
1064-
char_u *name;
1065-
int append; /* append to an existing variable */
1059+
var_redir_start(char_u *name, int append)
10661060
{
10671061
int save_emsg;
10681062
int err;
@@ -1139,9 +1133,7 @@ var_redir_start(name, append)
11391133
* :redir END
11401134
*/
11411135
void
1142-
var_redir_str(value, value_len)
1143-
char_u *value;
1144-
int value_len;
1136+
var_redir_str(char_u *value, int value_len)
11451137
{
11461138
int len;
11471139

@@ -1201,11 +1193,11 @@ var_redir_stop()
12011193

12021194
# if defined(FEAT_MBYTE) || defined(PROTO)
12031195
int
1204-
eval_charconvert(enc_from, enc_to, fname_from, fname_to)
1205-
char_u *enc_from;
1206-
char_u *enc_to;
1207-
char_u *fname_from;
1208-
char_u *fname_to;
1196+
eval_charconvert(
1197+
char_u *enc_from,
1198+
char_u *enc_to,
1199+
char_u *fname_from,
1200+
char_u *fname_to)
12091201
{
12101202
int err = FALSE;
12111203

src/main.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1064,9 +1064,9 @@ vim_main2(int argc UNUSED, char **argv UNUSED)
10641064
* commands, return when entering Ex mode. "noexmode" is TRUE then.
10651065
*/
10661066
void
1067-
main_loop(cmdwin, noexmode)
1068-
int cmdwin; /* TRUE when working in the command-line window */
1069-
int noexmode; /* TRUE when return on entering Ex mode */
1067+
main_loop(
1068+
int cmdwin, /* TRUE when working in the command-line window */
1069+
int noexmode) /* TRUE when return on entering Ex mode */
10701070
{
10711071
oparg_T oa; /* operator arguments */
10721072
volatile int previous_got_int = FALSE; /* "got_int" was TRUE */
@@ -1360,8 +1360,7 @@ main_loop(cmdwin, noexmode)
13601360
* Exit, but leave behind swap files for modified buffers.
13611361
*/
13621362
void
1363-
getout_preserve_modified(exitval)
1364-
int exitval;
1363+
getout_preserve_modified(int exitval)
13651364
{
13661365
# if defined(SIGHUP) && defined(SIG_IGN)
13671366
/* Ignore SIGHUP, because a dropped connection causes a read error, which
@@ -1380,8 +1379,7 @@ getout_preserve_modified(exitval)
13801379

13811380
/* Exit properly */
13821381
void
1383-
getout(exitval)
1384-
int exitval;
1382+
getout(int exitval)
13851383
{
13861384
#ifdef FEAT_AUTOCMD
13871385
buf_T *buf;

src/os_unix.h

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,7 @@
7575
#endif
7676

7777
#ifndef __ARGS
78-
/* The AIX VisualAge cc compiler defines __EXTENDED__ instead of __STDC__
79-
* because it includes pre-ansi features. */
80-
# if defined(__STDC__) || defined(__GNUC__) || defined(__EXTENDED__)
81-
# define __ARGS(x) x
82-
# else
83-
# define __ARGS(x) ()
84-
# endif
78+
# define __ARGS(x) x
8579
#endif
8680

8781
/* always use unlink() to remove files */
@@ -181,10 +175,6 @@
181175
# include <pwd.h>
182176
#endif
183177

184-
#ifdef __COHERENT__
185-
# undef __ARGS
186-
#endif
187-
188178
#if (defined(HAVE_SYS_RESOURCE_H) && defined(HAVE_GETRLIMIT)) \
189179
|| (defined(HAVE_SYS_SYSINFO_H) && defined(HAVE_SYSINFO)) \
190180
|| defined(HAVE_SYSCTL) || defined(HAVE_SYSCONF)

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,8 @@ static char *(features[]) =
741741

742742
static int included_patches[] =
743743
{ /* Add new patch number below this line */
744+
/**/
745+
1098,
744746
/**/
745747
1097,
746748
/**/

src/vim.h

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -255,43 +255,27 @@
255255
*/
256256
#ifdef AZTEC_C
257257
# include <functions.h>
258-
# define __ARGS(x) x
259258
#endif
260259

261260
#ifdef SASC
262261
# include <clib/exec_protos.h>
263-
# define __ARGS(x) x
264262
#endif
265263

266264
#ifdef _DCC
267265
# include <clib/exec_protos.h>
268-
# define __ARGS(x) x
269-
#endif
270-
271-
#ifdef __TURBOC__
272-
# define __ARGS(x) x
273266
#endif
274267

275268
#ifdef __BEOS__
276269
# include "os_beos.h"
277-
# define __ARGS(x) x
278270
#endif
279271

280272
#if (defined(UNIX) || defined(__EMX__) || defined(VMS)) \
281273
&& (!defined(MACOS_X) || defined(HAVE_CONFIG_H))
282274
# include "os_unix.h" /* bring lots of system header files */
283275
#endif
284276

285-
#if defined(MACOS) && (defined(__MRC__) || defined(__SC__))
286-
/* Apple's Compilers support prototypes */
287-
# define __ARGS(x) x
288-
#endif
289277
#ifndef __ARGS
290-
# if defined(__STDC__) || defined(__GNUC__) || defined(WIN3264)
291-
# define __ARGS(x) x
292-
# else
293-
# define __ARGS(x) ()
294-
# endif
278+
# define __ARGS(x) x
295279
#endif
296280

297281
/* __ARGS and __PARMS are the same thing. */

0 commit comments

Comments
 (0)