diff options
author | Ulrich Drepper <drepper@redhat.com> | 2005-04-01 09:53:28 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2005-04-01 09:53:28 +0000 |
commit | 91682d7038c0247ba1a52925b284fcb59756546e (patch) | |
tree | 72a7a15deaab616cd30e97712f31479ac7a65bbd /wcsmbs/wctob.c | |
parent | ee6189855aab3a9be8f3c2d95ce2b2cd17db4ec2 (diff) | |
download | glibc-91682d7038c0247ba1a52925b284fcb59756546e.zip glibc-91682d7038c0247ba1a52925b284fcb59756546e.tar.gz glibc-91682d7038c0247ba1a52925b284fcb59756546e.tar.bz2 |
* sysdeps/ia64/fpu/libm_cpu_defs.h: Update copyright.cvs/fedora-glibc-20050401T1444
2005-04-01 Ulrich Drepper <drepper@redhat.com>
* wcsmbs/btowc.c (__btowc): Optimize parameters in ASCII range.
* wcsmbs/wctob.c (wctob): Likewise.
* wcsmbs/wchar.h (btowc): Add optimized inline function.
(wctob): Likewise.
Diffstat (limited to 'wcsmbs/wctob.c')
-rw-r--r-- | wcsmbs/wctob.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/wcsmbs/wctob.c b/wcsmbs/wctob.c index 854a3f2..0f24157 100644 --- a/wcsmbs/wctob.c +++ b/wcsmbs/wctob.c @@ -40,6 +40,11 @@ wctob (c) if (c == WEOF) return EOF; + /* We know that only ASCII compatible encodings are used for the + locale and that the wide character encoding is ISO 10646. */ + if (c >= L'\0' && c <= L'\x7f') + return (int) c; + /* Tell where we want the result. */ data.__outbuf = buf; data.__outbufend = buf + MB_LEN_MAX; @@ -69,5 +74,5 @@ wctob (c) || data.__outbuf != (unsigned char *) (buf + 1)) return EOF; - return (unsigned char) buf[0]; + return buf[0]; } |