summary refs log tree commit diff
path: root/iconv/gconv_simple.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-09-05 02:41:25 +0000
committerUlrich Drepper <drepper@redhat.com>2000-09-05 02:41:25 +0000
commitb79f74cd622578ce5eea1a3ed5840ac53d6b6d93 (patch)
tree2c0e56654a4df00616e8994f181434ddf3246549 /iconv/gconv_simple.c
parentbcf6d602849db60d9651ffade87f18282c75ebd4 (diff)
downloadglibc-b79f74cd622578ce5eea1a3ed5840ac53d6b6d93.tar.gz
glibc-b79f74cd622578ce5eea1a3ed5840ac53d6b6d93.tar.xz
glibc-b79f74cd622578ce5eea1a3ed5840ac53d6b6d93.zip
Update.
2000-09-03  Bruno Haible  <haible@clisp.cons.org>

	* charmaps/EUC-TW: Add commented non-reversible mappings.

2000-09-03  Bruno Haible  <haible@clisp.cons.org>

	* charmaps/CP949: New file.

2000-09-03  Bruno Haible  <haible@clisp.cons.org>

	* charmaps/GB2312: Remove 0x80..0xA0, 0xAA..0xAF, 0xF8..FF.

2000-09-03  Bruno Haible  <haible@clisp.cons.org>

	* charmaps/EUC-JP: Nonreversibly map 0xA1C0 to U+005C and 0x8FA2B7 to
	U+007E.
Diffstat (limited to 'iconv/gconv_simple.c')
-rw-r--r--iconv/gconv_simple.c17
1 files changed, 2 insertions, 15 deletions
diff --git a/iconv/gconv_simple.c b/iconv/gconv_simple.c
index 9376b151ed..a41e1b50b2 100644
--- a/iconv/gconv_simple.c
+++ b/iconv/gconv_simple.c
@@ -34,19 +34,6 @@
 #endif
 
 
-/* These are definitions used by some of the functions for handling
-   UTF-8 encoding below.  */
-static const uint32_t encoding_mask[] =
-{
-  ~0x7ff, ~0xffff, ~0x1fffff, ~0x3ffffff
-};
-
-static const unsigned char encoding_byte[] =
-{
-  0xc0, 0xe0, 0xf0, 0xf8, 0xfc
-};
-
-
 /* Transform from the internal, UCS4-like format, to UCS4.  The
    difference between the internal ucs4 format and the real UCS4
    format is, if any, the endianess.  The Unicode/ISO 10646 says that
@@ -856,7 +843,7 @@ ucs4le_internal_loop_single (struct __gconv_step *step,
 	char *start;							      \
 									      \
 	for (step = 2; step < 6; ++step)				      \
-	  if ((wc & encoding_mask[step - 2]) == 0)			      \
+	  if ((wc & (~(uint32_t)0 << (5 * step + 1))) == 0)		      \
 	    break;							      \
 									      \
 	if (__builtin_expect (outptr + step > outend, 0))		      \
@@ -867,7 +854,7 @@ ucs4le_internal_loop_single (struct __gconv_step *step,
 	  }								      \
 									      \
 	start = outptr;							      \
-	*outptr = encoding_byte[step - 2];				      \
+	*outptr = (unsigned char) (~0xff >> step);			      \
 	outptr += step;							      \
 	--step;								      \
 	do								      \