]> Zhao Yanbai Git Server - minix.git/commitdiff
sys/sys/ctype_inline.h: merged
authorLionel Sambuc <lionel@minix3.org>
Mon, 2 Dec 2013 14:31:33 +0000 (15:31 +0100)
committerLionel Sambuc <lionel@minix3.org>
Mon, 3 Mar 2014 19:47:00 +0000 (20:47 +0100)
Change-Id: I0a04b7729b2226ce601cadceebfb6878302c64d1

sys/sys/ctype_inline.h

index d416a4591297d1925c5a445add40ce2f361487c0..105cdcb2c3cab343059c7cd4c7f0e9f31af80849 100644 (file)
 #include <sys/featuretest.h>
 
 #include <sys/ctype_bits.h>
-/* 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)