Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(315)

Side by Side Diff: fusl/src/ctype/iswprint.c

Issue 1714623002: [fusl] clang-format fusl (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: headers too Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 #include <wctype.h> 1 #include <wctype.h>
2 #include "libc.h" 2 #include "libc.h"
3 3
4 /* Consider all legal codepoints as printable except for: 4 /* Consider all legal codepoints as printable except for:
5 * - C0 and C1 control characters 5 * - C0 and C1 control characters
6 * - U+2028 and U+2029 (line/para break) 6 * - U+2028 and U+2029 (line/para break)
7 * - U+FFF9 through U+FFFB (interlinear annotation controls) 7 * - U+FFF9 through U+FFFB (interlinear annotation controls)
8 * The following code is optimized heavily to make hot paths for the 8 * The following code is optimized heavily to make hot paths for the
9 * expected printable characters. */ 9 * expected printable characters. */
10 10
11 int iswprint(wint_t wc) 11 int iswprint(wint_t wc) {
12 { 12 if (wc < 0xffU)
13 » if (wc < 0xffU) 13 return (wc + 1 & 0x7f) >= 0x21;
14 » » return (wc+1 & 0x7f) >= 0x21; 14 if (wc < 0x2028U || wc - 0x202aU < 0xd800 - 0x202a ||
15 » if (wc < 0x2028U || wc-0x202aU < 0xd800-0x202a || wc-0xe000U < 0xfff9-0x e000) 15 wc - 0xe000U < 0xfff9 - 0xe000)
16 » » return 1; 16 return 1;
17 » if (wc-0xfffcU > 0x10ffff-0xfffc || (wc&0xfffe)==0xfffe) 17 if (wc - 0xfffcU > 0x10ffff - 0xfffc || (wc & 0xfffe) == 0xfffe)
18 » » return 0; 18 return 0;
19 » return 1; 19 return 1;
20 } 20 }
21 21
22 int __iswprint_l(wint_t c, locale_t l) 22 int __iswprint_l(wint_t c, locale_t l) {
23 { 23 return iswprint(c);
24 » return iswprint(c);
25 } 24 }
26 25
27 weak_alias(__iswprint_l, iswprint_l); 26 weak_alias(__iswprint_l, iswprint_l);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698