* libc/include/ctype.h (__ctype_lookup): Fix precedence.
This commit is contained in:
parent
ac4ad8bffc
commit
73db6db783
|
@ -1,3 +1,7 @@
|
||||||
|
2009-11-06 Jon Turney <jon.turney@dronecode.org.uk>
|
||||||
|
|
||||||
|
* libc/include/ctype.h (__ctype_lookup): Fix precedence.
|
||||||
|
|
||||||
2009-10-30 Corinna Vinschen <corinna@vinschen.de>
|
2009-10-30 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* libc/stdio/fflush.c (_fflush_r): Store old errno to check for
|
* libc/stdio/fflush.c (_fflush_r): Store old errno to check for
|
||||||
|
|
|
@ -54,7 +54,7 @@ extern __IMPORT char *__ctype_ptr__;
|
||||||
Meanwhile, the real index to __ctype_ptr__+1 must be cast to int,
|
Meanwhile, the real index to __ctype_ptr__+1 must be cast to int,
|
||||||
since isalpha(0x100000001LL) must equal isalpha(1), rather than being
|
since isalpha(0x100000001LL) must equal isalpha(1), rather than being
|
||||||
an out-of-bounds reference on a 64-bit machine. */
|
an out-of-bounds reference on a 64-bit machine. */
|
||||||
#define __ctype_lookup(__c) ((__ctype_ptr__+sizeof(""[__c]))[(int)__c])
|
#define __ctype_lookup(__c) ((__ctype_ptr__+sizeof(""[__c]))[(int)(__c)])
|
||||||
|
|
||||||
#define isalpha(__c) (__ctype_lookup(__c)&(_U|_L))
|
#define isalpha(__c) (__ctype_lookup(__c)&(_U|_L))
|
||||||
#define isupper(__c) ((__ctype_lookup(__c)&(_U|_L))==_U)
|
#define isupper(__c) ((__ctype_lookup(__c)&(_U|_L))==_U)
|
||||||
|
|
Loading…
Reference in New Issue