From db242ed39de7e0ebf5fbb15fa468886aab87891c Mon Sep 17 00:00:00 2001 From: Ben Gras Date: Sun, 25 Mar 2012 20:38:37 +0200 Subject: [PATCH] retire _CONST, _VOLATILE, _SIZET, _ARGS, _VOID --- commands/acknm/acknm.c | 2 +- commands/fingerd/fingerd.c | 4 +-- commands/host/host.c | 34 +++++++++--------- commands/hostaddr/hostaddr.c | 4 +-- commands/reboot/halt.c | 6 ++-- commands/reboot/sh_wall.c | 4 +-- commands/reboot/shutdown.c | 22 ++++++------ commands/rlogin/rlogin.c | 66 +++++++++++++++++------------------ commands/rsh/rsh.c | 10 +++--- commands/tcpstat/Makefile | 2 +- commands/udpstat/Makefile | 2 +- include/minix/ansi.h | 21 ----------- include/minix/queryparam.h | 10 +++--- include/net/gen/if_ether.h | 10 +++--- include/net/gen/inet.h | 8 ++--- include/net/gen/oneCsum.h | 2 +- lib/libc/gen/minix/popen.c | 4 +-- lib/libc/sys-minix/access.c | 2 +- lib/libc/sys-minix/chdir.c | 2 +- lib/libc/sys-minix/chroot.c | 2 +- lib/libc/sys-minix/mount.c | 4 +-- lib/libc/sys-minix/pathconf.c | 2 +- servers/inet/Makefile | 2 +- servers/inet/generic/eth.h | 2 +- servers/inet/queryparam.h | 10 +++--- test/test1.c | 2 +- test/test5.c | 2 +- 27 files changed, 110 insertions(+), 131 deletions(-) diff --git a/commands/acknm/acknm.c b/commands/acknm/acknm.c index 9a5261008..cb043fffe 100644 --- a/commands/acknm/acknm.c +++ b/commands/acknm/acknm.c @@ -86,7 +86,7 @@ char **argv; } int nm_sort(tmp_stbl1, tmp_stbl2) -_CONST void *tmp_stbl1, *tmp_stbl2; +const void *tmp_stbl1, *tmp_stbl2; { struct nlist *stbl1 = (struct nlist *)tmp_stbl1; diff --git a/commands/fingerd/fingerd.c b/commands/fingerd/fingerd.c index db86e8ec9..92cacab7a 100644 --- a/commands/fingerd/fingerd.c +++ b/commands/fingerd/fingerd.c @@ -19,8 +19,8 @@ static char sccsid[] = "@(#)in.fingerd.c 1.1 87/12/21 SMI"; /* from UCB 5.1 6/6/ #include #include -int main _ARGS(( int argc, char *argv[] )); -void fatal _ARGS(( char *prog, char *s )); +int main( int argc, char *argv[] ); +void fatal( char *prog, char *s ); int main(argc, argv) char *argv[]; diff --git a/commands/host/host.c b/commands/host/host.c index 57808945c..0a5fa787e 100644 --- a/commands/host/host.c +++ b/commands/host/host.c @@ -104,24 +104,24 @@ int server_specified = 0; union querybuf; -int main _ARGS(( int c, char *v[] )); +int main( int c, char *v[] ); -static int parsetype _ARGS(( char *s )); -static int parseclass _ARGS(( char *s )); -static void hperror _ARGS(( int err_no )); -static void printanswer _ARGS(( struct hostent *hp )); -static int ListHosts _ARGS(( char *namePtr, int queryType )); -static int gethostinfo _ARGS(( char *name )); -static int getdomaininfo _ARGS(( char *name, char *domain )); -static int getinfo _ARGS(( char *name, char *domain, int type )); -static int printinfo _ARGS(( union querybuf *answer, u8_t *eom, int filter, - int isls )); -static char *DecodeError _ARGS(( int result )); -static u8_t *pr_rr _ARGS(( u8_t *cp, u8_t *msg, FILE *file, int filter )); -static u8_t * pr_cdname _ARGS(( u8_t *cp, u8_t *msg, u8_t *name, int namelen )); -static char *pr_class _ARGS(( int class )); -static char *pr_type _ARGS(( int type )); -static int tcpip_writeall _ARGS(( int fd, char *buf, unsigned siz )); +static int parsetype( char *s ); +static int parseclass( char *s ); +static void hperror( int err_no ); +static void printanswer( struct hostent *hp ); +static int ListHosts( char *namePtr, int queryType ); +static int gethostinfo( char *name ); +static int getdomaininfo( char *name, char *domain ); +static int getinfo( char *name, char *domain, int type ); +static int printinfo( union querybuf *answer, u8_t *eom, int filter, int + isls ); +static char *DecodeError( int result ); +static u8_t *pr_rr( u8_t *cp, u8_t *msg, FILE *file, int filter ); +static u8_t * pr_cdname( u8_t *cp, u8_t *msg, u8_t *name, int namelen ); +static char *pr_class( int class ); +static char *pr_type( int type ); +static int tcpip_writeall( int fd, char *buf, unsigned siz ); int main(c, v) diff --git a/commands/hostaddr/hostaddr.c b/commands/hostaddr/hostaddr.c index a33cba9c9..d45f4a114 100644 --- a/commands/hostaddr/hostaddr.c +++ b/commands/hostaddr/hostaddr.c @@ -40,8 +40,8 @@ char *prog_name; char DHCPCACHE[]=_PATH_DHCPCACHE; -int main _ARGS(( int argc, char *argv[] )); -void usage _ARGS(( void )); +int main( int argc, char *argv[] ); +void usage( void ); int main(argc, argv) int argc; diff --git a/commands/reboot/halt.c b/commands/reboot/halt.c index 62a122544..361d6835e 100644 --- a/commands/reboot/halt.c +++ b/commands/reboot/halt.c @@ -24,9 +24,9 @@ #include "wtmp.h" -void write_log _ARGS(( char *fn )); -void usage _ARGS(( void )); -int main _ARGS(( int argc, char *argv[] )); +void write_log( char *fn ); +void usage( void ); +int main( int argc, char *argv[] ); char *prog; char *reboot_code = "delay; boot"; diff --git a/commands/reboot/sh_wall.c b/commands/reboot/sh_wall.c index 82f76400f..6d836ec88 100644 --- a/commands/reboot/sh_wall.c +++ b/commands/reboot/sh_wall.c @@ -20,8 +20,8 @@ static char UTMP[] = "/etc/utmp"; /* Currently logged in users. */ -void wall _ARGS(( char *when, char *extra )); -void crnlcat _ARGS(( char *message, char *more )); +void wall( char *when, char *extra ); +void crnlcat( char *message, char *more ); void wall(when, extra) diff --git a/commands/reboot/shutdown.c b/commands/reboot/shutdown.c index 8578cbeaa..418aab8c2 100644 --- a/commands/reboot/shutdown.c +++ b/commands/reboot/shutdown.c @@ -47,17 +47,17 @@ static char NOLOGIN[] = "/etc/nologin"; #define inform_user inf_user #endif -void usage _ARGS(( void )); -void write_pid _ARGS(( void )); -int inform_user_time _ARGS(( void )); -void inform_user _ARGS(( void )); -void terminate _ARGS(( void )); -void wall _ARGS(( char *when, char *extra )); -int crash_check _ARGS(( void )); -void parse_time _ARGS(( char *arg )); -void get_message _ARGS(( void )); -int main _ARGS(( int argc, char *argv[] )); -char *itoa _ARGS(( int n )); +void usage( void ); +void write_pid( void ); +int inform_user_time( void ); +void inform_user( void ); +void terminate( void ); +void wall( char *when, char *extra ); +int crash_check( void ); +void parse_time( char *arg ); +void get_message( void ); +int main( int argc, char *argv[] ); +char *itoa( int n ); long wait_time=0L; char message[1024]; diff --git a/commands/rlogin/rlogin.c b/commands/rlogin/rlogin.c index af18abb69..e712b486d 100644 --- a/commands/rlogin/rlogin.c +++ b/commands/rlogin/rlogin.c @@ -142,45 +142,45 @@ struct winsize winsize; #define get_window_size(fd, wp) ioctl(fd, TIOCGWINSZ, wp) -extern int main _ARGS(( int argc, char **argv )); -static void usage _ARGS(( void )); -static u_char getescape _ARGS(( char *p )); -static char *speeds2str _ARGS(( speed_t speed )); -static void lostpeer _ARGS(( int sig )); -static void doit _ARGS(( void )); -static void setsignal _ARGS(( int sig, void (*act)(int sig) )); -static void msg _ARGS(( char *str )); -static void done _ARGS(( int status )); +extern int main( int argc, char **argv ); +static void usage( void ); +static u_char getescape( char *p ); +static char *speeds2str( speed_t speed ); +static void lostpeer( int sig ); +static void doit( void ); +static void setsignal( int sig, void (*act)(int sig) ); +static void msg( char *str ); +static void done( int status ); #if !__minix_vmd -static int reader _ARGS(( void )); +static int reader( void ); #endif -static void mode _ARGS(( int f )); +static void mode( int f ); #if __minix_vmd -static void mark_async _ARGS(( int fd )); -static void init_0 _ARGS(( void )); -static void init_1 _ARGS(( void )); -static void init_rd_rem _ARGS(( void )); -static void init_wr_rem _ARGS(( void )); -static void restart_0 _ARGS(( void )); -static void restart_1 _ARGS(( void )); -static void restart_rd_rem _ARGS(( void )); -static void restart_wr_rem _ARGS(( void )); -static void completed_0 _ARGS(( int result, int error )); -static void completed_1 _ARGS(( int result, int error )); -static void completed_rd_rem _ARGS(( int result, int error )); -static void completed_wr_rem _ARGS(( int result, int error )); -static void do_urg _ARGS(( int urg_byte )); +static void mark_async( int fd ); +static void init_0( void ); +static void init_1( void ); +static void init_rd_rem( void ); +static void init_wr_rem( void ); +static void restart_0( void ); +static void restart_1( void ); +static void restart_rd_rem( void ); +static void restart_wr_rem( void ); +static void completed_0( int result, int error ); +static void completed_1( int result, int error ); +static void completed_rd_rem( int result, int error ); +static void completed_wr_rem( int result, int error ); +static void do_urg( int urg_byte ); #endif #if !__minix_vmd -static void catch_child _ARGS(( int sig )); -static void writer _ARGS(( void )); +static void catch_child( int sig ); +static void writer( void ); #endif -static void echo _ARGS(( int c )); +static void echo( int c ); #if __minix_vmd -static void finish _ARGS(( void )); -static void sendwindow _ARGS(( void )); -static void sigwinch _ARGS(( int sig )); -static void subshell _ARGS(( void )); +static void finish( void ); +static void sendwindow( void ); +static void sigwinch( int sig ); +static void subshell( void ); #endif int main(argc, argv) @@ -540,7 +540,7 @@ printf("fwait: fw_fw= %d, fw_operation= %d, fw_result= %d, fw.fw_errno= %d\n", static void setsignal(sig, act) int sig; - void (*act) _ARGS(( int sig )); + void(*act) ( int sig ); { if (signal(sig, act) == SIG_IGN) (void)signal(sig, SIG_IGN); diff --git a/commands/rsh/rsh.c b/commands/rsh/rsh.c index d4bf6f44e..8e906e03b 100644 --- a/commands/rsh/rsh.c +++ b/commands/rsh/rsh.c @@ -59,11 +59,11 @@ static char sccsid[] = "@(#)rsh.c 5.24 (Berkeley) 7/1/91"; #include #include -int main _ARGS(( int argc, char *argv[] )); -void usage _ARGS(( void )); -char *copyargs _ARGS(( char **argv )); -void sendsig _ARGS(( int signo )); -void talk _ARGS(( int nflag, long omask, int pid, int rem )); +int main( int argc, char *argv[] ); +void usage( void ); +char *copyargs( char **argv ); +void sendsig( int signo ); +void talk( int nflag, long omask, int pid, int rem ); #define _PATH_RLOGIN1 "/bin/rlogin" #define _PATH_RLOGIN2 "/usr/bin/rlogin" diff --git a/commands/tcpstat/Makefile b/commands/tcpstat/Makefile index 47dbc14bb..d1d4a5436 100644 --- a/commands/tcpstat/Makefile +++ b/commands/tcpstat/Makefile @@ -1,5 +1,5 @@ PROG= tcpstat -CPPFLAGS+= -I${MINIXSRCDIR}/servers +CPPFLAGS+= -I${MINIXSRCDIR}/servers -D'ARGS(a)=a' MAN= .include diff --git a/commands/udpstat/Makefile b/commands/udpstat/Makefile index 20e6b7920..fa9dc8991 100644 --- a/commands/udpstat/Makefile +++ b/commands/udpstat/Makefile @@ -1,5 +1,5 @@ PROG= udpstat -CPPFLAGS+= -I${MINIXSRCDIR}/servers +CPPFLAGS+= -I${MINIXSRCDIR}/servers -D'ARGS(a)=a' MAN= .include diff --git a/include/minix/ansi.h b/include/minix/ansi.h index 5e5831083..153732855 100644 --- a/include/minix/ansi.h +++ b/include/minix/ansi.h @@ -19,27 +19,6 @@ #define _ANSI 31459 /* gcc conforms enough even in non-ANSI mode */ #endif -#define _VOIDSTAR void * -#define _VOID void - -#ifdef _ANSI - -#define _ARGS(params) params - -#define _CONST const -#define _VOLATILE volatile -#define _SIZET size_t - -#else - -#define _ARGS(params) () - -#define _CONST -#define _VOLATILE -#define _SIZET int - -#endif /* _ANSI */ - #if defined(__GNUC__) && !defined(__STRICT_ANSI__) || __STDC_VERSION__ >= 199901 #define __LONG_LONG_SUPPORTED 1 #endif diff --git a/include/minix/queryparam.h b/include/minix/queryparam.h index a3639c285..ed4dd1966 100644 --- a/include/minix/queryparam.h +++ b/include/minix/queryparam.h @@ -35,11 +35,11 @@ struct export_params { sizeof(((type *)0)->field) } #define QP_END() { 0, 0, 0 } -void qp_export _ARGS((struct export_params *_ex_params)); -int queryparam _ARGS((int (*_qgetc) _ARGS((void)), void **_paddress, - _mnx_size_t *_psize)); -_mnx_size_t paramvalue _ARGS((char **_value, void *_address, - _mnx_size_t _size)); +void qp_export(struct export_params *_ex_params); +int queryparam(int (*_qgetc) (void), void **_paddress, _mnx_size_t + *_psize); +_mnx_size_t paramvalue(char **_value, void *_address, _mnx_size_t + _size); #endif /* _MINIX__QUERYPARAM_H */ /* $PchId: queryparam.h,v 1.1 2005/06/28 14:31:26 philip Exp $ */ diff --git a/include/net/gen/if_ether.h b/include/net/gen/if_ether.h index f99e348e7..a94d899e0 100644 --- a/include/net/gen/if_ether.h +++ b/include/net/gen/if_ether.h @@ -9,10 +9,10 @@ struct ether_addr; #define _PATH_ETHERS "/etc/ethers" -char *ether_ntoa _ARGS(( struct ether_addr *e )); -struct ether_addr *ether_aton _ARGS(( const char *s )); -int ether_ntohost _ARGS(( char *hostname, struct ether_addr *e )); -int ether_hostton _ARGS(( char *hostname, struct ether_addr *e )); -int ether_line _ARGS(( char *l, struct ether_addr *e, char *hostname )); +char *ether_ntoa( struct ether_addr *e ); +struct ether_addr *ether_aton( const char *s ); +int ether_ntohost( char *hostname, struct ether_addr *e ); +int ether_hostton( char *hostname, struct ether_addr *e ); +int ether_line( char *l, struct ether_addr *e, char *hostname ); #endif /* __SERVER__IP__GEN__IF_ETHER_H__ */ diff --git a/include/net/gen/inet.h b/include/net/gen/inet.h index 47753608f..527ba6860 100644 --- a/include/net/gen/inet.h +++ b/include/net/gen/inet.h @@ -7,9 +7,9 @@ server/ip/gen/inet.h #include -ipaddr_t inet_addr _ARGS(( const char *addr )); -ipaddr_t inet_network _ARGS(( const char *addr )); -char *inet_ntoa _ARGS(( ipaddr_t addr )); -int inet_aton _ARGS(( const char *cp, ipaddr_t *pin )); +ipaddr_t inet_addr( const char *addr ); +ipaddr_t inet_network( const char *addr ); +char *inet_ntoa( ipaddr_t addr ); +int inet_aton( const char *cp, ipaddr_t *pin ); #endif /* __SERVER__IP__GEN__INET_H__ */ diff --git a/include/net/gen/oneCsum.h b/include/net/gen/oneCsum.h index 3bfae46ec..f14444a14 100644 --- a/include/net/gen/oneCsum.h +++ b/include/net/gen/oneCsum.h @@ -5,6 +5,6 @@ server/ip/gen/oneCsum.h #ifndef __SERVER__IP__GEN__ONECSUM_H__ #define __SERVER__IP__GEN__ONECSUM_H__ -u16_t oneC_sum _ARGS(( u16_t prev, void *data, size_t data_len )); +u16_t oneC_sum( u16_t prev, void *data, size_t data_len ); #endif /* __SERVER__IP__GEN__ONECSUM_H__ */ diff --git a/lib/libc/gen/minix/popen.c b/lib/libc/gen/minix/popen.c index 2791485d7..f6b52a9d4 100644 --- a/lib/libc/gen/minix/popen.c +++ b/lib/libc/gen/minix/popen.c @@ -40,8 +40,8 @@ static int pids[OPEN_MAX]; FILE * popen(command, type) -_CONST char *command; -_CONST char *type; +const char *command; +const char *type; { int piped[2]; int Xtype = *type == 'r' ? 0 : *type == 'w' ? 1 : 2; diff --git a/lib/libc/sys-minix/access.c b/lib/libc/sys-minix/access.c index 9aff366a0..1d3fd901a 100644 --- a/lib/libc/sys-minix/access.c +++ b/lib/libc/sys-minix/access.c @@ -9,7 +9,7 @@ __weak_alias(access, _access) #endif int access(name, mode) -_CONST char *name; +const char *name; int mode; { message m; diff --git a/lib/libc/sys-minix/chdir.c b/lib/libc/sys-minix/chdir.c index 03efaf756..e514326ab 100644 --- a/lib/libc/sys-minix/chdir.c +++ b/lib/libc/sys-minix/chdir.c @@ -10,7 +10,7 @@ __weak_alias(fchdir, _fchdir) #endif int chdir(name) -_CONST char *name; +const char *name; { message m; diff --git a/lib/libc/sys-minix/chroot.c b/lib/libc/sys-minix/chroot.c index c133ba347..decd519b2 100644 --- a/lib/libc/sys-minix/chroot.c +++ b/lib/libc/sys-minix/chroot.c @@ -9,7 +9,7 @@ __weak_alias(chroot, _chroot) #endif int chroot(name) -_CONST char *name; +const char *name; { message m; diff --git a/lib/libc/sys-minix/mount.c b/lib/libc/sys-minix/mount.c index 1f913f8cf..32d237f30 100644 --- a/lib/libc/sys-minix/mount.c +++ b/lib/libc/sys-minix/mount.c @@ -164,13 +164,13 @@ int mountflags; } int umount(name) -_CONST char *name; +const char *name; { return umount2(name, 0); } int umount2(name, flags) -_CONST char *name; +const char *name; int flags; { message m; diff --git a/lib/libc/sys-minix/pathconf.c b/lib/libc/sys-minix/pathconf.c index 49fa723e2..24c86f5bc 100644 --- a/lib/libc/sys-minix/pathconf.c +++ b/lib/libc/sys-minix/pathconf.c @@ -13,7 +13,7 @@ __weak_alias(pathconf, _pathconf) #endif long pathconf(path, name) -_CONST char *path; /* name of file being interrogated */ +const char *path; /* name of file being interrogated */ int name; /* property being inspected */ { /* POSIX allows some of the values in to be increased at diff --git a/servers/inet/Makefile b/servers/inet/Makefile index 4598f1a16..9bb7426fd 100644 --- a/servers/inet/Makefile +++ b/servers/inet/Makefile @@ -21,6 +21,6 @@ MAN= BINDIR?= /usr/sbin -CPPFLAGS+= -I${.CURDIR} -D_MINIX -Wall -Werror +CPPFLAGS+= -I${.CURDIR} -D_MINIX -D'ARGS(a)=a' -Wall -Werror .include diff --git a/servers/inet/generic/eth.h b/servers/inet/generic/eth.h index be712c730..8c0be61da 100644 --- a/servers/inet/generic/eth.h +++ b/servers/inet/generic/eth.h @@ -10,7 +10,7 @@ Copyright 1995 Philip Homburg #define NWEO_DEFAULT (NWEO_EN_LOC | NWEO_DI_BROAD | NWEO_DI_MULTI | \ NWEO_DI_PROMISC | NWEO_REMANY | NWEO_RWDATALL) -#define eth_addrcmp(a,b) (memcmp((_VOIDSTAR)&a, (_VOIDSTAR)&b, \ +#define eth_addrcmp(a,b) (memcmp((void *)&a, (void *)&b, \ sizeof(a))) /* Forward declatations */ diff --git a/servers/inet/queryparam.h b/servers/inet/queryparam.h index a3639c285..ed4dd1966 100644 --- a/servers/inet/queryparam.h +++ b/servers/inet/queryparam.h @@ -35,11 +35,11 @@ struct export_params { sizeof(((type *)0)->field) } #define QP_END() { 0, 0, 0 } -void qp_export _ARGS((struct export_params *_ex_params)); -int queryparam _ARGS((int (*_qgetc) _ARGS((void)), void **_paddress, - _mnx_size_t *_psize)); -_mnx_size_t paramvalue _ARGS((char **_value, void *_address, - _mnx_size_t _size)); +void qp_export(struct export_params *_ex_params); +int queryparam(int (*_qgetc) (void), void **_paddress, _mnx_size_t + *_psize); +_mnx_size_t paramvalue(char **_value, void *_address, _mnx_size_t + _size); #endif /* _MINIX__QUERYPARAM_H */ /* $PchId: queryparam.h,v 1.1 2005/06/28 14:31:26 philip Exp $ */ diff --git a/test/test1.c b/test/test1.c index 2d1932186..6160b676f 100644 --- a/test/test1.c +++ b/test/test1.c @@ -12,7 +12,7 @@ #define MAX_ERROR 4 #define ITERATIONS 10 -_VOLATILE int glov, gct; +volatile int glov, gct; int errct; int subtest; #include "common.c" diff --git a/test/test5.c b/test/test5.c index 0b452c72a..6ea1093c8 100644 --- a/test/test5.c +++ b/test/test5.c @@ -38,7 +38,7 @@ void test5h(void); void test5i(void); void ex(void); -_VOLATILE int childsigs, parsigs, alarms; +volatile int childsigs, parsigs, alarms; int main(argc, argv) int argc;