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

Side by Side Diff: fusl/src/ctype/wctrans.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 <string.h> 2 #include <string.h>
3 #include "libc.h" 3 #include "libc.h"
4 4
5 wctrans_t wctrans(const char *class) 5 wctrans_t wctrans(const char* class) {
6 { 6 if (!strcmp(class, "toupper"))
7 » if (!strcmp(class, "toupper")) return (wctrans_t)1; 7 return (wctrans_t)1;
8 » if (!strcmp(class, "tolower")) return (wctrans_t)2; 8 if (!strcmp(class, "tolower"))
9 » return 0; 9 return (wctrans_t)2;
10 return 0;
10 } 11 }
11 12
12 wint_t towctrans(wint_t wc, wctrans_t trans) 13 wint_t towctrans(wint_t wc, wctrans_t trans) {
13 { 14 if (trans == (wctrans_t)1)
14 » if (trans == (wctrans_t)1) return towupper(wc); 15 return towupper(wc);
15 » if (trans == (wctrans_t)2) return towlower(wc); 16 if (trans == (wctrans_t)2)
16 » return wc; 17 return towlower(wc);
18 return wc;
17 } 19 }
18 20
19 wctrans_t __wctrans_l(const char *s, locale_t l) 21 wctrans_t __wctrans_l(const char* s, locale_t l) {
20 { 22 return wctrans(s);
21 » return wctrans(s);
22 } 23 }
23 24
24 wint_t __towctrans_l(wint_t c, wctrans_t t, locale_t l) 25 wint_t __towctrans_l(wint_t c, wctrans_t t, locale_t l) {
25 { 26 return towctrans(c, t);
26 » return towctrans(c, t);
27 } 27 }
28 28
29 weak_alias(__wctrans_l, wctrans_l); 29 weak_alias(__wctrans_l, wctrans_l);
30 weak_alias(__towctrans_l, towctrans_l); 30 weak_alias(__towctrans_l, towctrans_l);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698