diff options
author | Jeff Johnston <jjohnstn@redhat.com> | 2008-07-21 21:28:34 +0000 |
---|---|---|
committer | Jeff Johnston <jjohnstn@redhat.com> | 2008-07-21 21:28:34 +0000 |
commit | fa914bf8ab6b2c93a02f1a915cc22c2e21d68f76 (patch) | |
tree | 1a312a9fb8bdc39c8201ef2a3fba874232646f14 /newlib/libc/include | |
parent | 0485c2ceece67d19a8c57ce774562f7e2bdef5ed (diff) | |
download | cygnal-fa914bf8ab6b2c93a02f1a915cc22c2e21d68f76.tar.gz cygnal-fa914bf8ab6b2c93a02f1a915cc22c2e21d68f76.tar.bz2 cygnal-fa914bf8ab6b2c93a02f1a915cc22c2e21d68f76.zip |
2008-07-21 Jeff Johnston <jjohnstn@redhat.com>
* libc/ctype/ctype_.c: Add new pointer __ctype_ptr__ which is one
less than the old __ctype_ptr.
* libc/ctype/isalnum.c: Use __ctype_ptr__.
* libc/ctype/isalpha.c: Ditto.
* libc/ctype/iscntrl.c: Ditto.
* libc/ctype/isdigit.c: Ditto.
* libc/ctype/islower.c: Ditto.
* libc/ctype/isprint.c: Ditto.
* libc/ctype/ispunct.c: Ditto.
* libc/ctype/isspace.c: Ditto.
* libc/ctype/isupper.c: Ditto.
* libc/ctype/isxdigit.c: Ditto.
* libc/include/ctype.h: Change ctype macros to use new __ctype_ptr__
and add declaration of __ctype_ptr__. Remove older ctype table pointers
from here even though they can still work.
Diffstat (limited to 'newlib/libc/include')
-rw-r--r-- | newlib/libc/include/ctype.h | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/newlib/libc/include/ctype.h b/newlib/libc/include/ctype.h index c1ace5077..9014dbe4f 100644 --- a/newlib/libc/include/ctype.h +++ b/newlib/libc/include/ctype.h @@ -36,21 +36,20 @@ int _EXFUN(_toupper, (int __c)); #define _X 0100 #define _B 0200 -extern __IMPORT _CONST char *__ctype_ptr; -extern __IMPORT _CONST char _ctype_[]; /* For backward compatibility. */ +extern __IMPORT _CONST char *__ctype_ptr__; #ifndef __cplusplus -#define isalpha(c) ((__ctype_ptr)[(unsigned)(c)]&(_U|_L)) -#define isupper(c) ((__ctype_ptr)[(unsigned)(c)]&_U) -#define islower(c) ((__ctype_ptr)[(unsigned)(c)]&_L) -#define isdigit(c) ((__ctype_ptr)[(unsigned)(c)]&_N) -#define isxdigit(c) ((__ctype_ptr)[(unsigned)(c)]&(_X|_N)) -#define isspace(c) ((__ctype_ptr)[(unsigned)(c)]&_S) -#define ispunct(c) ((__ctype_ptr)[(unsigned)(c)]&_P) -#define isalnum(c) ((__ctype_ptr)[(unsigned)(c)]&(_U|_L|_N)) -#define isprint(c) ((__ctype_ptr)[(unsigned)(c)]&(_P|_U|_L|_N|_B)) -#define isgraph(c) ((__ctype_ptr)[(unsigned)(c)]&(_P|_U|_L|_N)) -#define iscntrl(c) ((__ctype_ptr)[(unsigned)(c)]&_C) +#define isalpha(c) ((__ctype_ptr__)[(unsigned)((c)+1)]&(_U|_L)) +#define isupper(c) ((__ctype_ptr__)[(unsigned)((c)+1)]&_U) +#define islower(c) ((__ctype_ptr__)[(unsigned)((c)+1)]&_L) +#define isdigit(c) ((__ctype_ptr__)[(unsigned)((c)+1)]&_N) +#define isxdigit(c) ((__ctype_ptr__)[(unsigned)((c)+1)]&(_X|_N)) +#define isspace(c) ((__ctype_ptr__)[(unsigned)((c)+1)]&_S) +#define ispunct(c) ((__ctype_ptr__)[(unsigned)((c)+1)]&_P) +#define isalnum(c) ((__ctype_ptr__)[(unsigned)((c)+1)]&(_U|_L|_N)) +#define isprint(c) ((__ctype_ptr__)[(unsigned)((c)+1)]&(_P|_U|_L|_N|_B)) +#define isgraph(c) ((__ctype_ptr__)[(unsigned)((c)+1)]&(_P|_U|_L|_N)) +#define iscntrl(c) ((__ctype_ptr__)[(unsigned)((c)+1)]&_C) /* Non-gcc versions will get the library versions, and will be |