X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Funiwidth%2Fwidth.c;fp=lib%2Funiwidth%2Fwidth.c;h=b0660de92576a230fe3259048650e43be770f85f;hb=441aa3044f43e5572f58c354f01e6bc070acd5c7;hp=25ff0c73f25844f774ce14de75e9411d88eabeae;hpb=039ae97b8ae35a2446c5d62d72b21689c97da7e2;p=gnulib.git diff --git a/lib/uniwidth/width.c b/lib/uniwidth/width.c index 25ff0c73f..b0660de92 100644 --- a/lib/uniwidth/width.c +++ b/lib/uniwidth/width.c @@ -310,26 +310,26 @@ uc_width (ucs4_t uc, const char *encoding) { int ind = nonspacing_table_ind[uc >> 9]; if (ind >= 0) - if ((nonspacing_table_data[64*ind + ((uc >> 3) & 63)] >> (uc & 7)) & 1) - { - if (uc > 0 && uc < 0xa0) - return -1; - else - return 0; - } + if ((nonspacing_table_data[64*ind + ((uc >> 3) & 63)] >> (uc & 7)) & 1) + { + if (uc > 0 && uc < 0xa0) + return -1; + else + return 0; + } } else if ((uc >> 9) == (0xe0000 >> 9)) { if (uc >= 0xe0100) - { - if (uc <= 0xe01ef) - return 0; - } + { + if (uc <= 0xe01ef) + return 0; + } else - { - if (uc >= 0xe0020 ? uc <= 0xe007f : uc == 0xe0001) - return 0; - } + { + if (uc >= 0xe0020 ? uc <= 0xe007f : uc == 0xe0001) + return 0; + } } /* Test for double-width character. * Generated from "grep '^....;[WF]' EastAsianWidth.txt" @@ -337,17 +337,17 @@ uc_width (ucs4_t uc, const char *encoding) */ if (uc >= 0x1100 && ((uc < 0x1160) /* Hangul Jamo */ - || (uc >= 0x2329 && uc < 0x232b) /* Angle Brackets */ - || (uc >= 0x2e80 && uc < 0xa4d0 /* CJK ... Yi */ - && !(uc == 0x303f) && !(uc >= 0x4dc0 && uc < 0x4e00)) - || (uc >= 0xac00 && uc < 0xd7a4) /* Hangul Syllables */ - || (uc >= 0xf900 && uc < 0xfb00) /* CJK Compatibility Ideographs */ - || (uc >= 0xfe10 && uc < 0xfe20) /* Presentation Forms for Vertical */ - || (uc >= 0xfe30 && uc < 0xfe70) /* CJK Compatibility Forms */ - || (uc >= 0xff00 && uc < 0xff61) /* Fullwidth Forms */ - || (uc >= 0xffe0 && uc < 0xffe7) /* Fullwidth Signs */ - || (uc >= 0x20000 && uc <= 0x2a6d6) /* CJK */ - || (uc >= 0x2f800 && uc <= 0x2fa1d) /* CJK Compatibility Ideographs */ + || (uc >= 0x2329 && uc < 0x232b) /* Angle Brackets */ + || (uc >= 0x2e80 && uc < 0xa4d0 /* CJK ... Yi */ + && !(uc == 0x303f) && !(uc >= 0x4dc0 && uc < 0x4e00)) + || (uc >= 0xac00 && uc < 0xd7a4) /* Hangul Syllables */ + || (uc >= 0xf900 && uc < 0xfb00) /* CJK Compatibility Ideographs */ + || (uc >= 0xfe10 && uc < 0xfe20) /* Presentation Forms for Vertical */ + || (uc >= 0xfe30 && uc < 0xfe70) /* CJK Compatibility Forms */ + || (uc >= 0xff00 && uc < 0xff61) /* Fullwidth Forms */ + || (uc >= 0xffe0 && uc < 0xffe7) /* Fullwidth Signs */ + || (uc >= 0x20000 && uc <= 0x2a6d6) /* CJK */ + || (uc >= 0x2f800 && uc <= 0x2fa1d) /* CJK Compatibility Ideographs */ ) ) return 2; /* In ancient CJK encodings, Cyrillic and most other characters are