1712 remove uses of CPP assertions in conditionals
authorRichard Lowe <richlowe@richlowe.net>
Sun, 15 May 2011 23:00:11 +0100
changeset 13502 34f6da175f72
parent 13501 c3a7090dbc16
child 13503 32ce03c4d7ea
1712 remove uses of CPP assertions in conditionals Reviewed by: Andrew Stormont <[email protected]> Reviewed by: Dan McDonald <[email protected]> Reviewed by: Igor Kozhukhov <[email protected]> Reviewed by: Garrett D'Amore <[email protected]> Approved by: Gordon Ross <[email protected]>
usr/src/ucbhead/stdio.h
usr/src/ucblib/libucb/port/gen/setbuffer.c
usr/src/uts/common/io/myri10ge/drv/myri10ge.c
--- a/usr/src/ucbhead/stdio.h	Thu Nov 03 18:34:26 2011 -0700
+++ b/usr/src/ucbhead/stdio.h	Sun May 15 23:00:11 2011 +0100
@@ -44,8 +44,6 @@
 #ifndef _STDIO_H
 #define	_STDIO_H
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
 #include <sys/feature_tests.h>
 #include <sys/va_list.h>
 #include <stdio_tag.h>
@@ -83,37 +81,7 @@
 #define	NULL		0
 #endif
 
-#if defined(__STDC__)
-
-#if #machine(pdp11)
-#define	BUFSIZ		512
-#define	_STDIO_REVERSE
-#elif #machine(u370)
-#define	BUFSIZ		4096
-#define	_STDIO_REVERSE
-#define	_STDIO_ALLOCATE
-#else
 #define	BUFSIZ		1024
-#endif
-
-#else	/* !defined(__STDC__) */
-
-#if pdp11 || u370
-
-#if pdp11
-#define	BUFSIZ		512
-#define	_STDIO_REVERSE
-#else 	/* u370 */
-#define	BUFSIZ		4096
-#define	_STDIO_REVERSE
-#define	_STDIO_ALLOCATE
-#endif
-
-#else
-#define	BUFSIZ		1024
-#endif
-
-#endif	/* __STDC__ */
 
 #if defined(__i386)
 #define	_NFILE	60	/* initial number of streams: Intel x86 ABI */
@@ -154,31 +122,19 @@
 
 #define	L_tmpnam	25	/* (sizeof(P_tmpdir) + 15) */
 
-#if defined(__STDC__)
 #define	stdin	(&__iob[0])
 #define	stdout	(&__iob[1])
 #define	stderr	(&__iob[2])
-#else
-#define	stdin	(&_iob[0])
-#define	stdout	(&_iob[1])
-#define	stderr	(&_iob[2])
-#endif
 
 #ifndef	_FILEDEFED
 #define	_FILEDEFED
 typedef	__FILE FILE;
 #endif
 
-#if defined(__STDC__)
 extern FILE		__iob[_NFILE];
-#else
-extern FILE		_iob[_NFILE];
-#endif
 extern FILE		*_lastbuf;
 extern unsigned char 	*_bufendtab[];
-#ifndef _STDIO_ALLOCATE
 extern unsigned char	 _sibuf[], _sobuf[];
-#endif
 
 /* Large file interfaces */
 /* transition back from explicit 64-bit offset to implicit (64-bit) offset */
@@ -203,7 +159,6 @@
 #endif
 #endif
 
-#if defined(__STDC__)
 
 extern int	remove(const char *);
 extern int	rename(const char *, const char *);
@@ -272,44 +227,16 @@
 
 #endif	/* !defined(_STRICT_STDC) */
 
-#else	/* !defined __STDC__ */
-#define	_bufend(p)	_bufendtab[fileno(p)]
-#define	_bufsiz(p)	(_bufend(p) - (p)->_base)
-
-extern FILE	*fopen(), *fdopen(), *freopen(), *popen();
-extern long	ftell();
-extern void	rewind(), setbuf(), setbuffer();
-extern int	setlinebuf();
-extern char	*ctermid(), *cuserid(), *fgets(), *gets(), *sprintf(),
-		*vsprintf();
-extern int	fclose(), fflush(), fread(), fwrite(), fseek(), fgetc(),
-		getw(), pclose(), printf(), fprintf(),
-		vprintf(), vfprintf(), fputc(), putw(),
-		puts(), fputs(), scanf(), fscanf(), sscanf(),
-		setvbuf(), system(), ungetc();
-extern int	fileno();
-extern int	getc(), getchar(), putc(), putchar(), feof(), ferror();
-extern void	clearerr();
-
-#endif	/* __STDC__ */
 
 #ifndef __lint
 
 #ifndef _LP64
 
-#ifdef __STDC__
 
 #define	getc(p)		(--(p)->_cnt < 0 ? __filbuf(p) : (int)*(p)->_ptr++)
 #define	putc(x, p)	(--(p)->_cnt < 0 ? __flsbuf((x), (p)) \
 				: (int)(*(p)->_ptr++ = (x)))
 
-#else /* __STDC__ */
-
-#define	getc(p)		(--(p)->_cnt < 0 ? _filbuf(p) : (int)*(p)->_ptr++)
-#define	putc(x, p)	(--(p)->_cnt < 0 ? \
-			_flsbuf((unsigned char) (x), (p)) : \
-			(int)(*(p)->_ptr++ = (unsigned char)(x)))
-#endif /* __STDC__ */
 
 #define	clearerr(p)	((void) ((p)->_flag &= ~(_IOERR | _IOEOF)))
 #define	feof(p)		((p)->_flag & _IOEOF)
@@ -324,12 +251,8 @@
 
 #if	defined(_LARGEFILE64_SOURCE) && !((_FILE_OFFSET_BITS == 64) && \
 	    !defined(__PRAGMA_REDEFINE_EXTNAME))
-#if defined(__STDC__)
 extern FILE	*fopen64(const char *, const char *);
 extern FILE	*freopen64(const char *, const char *, FILE *);
-#else
-extern FILE	*fopen64(), *freopen64();
-#endif
 #endif	/* _LARGEFILE64_SOURCE... */
 
 #ifdef __cplusplus
--- a/usr/src/ucblib/libucb/port/gen/setbuffer.c	Thu Nov 03 18:34:26 2011 -0700
+++ b/usr/src/ucblib/libucb/port/gen/setbuffer.c	Sun May 15 23:00:11 2011 +0100
@@ -36,8 +36,6 @@
  * Use is subject to license terms.
  */
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
 /*LINTLIBRARY*/
 
 #include <sys/types.h>
@@ -61,14 +59,11 @@
 	iop->_flag &= ~(_IOMYBUF | _IONBF | _IOLBF);
 	if (buf == 0) {
 		iop->_flag |= _IONBF;
-#ifndef _STDIO_ALLOCATE
 		if (fno < 2) {
 			/* use special buffer for std{in,out} */
 			buf = (fno == 0) ? _sibuf : _sobuf;
 			size = BUFSIZ - _SMBFSZ;
-		} else /* needed for ifdef */
-#endif
-		if (fno < _NFILE) {
+		} else if (fno < _NFILE) {
 			buf = _smbuf[fno];
 			size = _SMBFSZ - PUSHBACK;
 		} else if ((buf = (Uchar *)malloc(_SMBFSZ * sizeof (Uchar))) !=
--- a/usr/src/uts/common/io/myri10ge/drv/myri10ge.c	Thu Nov 03 18:34:26 2011 -0700
+++ b/usr/src/uts/common/io/myri10ge/drv/myri10ge.c	Sun May 15 23:00:11 2011 +0100
@@ -52,8 +52,7 @@
 static int myri10ge_small_bytes = 510;
 static int myri10ge_intr_coal_delay = 125;
 static int myri10ge_flow_control = 1;
-#if #cpu(i386) || defined __i386 || defined i386 ||	\
-	defined __i386__ || #cpu(x86_64) || defined __x86_64__
+#if defined __i386 || defined i386 || defined __i386__ || defined __x86_64__
 static int myri10ge_nvidia_ecrc_enable = 1;
 #endif
 static int myri10ge_mtu_override = 0;
@@ -4227,8 +4226,7 @@
 
 
 
-#if #cpu(i386) || defined __i386 || defined i386 ||	\
-	defined __i386__ || #cpu(x86_64) || defined __x86_64__
+#if defined __i386 || defined i386 || defined __i386__ || defined __x86_64__
 
 #include <vm/hat.h>
 #include <sys/ddi_isa.h>
@@ -4672,8 +4670,7 @@
 	myri10ge_intr_coal_delay = ddi_prop_get_int(DDI_DEV_T_ANY, dip, 0,
 	    "myri10ge_intr_coal_delay", myri10ge_intr_coal_delay);
 
-#if #cpu(i386) || defined __i386 || defined i386 ||	\
-	defined __i386__ || #cpu(x86_64) || defined __x86_64__
+#if defined __i386 || defined i386 || defined __i386__ || defined __x86_64__
 	myri10ge_nvidia_ecrc_enable = ddi_prop_get_int(DDI_DEV_T_ANY, dip, 0,
 	    "myri10ge_nvidia_ecrc_enable", 1);
 #endif