mirror of https://gitee.com/openkylin/linux.git
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>
This commit is contained in:
parent
c4a7dca92b
commit
2cd13b0f7d
|
@ -199,6 +199,8 @@ static inline int has_extension(const char *filename, const char *ext)
|
||||||
#undef isalpha
|
#undef isalpha
|
||||||
#undef isprint
|
#undef isprint
|
||||||
#undef isalnum
|
#undef isalnum
|
||||||
|
#undef islower
|
||||||
|
#undef isupper
|
||||||
#undef tolower
|
#undef tolower
|
||||||
#undef toupper
|
#undef toupper
|
||||||
|
|
||||||
|
@ -219,6 +221,8 @@ extern unsigned char sane_ctype[256];
|
||||||
#define isalpha(x) sane_istest(x,GIT_ALPHA)
|
#define isalpha(x) sane_istest(x,GIT_ALPHA)
|
||||||
#define isalnum(x) sane_istest(x,GIT_ALPHA | GIT_DIGIT)
|
#define isalnum(x) sane_istest(x,GIT_ALPHA | GIT_DIGIT)
|
||||||
#define isprint(x) sane_istest(x,GIT_PRINT)
|
#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 tolower(x) sane_case((unsigned char)(x), 0x20)
|
||||||
#define toupper(x) sane_case((unsigned char)(x), 0)
|
#define toupper(x) sane_case((unsigned char)(x), 0)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue