about summary refs log tree commit diff
path: root/wcsmbs/wctob.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2004-12-22 20:10:10 +0000
committerUlrich Drepper <drepper@redhat.com>2004-12-22 20:10:10 +0000
commita334319f6530564d22e775935d9c91663623a1b4 (patch)
treeb5877475619e4c938e98757d518bb1e9cbead751 /wcsmbs/wctob.c
parent0ecb606cb6cf65de1d9fc8a919bceb4be476c602 (diff)
downloadglibc-a334319f6530564d22e775935d9c91663623a1b4.tar.gz
glibc-a334319f6530564d22e775935d9c91663623a1b4.tar.xz
glibc-a334319f6530564d22e775935d9c91663623a1b4.zip
(CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
Diffstat (limited to 'wcsmbs/wctob.c')
-rw-r--r--wcsmbs/wctob.c20
1 files changed, 4 insertions, 16 deletions
diff --git a/wcsmbs/wctob.c b/wcsmbs/wctob.c
index cbaac53367..b85ba6dd8f 100644
--- a/wcsmbs/wctob.c
+++ b/wcsmbs/wctob.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2000, 2002, 2003, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2000, 2002, 2003 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1996.
 
@@ -24,14 +24,12 @@
 #include <wchar.h>
 #include <wcsmbsload.h>
 
-#include <sysdep.h>
-
 
 int
 wctob (c)
      wint_t c;
 {
-  unsigned char buf[MB_LEN_MAX];
+  char buf[MB_LEN_MAX];
   struct __gconv_step_data data;
   wchar_t inbuf[1];
   wchar_t *inptr = inbuf;
@@ -42,11 +40,6 @@ 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;
@@ -66,12 +59,7 @@ wctob (c)
   inbuf[0] = c;
 
   const unsigned char *argptr = (const unsigned char *) inptr;
-  __gconv_fct fct = fcts->tomb->__fct;
-#ifdef PTR_DEMANGLE
-  if (fcts->tomb->__shlib_handle != NULL)
-    PTR_DEMANGLE (fct);
-#endif
-  status = DL_CALL_FCT (fct,
+  status = DL_CALL_FCT (fcts->tomb->__fct,
 			(fcts->tomb, &data, &argptr,
 			 argptr + sizeof (inbuf[0]), NULL, &dummy, 0, 1));
 
@@ -81,5 +69,5 @@ wctob (c)
       || data.__outbuf != (unsigned char *) (buf + 1))
     return EOF;
 
-  return buf[0];
+  return (unsigned char) buf[0];
 }