From: Erwin Janssen Date: Mon, 19 Sep 2016 16:08:08 +0000 (+0200) Subject: Remove _ARG_ macro from all files. X-Git-Tag: untagged-5fc0363bc76319758ff6~1^2^2~17 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=508f2dba5be119216139e4b8b2b6ecdf0c05c176;p=graphviz Remove _ARG_ macro from all files. This macro is used to simplify function prototyping when using the old K&R C and more modern C dialects. Only three projects use this macro: cdt, sfio and vmalloc. K&R is obsolete, so this macro adds no benefits and only makes the code more complicated. Definition and usage of this macro is removed from all files. --- diff --git a/ast_common.h.in b/ast_common.h.in index 1e71ad661..bbb98eeae 100644 --- a/ast_common.h.in +++ b/ast_common.h.in @@ -69,11 +69,6 @@ # endif #endif /*_BEGIN_EXTERNS_*/ -/* _ARG_ simplifies function prototyping among flavors of C */ -#ifndef _ARG_ -#define _ARG_(x) x -#endif /*_ARG_*/ - /* __INLINE__ is the inline keyword */ #if !defined(__INLINE__) && defined(__cplusplus) #define __INLINE__ inline diff --git a/features/common b/features/common index 12d98d11e..5a7d1df61 100644 --- a/features/common +++ b/features/common @@ -78,11 +78,6 @@ cat{ #endif #endif /*_BEGIN_EXTERNS_*/ - /* _ARG_ simplifies function prototyping among flavors of C */ - #ifndef _ARG_ - #define _ARG_(x) x - #endif /*_ARG_*/ - /* __INLINE__ is the inline keyword */ #if !defined(__INLINE__) && defined(__cplusplus) #define __INLINE__ inline @@ -152,7 +147,7 @@ tst - -DN=0 - -DN=1 - -DN=2 - -DN=3 - -DN=4 - -DN=5 - -DN=6 - -DN=7 - -DN=8 outp #endif _BEGIN_EXTERNS_ - extern int printf _ARG_((const char*, ...)); + extern int printf(const char*, ...); _END_EXTERNS_ #if N == 0 @@ -289,7 +284,7 @@ tst - -DTRY=1 - -DTRY=1 -Dvoid=char - -DTRY=2 - -DTRY=3 - -DTRY=4 output{ #endif #undef printf _BEGIN_EXTERNS_ - extern int printf _ARG_((const char*, ...)); + extern int printf(const char*, ...); _END_EXTERNS_ static va_list ap; main() diff --git a/iffe b/iffe index f448ad870..91ee9bff7 100755 --- a/iffe +++ b/iffe @@ -626,11 +626,9 @@ case `(getopts '[-][123:xyz]' opt --xyz; echo 0$opt) 2>/dev/null` in following at the top to hide dialect differences:]{ [+#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)?] [+#define _STD_ 1?] - [+#define _ARG_(x) x?] [+#define _VOID_ void?] [+#else?] [+#define _STD_ 0?] - [+#define _ARG_(x) ()?] [+#define _VOID_ char?] [+#endif?] [+#if defined(__cplusplus)?] @@ -1040,11 +1038,9 @@ status=2 std='#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus) #define _STD_ 1 -#define _ARG_(x) x #define _VOID_ void #else #define _STD_ 0 -#define _ARG_(x) () #define _VOID_ char #endif #if defined(__cplusplus) @@ -3267,7 +3263,7 @@ $inc $ext _BEGIN_EXTERNS_ struct _iffe_struct { int _iffe_member; }; -extern struct _iffe_struct* $v _ARG_((struct _iffe_struct*)); +extern struct _iffe_struct* $v (struct _iffe_struct*); _END_EXTERNS_ " $cc -c $tmp.c <&$nullin >&$nullout diff --git a/lib/cdt/cdt.h b/lib/cdt/cdt.h index 98fad493c..19dcb2512 100644 --- a/lib/cdt/cdt.h +++ b/lib/cdt/cdt.h @@ -12,10 +12,6 @@ #define Void_t void #endif -#ifndef _ARG_ -#define _ARG_(x) x -#endif - #include /* size_t */ #include @@ -50,13 +46,13 @@ typedef struct _dtdata_s Dtdata_t; typedef struct _dt_s Dt_t; typedef struct _dt_s Dict_t; /* for libdict compatibility */ typedef struct _dtstat_s Dtstat_t; -typedef Void_t* (*Dtmemory_f)_ARG_((Dt_t*,Void_t*,size_t,Dtdisc_t*)); -typedef Void_t* (*Dtsearch_f)_ARG_((Dt_t*,Void_t*,int)); -typedef Void_t* (*Dtmake_f)_ARG_((Dt_t*,Void_t*,Dtdisc_t*)); -typedef void (*Dtfree_f)_ARG_((Dt_t*,Void_t*,Dtdisc_t*)); -typedef int (*Dtcompar_f)_ARG_((Dt_t*,Void_t*,Void_t*,Dtdisc_t*)); -typedef unsigned int (*Dthash_f)_ARG_((Dt_t*,Void_t*,Dtdisc_t*)); -typedef int (*Dtevent_f)_ARG_((Dt_t*,int,Void_t*,Dtdisc_t*)); +typedef Void_t* (*Dtmemory_f)(Dt_t*,Void_t*,size_t,Dtdisc_t*); +typedef Void_t* (*Dtsearch_f)(Dt_t*,Void_t*,int); +typedef Void_t* (*Dtmake_f)(Dt_t*,Void_t*,Dtdisc_t*); +typedef void (*Dtfree_f)(Dt_t*,Void_t*,Dtdisc_t*); +typedef int (*Dtcompar_f)(Dt_t*,Void_t*,Void_t*,Dtdisc_t*); +typedef unsigned int (*Dthash_f)(Dt_t*,Void_t*,Dtdisc_t*); +typedef int (*Dtevent_f)(Dt_t*,int,Void_t*,Dtdisc_t*); struct _dtlink_s { Dtlink_t* right; /* right child */ @@ -221,25 +217,25 @@ _BEGIN_EXTERNS_ /* public functions */ #define extern __EXPORT__ #endif -extern Dt_t* dtopen _ARG_((Dtdisc_t*, Dtmethod_t*)); -extern int dtclose _ARG_((Dt_t*)); -extern Dt_t* dtview _ARG_((Dt_t*, Dt_t*)); -extern Dtdisc_t* dtdisc _ARG_((Dt_t* dt, Dtdisc_t*, int)); -extern Dtmethod_t* dtmethod _ARG_((Dt_t*, Dtmethod_t*)); +extern Dt_t* dtopen(Dtdisc_t*, Dtmethod_t*); +extern int dtclose(Dt_t*); +extern Dt_t* dtview(Dt_t*, Dt_t*); +extern Dtdisc_t* dtdisc(Dt_t* dt, Dtdisc_t*, int); +extern Dtmethod_t* dtmethod(Dt_t*, Dtmethod_t*); -extern Dtlink_t* dtflatten _ARG_((Dt_t*)); -extern Dtlink_t* dtextract _ARG_((Dt_t*)); -extern int dtrestore _ARG_((Dt_t*, Dtlink_t*)); +extern Dtlink_t* dtflatten(Dt_t*); +extern Dtlink_t* dtextract(Dt_t*); +extern int dtrestore(Dt_t*, Dtlink_t*); -extern int dttreeset _ARG_((Dt_t*, int, int)); +extern int dttreeset(Dt_t*, int, int); -extern int dtwalk _ARG_((Dt_t*, int(*)(Dt_t*,Void_t*,Void_t*), Void_t*)); +extern int dtwalk(Dt_t*, int(*)(Dt_t*,Void_t*,Void_t*), Void_t*); -extern Void_t* dtrenew _ARG_((Dt_t*, Void_t*)); +extern Void_t* dtrenew(Dt_t*, Void_t*); -extern int dtsize _ARG_((Dt_t*)); -extern int dtstat _ARG_((Dt_t*, Dtstat_t*, int)); -extern unsigned int dtstrhash _ARG_((unsigned int, Void_t*, int)); +extern int dtsize(Dt_t*); +extern int dtstat(Dt_t*, Dtstat_t*, int); +extern unsigned int dtstrhash(unsigned int, Void_t*, int); #undef extern _END_EXTERNS_ diff --git a/lib/cdt/features/common b/lib/cdt/features/common index 8b59049f0..d554c86d3 100644 --- a/lib/cdt/features/common +++ b/lib/cdt/features/common @@ -80,11 +80,6 @@ cat{ #endif #endif /*_BEGIN_EXTERNS_*/ - /* _ARG_ simplifies function prototyping among flavors of C */ - #ifndef _ARG_ - #define _ARG_(x) x - #endif /*_ARG_*/ - /* __INLINE__ is the inline keyword */ #if !defined(__INLINE__) && defined(__cplusplus) #define __INLINE__ inline @@ -159,7 +154,7 @@ tst - -DN=0 - -DN=1 - -DN=2 - -DN=3 - -DN=4 - -DN=5 - -DN=6 - -DN=7 - -DN=8 outp #endif _BEGIN_EXTERNS_ - extern int printf _ARG_((const char*, ...)); + extern int printf(const char*, ...); _END_EXTERNS_ #if N == 0 @@ -296,7 +291,7 @@ tst - -DTRY=1 - -DTRY=1 -Dvoid=char - -DTRY=2 - -DTRY=3 - -DTRY=4 output{ #endif #undef printf _BEGIN_EXTERNS_ - extern int printf _ARG_((const char*, ...)); + extern int printf(const char*, ...); _END_EXTERNS_ static va_list ap; main() diff --git a/lib/sfio/Sfio_dc/sfdisc.h b/lib/sfio/Sfio_dc/sfdisc.h index 3bffa3dca..02e5b3525 100644 --- a/lib/sfio/Sfio_dc/sfdisc.h +++ b/lib/sfio/Sfio_dc/sfdisc.h @@ -22,15 +22,15 @@ extern "C" { _BEGIN_EXTERNS_ /* functions to create disciplines */ - extern int sfdcdio _ARG_((Sfio_t *, size_t)); - extern int sfdcdos _ARG_((Sfio_t *)); - extern int sfdcfilter _ARG_((Sfio_t *, const char *)); - extern int sfdclzw _ARG_((Sfio_t *)); - extern int sfdcseekable _ARG_((Sfio_t *)); - extern int sfdcslow _ARG_((Sfio_t *)); - extern int sfdcsubstream _ARG_((Sfio_t *, Sfio_t *, Sfoff_t, Sfoff_t)); - extern int sfdctee _ARG_((Sfio_t *, Sfio_t *)); - extern int sfdcunion _ARG_((Sfio_t *, Sfio_t **, int)); + extern int sfdcdio(Sfio_t *, size_t); + extern int sfdcdos(Sfio_t *); + extern int sfdcfilter(Sfio_t *, const char *); + extern int sfdclzw(Sfio_t *); + extern int sfdcseekable(Sfio_t *); + extern int sfdcslow(Sfio_t *); + extern int sfdcsubstream(Sfio_t *, Sfio_t *, Sfoff_t, Sfoff_t); + extern int sfdctee(Sfio_t *, Sfio_t *); + extern int sfdcunion(Sfio_t *, Sfio_t **, int); _END_EXTERNS_ #endif #ifdef __cplusplus diff --git a/lib/sfio/features/common b/lib/sfio/features/common index 8f649c96a..fce0e3593 100644 --- a/lib/sfio/features/common +++ b/lib/sfio/features/common @@ -78,11 +78,6 @@ cat{ #endif #endif /*_BEGIN_EXTERNS_*/ - /* _ARG_ simplifies function prototyping among flavors of C */ - #ifndef _ARG_ - #define _ARG_(x) x - #endif /*_ARG_*/ - /* __INLINE__ is the inline keyword */ #if !defined(__INLINE__) && defined(__cplusplus) #define __INLINE__ inline @@ -152,7 +147,7 @@ tst - -DN=0 - -DN=1 - -DN=2 - -DN=3 - -DN=4 - -DN=5 - -DN=6 - -DN=7 - -DN=8 outp #endif _BEGIN_EXTERNS_ - extern int printf _ARG_((const char*, ...)); + extern int printf(const char*, ...); _END_EXTERNS_ #if N == 0 @@ -289,7 +284,7 @@ tst - -DTRY=1 - -DTRY=1 -Dvoid=char - -DTRY=2 - -DTRY=3 - -DTRY=4 output{ #endif #undef printf _BEGIN_EXTERNS_ - extern int printf _ARG_((const char*, ...)); + extern int printf(const char*, ...); _END_EXTERNS_ static va_list ap; main() diff --git a/lib/sfio/features/sfio b/lib/sfio/features/sfio index 6df89258a..aee3ad144 100644 --- a/lib/sfio/features/sfio +++ b/lib/sfio/features/sfio @@ -35,8 +35,8 @@ typ struct_stat64 compile{ exit cleanup note{ stuck with standard _cleanup }end execute{ #include _BEGIN_EXTERNS_ - extern void exit _ARG_((int)); - extern void _exit _ARG_((int)); + extern void exit(int); + extern void _exit(int); extern void _cleanup(); void _cleanup() { _exit(0); } _END_EXTERNS_ @@ -169,10 +169,10 @@ tst output{ #include _BEGIN_EXTERNS_ - int creat _ARG_((char*, int)); - int open _ARG_((char*, int)); - int unlink _ARG_((char*)); - int read _ARG_((int, char*, int)); + int creat(char*, int); + int open(char*, int); + int unlink(char*); + int read(int, char*, int); _END_EXTERNS_ #define MAPSIZE (64*1024) @@ -288,9 +288,9 @@ lib getpagesize tmp rmfail note{ file not removable if still opened }end execute{ #include _BEGIN_EXTERNS_ - extern int creat _ARG_((char*, int)); - extern int unlink _ARG_((char*)); - extern int write _ARG_((int, char*, int)); + extern int creat(char*, int); + extern int unlink(char*); + extern int write(int, char*, int); _END_EXTERNS_ main() { int fw, fr; @@ -349,7 +349,7 @@ proto open note{ open() has a vararg prototype }end compile{ #include _BEGIN_EXTERNS_ - extern int open _ARG_((const char*,int,...)); + extern int open(const char*,int,...); _END_EXTERNS_ main() { @@ -377,7 +377,7 @@ proto bzero note{ bzero() has prototype }end compile{ lib poll_fd_1 note{ fd is first arg to poll() }end execute{ #include _BEGIN_EXTERNS_ - extern int pipe _ARG_((int*)); + extern int pipe(int*); _END_EXTERNS_ main() { int rw[2]; @@ -393,7 +393,7 @@ lib poll_fd_1 note{ fd is first arg to poll() }end execute{ lib poll_fd_2 note{ fd is second arg to poll() }end execute{ #include _BEGIN_EXTERNS_ - extern int pipe _ARG_((int*)); + extern int pipe(int*); _END_EXTERNS_ main() { int rw[2]; diff --git a/lib/sfio/sfexit.c b/lib/sfio/sfexit.c index 506c192f2..b7678f72b 100644 --- a/lib/sfio/sfexit.c +++ b/lib/sfio/sfexit.c @@ -36,7 +36,7 @@ int atexit(void (*exitf) (void)) typedef struct _exit_s { struct _exit_s *next; - void (*exitf) _ARG_((void)); + void (*exitf) (void); } Exit_t; static Exit_t *Exit; diff --git a/lib/sfio/sfextern.c b/lib/sfio/sfextern.c index 820bbea11..f2bf3ab95 100644 --- a/lib/sfio/sfextern.c +++ b/lib/sfio/sfextern.c @@ -33,17 +33,17 @@ static void _sfoncef(void) /* global variables used internally to the package */ Sfextern_t _Sfextern = { 0, /* _Sfpage */ {NIL(Sfpool_t *), 0, 0, 0, NIL(Sfio_t **)}, /* _Sfpool */ - NIL(int (*)_ARG_((Sfio_t *, int))), /* _Sfpmove */ - NIL(Sfio_t * (*)_ARG_((Sfio_t *, Sfio_t *))), /* _Sfstack */ - NIL(void (*)_ARG_((Sfio_t *, int, int))), /* _Sfnotify */ - NIL(int (*)_ARG_((Sfio_t *))), /* _Sfstdsync */ + NIL(int (*)(Sfio_t *, int)), /* _Sfpmove */ + NIL(Sfio_t * (*)(Sfio_t *, Sfio_t *)), /* _Sfstack */ + NIL(void (*)(Sfio_t *, int, int)), /* _Sfnotify */ + NIL(int (*)(Sfio_t *)), /* _Sfstdsync */ {NIL(Sfread_f), /* _Sfudisc */ NIL(Sfwrite_f), NIL(Sfseek_f), NIL(Sfexcept_f), NIL(Sfdisc_t *) }, - NIL(void (*)_ARG_((void))), /* _Sfcleanup */ + NIL(void (*)(void)), /* _Sfcleanup */ 0, /* _Sfexiting */ 0, /* _Sfdone */ &Sfonce, /* _Sfonce */ diff --git a/lib/sfio/sfhdr.h b/lib/sfio/sfhdr.h index c08493647..3a16f7217 100644 --- a/lib/sfio/sfhdr.h +++ b/lib/sfio/sfhdr.h @@ -577,16 +577,16 @@ extern "C" { typedef struct _sfextern_s { ssize_t sf_page; struct _sfpool_s sf_pool; - int (*sf_pmove) _ARG_((Sfio_t *, int)); - Sfio_t *(*sf_stack) _ARG_((Sfio_t *, Sfio_t *)); - void (*sf_notify) _ARG_((Sfio_t *, int, int)); - int (*sf_stdsync) _ARG_((Sfio_t *)); + int (*sf_pmove) (Sfio_t *, int); + Sfio_t *(*sf_stack) (Sfio_t *, Sfio_t *); + void (*sf_notify) (Sfio_t *, int, int); + int (*sf_stdsync) (Sfio_t *); struct _sfdisc_s sf_udisc; - void (*sf_cleanup) _ARG_((void)); + void (*sf_cleanup) (void); int sf_exiting; int sf_done; Vtonce_t *sf_once; - void (*sf_oncef) _ARG_((void)); + void (*sf_oncef) (void); Vtmutex_t *sf_mutex; } Sfextern_t; @@ -799,9 +799,8 @@ extern "C" { char *sf_digits; /* digits for general bases */ int (*sf_cvinitf) (void); /* initialization function */ int sf_cvinit; /* initialization state */ - Fmtpos_t *(*sf_fmtposf) - _ARG_((Sfio_t *, const char *, va_list, int)); - char *(*sf_fmtintf) _ARG_((const char *, int *)); + Fmtpos_t *(*sf_fmtposf) (Sfio_t *, const char *, va_list, int); + char *(*sf_fmtintf) (const char *, int *); uchar sf_cv36[SF_MAXCHAR + 1]; /* conversion for base [2-36] */ uchar sf_cv64[SF_MAXCHAR + 1]; /* conversion for base [37-64] */ uchar sf_type[SF_MAXCHAR + 1]; /* conversion formats&types */ @@ -903,16 +902,16 @@ extern "C" { _BEGIN_EXTERNS_ extern Sfextern_t _Sfextern; extern Sftab_t _Sftable; - extern int _sfpopen _ARG_((Sfio_t *, int, int, int)); - extern int _sfpclose _ARG_((Sfio_t *)); - extern int _sfmode _ARG_((Sfio_t *, int, int)); - extern int _sftype _ARG_((const char *, int *, int *)); - extern int _sfexcept _ARG_((Sfio_t *, int, ssize_t, Sfdisc_t *)); - extern Sfrsrv_t *_sfrsrv _ARG_((Sfio_t *, ssize_t)); - extern int _sfsetpool _ARG_((Sfio_t *)); - extern char *_sfcvt _ARG_((Void_t *, int, int *, int *, int)); - extern char **_sfgetpath _ARG_((char *)); - extern Sfdouble_t _sfstrtod _ARG_((const char *, char **)); + extern int _sfpopen(Sfio_t *, int, int, int); + extern int _sfpclose(Sfio_t *); + extern int _sfmode(Sfio_t *, int, int); + extern int _sftype(const char *, int *, int *); + extern int _sfexcept(Sfio_t *, int, ssize_t, Sfdisc_t *); + extern Sfrsrv_t *_sfrsrv(Sfio_t *, ssize_t); + extern int _sfsetpool(Sfio_t *); + extern char *_sfcvt(Void_t *, int, int *, int *, int); + extern char **_sfgetpath(char *); + extern Sfdouble_t _sfstrtod(const char *, char **); #if !_lib_strtod #define strtod _sfstrtod @@ -925,14 +924,14 @@ extern "C" { /* for portable encoding of double values */ #if !__STDC__ #ifndef WIN32 - extern double frexp _ARG_((double, int *)); - extern double ldexp _ARG_((double, int)); + extern double frexp(double, int *); + extern double ldexp(double, int); #endif #endif #if !defined(_hdr_mman) && !_sys_mman - extern Void_t *mmap _ARG_((Void_t *, size_t, int, int, int, off_t)); - extern int munmap _ARG_((Void_t *, size_t)); + extern Void_t *mmap(Void_t *, size_t, int, int, int, off_t); + extern int munmap(Void_t *, size_t); #endif #if !defined(_PACKAGE_ast) @@ -943,61 +942,61 @@ extern "C" { #define SF_ERROR 0000400 /* an error happened */ #else #if !_hdr_unistd - extern int close _ARG_((int)); - extern ssize_t read _ARG_((int, void *, size_t)); - extern ssize_t write _ARG_((int, const void *, size_t)); - extern off_t lseek _ARG_((int, off_t, int)); - extern int dup _ARG_((int)); - extern int isatty _ARG_((int)); - extern int wait _ARG_((int *)); - extern int pipe _ARG_((int *)); - extern int access _ARG_((const char *, int)); - extern uint sleep _ARG_((uint)); - extern int execl _ARG_((const char *, const char *, ...)); - extern int execv _ARG_((const char *, char **)); + extern int close(int); + extern ssize_t read(int, void *, size_t); + extern ssize_t write(int, const void *, size_t); + extern off_t lseek(int, off_t, int); + extern int dup(int); + extern int isatty(int); + extern int wait(int *); + extern int pipe(int *); + extern int access(const char *, int); + extern uint sleep(uint); + extern int execl(const char *, const char *, ...); + extern int execv(const char *, char **); #if !defined(fork) - extern int fork _ARG_((void)); + extern int fork(void); #endif #if _lib_unlink - extern int unlink _ARG_((const char *)); + extern int unlink(const char *); #endif #endif /*_hdr_unistd*/ #endif /* WIN32 */ #if _lib_bcopy && !_proto_bcopy - extern void bcopy _ARG_((const void *, void *, size_t)); + extern void bcopy(const void *, void *, size_t); #endif #if _lib_bzero && !_proto_bzero - extern void bzero _ARG_((void *, size_t)); + extern void bzero(void *, size_t); #endif - extern time_t time _ARG_((time_t *)); - extern int waitpid _ARG_((int, int *, int)); + extern time_t time(time_t *); + extern int waitpid(int, int *, int); #ifndef WIN32 - extern void _exit _ARG_((int)); + extern void _exit(int); #endif - typedef int (*Onexit_f) _ARG_((void)); - extern Onexit_f onexit _ARG_((Onexit_f)); + typedef int (*Onexit_f)(void); + extern Onexit_f onexit(Onexit_f); #if _sys_stat - extern int fstat _ARG_((int, Stat_t *)); + extern int fstat(int, Stat_t *); #endif #if _lib_vfork && !defined(_hdr_vfork) && !defined(_sys_vfork) - extern pid_t vfork _ARG_((void)); + extern pid_t vfork(void); #endif /*_lib_vfork*/ #if defined(_lib_poll) #if _lib_poll_fd_1 - extern int poll _ARG_((struct pollfd *, ulong, int)); + extern int poll(struct pollfd *, ulong, int); #else - extern int poll _ARG_((ulong, struct pollfd *, int)); + extern int poll(ulong, struct pollfd *, int); #endif #endif /*_lib_poll*/ #if _proto_open && defined(__cplusplus) - extern int open _ARG_((const char *, int, ...)); + extern int open(const char *, int, ...); #endif #endif /* defined(_PACKAGE_ast) */ diff --git a/lib/sfio/sfio.h b/lib/sfio/sfio.h index 04fdb4bc2..77fb26466 100644 --- a/lib/sfio/sfio.h +++ b/lib/sfio/sfio.h @@ -107,11 +107,11 @@ extern "C" { typedef struct _sfdisc_s Sfdisc_t; typedef ssize_t(*Sfread_f) - _ARG_((Sfio_t *, Void_t *, size_t, Sfdisc_t *)); + (Sfio_t *, Void_t *, size_t, Sfdisc_t *); typedef ssize_t(*Sfwrite_f) - _ARG_((Sfio_t *, const Void_t *, size_t, Sfdisc_t *)); - typedef Sfoff_t(*Sfseek_f) _ARG_((Sfio_t *, Sfoff_t, int, Sfdisc_t *)); - typedef int (*Sfexcept_f) _ARG_((Sfio_t *, int, Void_t *, Sfdisc_t *)); + (Sfio_t *, const Void_t *, size_t, Sfdisc_t *); + typedef Sfoff_t(*Sfseek_f) (Sfio_t *, Sfoff_t, int, Sfdisc_t *); + typedef int (*Sfexcept_f) (Sfio_t *, int, Void_t *, Sfdisc_t *); /* discipline structure */ struct _sfdisc_s { @@ -141,9 +141,8 @@ extern "C" { /* formatting environment */ typedef struct _sffmt_s Sffmt_t; - typedef int (*Sffmtext_f) _ARG_((Sfio_t *, Void_t *, Sffmt_t *)); - typedef int (*Sffmtevent_f) - _ARG_((Sfio_t *, int, Void_t *, Sffmt_t *)); + typedef int (*Sffmtext_f)(Sfio_t *, Void_t *, Sffmt_t *); + typedef int (*Sffmtevent_f)(Sfio_t *, int, Void_t *, Sffmt_t *); struct _sffmt_s { long version; /* version of this structure */ Sffmtext_f extf; /* function to process arguments */ @@ -302,93 +301,92 @@ extern "C" { #define extern __EXPORT__ #endif - extern Sfio_t *sfnew _ARG_((Sfio_t *, Void_t *, size_t, int, int)); - extern Sfio_t *sfopen _ARG_((Sfio_t *, const char *, const char *)); - extern Sfio_t *sfpopen _ARG_((Sfio_t *, const char *, const char *)); - extern Sfio_t *sfstack _ARG_((Sfio_t *, Sfio_t *)); - extern Sfio_t *sfswap _ARG_((Sfio_t *, Sfio_t *)); - extern Sfio_t *sftmp _ARG_((size_t)); - extern int sfpurge _ARG_((Sfio_t *)); - extern int sfpoll _ARG_((Sfio_t **, int, int)); - extern Void_t *sfreserve _ARG_((Sfio_t *, ssize_t, int)); - extern int sfsync _ARG_((Sfio_t *)); - extern int sfclrlock _ARG_((Sfio_t *)); - extern Void_t *sfsetbuf _ARG_((Sfio_t *, Void_t *, size_t)); - extern Sfdisc_t *sfdisc _ARG_((Sfio_t *, Sfdisc_t *)); - extern int sfraise _ARG_((Sfio_t *, int, Void_t *)); - extern int sfnotify _ARG_((void (*)(Sfio_t *, int, int))); - extern int sfset _ARG_((Sfio_t *, int, int)); - extern int sfsetfd _ARG_((Sfio_t *, int)); - extern Sfio_t *sfpool _ARG_((Sfio_t *, Sfio_t *, int)); - extern ssize_t sfread _ARG_((Sfio_t *, Void_t *, size_t)); - extern ssize_t sfwrite _ARG_((Sfio_t *, const Void_t *, size_t)); - extern Sfoff_t sfmove _ARG_((Sfio_t *, Sfio_t *, Sfoff_t, int)); - extern int sfclose _ARG_((Sfio_t *)); - extern Sfoff_t sftell _ARG_((Sfio_t *)); - extern Sfoff_t sfseek _ARG_((Sfio_t *, Sfoff_t, int)); - extern ssize_t sfputr _ARG_((Sfio_t *, const char *, int)); - extern char *sfgetr _ARG_((Sfio_t *, int, int)); - extern ssize_t sfnputc _ARG_((Sfio_t *, int, size_t)); - extern int sfungetc _ARG_((Sfio_t *, int)); - extern int sfprintf _ARG_((Sfio_t *, const char *, ...)); - extern char *sfprints _ARG_((const char *, ...)); - extern int sfsprintf _ARG_((char *, int, const char *, ...)); - extern int sfvsprintf _ARG_((char *, int, const char *, va_list)); - extern int sfvprintf _ARG_((Sfio_t *, const char *, va_list)); - extern int sfscanf _ARG_((Sfio_t *, const char *, ...)); - extern int sfsscanf _ARG_((const char *, const char *, ...)); - extern int sfvsscanf _ARG_((const char *, const char *, va_list)); - extern int sfvscanf _ARG_((Sfio_t *, const char *, va_list)); - extern int sfresize _ARG_((Sfio_t *, Sfoff_t)); + extern Sfio_t *sfnew(Sfio_t *, Void_t *, size_t, int, int); + extern Sfio_t *sfopen(Sfio_t *, const char *, const char *); + extern Sfio_t *sfpopen(Sfio_t *, const char *, const char *); + extern Sfio_t *sfstack(Sfio_t *, Sfio_t *); + extern Sfio_t *sfswap(Sfio_t *, Sfio_t *); + extern Sfio_t *sftmp(size_t); + extern int sfpurge(Sfio_t *); + extern int sfpoll(Sfio_t **, int, int); + extern Void_t *sfreserve(Sfio_t *, ssize_t, int); + extern int sfsync(Sfio_t *); + extern int sfclrlock(Sfio_t *); + extern Void_t *sfsetbuf(Sfio_t *, Void_t *, size_t); + extern Sfdisc_t *sfdisc(Sfio_t *, Sfdisc_t *); + extern int sfraise(Sfio_t *, int, Void_t *); + extern int sfnotify(void (*)(Sfio_t *, int, int)); + extern int sfset(Sfio_t *, int, int); + extern int sfsetfd(Sfio_t *, int); + extern Sfio_t *sfpool(Sfio_t *, Sfio_t *, int); + extern ssize_t sfread(Sfio_t *, Void_t *, size_t); + extern ssize_t sfwrite(Sfio_t *, const Void_t *, size_t); + extern Sfoff_t sfmove(Sfio_t *, Sfio_t *, Sfoff_t, int); + extern int sfclose(Sfio_t *); + extern Sfoff_t sftell(Sfio_t *); + extern Sfoff_t sfseek(Sfio_t *, Sfoff_t, int); + extern ssize_t sfputr(Sfio_t *, const char *, int); + extern char *sfgetr(Sfio_t *, int, int); + extern ssize_t sfnputc(Sfio_t *, int, size_t); + extern int sfungetc(Sfio_t *, int); + extern int sfprintf(Sfio_t *, const char *, ...); + extern char *sfprints(const char *, ...); + extern int sfsprintf(char *, int, const char *, ...); + extern int sfvsprintf(char *, int, const char *, va_list); + extern int sfvprintf(Sfio_t *, const char *, va_list); + extern int sfscanf(Sfio_t *, const char *, ...); + extern int sfsscanf(const char *, const char *, ...); + extern int sfvsscanf(const char *, const char *, va_list); + extern int sfvscanf(Sfio_t *, const char *, va_list); + extern int sfresize(Sfio_t *, Sfoff_t); /* mutex locking for thread-safety */ - extern int sfmutex _ARG_((Sfio_t *, int)); + extern int sfmutex(Sfio_t *, int); /* io functions with discipline continuation */ - extern ssize_t sfrd _ARG_((Sfio_t *, Void_t *, size_t, Sfdisc_t *)); - extern ssize_t sfwr - _ARG_((Sfio_t *, const Void_t *, size_t, Sfdisc_t *)); - extern Sfoff_t sfsk _ARG_((Sfio_t *, Sfoff_t, int, Sfdisc_t *)); - extern ssize_t sfpkrd _ARG_((int, Void_t *, size_t, int, long, int)); + extern ssize_t sfrd(Sfio_t *, Void_t *, size_t, Sfdisc_t *); + extern ssize_t sfwr(Sfio_t *, const Void_t *, size_t, Sfdisc_t *); + extern Sfoff_t sfsk(Sfio_t *, Sfoff_t, int, Sfdisc_t *); + extern ssize_t sfpkrd(int, Void_t *, size_t, int, long, int); /* portable handling of primitive types */ - extern int sfdlen _ARG_((Sfdouble_t)); - extern int sfllen _ARG_((Sflong_t)); - extern int sfulen _ARG_((Sfulong_t)); - - extern int sfputd _ARG_((Sfio_t *, Sfdouble_t)); - extern int sfputl _ARG_((Sfio_t *, Sflong_t)); - extern int sfputu _ARG_((Sfio_t *, Sfulong_t)); - extern int sfputm _ARG_((Sfio_t *, Sfulong_t, Sfulong_t)); - extern int sfputc _ARG_((Sfio_t *, int)); - - extern Sfdouble_t sfgetd _ARG_((Sfio_t *)); - extern Sflong_t sfgetl _ARG_((Sfio_t *)); - extern Sfulong_t sfgetu _ARG_((Sfio_t *)); - extern Sfulong_t sfgetm _ARG_((Sfio_t *, Sfulong_t)); - extern int sfgetc _ARG_((Sfio_t *)); - - extern int _sfputd _ARG_((Sfio_t *, Sfdouble_t)); - extern int _sfputl _ARG_((Sfio_t *, Sflong_t)); - extern int _sfputu _ARG_((Sfio_t *, Sfulong_t)); - extern int _sfputm _ARG_((Sfio_t *, Sfulong_t, Sfulong_t)); - extern int _sfflsbuf _ARG_((Sfio_t *, int)); - - extern int _sffilbuf _ARG_((Sfio_t *, int)); - - extern int _sfdlen _ARG_((Sfdouble_t)); - extern int _sfllen _ARG_((Sflong_t)); - extern int _sfulen _ARG_((Sfulong_t)); + extern int sfdlen(Sfdouble_t); + extern int sfllen(Sflong_t); + extern int sfulen(Sfulong_t); + + extern int sfputd(Sfio_t *, Sfdouble_t); + extern int sfputl(Sfio_t *, Sflong_t); + extern int sfputu(Sfio_t *, Sfulong_t); + extern int sfputm(Sfio_t *, Sfulong_t, Sfulong_t); + extern int sfputc(Sfio_t *, int); + + extern Sfdouble_t sfgetd(Sfio_t *); + extern Sflong_t sfgetl(Sfio_t *); + extern Sfulong_t sfgetu(Sfio_t *); + extern Sfulong_t sfgetm(Sfio_t *, Sfulong_t); + extern int sfgetc(Sfio_t *); + + extern int _sfputd(Sfio_t *, Sfdouble_t); + extern int _sfputl(Sfio_t *, Sflong_t); + extern int _sfputu(Sfio_t *, Sfulong_t); + extern int _sfputm(Sfio_t *, Sfulong_t, Sfulong_t); + extern int _sfflsbuf(Sfio_t *, int); + + extern int _sffilbuf(Sfio_t *, int); + + extern int _sfdlen(Sfdouble_t); + extern int _sfllen(Sflong_t); + extern int _sfulen(Sfulong_t); /* miscellaneous function analogues of fast in-line functions */ - extern Sfoff_t sfsize _ARG_((Sfio_t *)); - extern int sfclrerr _ARG_((Sfio_t *)); - extern int sfeof _ARG_((Sfio_t *)); - extern int sferror _ARG_((Sfio_t *)); - extern int sffileno _ARG_((Sfio_t *)); - extern int sfstacked _ARG_((Sfio_t *)); - extern ssize_t sfvalue _ARG_((Sfio_t *)); - extern ssize_t sfslen _ARG_((void)); + extern Sfoff_t sfsize(Sfio_t *); + extern int sfclrerr(Sfio_t *); + extern int sfeof(Sfio_t *); + extern int sferror(Sfio_t *); + extern int sffileno(Sfio_t *); + extern int sfstacked(Sfio_t *); + extern ssize_t sfvalue(Sfio_t *); + extern ssize_t sfslen(void); #undef extern _END_EXTERNS_ diff --git a/lib/sfio/sfmode.c b/lib/sfio/sfmode.c index b6f8ad538..74018c3f8 100644 --- a/lib/sfio/sfmode.c +++ b/lib/sfio/sfmode.c @@ -40,7 +40,7 @@ static char *Version = "\n@(#)sfio (AT&T Labs - kpv) 2001-02-01\0\n"; #define Sfsignal_f Sig_handler_t #else #include -typedef void (*Sfsignal_f) _ARG_((int)); +typedef void (*Sfsignal_f) (int); #endif static int _Sfsigp = 0; /* # of streams needing SIGPIPE protection */ diff --git a/lib/sfio/sfsetbuf.c b/lib/sfio/sfsetbuf.c index 2d959d887..e76b58e2b 100644 --- a/lib/sfio/sfsetbuf.c +++ b/lib/sfio/sfsetbuf.c @@ -26,7 +26,7 @@ __STDPP__directive pragma pp:nohide getpagesize #endif #if _lib_getpagesize -_BEGIN_EXTERNS_ extern int getpagesize _ARG_((void)); +_BEGIN_EXTERNS_ extern int getpagesize(void); _END_EXTERNS_ #endif /* Set a (new) buffer for a stream. diff --git a/lib/sfio/sftmp.c b/lib/sfio/sftmp.c index 464dcf534..054117725 100644 --- a/lib/sfio/sftmp.c +++ b/lib/sfio/sftmp.c @@ -257,7 +257,7 @@ static int _tmpexcept(Sfio_t * f, int type, Void_t * val, Sfdisc_t * disc) reg int fd, m; reg Sfio_t *sf; Sfio_t newf, savf; - void (*notifyf) _ARG_((Sfio_t *, int, int)); + void (*notifyf) (Sfio_t *, int, int); NOTUSED(val); diff --git a/lib/sfio/vthread.h b/lib/sfio/vthread.h index 33a033c2a..1a994825e 100644 --- a/lib/sfio/vthread.h +++ b/lib/sfio/vthread.h @@ -101,26 +101,26 @@ extern "C" { #define EPERM 1 #endif - _BEGIN_EXTERNS_ extern Vthread_t *vtopen _ARG_((Vthread_t *, int)); - extern int vtclose _ARG_((Vthread_t *)); - extern int vtset _ARG_((Vthread_t *, int, Void_t *)); - extern int vtrun _ARG_((Vthread_t *, void *(*)(void *), void *)); - extern int vtkill _ARG_((Vthread_t *)); - extern int vtwait _ARG_((Vthread_t *)); - -/* extern int vtonce _ARG_((Vtonce_t *, void (*)())); */ - - extern Vtmutex_t *vtmtxopen _ARG_((Vtmutex_t *, int)); - extern int vtmtxclose _ARG_((Vtmutex_t *)); - extern int vtmtxlock _ARG_((Vtmutex_t *)); - extern int vtmtxtrylock _ARG_((Vtmutex_t *)); - extern int vtmtxunlock _ARG_((Vtmutex_t *)); - extern int vtmtxclrlock _ARG_((Vtmutex_t *)); - - extern Void_t *vtstatus _ARG_((Vthread_t *)); - extern int vterror _ARG_((Vthread_t *)); - extern int vtmtxerror _ARG_((Vtmutex_t *)); - extern int vtonceerror _ARG_((Vtonce_t *)); + _BEGIN_EXTERNS_ extern Vthread_t *vtopen(Vthread_t *, int); + extern int vtclose(Vthread_t *); + extern int vtset(Vthread_t *, int, Void_t *); + extern int vtrun(Vthread_t *, void *(*)(void *), void *); + extern int vtkill(Vthread_t *); + extern int vtwait(Vthread_t *); + +/* extern int vtonce(Vtonce_t *, void (*)()); */ + + extern Vtmutex_t *vtmtxopen(Vtmutex_t *, int); + extern int vtmtxclose(Vtmutex_t *); + extern int vtmtxlock(Vtmutex_t *); + extern int vtmtxtrylock(Vtmutex_t *); + extern int vtmtxunlock(Vtmutex_t *); + extern int vtmtxclrlock(Vtmutex_t *); + + extern Void_t *vtstatus(Vthread_t *); + extern int vterror(Vthread_t *); + extern int vtmtxerror(Vtmutex_t *); + extern int vtonceerror(Vtonce_t *); _END_EXTERNS_ #if defined(vt_threaded) && vt_threaded diff --git a/lib/vmalloc/features/common b/lib/vmalloc/features/common index 8f649c96a..fce0e3593 100644 --- a/lib/vmalloc/features/common +++ b/lib/vmalloc/features/common @@ -78,11 +78,6 @@ cat{ #endif #endif /*_BEGIN_EXTERNS_*/ - /* _ARG_ simplifies function prototyping among flavors of C */ - #ifndef _ARG_ - #define _ARG_(x) x - #endif /*_ARG_*/ - /* __INLINE__ is the inline keyword */ #if !defined(__INLINE__) && defined(__cplusplus) #define __INLINE__ inline @@ -152,7 +147,7 @@ tst - -DN=0 - -DN=1 - -DN=2 - -DN=3 - -DN=4 - -DN=5 - -DN=6 - -DN=7 - -DN=8 outp #endif _BEGIN_EXTERNS_ - extern int printf _ARG_((const char*, ...)); + extern int printf(const char*, ...); _END_EXTERNS_ #if N == 0 @@ -289,7 +284,7 @@ tst - -DTRY=1 - -DTRY=1 -Dvoid=char - -DTRY=2 - -DTRY=3 - -DTRY=4 output{ #endif #undef printf _BEGIN_EXTERNS_ - extern int printf _ARG_((const char*, ...)); + extern int printf(const char*, ...); _END_EXTERNS_ static va_list ap; main() diff --git a/lib/vmalloc/features/vmalloc b/lib/vmalloc/features/vmalloc index 6300ca60f..1e0280379 100644 --- a/lib/vmalloc/features/vmalloc +++ b/lib/vmalloc/features/vmalloc @@ -21,8 +21,8 @@ hdr dlfcn std malloc note{ stuck with standard malloc }end noexecute{ _BEGIN_EXTERNS_ - extern void _exit _ARG_((int)); - extern char* strdup _ARG_((const char*)); + extern void _exit(int); + extern char* strdup(const char*); #if _STD_ char* malloc(unsigned n) { _exit(0); return 0; } #else @@ -94,8 +94,8 @@ stk down note{ stack grows downward }end execute{ exit cleanup note{ stuck with standard _cleanup }end execute{ #include _BEGIN_EXTERNS_ - extern void exit _ARG_((int)); - extern void _exit _ARG_((int)); + extern void exit(int); + extern void _exit(int); extern void _cleanup(); void _cleanup() { _exit(0); } _END_EXTERNS_ diff --git a/lib/vmalloc/vmalloc.h b/lib/vmalloc/vmalloc.h index 14a5f3902..266860ee1 100644 --- a/lib/vmalloc/vmalloc.h +++ b/lib/vmalloc/vmalloc.h @@ -36,9 +36,9 @@ extern "C" { typedef struct _vmdisc_s Vmdisc_t; typedef struct _vmethod_s Vmethod_t; typedef Void_t *(*Vmemory_f) - _ARG_((Vmalloc_t *, Void_t *, size_t, size_t, Vmdisc_t *)); + (Vmalloc_t *, Void_t *, size_t, size_t, Vmdisc_t *); typedef int (*Vmexcept_f) - _ARG_((Vmalloc_t *, int, Void_t *, Vmdisc_t *)); + (Vmalloc_t *, int, Void_t *, Vmdisc_t *); struct _vmstat_s { int n_busy; /* number of busy blocks */ @@ -58,13 +58,13 @@ extern "C" { }; struct _vmethod_s { - Void_t *(*allocf) _ARG_((Vmalloc_t *, size_t)); - Void_t *(*resizef) _ARG_((Vmalloc_t *, Void_t *, size_t, int)); - int (*freef) _ARG_((Vmalloc_t *, Void_t *)); - long (*addrf) _ARG_((Vmalloc_t *, Void_t *)); - long (*sizef) _ARG_((Vmalloc_t *, Void_t *)); - int (*compactf) _ARG_((Vmalloc_t *)); - Void_t *(*alignf) _ARG_((Vmalloc_t *, size_t, size_t)); + Void_t *(*allocf) (Vmalloc_t *, size_t); + Void_t *(*resizef) (Vmalloc_t *, Void_t *, size_t, int); + int (*freef) (Vmalloc_t *, Void_t *); + long (*addrf) (Vmalloc_t *, Void_t *); + long (*sizef) (Vmalloc_t *, Void_t *); + int (*compactf) (Vmalloc_t *); + Void_t *(*alignf) (Vmalloc_t *, size_t, size_t); unsigned short meth; }; @@ -135,39 +135,39 @@ extern "C" { #if _BLD_vmalloc && defined(__EXPORT__) #define extern __EXPORT__ #endif - extern Vmalloc_t *vmopen _ARG_((Vmdisc_t *, Vmethod_t *, int)); - extern int vmclose _ARG_((Vmalloc_t *)); - extern int vmclear _ARG_((Vmalloc_t *)); - extern int vmcompact _ARG_((Vmalloc_t *)); + extern Vmalloc_t *vmopen(Vmdisc_t *, Vmethod_t *, int); + extern int vmclose(Vmalloc_t *); + extern int vmclear(Vmalloc_t *); + extern int vmcompact(Vmalloc_t *); - extern Vmdisc_t *vmdisc _ARG_((Vmalloc_t *, Vmdisc_t *)); + extern Vmdisc_t *vmdisc(Vmalloc_t *, Vmdisc_t *); - extern Void_t *vmalloc _ARG_((Vmalloc_t *, size_t)); - extern Void_t *vmalign _ARG_((Vmalloc_t *, size_t, size_t)); - extern Void_t *vmresize _ARG_((Vmalloc_t *, Void_t *, size_t, int)); - extern int vmfree _ARG_((Vmalloc_t *, Void_t *)); + extern Void_t *vmalloc(Vmalloc_t *, size_t); + extern Void_t *vmalign(Vmalloc_t *, size_t, size_t); + extern Void_t *vmresize(Vmalloc_t *, Void_t *, size_t, int); + extern int vmfree(Vmalloc_t *, Void_t *); - extern long vmaddr _ARG_((Vmalloc_t *, Void_t *)); - extern long vmsize _ARG_((Vmalloc_t *, Void_t *)); + extern long vmaddr(Vmalloc_t *, Void_t *); + extern long vmsize(Vmalloc_t *, Void_t *); - extern Vmalloc_t *vmregion _ARG_((Void_t *)); - extern Void_t *vmsegment _ARG_((Vmalloc_t *, Void_t *)); - extern int vmset _ARG_((Vmalloc_t *, int, int)); + extern Vmalloc_t *vmregion(Void_t *); + extern Void_t *vmsegment(Vmalloc_t *, Void_t *); + extern int vmset(Vmalloc_t *, int, int); - extern Void_t *vmdbwatch _ARG_((Void_t *)); - extern int vmdbcheck _ARG_((Vmalloc_t *)); + extern Void_t *vmdbwatch(Void_t *); + extern int vmdbcheck(Vmalloc_t *); - extern int vmprofile _ARG_((Vmalloc_t *, int)); + extern int vmprofile(Vmalloc_t *, int); - extern int vmtrace _ARG_((int)); - extern int vmtrbusy _ARG_((Vmalloc_t *)); + extern int vmtrace(int); + extern int vmtrbusy(Vmalloc_t *); - extern int vmstat _ARG_((Vmalloc_t *, Vmstat_t *)); + extern int vmstat(Vmalloc_t *, Vmstat_t *); - extern int vmwalk _ARG_((Vmalloc_t *, + extern int vmwalk(Vmalloc_t *, int (*)(Vmalloc_t *, Void_t *, size_t, - Vmdisc_t *))); - extern char *vmstrdup _ARG_((Vmalloc_t *, const char *)); + Vmdisc_t *)); + extern char *vmstrdup(Vmalloc_t *, const char *); #undef extern diff --git a/lib/vmalloc/vmexit.c b/lib/vmalloc/vmexit.c index b63b1f8d4..de0073486 100644 --- a/lib/vmalloc/vmexit.c +++ b/lib/vmalloc/vmexit.c @@ -32,7 +32,7 @@ int atexit(void (*exitf) (void)) typedef struct _exit_s { struct _exit_s *next; - void (*exitf) _ARG_((void)); + void (*exitf)(void); } Exit_t; static Exit_t *Exit; diff --git a/lib/vmalloc/vmhdr.h b/lib/vmalloc/vmhdr.h index 509a9ad5c..909aec780 100644 --- a/lib/vmalloc/vmhdr.h +++ b/lib/vmalloc/vmhdr.h @@ -88,7 +88,7 @@ extern "C" { #define ASSERT(p) #define COUNT(n) #else - extern int printf _ARG_((const char *, ...)); + extern int printf(const char *, ...); #if defined(__LINE__) && defined(__FILE__) #define PRFILELINE printf("Assertion failed at %s:%d\n",__FILE__,__LINE__) #else @@ -410,16 +410,16 @@ extern "C" { } /* external symbols for internal use by vmalloc */ - typedef Block_t *(*Vmsearch_f) _ARG_((Vmdata_t *, size_t, Block_t *)); + typedef Block_t *(*Vmsearch_f) (Vmdata_t *, size_t, Block_t *); typedef struct _vmextern_ { - Block_t *(*vm_extend) _ARG_((Vmalloc_t *, size_t, Vmsearch_f)); - int (*vm_truncate) _ARG_((Vmalloc_t *, Seg_t *, size_t, int)); + Block_t *(*vm_extend) (Vmalloc_t *, size_t, Vmsearch_f); + int (*vm_truncate) (Vmalloc_t *, Seg_t *, size_t, int); size_t vm_pagesize; - char *(*vm_strcpy) _ARG_((char *, char *, int)); - char *(*vm_itoa) _ARG_((Vmulong_t, int)); - void (*vm_trace) _ARG_((Vmalloc_t *, - Vmuchar_t *, Vmuchar_t *, size_t, size_t)); - void (*vm_pfclose) _ARG_((Vmalloc_t *)); + char *(*vm_strcpy) (char *, char *, int); + char *(*vm_itoa) (Vmulong_t, int); + void (*vm_trace) (Vmalloc_t *, + Vmuchar_t *, Vmuchar_t *, size_t, size_t); + void (*vm_pfclose) (Vmalloc_t *); } Vmextern_t; #define _Vmextend (_Vmextern.vm_extend) @@ -435,11 +435,11 @@ extern "C" { #if !defined(_PACKAGE_ast) - extern size_t getpagesize _ARG_((void)); + extern size_t getpagesize(void); #ifndef WIN32 - extern void abort _ARG_((void)); - extern ssize_t write _ARG_((int, const void *, size_t)); + extern void abort(void); + extern ssize_t write(int, const void *, size_t); #endif #ifndef cfree @@ -451,17 +451,17 @@ extern "C" { /* for malloc.c */ #ifndef WIN32 - extern int creat _ARG_((const char *, int)); - extern int close _ARG_((int)); + extern int creat(const char *, int); + extern int close(int); #endif - extern int getpid _ARG_((void)); + extern int getpid(void); /* for vmexit.c */ #ifndef WIN32 - extern int onexit _ARG_((void (*)(void))); - extern void _exit _ARG_((int)); + extern int onexit(void(*)(void)); + extern void _exit(int); #endif - extern void _cleanup _ARG_((void)); + extern void _cleanup(void); #endif /*!PACKAGE_ast */ @@ -470,7 +470,7 @@ extern "C" { typedef int ssize_t; #endif #if !defined(_WIN32) - extern Vmuchar_t *sbrk _ARG_((ssize_t)); + extern Vmuchar_t *sbrk(ssize_t); #endif _END_EXTERNS_ diff --git a/lib/vmalloc/vmprivate.c b/lib/vmalloc/vmprivate.c index 0f3ad4c27..33f675e56 100644 --- a/lib/vmalloc/vmprivate.c +++ b/lib/vmalloc/vmprivate.c @@ -256,9 +256,9 @@ static int vmtruncate(Vmalloc_t * vm, Seg_t * seg, size_t size, int exact) Vmextern_t _Vmextern = { vmextend, /* _Vmextend */ vmtruncate, /* _Vmtruncate */ 0, /* _Vmpagesize */ - NIL(char *(*)_ARG_((char *, char *, int))), /* _Vmstrcpy */ - NIL(char *(*)_ARG_((Vmulong_t, int))), /* _Vmitoa */ - NIL(void (*)_ARG_((Vmalloc_t *, - Vmuchar_t *, Vmuchar_t *, size_t, size_t))), /* _Vmtrace */ - NIL(void (*)_ARG_((Vmalloc_t *))) /* _Vmpfclose */ + NIL(char *(*)(char *, char *, int)), /* _Vmstrcpy */ + NIL(char *(*)(Vmulong_t, int)), /* _Vmitoa */ + NIL(void (*)(Vmalloc_t *, + Vmuchar_t *, Vmuchar_t *, size_t, size_t)), /* _Vmtrace */ + NIL(void (*)(Vmalloc_t *)) /* _Vmpfclose */ }; diff --git a/windows/include/ast_common.h b/windows/include/ast_common.h index 2ca6cf2fa..dc03822c6 100644 --- a/windows/include/ast_common.h +++ b/windows/include/ast_common.h @@ -56,11 +56,6 @@ #endif #endif /*_BEGIN_EXTERNS_*/ -/* _ARG_ simplifies function prototyping among flavors of C */ -#ifndef _ARG_ -#define _ARG_(x) x -#endif /*_ARG_*/ - /* __INLINE__ is the inline keyword */ #if !defined(__INLINE__) && defined(__cplusplus) #define __INLINE__ inline