From: Lionel Sambuc Date: Mon, 2 Dec 2013 14:31:33 +0000 (+0100) Subject: sys/sys/ctype_inline.h: merged X-Git-Tag: v3.3.0~485 X-Git-Url: http://zhaoyanbai.com/repos/%22../static/icons/zlib_tech.html?a=commitdiff_plain;h=d1ae7749c8f0503a342d4c6a62317ff65a05d743;p=minix.git sys/sys/ctype_inline.h: merged Change-Id: I0a04b7729b2226ce601cadceebfb6878302c64d1 --- diff --git a/sys/sys/ctype_inline.h b/sys/sys/ctype_inline.h index d416a4591..105cdcb2c 100644 --- a/sys/sys/ctype_inline.h +++ b/sys/sys/ctype_inline.h @@ -44,20 +44,20 @@ #include #include -/* LSC: cast to unsigned char in order to prevent char as indice errors. */ -#define isdigit(c) ((int)((_ctype_ + 1)[(unsigned char)(c)] & _CTYPE_N)) -#define islower(c) ((int)((_ctype_ + 1)[(unsigned char)(c)] & _CTYPE_L)) -#define isspace(c) ((int)((_ctype_ + 1)[(unsigned char)(c)] & _CTYPE_S)) -#define ispunct(c) ((int)((_ctype_ + 1)[(unsigned char)(c)] & _CTYPE_P)) -#define isupper(c) ((int)((_ctype_ + 1)[(unsigned char)(c)] & _CTYPE_U)) -#define isalpha(c) ((int)((_ctype_ + 1)[(unsigned char)(c)] & (_CTYPE_U|_CTYPE_L))) -#define isxdigit(c) ((int)((_ctype_ + 1)[(unsigned char)(c)] & (_CTYPE_N|_CTYPE_X))) -#define isalnum(c) ((int)((_ctype_ + 1)[(unsigned char)(c)] & (_CTYPE_U|_CTYPE_L|_CTYPE_N))) -#define isprint(c) ((int)((_ctype_ + 1)[(unsigned char)(c)] & (_CTYPE_P|_CTYPE_U|_CTYPE_L|_CTYPE_N|_CTYPE_B))) -#define isgraph(c) ((int)((_ctype_ + 1)[(unsigned char)(c)] & (_CTYPE_P|_CTYPE_U|_CTYPE_L|_CTYPE_N))) -#define iscntrl(c) ((int)((_ctype_ + 1)[(unsigned char)(c)] & _CTYPE_C)) -#define tolower(c) ((int)((_tolower_tab_ + 1)[(unsigned char)(c)])) -#define toupper(c) ((int)((_toupper_tab_ + 1)[(unsigned char)(c)])) + +#define isdigit(c) ((int)((_ctype_ + 1)[(c)] & _CTYPE_N)) +#define islower(c) ((int)((_ctype_ + 1)[(c)] & _CTYPE_L)) +#define isspace(c) ((int)((_ctype_ + 1)[(c)] & _CTYPE_S)) +#define ispunct(c) ((int)((_ctype_ + 1)[(c)] & _CTYPE_P)) +#define isupper(c) ((int)((_ctype_ + 1)[(c)] & _CTYPE_U)) +#define isalpha(c) ((int)((_ctype_ + 1)[(c)] & (_CTYPE_U|_CTYPE_L))) +#define isxdigit(c) ((int)((_ctype_ + 1)[(c)] & (_CTYPE_N|_CTYPE_X))) +#define isalnum(c) ((int)((_ctype_ + 1)[(c)] & (_CTYPE_U|_CTYPE_L|_CTYPE_N))) +#define isprint(c) ((int)((_ctype_ + 1)[(c)] & (_CTYPE_P|_CTYPE_U|_CTYPE_L|_CTYPE_N|_CTYPE_B))) +#define isgraph(c) ((int)((_ctype_ + 1)[(c)] & (_CTYPE_P|_CTYPE_U|_CTYPE_L|_CTYPE_N))) +#define iscntrl(c) ((int)((_ctype_ + 1)[(c)] & _CTYPE_C)) +#define tolower(c) ((int)((_tolower_tab_ + 1)[(c)])) +#define toupper(c) ((int)((_toupper_tab_ + 1)[(c)])) #if defined(_XOPEN_SOURCE) || defined(_NETBSD_SOURCE) #define isascii(c) ((unsigned)(c) <= 0177)