aboutsummaryrefslogtreecommitdiff
path: root/iconvdata/gbk.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1999-12-28 01:03:14 +0000
committerUlrich Drepper <drepper@redhat.com>1999-12-28 01:03:14 +0000
commita1b038d329d56b9e205b7b940e7b921f06f0aaef (patch)
treeb92653c7af8785ecda2eb6d1a44b896d00891d7c /iconvdata/gbk.c
parent2d05bb3556b808a605342d80602f7d4ae5262b02 (diff)
downloadglibc-a1b038d329d56b9e205b7b940e7b921f06f0aaef.zip
glibc-a1b038d329d56b9e205b7b940e7b921f06f0aaef.tar.gz
glibc-a1b038d329d56b9e205b7b940e7b921f06f0aaef.tar.bz2
Update.
* iconvdata/gbk.c: OPtimize the swrich statement in the conversion to GBK a bit.
Diffstat (limited to 'iconvdata/gbk.c')
-rw-r--r--iconvdata/gbk.c44
1 files changed, 7 insertions, 37 deletions
diff --git a/iconvdata/gbk.c b/iconvdata/gbk.c
index e56136a..b468701 100644
--- a/iconvdata/gbk.c
+++ b/iconvdata/gbk.c
@@ -42,7 +42,7 @@
int(($g - 0x8140) / 256) * 192 + (($g - 0x8140) & 0xff), $u);
}
printf ("\n");
-
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
static const uint16_t __gbk_to_ucs[] =
@@ -13247,17 +13247,8 @@ static const char __gbk_from_ucs4_tab12[][2] =
case 0x261: \
cp = "\xa8\xc0"; \
break; \
- case 0x2c7: \
- cp = "\xa1\xa6"; \
- break; \
- case 0x2c9: \
- cp = "\xa1\xa5"; \
- break; \
- case 0x2ca: \
- cp = "\xa8\x40"; \
- break; \
- case 0x2cb: \
- cp = "\xa8\x41"; \
+ case 0x2c7 ... 0x2cb: \
+ cp = "\xa1\xa6\0\0\0\0\0\0\xa1\xa5\0\0\xa8\x40\0\0\xa8\x41"[(ch - 0x2c7) * 4]; \
break; \
case 0x2d9: \
cp = "\xa8\x42"; \
@@ -13296,14 +13287,8 @@ static const char __gbk_from_ucs4_tab12[][2] =
buf[0] = '\xa8'; \
buf[1] = '\x80' + (ch - 0x2588); \
break; \
- case 0x2593: \
- cp = "\xa8\x88"; \
- break; \
- case 0x2594: \
- cp = "\xa8\x89"; \
- break; \
- case 0x2595: \
- cp = "\xa8\x8a"; \
+ case 0x2593 ... 0x2595: \
+ cp = "\xa8\x88\0\0\xa8\x89\0\0\xa8\x8a"[(ch - 0x2593) * 4]; \
break; \
case 0x25a0: \
cp = "\xa1\xf6"; \
@@ -13433,23 +13418,8 @@ static const char __gbk_from_ucs4_tab12[][2] =
case 0xff01 ... 0xff5e: \
cp = __gbk_from_ucs4_tab12[ch - 0xff01]; \
break; \
- case 0xffe0: \
- cp = "\xa1\xe9"; \
- break; \
- case 0xffe1: \
- cp = "\xa1\xea"; \
- break; \
- case 0xffe2: \
- cp = "\xa9\x56"; \
- break; \
- case 0xffe3: \
- cp = "\xa3\xfe"; \
- break; \
- case 0xffe4: \
- cp = "\xa9\x57"; \
- break; \
- case 0xffe5: \
- cp = "\xa3\xa4"; \
+ case 0xffe0 ... 0xffe5: \
+ cp = "\xa1\xe9\0\0\xa1\xea\0\0\xa9\x56\0\0\xa3\xfe\0\0\xa9\x57\0\0\xa3\xa4"[(ch - 0xffe0) * 4]; \
break; \
default: \
cp = ""; \