diff options
author | Andrey A. Chernov <ache@FreeBSD.org> | 1997-10-23 01:29:44 +0000 |
---|---|---|
committer | Andrey A. Chernov <ache@FreeBSD.org> | 1997-10-23 01:29:44 +0000 |
commit | 92463139ce416ba7f39fc953d0139ee4a2177069 (patch) | |
tree | 17cb7c6ba6399c49ef5672191916d7078c06d672 /contrib/awk | |
parent | 48f814b934aa4cc2d90a5423f33d6e77eb6a7fb8 (diff) | |
download | src-92463139ce416ba7f39fc953d0139ee4a2177069.tar.gz src-92463139ce416ba7f39fc953d0139ee4a2177069.zip |
Add (unsigned char) cast to all ctype macros
Notes
Notes:
svn path=/head/; revision=30653
Diffstat (limited to 'contrib/awk')
-rw-r--r-- | contrib/awk/awk.h | 28 | ||||
-rw-r--r-- | contrib/awk/dfa.c | 46 |
2 files changed, 37 insertions, 37 deletions
diff --git a/contrib/awk/awk.h b/contrib/awk/awk.h index 3ab2015c8bb6..b87a645a118a 100644 --- a/contrib/awk/awk.h +++ b/contrib/awk/awk.h @@ -65,30 +65,30 @@ extern int errno; #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)) +#define ISGRAPH(c) (ISASCII(c) && isprint((unsigned char)c) && !isspace((unsigned char)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 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)) #ifdef __STDC__ diff --git a/contrib/awk/dfa.c b/contrib/awk/dfa.c index c806bea81b3f..88e8e3e2d951 100644 --- a/contrib/awk/dfa.c +++ b/contrib/awk/dfa.c @@ -48,33 +48,33 @@ extern void free(); #endif /* DEBUG */ #ifndef isgraph -#define isgraph(C) (isprint(C) && !isspace(C)) +#define isgraph(C) (isprint((unsigned char)C) && !isspace((unsigned char)C)) #endif #if defined (STDC_HEADERS) || (!defined (isascii) && !defined (HAVE_ISASCII)) -#define ISALPHA(C) isalpha(C) -#define ISUPPER(C) isupper(C) -#define ISLOWER(C) islower(C) -#define ISDIGIT(C) isdigit(C) -#define ISXDIGIT(C) isxdigit(C) -#define ISSPACE(C) isspace(C) -#define ISPUNCT(C) ispunct(C) -#define ISALNUM(C) isalnum(C) -#define ISPRINT(C) isprint(C) -#define ISGRAPH(C) isgraph(C) -#define ISCNTRL(C) iscntrl(C) +#define ISALPHA(C) isalpha((unsigned char)C) +#define ISUPPER(C) isupper((unsigned char)C) +#define ISLOWER(C) islower((unsigned char)C) +#define ISDIGIT(C) isdigit((unsigned char)C) +#define ISXDIGIT(C) isxdigit((unsigned char)C) +#define ISSPACE(C) isspace((unsigned char)C) +#define ISPUNCT(C) ispunct((unsigned char)C) +#define ISALNUM(C) isalnum((unsigned char)C) +#define ISPRINT(C) isprint((unsigned char)C) +#define ISGRAPH(C) isgraph((unsigned char)C) +#define ISCNTRL(C) iscntrl((unsigned char)C) #else -#define ISALPHA(C) (isascii(C) && isalpha(C)) -#define ISUPPER(C) (isascii(C) && isupper(C)) -#define ISLOWER(C) (isascii(C) && islower(C)) -#define ISDIGIT(C) (isascii(C) && isdigit(C)) -#define ISXDIGIT(C) (isascii(C) && isxdigit(C)) -#define ISSPACE(C) (isascii(C) && isspace(C)) -#define ISPUNCT(C) (isascii(C) && ispunct(C)) -#define ISALNUM(C) (isascii(C) && isalnum(C)) -#define ISPRINT(C) (isascii(C) && isprint(C)) -#define ISGRAPH(C) (isascii(C) && isgraph(C)) -#define ISCNTRL(C) (isascii(C) && iscntrl(C)) +#define ISALPHA(C) (isascii((unsigned char)C) && isalpha(C)) +#define ISUPPER(C) (isascii((unsigned char)C) && isupper(C)) +#define ISLOWER(C) (isascii((unsigned char)C) && islower(C)) +#define ISDIGIT(C) (isascii((unsigned char)C) && isdigit(C)) +#define ISXDIGIT(C) (isascii((unsigned char)C) && isxdigit(C)) +#define ISSPACE(C) (isascii((unsigned char)C) && isspace(C)) +#define ISPUNCT(C) (isascii((unsigned char)C) && ispunct(C)) +#define ISALNUM(C) (isascii((unsigned char)C) && isalnum(C)) +#define ISPRINT(C) (isascii((unsigned char)C) && isprint(C)) +#define ISGRAPH(C) (isascii((unsigned char)C) && isgraph(C)) +#define ISCNTRL(C) (isascii((unsigned char)C) && iscntrl(C)) #endif #ifndef __FreeBSD__ |