diff options
author | Eric Blake <eblake@redhat.com> | 2009-11-06 03:27:19 +0000 |
---|---|---|
committer | Eric Blake <eblake@redhat.com> | 2009-11-06 03:27:19 +0000 |
commit | 73db6db783606e4d05a3760a7a8344a6eeaca173 (patch) | |
tree | 82ed3c74babdb16a6f8855f1b84b480647b2a0cd /newlib | |
parent | ac4ad8bffcb1358c593b327ae1f1354ec26fee90 (diff) | |
download | newlib-73db6db783606e4d05a3760a7a8344a6eeaca173.zip newlib-73db6db783606e4d05a3760a7a8344a6eeaca173.tar.gz newlib-73db6db783606e4d05a3760a7a8344a6eeaca173.tar.bz2 |
* libc/include/ctype.h (__ctype_lookup): Fix precedence.
Diffstat (limited to 'newlib')
-rw-r--r-- | newlib/ChangeLog | 4 | ||||
-rw-r--r-- | newlib/libc/include/ctype.h | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/newlib/ChangeLog b/newlib/ChangeLog index f0cb51b..8be4915 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -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> * libc/stdio/fflush.c (_fflush_r): Store old errno to check for diff --git a/newlib/libc/include/ctype.h b/newlib/libc/include/ctype.h index 75e1c48..56ad5ab 100644 --- a/newlib/libc/include/ctype.h +++ b/newlib/libc/include/ctype.h @@ -54,7 +54,7 @@ extern __IMPORT char *__ctype_ptr__; Meanwhile, the real index to __ctype_ptr__+1 must be cast to int, since isalpha(0x100000001LL) must equal isalpha(1), rather than being 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 isupper(__c) ((__ctype_lookup(__c)&(_U|_L))==_U) |