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

Side by Side Diff: fusl/include/ctype.h

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 #ifndef»_CTYPE_H 1 #ifndef _CTYPE_H
2 #define»_CTYPE_H 2 #define _CTYPE_H
3 3
4 #ifdef __cplusplus 4 #ifdef __cplusplus
5 extern "C" { 5 extern "C" {
6 #endif 6 #endif
7 7
8 #include <features.h> 8 #include <features.h>
9 9
10 int isalnum(int); 10 int isalnum(int);
11 int isalpha(int); 11 int isalpha(int);
12 int isblank(int); 12 int isblank(int);
13 int iscntrl(int); 13 int iscntrl(int);
14 int isdigit(int); 14 int isdigit(int);
15 int isgraph(int); 15 int isgraph(int);
16 int islower(int); 16 int islower(int);
17 int isprint(int); 17 int isprint(int);
18 int ispunct(int); 18 int ispunct(int);
19 int isspace(int); 19 int isspace(int);
20 int isupper(int); 20 int isupper(int);
21 int isxdigit(int); 21 int isxdigit(int);
22 int tolower(int); 22 int tolower(int);
23 int toupper(int); 23 int toupper(int);
24 24
25 #ifndef __cplusplus 25 #ifndef __cplusplus
26 static __inline int __isspace(int _c) 26 static __inline int __isspace(int _c) {
27 { 27 return _c == ' ' || (unsigned)_c - '\t' < 5;
28 » return _c == ' ' || (unsigned)_c-'\t' < 5;
29 } 28 }
30 29
31 #define isalpha(a) (0 ? isalpha(a) : (((unsigned)(a)|32)-'a') < 26) 30 #define isalpha(a) (0 ? isalpha(a) : (((unsigned)(a) | 32) - 'a') < 26)
32 #define isdigit(a) (0 ? isdigit(a) : ((unsigned)(a)-'0') < 10) 31 #define isdigit(a) (0 ? isdigit(a) : ((unsigned)(a) - '0') < 10)
33 #define islower(a) (0 ? islower(a) : ((unsigned)(a)-'a') < 26) 32 #define islower(a) (0 ? islower(a) : ((unsigned)(a) - 'a') < 26)
34 #define isupper(a) (0 ? isupper(a) : ((unsigned)(a)-'A') < 26) 33 #define isupper(a) (0 ? isupper(a) : ((unsigned)(a) - 'A') < 26)
35 #define isprint(a) (0 ? isprint(a) : ((unsigned)(a)-0x20) < 0x5f) 34 #define isprint(a) (0 ? isprint(a) : ((unsigned)(a)-0x20) < 0x5f)
36 #define isgraph(a) (0 ? isgraph(a) : ((unsigned)(a)-0x21) < 0x5e) 35 #define isgraph(a) (0 ? isgraph(a) : ((unsigned)(a)-0x21) < 0x5e)
37 #define isspace(a) __isspace(a) 36 #define isspace(a) __isspace(a)
38 #endif 37 #endif
39 38
40 39 #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) || \
41 #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ 40 defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
42 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
43 || defined(_BSD_SOURCE)
44 41
45 #define __NEED_locale_t 42 #define __NEED_locale_t
46 #include <bits/alltypes.h> 43 #include <bits/alltypes.h>
47 44
48 int isalnum_l(int, locale_t); 45 int isalnum_l(int, locale_t);
49 int isalpha_l(int, locale_t); 46 int isalpha_l(int, locale_t);
50 int isblank_l(int, locale_t); 47 int isblank_l(int, locale_t);
51 int iscntrl_l(int, locale_t); 48 int iscntrl_l(int, locale_t);
52 int isdigit_l(int, locale_t); 49 int isdigit_l(int, locale_t);
53 int isgraph_l(int, locale_t); 50 int isgraph_l(int, locale_t);
54 int islower_l(int, locale_t); 51 int islower_l(int, locale_t);
55 int isprint_l(int, locale_t); 52 int isprint_l(int, locale_t);
56 int ispunct_l(int, locale_t); 53 int ispunct_l(int, locale_t);
57 int isspace_l(int, locale_t); 54 int isspace_l(int, locale_t);
58 int isupper_l(int, locale_t); 55 int isupper_l(int, locale_t);
59 int isxdigit_l(int, locale_t); 56 int isxdigit_l(int, locale_t);
60 int tolower_l(int, locale_t); 57 int tolower_l(int, locale_t);
61 int toupper_l(int, locale_t); 58 int toupper_l(int, locale_t);
62 59
63 int isascii(int); 60 int isascii(int);
64 int toascii(int); 61 int toascii(int);
65 #define _tolower(a) ((a)|0x20) 62 #define _tolower(a) ((a) | 0x20)
66 #define _toupper(a) ((a)&0x5f) 63 #define _toupper(a) ((a)&0x5f)
67 #define isascii(a) (0 ? isascii(a) : (unsigned)(a) < 128) 64 #define isascii(a) (0 ? isascii(a) : (unsigned)(a) < 128)
68 65
69 #endif 66 #endif
70 67
71 #ifdef __cplusplus 68 #ifdef __cplusplus
72 } 69 }
73 #endif 70 #endif
74 71
75 #endif 72 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698