diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2013-10-28 22:54:13 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2013-10-28 22:54:13 (GMT) |
commit | bd97ac35f7cab6229243e2c93b6fa6eaf7f0cc19 (patch) | |
tree | 65a872a6465d226a833445ce4a5f46ea6d363949 /Modules/cjkcodecs/_codecs_cn.c | |
parent | 0a6e2c59d362659001adfb232537f9af5fdb256c (diff) | |
download | cpython-bd97ac35f7cab6229243e2c93b6fa6eaf7f0cc19.zip cpython-bd97ac35f7cab6229243e2c93b6fa6eaf7f0cc19.tar.gz cpython-bd97ac35f7cab6229243e2c93b6fa6eaf7f0cc19.tar.bz2 |
CJK codecs: use less magic and more readable macros, write explicit if
Diffstat (limited to 'Modules/cjkcodecs/_codecs_cn.c')
-rw-r--r-- | Modules/cjkcodecs/_codecs_cn.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Modules/cjkcodecs/_codecs_cn.c b/Modules/cjkcodecs/_codecs_cn.c index 430ca5c..3bd3f23 100644 --- a/Modules/cjkcodecs/_codecs_cn.c +++ b/Modules/cjkcodecs/_codecs_cn.c @@ -36,7 +36,7 @@ if ((code) == 0x2014) (assi) = 0xa1aa; \ else if ((code) == 0x2015) (assi) = 0xa844; \ else if ((code) == 0x00b7) (assi) = 0xa1a4; \ - else if ((code) != 0x30fb && TRYMAP_ENC_COND(gbcommon, assi, code)); + else if ((code) != 0x30fb && TRYMAP_ENC(gbcommon, assi, code)); /* * GB2312 codec @@ -58,7 +58,7 @@ ENCODER(gb2312) return 1; REQUIRE_OUTBUF(2) - TRYMAP_ENC(gbcommon, code, c); + if (TRYMAP_ENC(gbcommon, code, c)); else return 1; if (code & 0x8000) /* MSB set: GBK */ @@ -192,7 +192,7 @@ ENCODER(gb18030) REQUIRE_OUTBUF(2) GBK_ENCODE(c, code) - else TRYMAP_ENC(gb18030ext, code, c); + else if (TRYMAP_ENC(gb18030ext, code, c)); else { const struct _gb18030_to_unibmp_ranges *utrrange; @@ -343,7 +343,7 @@ ENCODER(hz) if (c > 0xFFFF) return 1; - TRYMAP_ENC(gbcommon, code, c); + if (TRYMAP_ENC(gbcommon, code, c)); else return 1; if (code & 0x8000) /* MSB set: GBK */ |