diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2013-10-29 00:09:41 +0100 |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2013-10-29 00:09:41 +0100 |
commit | 4a623f948bc424abbdd115586980c32e63a0e4be (patch) | |
tree | 955c3b999b9959f09ac7646d9e227ca84a60d24b /Modules/cjkcodecs/alg_jisx0201.h | |
parent | 4d58ae8ed39af405aeccdd612343938fc97b346d (diff) | |
download | cpython-4a623f948bc424abbdd115586980c32e63a0e4be.tar.gz |
CJK codecs: add newlines for readability
Diffstat (limited to 'Modules/cjkcodecs/alg_jisx0201.h')
-rw-r--r-- | Modules/cjkcodecs/alg_jisx0201.h | 37 |
1 files changed, 28 insertions, 9 deletions
diff --git a/Modules/cjkcodecs/alg_jisx0201.h b/Modules/cjkcodecs/alg_jisx0201.h index 98c63e6b70..5368e0884f 100644 --- a/Modules/cjkcodecs/alg_jisx0201.h +++ b/Modules/cjkcodecs/alg_jisx0201.h @@ -1,27 +1,46 @@ #define JISX0201_R_ENCODE(c, assi) \ - if ((c) < 0x80 && (c) != 0x5c && (c) != 0x7e) \ + if ((c) < 0x80 && (c) != 0x5c && (c) != 0x7e) { \ (assi) = (c); \ - else if ((c) == 0x00a5) (assi) = 0x5c; \ - else if ((c) == 0x203e) (assi) = 0x7e; + } \ + else if ((c) == 0x00a5) { \ + (assi) = 0x5c; \ + } \ + else if ((c) == 0x203e) { \ + (assi) = 0x7e; \ + } + #define JISX0201_K_ENCODE(c, assi) \ if ((c) >= 0xff61 && (c) <= 0xff9f) \ - (assi) = (c) - 0xfec0; + { (assi) = (c) - 0xfec0; } + #define JISX0201_ENCODE(c, assi) \ JISX0201_R_ENCODE(c, assi) \ else JISX0201_K_ENCODE(c, assi) #define JISX0201_R_DECODE_CHAR(c, assi) \ - if ((c) < 0x5c) (assi) = (c); \ - else if ((c) == 0x5c) (assi) = 0x00a5; \ - else if ((c) < 0x7e) (assi) = (c); \ - else if ((c) == 0x7e) (assi) = 0x203e; \ - else if ((c) == 0x7f) (assi) = 0x7f; + if ((c) < 0x5c) { \ + (assi) = (c); \ + } \ + else if ((c) == 0x5c) { \ + (assi) = 0x00a5; \ + } \ + else if ((c) < 0x7e) { \ + (assi) = (c); \ + } \ + else if ((c) == 0x7e) { \ + (assi) = 0x203e; \ + } \ + else if ((c) == 0x7f) { \ + (assi) = 0x7f; \ + } + #define JISX0201_R_DECODE(c, writer) \ if ((c) < 0x5c) OUTCHAR(c); \ else if ((c) == 0x5c) OUTCHAR(0x00a5); \ else if ((c) < 0x7e) OUTCHAR(c); \ else if ((c) == 0x7e) OUTCHAR(0x203e); \ else if ((c) == 0x7f) OUTCHAR(0x7f); + #define JISX0201_K_DECODE(c, writer) \ if ((c) >= 0xa1 && (c) <= 0xdf) \ OUTCHAR(0xfec0 + (c)); |