diff options
author | Karl Williamson <public@khwilliamson.com> | 2011-10-16 12:43:54 -0600 |
---|---|---|
committer | Karl Williamson <public@khwilliamson.com> | 2011-10-17 21:52:16 -0600 |
commit | 1b4059d5cc56d776be91d8e68e5a22ebabf25d09 (patch) | |
tree | e6416830c665f55b9997f1440cd8205721726252 /utf8.c | |
parent | 18f762c3fc05b01f683e8eefc830106deeb0df8f (diff) | |
download | perl-1b4059d5cc56d776be91d8e68e5a22ebabf25d09.tar.gz |
utf8.c: White space only
Indent newly formed blocks, and reflow comments and code to fit in
narrower space
Diffstat (limited to 'utf8.c')
-rw-r--r-- | utf8.c | 71 |
1 files changed, 37 insertions, 34 deletions
@@ -3444,45 +3444,48 @@ Perl_foldEQ_utf8_flags(pTHX_ const char *s1, char **pe1, register UV l1, bool u1 * handle locale rules */ } else { - if ((flags & FOLDEQ_UTF8_LOCALE) - && (! u1 || UTF8_IS_INVARIANT(*p1) || UTF8_IS_DOWNGRADEABLE_START(*p1))) - { - /* There is no mixing of code points above and below 255. */ - if (u2 && (! UTF8_IS_INVARIANT(*p2) - && ! UTF8_IS_DOWNGRADEABLE_START(*p2))) + if ((flags & FOLDEQ_UTF8_LOCALE) + && (! u1 || UTF8_IS_INVARIANT(*p1) + || UTF8_IS_DOWNGRADEABLE_START(*p1))) { - return 0; - } + /* There is no mixing of code points above and below 255. */ + if (u2 && (! UTF8_IS_INVARIANT(*p2) + && ! UTF8_IS_DOWNGRADEABLE_START(*p2))) + { + return 0; + } - /* We handle locale rules by converting, if necessary, the code - * point to a single byte. */ - if (! u1 || UTF8_IS_INVARIANT(*p1)) { - *foldbuf1 = *p1; + /* We handle locale rules by converting, if necessary, the + * code point to a single byte. */ + if (! u1 || UTF8_IS_INVARIANT(*p1)) { + *foldbuf1 = *p1; + } + else { + *foldbuf1 = TWO_BYTE_UTF8_TO_UNI(*p1, *(p1 + 1)); + } + n1 = 1; } - else { - *foldbuf1 = TWO_BYTE_UTF8_TO_UNI(*p1, *(p1 + 1)); + else if (isASCII(*p1)) { /* Note, that here won't be + both ASCII and using locale + rules */ + + /* If trying to mix non- with ASCII, and not supposed to, + * fail */ + if ((flags & FOLDEQ_UTF8_NOMIX_ASCII) && ! isASCII(*p2)) { + return 0; + } + n1 = 1; + *foldbuf1 = toLOWER(*p1); /* Folds in the ASCII range are + just lowercased */ } - n1 = 1; - } - else if (isASCII(*p1)) { /* Note, that here won't be both ASCII - and using locale rules */ - - /* If trying to mix non- with ASCII, and not supposed to, fail */ - if ((flags & FOLDEQ_UTF8_NOMIX_ASCII) && ! isASCII(*p2)) { - return 0; + else if (u1) { + to_utf8_fold(p1, foldbuf1, &n1); } - n1 = 1; - *foldbuf1 = toLOWER(*p1); /* Folds in the ASCII range are - just lowercased */ - } - else if (u1) { - to_utf8_fold(p1, foldbuf1, &n1); - } - else { /* Not utf8, convert to it first and then get fold */ - uvuni_to_utf8(natbuf, (UV) NATIVE_TO_UNI(((UV)*p1))); - to_utf8_fold(natbuf, foldbuf1, &n1); - } - f1 = foldbuf1; + else { /* Not utf8, convert to it first and then get fold */ + uvuni_to_utf8(natbuf, (UV) NATIVE_TO_UNI(((UV)*p1))); + to_utf8_fold(natbuf, foldbuf1, &n1); + } + f1 = foldbuf1; } } |