about summary refs log tree commit diff
path: root/wcsmbs/wctob.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2005-04-01 09:53:28 +0000
committerUlrich Drepper <drepper@redhat.com>2005-04-01 09:53:28 +0000
commit91682d7038c0247ba1a52925b284fcb59756546e (patch)
tree72a7a15deaab616cd30e97712f31479ac7a65bbd /wcsmbs/wctob.c
parentee6189855aab3a9be8f3c2d95ce2b2cd17db4ec2 (diff)
downloadglibc-91682d7038c0247ba1a52925b284fcb59756546e.tar.gz
glibc-91682d7038c0247ba1a52925b284fcb59756546e.tar.xz
glibc-91682d7038c0247ba1a52925b284fcb59756546e.zip
* 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.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/wcsmbs/wctob.c b/wcsmbs/wctob.c
index 854a3f25db..0f241577a4 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];
 }