From: Ben Gras Date: Sun, 25 Mar 2012 19:04:28 +0000 (+0200) Subject: retire _ANSI and X-Git-Tag: v3.2.1~641 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/zpipe.c?a=commitdiff_plain;h=204ae725259c7ac42e65819f96ef597d2689d642;p=minix.git retire _ANSI and --- diff --git a/commands/cawf/bsfilt.c b/commands/cawf/bsfilt.c index 39858ccca..214efda33 100644 --- a/commands/cawf/bsfilt.c +++ b/commands/cawf/bsfilt.c @@ -42,7 +42,6 @@ #include -#include #define MAXLL 2048 /* ridiculous maximum line length */ diff --git a/commands/cawf/proto.h b/commands/cawf/proto.h index 34df3be28..6b1a5cc40 100644 --- a/commands/cawf/proto.h +++ b/commands/cawf/proto.h @@ -28,7 +28,6 @@ * 4. This notice may not be removed or altered. */ -#include #ifdef UNIX # ifdef USG diff --git a/commands/elvis/curses.c b/commands/elvis/curses.c index fcfc7d8c5..f8cc76742 100644 --- a/commands/elvis/curses.c +++ b/commands/elvis/curses.c @@ -383,11 +383,7 @@ void resume_curses(quietly) } exwrote = FALSE; -#if TURBOC || __GNUC__ || _ANSI signal(SIGINT, (void(*)()) trapint); -#else - signal(SIGINT, trapint); -#endif } /* This function fetches an optional string from termcap */ diff --git a/commands/elvis/main.c b/commands/elvis/main.c index 269d35196..0198b8be4 100644 --- a/commands/elvis/main.c +++ b/commands/elvis/main.c @@ -434,11 +434,7 @@ int trapint(signo) #if OSK sigmask(-1); #endif -#if TURBOC || __GNUC__ || _ANSI signal(signo, (void (*)())trapint); -#else - signal(signo, trapint); -#endif doingglobal = FALSE; longjmp(jmpenv, 1); diff --git a/commands/elvis/system.c b/commands/elvis/system.c index 676d788c1..e73bc5a92 100644 --- a/commands/elvis/system.c +++ b/commands/elvis/system.c @@ -73,11 +73,7 @@ int system(cmd) { status = -1; } -#if __GNUC__ || _ANSI signal(SIGINT, (void (*)()) trapint); -#else - signal(SIGINT, trapint); -#endif } return status; @@ -168,11 +164,7 @@ int rpclose(fd) close(fd); wait(&status); -#if __GNUC__ || _ANSI signal(SIGINT, (void (*)()) trapint); -#else - signal(SIGINT, trapint); -#endif return status; } diff --git a/commands/elvis/unix.c b/commands/elvis/unix.c index cf101261d..f366d2673 100644 --- a/commands/elvis/unix.c +++ b/commands/elvis/unix.c @@ -189,11 +189,7 @@ int ttyread(buf, len, time) int time; /* maximum time to allow for reading */ { /* arrange for timeout */ -#if __GNUC__ || _ANSI signal(SIGALRM, (void (*)()) dummy); -#else - signal(SIGALRM, dummy); -#endif alarm(time); /* perform the blocking read */ @@ -207,11 +203,7 @@ int ttyread(buf, len, time) } /* cancel the alarm */ -#if _ANSI signal(SIGALRM, (void (*)())dummy); /* work around a bug in Minix */ -#else - signal(SIGALRM, dummy); /* work around a bug in Minix */ -#endif alarm(0); /* return the number of bytes read */ diff --git a/commands/mdb/mdb.h b/commands/mdb/mdb.h index 6e5d45c20..c7a563609 100644 --- a/commands/mdb/mdb.h +++ b/commands/mdb/mdb.h @@ -36,7 +36,6 @@ #include -#include #include #include diff --git a/commands/stty/stty.c b/commands/stty/stty.c index f97db69f1..309cbc5be 100644 --- a/commands/stty/stty.c +++ b/commands/stty/stty.c @@ -92,11 +92,7 @@ int column= 0, max_column=80; /* Assume 80 character terminals. */ struct winsize winsize; #endif -#if __minix -#define PROTO(a) _ARGS(a) -#else -#define PROTO(a) () -#endif +#define PROTO(a) a int main PROTO(( int argc, char **argv )); void report PROTO(( int flags )); diff --git a/common/include/sys/mount.h b/common/include/sys/mount.h index 444a98568..606fff1e9 100644 --- a/common/include/sys/mount.h +++ b/common/include/sys/mount.h @@ -10,12 +10,6 @@ #define MS_LABEL16 0x004 /* Mount message points to 16-byte label */ #define MS_EXISTING 0x008 /* Tell mount to use already running server */ - -/* Function Prototypes. */ -#ifndef _MINIX_ANSI_H -#include -#endif - int mount(char *_spec, char *_name, int _mountflags, char *type, char *args); int umount(const char *_name); diff --git a/common/include/termios.h b/common/include/termios.h index 1cff1a9bc..18ebd29f7 100644 --- a/common/include/termios.h +++ b/common/include/termios.h @@ -120,11 +120,6 @@ struct termios { #define TCIOFF 3 /* transmit a STOP character on the line */ #define TCION 4 /* transmit a START character on the line */ -/* Function Prototypes. */ -#ifndef _MINIX_ANSI_H -#include -#endif - int tcsendbreak(int _fildes, int _duration); int tcdrain(int _filedes); int tcflush(int _filedes, int _queue_selector); diff --git a/include/Makefile.minix.inc b/include/Makefile.minix.inc index 03d3cc2e1..49a1dfcba 100644 --- a/include/Makefile.minix.inc +++ b/include/Makefile.minix.inc @@ -2,7 +2,7 @@ INCS+= env.h fetch.h lib.h libutil.h timers.h -INCS+= minix/acpi.h minix/ansi.h minix/audio_fw.h minix/bitmap.h \ +INCS+= minix/acpi.h minix/audio_fw.h minix/bitmap.h \ minix/bdev.h minix/blockdriver.h minix/blockdriver_mt.h \ minix/btrace.h \ minix/callnr.h minix/chardriver.h minix/com.h minix/compiler.h \ diff --git a/include/ddekit/ddekit.h b/include/ddekit/ddekit.h index 300f831b2..9535fe5d4 100644 --- a/include/ddekit/ddekit.h +++ b/include/ddekit/ddekit.h @@ -1,6 +1,5 @@ #ifndef _DDEKIT_DDEKIT_H #define _DDEKIT_DDEKIT_H -#include void ddekit_init(void); #endif diff --git a/include/env.h b/include/env.h index 34e84c71a..2f6f64d77 100644 --- a/include/env.h +++ b/include/env.h @@ -1,5 +1,4 @@ #ifdef __NBSD_LIBC -#include #endif int env_parse(char *env, char *fmt, int field, long *param, long min, long max); diff --git a/include/lib.h b/include/lib.h index fc6fcd914..9932a4f01 100644 --- a/include/lib.h +++ b/include/lib.h @@ -19,7 +19,6 @@ #include #include #include -#include #include #include diff --git a/include/minix/ansi.h b/include/minix/ansi.h deleted file mode 100644 index 5a88913dc..000000000 --- a/include/minix/ansi.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef _MINIX_ANSI_H -#define _MINIX_ANSI_H - -#if __STDC__ == 1 -#define _ANSI 31459 /* compiler claims full ANSI conformance */ -#endif - -#ifdef __GNUC__ -#define _ANSI 31459 /* gcc conforms enough even in non-ANSI mode */ -#endif - -/* Setting of _POSIX_SOURCE (or _NETBSD_SOURCE) in NBSD headers is - * done in */ -#include - -#endif /* _MINIX_ANSI_H */ diff --git a/include/minix/driver.h b/include/minix/driver.h index 1b9602d11..411637bc8 100644 --- a/include/minix/driver.h +++ b/include/minix/driver.h @@ -9,7 +9,6 @@ /* The following are so basic, all the *.c files get them automatically. */ #include /* MUST be first */ -#include /* MUST be second */ #include #include #include diff --git a/include/minix/drivers.h b/include/minix/drivers.h index 776f3c8e2..a2c6968c6 100644 --- a/include/minix/drivers.h +++ b/include/minix/drivers.h @@ -11,7 +11,6 @@ /* The following are so basic, all the *.c files get them automatically. */ #include /* MUST be first */ -#include /* MUST be second */ #include #include #include diff --git a/include/minix/ipc.h b/include/minix/ipc.h index d67c4d2b5..752bebe31 100644 --- a/include/minix/ipc.h +++ b/include/minix/ipc.h @@ -2,7 +2,6 @@ #define _IPC_H #ifdef __NBSD_LIBC -#include #endif #include #include diff --git a/include/minix/minlib.h b/include/minix/minlib.h index d2d5758da..1a65f8e1f 100644 --- a/include/minix/minlib.h +++ b/include/minix/minlib.h @@ -1,10 +1,6 @@ #ifndef _MINLIB #define _MINLIB -#ifndef _MINIX_ANSI_H -#include -#endif - /* Miscellaneous BSD. */ char *itoa(int _n); #ifndef __NBSD_LIBC diff --git a/include/minix/mthread.h b/include/minix/mthread.h index b9f7d33c1..786557a09 100644 --- a/include/minix/mthread.h +++ b/include/minix/mthread.h @@ -2,7 +2,6 @@ #define _MTHREAD_H #include /* MUST be first */ -#include /* MUST be second */ #include #include #include diff --git a/include/minix/profile.h b/include/minix/profile.h index aad400537..c84efc182 100644 --- a/include/minix/profile.h +++ b/include/minix/profile.h @@ -1,7 +1,6 @@ #ifndef _PROFILE_H #define _PROFILE_H -#include #include /* diff --git a/include/minix/queryparam.h b/include/minix/queryparam.h index ed4dd1966..e5cc8ad3e 100644 --- a/include/minix/queryparam.h +++ b/include/minix/queryparam.h @@ -4,7 +4,6 @@ #ifndef _MINIX__QUERYPARAM_H #define _MINIX__QUERYPARAM_H -#include typedef size_t _mnx_size_t; diff --git a/include/minix/types.h b/include/minix/types.h index 68c6b6788..b7e2c43c2 100644 --- a/include/minix/types.h +++ b/include/minix/types.h @@ -2,7 +2,6 @@ #define _MINIX_TYPES_H_ /* Dummy file used in legacy (and shared) minix includes. */ -#include #include #include diff --git a/include/sys/cdefs.h b/include/sys/cdefs.h index 3dee9c6b0..d73762697 100644 --- a/include/sys/cdefs.h +++ b/include/sys/cdefs.h @@ -484,7 +484,6 @@ #ifdef _MINIX /* If compiling in Minix tree, Minix ANSI definitions are always useful. */ -#include #endif #endif /* !_SYS_CDEFS_H_ */ diff --git a/kernel/debug.h b/kernel/debug.h index 7cb7e7e84..f84427e20 100644 --- a/kernel/debug.h +++ b/kernel/debug.h @@ -8,7 +8,6 @@ */ #ifndef __ASSEMBLY__ -#include #include #include "config.h" #endif diff --git a/kernel/kernel.h b/kernel/kernel.h index 73f375a4e..7a6a148d4 100644 --- a/kernel/kernel.h +++ b/kernel/kernel.h @@ -26,7 +26,6 @@ /* The following are so basic, all the *.c files get them automatically. */ #include /* global configuration, MUST be first */ -#include /* C style: ANSI or K&R, MUST be second */ #include /* general system types */ #include /* MINIX specific constants */ #include /* MINIX specific types, e.g. message */ diff --git a/lib/libc/gen/minix/popen.c b/lib/libc/gen/minix/popen.c index f6b52a9d4..3bd48fc46 100644 --- a/lib/libc/gen/minix/popen.c +++ b/lib/libc/gen/minix/popen.c @@ -4,7 +4,6 @@ /* $Header$ */ #include #include "namespace.h" -#include #ifdef __weak_alias __weak_alias(popen, _popen) @@ -26,7 +25,6 @@ typedef union wait wait_arg; typedef int wait_arg; #endif /* __BSD4_2 */ -#ifdef _ANSI int _close(int d); int _dup2(int oldd, int newd); /* not present in System 5 */ int _execl(const char *name, const char *_arg, ... ); @@ -34,7 +32,6 @@ pid_t _fork(void); int _pipe(int fildes[2]); pid_t _wait(wait_arg *status); void _exit(int status); -#endif static int pids[OPEN_MAX]; @@ -84,13 +81,8 @@ FILE *stream; wait_arg status; int wret; -#ifdef _ANSI void (*intsave)(int) = signal(SIGINT, SIG_IGN); void (*quitsave)(int) = signal(SIGQUIT, SIG_IGN); -#else - void (*intsave)() = signal(SIGINT, SIG_IGN); - void (*quitsave)() = signal(SIGQUIT, SIG_IGN); -#endif fclose(stream); while ((wret = _wait(&status)) != -1) { if (wret == pids[fd]) break; diff --git a/lib/libc/sys-minix/accept.c b/lib/libc/sys-minix/accept.c index 390353308..7e659884e 100644 --- a/lib/libc/sys-minix/accept.c +++ b/lib/libc/sys-minix/accept.c @@ -1,5 +1,4 @@ #include -#include #include "namespace.h" #include diff --git a/lib/libc/sys-minix/fcntl.c b/lib/libc/sys-minix/fcntl.c index 31e1281f3..59c37a652 100644 --- a/lib/libc/sys-minix/fcntl.c +++ b/lib/libc/sys-minix/fcntl.c @@ -9,13 +9,7 @@ __weak_alias(fcntl, _fcntl) #endif -#if _ANSI int fcntl(int fd, int cmd, ...) -#else -int fcntl(fd, cmd) -int fd; -int cmd; -#endif { va_list argp; message m; diff --git a/lib/libc/sys-minix/getpeername.c b/lib/libc/sys-minix/getpeername.c index 295c28125..20f6659f2 100644 --- a/lib/libc/sys-minix/getpeername.c +++ b/lib/libc/sys-minix/getpeername.c @@ -1,6 +1,5 @@ #include #include "namespace.h" -#include #include #include diff --git a/lib/libc/sys-minix/getsockname.c b/lib/libc/sys-minix/getsockname.c index cbc0574bd..a2dce74e1 100644 --- a/lib/libc/sys-minix/getsockname.c +++ b/lib/libc/sys-minix/getsockname.c @@ -8,7 +8,6 @@ #include #include "namespace.h" -#include #include #include #include diff --git a/lib/libc/sys-minix/getsockopt.c b/lib/libc/sys-minix/getsockopt.c index e57d34233..09a6dff64 100644 --- a/lib/libc/sys-minix/getsockopt.c +++ b/lib/libc/sys-minix/getsockopt.c @@ -1,5 +1,4 @@ #include -#include #include "namespace.h" #include diff --git a/lib/libc/sys-minix/minix_rs.c b/lib/libc/sys-minix/minix_rs.c index 236c55d08..6b3f3e9d2 100644 --- a/lib/libc/sys-minix/minix_rs.c +++ b/lib/libc/sys-minix/minix_rs.c @@ -2,7 +2,6 @@ #define _SYSTEM 1 #define _MINIX 1 -#include #include #include #include diff --git a/lib/libc/sys-minix/open.c b/lib/libc/sys-minix/open.c index cd62a0300..47dd62477 100644 --- a/lib/libc/sys-minix/open.c +++ b/lib/libc/sys-minix/open.c @@ -10,11 +10,7 @@ __weak_alias(open, _open) #endif -#if _ANSI int open(const char *name, int flags, ...) -#else -int open(const char *name, int flags) -#endif { va_list argp; message m; diff --git a/lib/libc/sys-minix/recvfrom.c b/lib/libc/sys-minix/recvfrom.c index 393372b81..9b0cb41a6 100644 --- a/lib/libc/sys-minix/recvfrom.c +++ b/lib/libc/sys-minix/recvfrom.c @@ -1,5 +1,4 @@ #include -#include #include "namespace.h" #undef NDEBUG diff --git a/lib/libcompat_minix/include/compat/a.out.h b/lib/libcompat_minix/include/compat/a.out.h index a45645c08..e85927de6 100644 --- a/lib/libcompat_minix/include/compat/a.out.h +++ b/lib/libcompat_minix/include/compat/a.out.h @@ -108,11 +108,6 @@ struct nlist { /* symbol table entry */ #define C_EXT 0020 /* external symbol */ #define C_STAT 0030 /* static */ -/* Function prototypes. */ -#ifndef _MINIX_ANSI_H -#include -#endif - int nlist(char *_file, struct nlist *_nl); #endif /* _AOUT_H */ diff --git a/lib/libminlib/fslib.c b/lib/libminlib/fslib.c index 0ededda08..899f35c95 100644 --- a/lib/libminlib/fslib.c +++ b/lib/libminlib/fslib.c @@ -1,7 +1,6 @@ /* fslib.c - routines needed by fs and fs utilities */ #include /* for unused stuff in :-( */ -#include #include #include #include diff --git a/lib/libpuffs/fs.h b/lib/libpuffs/fs.h index 44c70a9e3..7c711d124 100644 --- a/lib/libpuffs/fs.h +++ b/lib/libpuffs/fs.h @@ -13,7 +13,6 @@ /* The following are so basic, all the *.c files get them automatically. */ #include /* MUST be first */ -#include /* MUST be second */ #include #include #include diff --git a/lib/libsys/asynsend.c b/lib/libsys/asynsend.c index f5f8957ce..c1f4ea47e 100644 --- a/lib/libsys/asynsend.c +++ b/lib/libsys/asynsend.c @@ -2,7 +2,6 @@ #define _SYSTEM 1 #include -#include #include #include #include diff --git a/lib/libvtreefs/inc.h b/lib/libvtreefs/inc.h index ac477af9c..89a98e8a0 100644 --- a/lib/libvtreefs/inc.h +++ b/lib/libvtreefs/inc.h @@ -4,7 +4,6 @@ #define _MINIX 1 /* tell headers to include MINIX stuff */ #define _SYSTEM 1 /* tell headers that this is the kernel */ -#include #include #include #include diff --git a/servers/ds/inc.h b/servers/ds/inc.h index c9b16f2fc..7ed2d76cb 100644 --- a/servers/ds/inc.h +++ b/servers/ds/inc.h @@ -7,7 +7,6 @@ #define _MINIX 1 /* tell headers to include MINIX stuff */ #define _SYSTEM 1 /* get OK and negative error codes */ -#include #include #include #include diff --git a/servers/ext2/fs.h b/servers/ext2/fs.h index 0a1b794fc..068306594 100644 --- a/servers/ext2/fs.h +++ b/servers/ext2/fs.h @@ -13,7 +13,6 @@ /* The following are so basic, all the *.c files get them automatically. */ #include /* MUST be first */ -#include /* MUST be second */ #include #include #include diff --git a/servers/inet/inet.h b/servers/inet/inet.h index 01fecb328..2e1b92224 100644 --- a/servers/inet/inet.h +++ b/servers/inet/inet.h @@ -94,12 +94,6 @@ void inet_panic(void) _NORETURN; do { if (((level) & DEBUG) && (condition)) \ { where(); code; } } while(0) -#if _ANSI -#define ARGS(x) x -#else /* _ANSI */ -#define ARGS(x) () -#endif /* _ANSI */ - extern int this_proc; extern char version[]; diff --git a/servers/inet/queryparam.h b/servers/inet/queryparam.h index ed4dd1966..e5cc8ad3e 100644 --- a/servers/inet/queryparam.h +++ b/servers/inet/queryparam.h @@ -4,7 +4,6 @@ #ifndef _MINIX__QUERYPARAM_H #define _MINIX__QUERYPARAM_H -#include typedef size_t _mnx_size_t; diff --git a/servers/is/inc.h b/servers/is/inc.h index 10b2772d7..f0133dc74 100644 --- a/servers/is/inc.h +++ b/servers/is/inc.h @@ -7,7 +7,6 @@ #define _SYSTEM 1 /* get OK and negative error codes */ #define _MINIX 1 /* tell headers to include MINIX stuff */ -#include #include #include #include diff --git a/servers/iso9660fs/inc.h b/servers/iso9660fs/inc.h index d7559d5f2..602c56616 100644 --- a/servers/iso9660fs/inc.h +++ b/servers/iso9660fs/inc.h @@ -4,7 +4,6 @@ #define VERBOSE 0 /* display diagnostics */ -#include #include #include #include diff --git a/servers/mfs/fs.h b/servers/mfs/fs.h index df905d111..caa2291b4 100644 --- a/servers/mfs/fs.h +++ b/servers/mfs/fs.h @@ -12,7 +12,6 @@ /* The following are so basic, all the *.c files get them automatically. */ #include /* MUST be first */ -#include /* MUST be second */ #include #include #include diff --git a/servers/pfs/fs.h b/servers/pfs/fs.h index 2bc006af3..3eb79b50c 100644 --- a/servers/pfs/fs.h +++ b/servers/pfs/fs.h @@ -10,7 +10,6 @@ /* The following are so basic, all the *.c files get them automatically. */ #include /* MUST be first */ -#include /* MUST be second */ #include #include #include diff --git a/servers/pfs/inc.h b/servers/pfs/inc.h index 4484e8038..6a1fcaa6c 100644 --- a/servers/pfs/inc.h +++ b/servers/pfs/inc.h @@ -10,7 +10,6 @@ #include #endif -#include #include #include #include diff --git a/servers/pm/pm.h b/servers/pm/pm.h index d18ecbf33..5372bf773 100644 --- a/servers/pm/pm.h +++ b/servers/pm/pm.h @@ -7,7 +7,6 @@ /* The following are so basic, all the *.c files get them automatically. */ #include /* MUST be first */ -#include /* MUST be second */ #include #include #include diff --git a/servers/procfs/inc.h b/servers/procfs/inc.h index 7a10ab571..61408f082 100644 --- a/servers/procfs/inc.h +++ b/servers/procfs/inc.h @@ -6,7 +6,6 @@ #define _SYSTEM 1 #include -#include #include #include #include diff --git a/servers/rs/inc.h b/servers/rs/inc.h index 5b5e34579..6077f1868 100644 --- a/servers/rs/inc.h +++ b/servers/rs/inc.h @@ -7,7 +7,6 @@ #define _SYSTEM 1 /* get OK and negative error codes */ #define _MINIX 1 /* tell headers to include MINIX stuff */ -#include #include #include #include diff --git a/servers/sched/sched.h b/servers/sched/sched.h index f5678ff75..80a75a98f 100644 --- a/servers/sched/sched.h +++ b/servers/sched/sched.h @@ -7,7 +7,6 @@ /* The following are so basic, all the *.c files get them automatically. */ #include /* MUST be first */ -#include /* MUST be second */ #include #include diff --git a/servers/vfs/fs.h b/servers/vfs/fs.h index 9531c2207..d3fc953b3 100644 --- a/servers/vfs/fs.h +++ b/servers/vfs/fs.h @@ -24,7 +24,6 @@ /* The following are so basic, all the *.c files get them automatically. */ #include /* MUST be first */ -#include /* MUST be second */ #include #include #include diff --git a/test/test38.c b/test/test38.c index 9ed4b0063..ff1b558ce 100644 --- a/test/test38.c +++ b/test/test38.c @@ -565,11 +565,7 @@ void test38c() #ifdef SIGACTION struct sigaction act, oact; #else -#if _ANSI void (*oldfunc) (int); -#else - void (*oldfunc) (); -#endif #endif subtest = 3;