From b79f74cd622578ce5eea1a3ed5840ac53d6b6d93 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 5 Sep 2000 02:41:25 +0000 Subject: Update. 2000-09-03 Bruno Haible * charmaps/EUC-TW: Add commented non-reversible mappings. 2000-09-03 Bruno Haible * charmaps/CP949: New file. 2000-09-03 Bruno Haible * charmaps/GB2312: Remove 0x80..0xA0, 0xAA..0xAF, 0xF8..FF. 2000-09-03 Bruno Haible * charmaps/EUC-JP: Nonreversibly map 0xA1C0 to U+005C and 0x8FA2B7 to U+007E. --- iconv/gconv_simple.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) (limited to 'iconv/gconv_simple.c') diff --git a/iconv/gconv_simple.c b/iconv/gconv_simple.c index 9376b15..a41e1b5 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 \ -- cgit v1.1