about summary refs log tree commit diff
path: root/wctype
diff options
context:
space:
mode:
Diffstat (limited to 'wctype')
-rw-r--r--wctype/wctrans.c13
-rw-r--r--wctype/wctype.h5
2 files changed, 9 insertions, 9 deletions
diff --git a/wctype/wctrans.c b/wctype/wctrans.c
index 3f823e56a8..3c46131f24 100644
--- a/wctype/wctrans.c
+++ b/wctype/wctrans.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1996.
 
@@ -18,6 +18,7 @@
    Boston, MA 02111-1307, USA.  */
 
 #include <ctype.h>
+#include <inttypes.h>
 #include <string.h>
 #include <wctype.h>
 #include "../locale/localeinfo.h"
@@ -27,7 +28,7 @@ wctrans (const char *property)
 {
   const char *names;
   size_t cnt;
-  unsigned int **result;
+  int32_t *result;
 
   names = _NL_CURRENT (LC_CTYPE, _NL_CTYPE_MAP_NAMES);
   cnt = 0;
@@ -49,11 +50,7 @@ wctrans (const char *property)
     return (wctrans_t) __ctype_tolower;
 
   /* We have to search the table.  */
-  result = (unsigned int **) &_NL_CURRENT (LC_CTYPE, _NL_CTYPE_WIDTH);
+  result = (int32_t *) _NL_CURRENT (LC_CTYPE, _NL_CTYPE_WIDTH + cnt - 2);
 
-#if __BYTE_ORDER == _BIG_ENDIAN
-  return (wctrans_t) result[1 + 2 * cnt];
-#else
-  return (wctrans_t) result[1 + 2 * cnt + 1];
-#endif
+  return (wctrans_t) (result + 128);
 }
diff --git a/wctype/wctype.h b/wctype/wctype.h
index 68f3853c94..378095bcb4 100644
--- a/wctype/wctype.h
+++ b/wctype/wctype.h
@@ -70,7 +70,10 @@ typedef unsigned long int wctype_t;
 #   define _ISwbit(bit)	(1 << (bit))
 #  else /* __BYTE_ORDER == __LITTLE_ENDIAN */
 #   define _ISwbit(bit)	\
-	((bit) < 8 ? (int) (1UL << (bit) << 24) : (int) (1UL << ((bit) + 8)))
+	((bit) < 8 ? (int) (1UL << ((bit) + 24))			      \
+	 : ((bit) < 16 ? (int) (1UL << ((bit) + 8))			      \
+	    : ((bit) < 24 ? (int) (1UL << ((bit) - 8 ))			      \
+	       : (int) (1UL << ((bit) - 24 )))))
 #  endif
 
 enum