public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] perf tools: Implement islower/isupper macro into util.h
@ 2012-02-10  1:10 Namhyung Kim
  2012-02-10  1:10 ` [PATCH 2/3] perf tools: ctype.c only wants util.h Namhyung Kim
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Namhyung Kim @ 2012-02-10  1:10 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Namhyung Kim, Peter Zijlstra, Paul Mackerras, Ingo Molnar,
	linux-kernel

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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-02-17  9:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-10  1:10 [PATCH 1/3] perf tools: Implement islower/isupper macro into util.h Namhyung Kim
2012-02-10  1:10 ` [PATCH 2/3] perf tools: ctype.c only wants util.h Namhyung Kim
2012-02-17  9:49   ` [tip:perf/core] " tip-bot for Namhyung Kim
2012-02-10  1:10 ` [PATCH 3/3] perf tools: Get rid of ctype.h in symbol.c Namhyung Kim
2012-02-17  9:50   ` [tip:perf/core] " tip-bot for Namhyung Kim
2012-02-17  9:48 ` [tip:perf/core] perf tools: Implement islower/ isupper macro into util.h tip-bot for Namhyung Kim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox