Messages in this thread Patch in this message | | | From | Namhyung Kim <> | Subject | [PATCH 1/3] perf tools: Implement islower/isupper macro into util.h | Date | Fri, 10 Feb 2012 10:10:15 +0900 |
| |
The util.h provides various ctype macros but lacks those two. Add them.
Signed-off-by: Namhyung Kim <namhyung.kim@lge.com> --- 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 232d17ef3e60..2ea0dae542c6 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) #undef isalpha #undef isprint #undef isalnum +#undef islower +#undef isupper #undef tolower #undef toupper @@ -219,6 +221,8 @@ extern unsigned char sane_ctype[256]; #define isalpha(x) sane_istest(x,GIT_ALPHA) #define isalnum(x) sane_istest(x,GIT_ALPHA | GIT_DIGIT) #define isprint(x) sane_istest(x,GIT_PRINT) +#define islower(x) (sane_istest(x,GIT_ALPHA) && sane_istest(x,0x20)) +#define isupper(x) (sane_istest(x,GIT_ALPHA) && !sane_istest(x,0x20)) #define tolower(x) sane_case((unsigned char)(x), 0x20) #define toupper(x) sane_case((unsigned char)(x), 0) -- 1.7.9
| |