diff options
author | ache <ache@FreeBSD.org> | 1997-10-23 02:22:51 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 1997-10-23 02:22:51 +0000 |
commit | 1252945e3ac1c3d279a7d1efbd7a288ee87e136a (patch) | |
tree | 93c17efb1f4195ed3240e25b4bff9bc31dc7172a /gnu | |
parent | 43e60f18ddba317beb57ef3cd328e3cc9bc75fc4 (diff) | |
download | FreeBSD-src-1252945e3ac1c3d279a7d1efbd7a288ee87e136a.zip FreeBSD-src-1252945e3ac1c3d279a7d1efbd7a288ee87e136a.tar.gz |
Add (unsigned char) cast to ctype macros
Diffstat (limited to 'gnu')
-rw-r--r-- | gnu/usr.bin/diff/system.h | 10 | ||||
-rw-r--r-- | gnu/usr.bin/sort/system.h | 32 |
2 files changed, 21 insertions, 21 deletions
diff --git a/gnu/usr.bin/diff/system.h b/gnu/usr.bin/diff/system.h index 47db287..e15a9f0 100644 --- a/gnu/usr.bin/diff/system.h +++ b/gnu/usr.bin/diff/system.h @@ -190,20 +190,20 @@ void *memchr (); #if STDC_HEADERS #define CTYPE_DOMAIN(c) 1 #else -#define CTYPE_DOMAIN(c) ((unsigned) (c) <= 0177) +#define CTYPE_DOMAIN(c) ((unsigned char) (c) <= 0177) #endif #ifndef ISPRINT -#define ISPRINT(c) (CTYPE_DOMAIN (c) && isprint (c)) +#define ISPRINT(c) (CTYPE_DOMAIN (c) && isprint ((unsigned char)c)) #endif #ifndef ISSPACE -#define ISSPACE(c) (CTYPE_DOMAIN (c) && isspace (c)) +#define ISSPACE(c) (CTYPE_DOMAIN (c) && isspace ((unsigned char)c)) #endif #ifndef ISUPPER -#define ISUPPER(c) (CTYPE_DOMAIN (c) && isupper (c)) +#define ISUPPER(c) (CTYPE_DOMAIN (c) && isupper ((unsigned char)c)) #endif #ifndef ISDIGIT -#define ISDIGIT(c) ((unsigned) (c) - '0' <= 9) +#define ISDIGIT(c) ((unsigned char) (c) - '0' <= 9) #endif #include <errno.h> diff --git a/gnu/usr.bin/sort/system.h b/gnu/usr.bin/sort/system.h index bfb19e1..ed0b26b 100644 --- a/gnu/usr.bin/sort/system.h +++ b/gnu/usr.bin/sort/system.h @@ -167,30 +167,30 @@ char *getenv (); #if defined (STDC_HEADERS) || (!defined (isascii) && !defined (HAVE_ISASCII)) #define ISASCII(c) 1 #else -#define ISASCII(c) isascii(c) +#define ISASCII(c) isascii((unsigned char)c) #endif #ifdef isblank -#define ISBLANK(c) (ISASCII (c) && isblank (c)) +#define ISBLANK(c) (ISASCII (c) && isblank ((unsigned char)c)) #else #define ISBLANK(c) ((c) == ' ' || (c) == '\t') #endif #ifdef isgraph -#define ISGRAPH(c) (ISASCII (c) && isgraph (c)) +#define ISGRAPH(c) (ISASCII (c) && isgraph ((unsigned char)c)) #else -#define ISGRAPH(c) (ISASCII (c) && isprint (c) && !isspace (c)) -#endif - -#define ISPRINT(c) (ISASCII (c) && isprint (c)) -#define ISDIGIT(c) (ISASCII (c) && isdigit (c)) -#define ISALNUM(c) (ISASCII (c) && isalnum (c)) -#define ISALPHA(c) (ISASCII (c) && isalpha (c)) -#define ISCNTRL(c) (ISASCII (c) && iscntrl (c)) -#define ISLOWER(c) (ISASCII (c) && islower (c)) -#define ISPUNCT(c) (ISASCII (c) && ispunct (c)) -#define ISSPACE(c) (ISASCII (c) && isspace (c)) -#define ISUPPER(c) (ISASCII (c) && isupper (c)) -#define ISXDIGIT(c) (ISASCII (c) && isxdigit (c)) +#define ISGRAPH(c) (ISASCII (c) && isprint ((unsigned char)c) && !isspace ((unsigned char)c)) +#endif + +#define ISPRINT(c) (ISASCII (c) && isprint ((unsigned char)c)) +#define ISDIGIT(c) (ISASCII (c) && isdigit ((unsigned char)c)) +#define ISALNUM(c) (ISASCII (c) && isalnum ((unsigned char)c)) +#define ISALPHA(c) (ISASCII (c) && isalpha ((unsigned char)c)) +#define ISCNTRL(c) (ISASCII (c) && iscntrl ((unsigned char)c)) +#define ISLOWER(c) (ISASCII (c) && islower ((unsigned char)c)) +#define ISPUNCT(c) (ISASCII (c) && ispunct ((unsigned char)c)) +#define ISSPACE(c) (ISASCII (c) && isspace ((unsigned char)c)) +#define ISUPPER(c) (ISASCII (c) && isupper ((unsigned char)c)) +#define ISXDIGIT(c) (ISASCII (c) && isxdigit ((unsigned char)c)) /* Disable string localization for the time being. */ #undef _ |