mirror of
https://github.com/python/cpython.git
synced 2025-10-29 01:22:59 +00:00
(Merge 3.2) Issue #12016: Reindent decoders of HK and JP codecs
This commit is contained in:
commit
2bc6c2ec2f
2 changed files with 49 additions and 48 deletions
|
|
@ -115,14 +115,15 @@ DECODER(big5hkscs)
|
||||||
|
|
||||||
REQUIRE_INBUF(2)
|
REQUIRE_INBUF(2)
|
||||||
|
|
||||||
if (0xc6 <= c && c <= 0xc8 && (c >= 0xc7 || IN2 >= 0xa1))
|
if (0xc6 > c || c > 0xc8 || (c < 0xc7 && IN2 < 0xa1)) {
|
||||||
goto hkscsdec;
|
|
||||||
|
|
||||||
TRYMAP_DEC(big5, **outbuf, c, IN2) {
|
TRYMAP_DEC(big5, **outbuf, c, IN2) {
|
||||||
NEXT(2, 1)
|
NEXT(2, 1)
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
else
|
}
|
||||||
hkscsdec: TRYMAP_DEC(big5hkscs, decoded, c, IN2) {
|
|
||||||
|
TRYMAP_DEC(big5hkscs, decoded, c, IN2)
|
||||||
|
{
|
||||||
int s = BH2S(c, IN2);
|
int s = BH2S(c, IN2);
|
||||||
const unsigned char *hintbase;
|
const unsigned char *hintbase;
|
||||||
|
|
||||||
|
|
@ -152,8 +153,9 @@ hkscsdec: TRYMAP_DEC(big5hkscs, decoded, c, IN2) {
|
||||||
OUT1(decoded)
|
OUT1(decoded)
|
||||||
NEXT(2, 1)
|
NEXT(2, 1)
|
||||||
}
|
}
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
switch ((c << 8) | IN2) {
|
switch ((c << 8) | IN2) {
|
||||||
case 0x8862: WRITE2(0x00ca, 0x0304); break;
|
case 0x8862: WRITE2(0x00ca, 0x0304); break;
|
||||||
case 0x8864: WRITE2(0x00ca, 0x030c); break;
|
case 0x8864: WRITE2(0x00ca, 0x030c); break;
|
||||||
|
|
@ -164,7 +166,6 @@ hkscsdec: TRYMAP_DEC(big5hkscs, decoded, c, IN2) {
|
||||||
|
|
||||||
NEXT(2, 2) /* all decoded codepoints are pairs, above. */
|
NEXT(2, 2) /* all decoded codepoints are pairs, above. */
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue