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

Unified Diff: fusl/src/ctype/wcwidth.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 side-by-side diff with in-line comments
Download patch
Index: fusl/src/ctype/wcwidth.c
diff --git a/fusl/src/ctype/wcwidth.c b/fusl/src/ctype/wcwidth.c
index 49c40eea8cabfc6f1a0a30aafda9625e85b82611..58846c1e82f5f7231afe7f862fd25fc53d1a907b 100644
--- a/fusl/src/ctype/wcwidth.c
+++ b/fusl/src/ctype/wcwidth.c
@@ -8,22 +8,21 @@ static const unsigned char wtable[] = {
#include "wide.h"
};
-int wcwidth(wchar_t wc)
-{
- if (wc < 0xffU)
- return (wc+1 & 0x7f) >= 0x21 ? 1 : wc ? -1 : 0;
- if ((wc & 0xfffeffffU) < 0xfffe) {
- if ((table[table[wc>>8]*32+((wc&255)>>3)]>>(wc&7))&1)
- return 0;
- if ((wtable[wtable[wc>>8]*32+((wc&255)>>3)]>>(wc&7))&1)
- return 2;
- return 1;
- }
- if ((wc & 0xfffe) == 0xfffe)
- return -1;
- if (wc-0x20000U < 0x20000)
- return 2;
- if (wc == 0xe0001 || wc-0xe0020U < 0x5f || wc-0xe0100 < 0xef)
- return 0;
- return 1;
+int wcwidth(wchar_t wc) {
+ if (wc < 0xffU)
+ return (wc + 1 & 0x7f) >= 0x21 ? 1 : wc ? -1 : 0;
+ if ((wc & 0xfffeffffU) < 0xfffe) {
+ if ((table[table[wc >> 8] * 32 + ((wc & 255) >> 3)] >> (wc & 7)) & 1)
+ return 0;
+ if ((wtable[wtable[wc >> 8] * 32 + ((wc & 255) >> 3)] >> (wc & 7)) & 1)
+ return 2;
+ return 1;
+ }
+ if ((wc & 0xfffe) == 0xfffe)
+ return -1;
+ if (wc - 0x20000U < 0x20000)
+ return 2;
+ if (wc == 0xe0001 || wc - 0xe0020U < 0x5f || wc - 0xe0100 < 0xef)
+ return 0;
+ return 1;
}

Powered by Google App Engine
This is Rietveld 408576698