summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Lowe <richlowe@richlowe.net>2011-05-15 23:00:11 +0100
committerRichard Lowe <richlowe@richlowe.net>2011-05-15 23:00:11 +0100
commit5ee6ac27d4fd4c9412183aa8cc1143f36ae04a8c (patch)
tree6dd09ce00ac49708866b4a18423cb0a503cbc6fb
parentdeef35fd18fdfb1c42002a4793ebb2c181b08680 (diff)
downloadillumos-joyent-5ee6ac27d4fd4c9412183aa8cc1143f36ae04a8c.tar.gz
1712 remove uses of CPP assertions in conditionals
Reviewed by: Andrew Stormont <Andrew.Stormont@nexenta.com> Reviewed by: Dan McDonald <danmcd@nexenta.com> Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com> Reviewed by: Garrett D'Amore <garrett@nexenta.com> Approved by: Gordon Ross <gwr@nexenta.com>
-rw-r--r--usr/src/ucbhead/stdio.h77
-rw-r--r--usr/src/ucblib/libucb/port/gen/setbuffer.c7
-rw-r--r--usr/src/uts/common/io/myri10ge/drv/myri10ge.c9
3 files changed, 4 insertions, 89 deletions
diff --git a/usr/src/ucbhead/stdio.h b/usr/src/ucbhead/stdio.h
index 7130b93169..dd6cc3bce9 100644
--- a/usr/src/ucbhead/stdio.h
+++ b/usr/src/ucbhead/stdio.h
@@ -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 @@ typedef long fpos_t;
#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 @@ typedef long fpos_t;
#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 @@ extern unsigned char _sibuf[], _sobuf[];
#endif
#endif
-#if defined(__STDC__)
extern int remove(const char *);
extern int rename(const char *, const char *);
@@ -272,44 +227,16 @@ extern int fileno(FILE *);
#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 @@ extern void clearerr();
#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
diff --git a/usr/src/ucblib/libucb/port/gen/setbuffer.c b/usr/src/ucblib/libucb/port/gen/setbuffer.c
index 47aa76f88b..8eeea0179b 100644
--- a/usr/src/ucblib/libucb/port/gen/setbuffer.c
+++ b/usr/src/ucblib/libucb/port/gen/setbuffer.c
@@ -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 @@ setbuffer(FILE *iop, char *abuf, int asize)
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))) !=
diff --git a/usr/src/uts/common/io/myri10ge/drv/myri10ge.c b/usr/src/uts/common/io/myri10ge/drv/myri10ge.c
index 7cdbad3249..791d6cb54c 100644
--- a/usr/src/uts/common/io/myri10ge/drv/myri10ge.c
+++ b/usr/src/uts/common/io/myri10ge/drv/myri10ge.c
@@ -52,8 +52,7 @@ static const char __idstring[] =
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 @@ myri10ge_slice_stat_init(struct myri10ge_slice_state *ss)
-#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_get_props(dev_info_t *dip)
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