diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2002-12-30 21:36:07 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2002-12-30 21:36:07 +0000 |
commit | 0b5fa73158ff68f27d1b67abfcc38579b2e82ea3 (patch) | |
tree | ced21f99be0318441446ec63a929edf03062b1e1 | |
parent | 3feabdf302ed8decf9f09b6e0ce49d021d48acf1 (diff) |
Back out __EOF stuff and just use -1 in ctype.h. This is OK since
we don't want any user defines to change how the inlined ctype
functions behave.
-rw-r--r-- | include/ctype.h | 28 | ||||
-rw-r--r-- | include/stdio.h | 7 |
2 files changed, 14 insertions, 21 deletions
diff --git a/include/ctype.h b/include/ctype.h index 3fd79836c37..02380f1627e 100644 --- a/include/ctype.h +++ b/include/ctype.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ctype.h,v 1.11 2002/12/29 03:02:35 millert Exp $ */ +/* $OpenBSD: ctype.h,v 1.12 2002/12/30 21:36:05 millert Exp $ */ /* $NetBSD: ctype.h,v 1.14 1994/10/26 00:55:47 cgd Exp $ */ /* @@ -54,10 +54,6 @@ #define _X 0x40 #define _B 0x80 -#ifndef __EOF -#define __EOF (-1) /* must match stdio.h */ -#endif - extern const char *_ctype_; extern const short *_tolower_tab_; extern const short *_toupper_tab_; @@ -91,57 +87,57 @@ __END_DECLS static __inline int isalnum(int c) { - return (c == __EOF ? 0 : ((_ctype_ + 1)[(unsigned char)(c & 0xff)] & (_U|_L|_N))); + return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)(c & 0xff)] & (_U|_L|_N))); } static __inline int isalpha(int c) { - return (c == __EOF ? 0 : ((_ctype_ + 1)[(unsigned char)(c & 0xff)] & (_U|_L))); + return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)(c & 0xff)] & (_U|_L))); } static __inline int iscntrl(int c) { - return (c == __EOF ? 0 : ((_ctype_ + 1)[(unsigned char)(c & 0xff)] & _C)); + return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)(c & 0xff)] & _C)); } static __inline int isdigit(int c) { - return (c == __EOF ? 0 : ((_ctype_ + 1)[(unsigned char)(c & 0xff)] & _N)); + return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)(c & 0xff)] & _N)); } static __inline int isgraph(int c) { - return (c == __EOF ? 0 : ((_ctype_ + 1)[(unsigned char)(c & 0xff)] & (_P|_U|_L|_N))); + return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)(c & 0xff)] & (_P|_U|_L|_N))); } static __inline int islower(int c) { - return (c == __EOF ? 0 : ((_ctype_ + 1)[(unsigned char)(c & 0xff)] & _L)); + return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)(c & 0xff)] & _L)); } static __inline int isprint(int c) { - return (c == __EOF ? 0 : ((_ctype_ + 1)[(unsigned char)(c & 0xff)] & (_P|_U|_L|_N|_B))); + return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)(c & 0xff)] & (_P|_U|_L|_N|_B))); } static __inline int ispunct(int c) { - return (c == __EOF ? 0 : ((_ctype_ + 1)[(unsigned char)(c & 0xff)] & _P)); + return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)(c & 0xff)] & _P)); } static __inline int isspace(int c) { - return (c == __EOF ? 0 : ((_ctype_ + 1)[(unsigned char)(c & 0xff)] & _S)); + return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)(c & 0xff)] & _S)); } static __inline int isupper(int c) { - return (c == __EOF ? 0 : ((_ctype_ + 1)[(unsigned char)(c & 0xff)] & _U)); + return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)(c & 0xff)] & _U)); } static __inline int isxdigit(int c) { - return (c == __EOF ? 0 : ((_ctype_ + 1)[(unsigned char)(c & 0xff)] & (_N|_X))); + return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)(c & 0xff)] & (_N|_X))); } static __inline int tolower(int c) diff --git a/include/stdio.h b/include/stdio.h index 0c134846b6e..221ab75b554 100644 --- a/include/stdio.h +++ b/include/stdio.h @@ -1,4 +1,4 @@ -/* $OpenBSD: stdio.h,v 1.24 2002/12/29 03:02:34 millert Exp $ */ +/* $OpenBSD: stdio.h,v 1.25 2002/12/30 21:36:06 millert Exp $ */ /* $NetBSD: stdio.h,v 1.18 1996/04/25 18:29:21 jtc Exp $ */ /*- @@ -176,10 +176,7 @@ __END_DECLS #define BUFSIZ 1024 /* size of buffer used by setbuf */ -#ifndef __EOF -#define __EOF (-1) -#endif -#define EOF __EOF +#define EOF (-1) /* * FOPEN_MAX is a minimum maximum, and should be the number of descriptors |