diff options
author | Namhyung Kim <namhyung.kim@lge.com> | 2012-02-09 20:10:15 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-02-13 20:15:43 -0500 |
commit | 2cd13b0f7dd3a5df68ff4cd82af2e1f7bc2a43ab (patch) | |
tree | 781393ef9cf4099207dc5e10f3308f70bb70b87b /tools/perf/util | |
parent | c4a7dca92bbb9881a5d678720f1d0c2153499749 (diff) |
perf tools: Implement islower/isupper macro into util.h
The util.h header provides various ctype macros but lacks those two.
Add them.
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1328836217-9118-1-git-send-email-namhyung.kim@lge.com
Signed-off-by: Namhyung Kim <namhyung.kim@lge.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util')
-rw-r--r-- | tools/perf/util/util.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h index 7917b09430bd..0f99f394d8e0 100644 --- a/tools/perf/util/util.h +++ b/tools/perf/util/util.h | |||
@@ -199,6 +199,8 @@ static inline int has_extension(const char *filename, const char *ext) | |||
199 | #undef isalpha | 199 | #undef isalpha |
200 | #undef isprint | 200 | #undef isprint |
201 | #undef isalnum | 201 | #undef isalnum |
202 | #undef islower | ||
203 | #undef isupper | ||
202 | #undef tolower | 204 | #undef tolower |
203 | #undef toupper | 205 | #undef toupper |
204 | 206 | ||
@@ -219,6 +221,8 @@ extern unsigned char sane_ctype[256]; | |||
219 | #define isalpha(x) sane_istest(x,GIT_ALPHA) | 221 | #define isalpha(x) sane_istest(x,GIT_ALPHA) |
220 | #define isalnum(x) sane_istest(x,GIT_ALPHA | GIT_DIGIT) | 222 | #define isalnum(x) sane_istest(x,GIT_ALPHA | GIT_DIGIT) |
221 | #define isprint(x) sane_istest(x,GIT_PRINT) | 223 | #define isprint(x) sane_istest(x,GIT_PRINT) |
224 | #define islower(x) (sane_istest(x,GIT_ALPHA) && sane_istest(x,0x20)) | ||
225 | #define isupper(x) (sane_istest(x,GIT_ALPHA) && !sane_istest(x,0x20)) | ||
222 | #define tolower(x) sane_case((unsigned char)(x), 0x20) | 226 | #define tolower(x) sane_case((unsigned char)(x), 0x20) |
223 | #define toupper(x) sane_case((unsigned char)(x), 0) | 227 | #define toupper(x) sane_case((unsigned char)(x), 0) |
224 | 228 | ||