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

* [PATCH 2/3] perf tools: ctype.c only wants util.h
  2012-02-10  1:10 [PATCH 1/3] perf tools: Implement islower/isupper macro into util.h Namhyung Kim
@ 2012-02-10  1:10 ` 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:48 ` [tip:perf/core] perf tools: Implement islower/ isupper macro into util.h tip-bot for Namhyung Kim
  2 siblings, 1 reply; 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 implementation of sane ctype macros only depends on symbols in
util.h not cache.h.

Signed-off-by: Namhyung Kim <namhyung.kim@lge.com>
---
 tools/perf/util/ctype.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/perf/util/ctype.c b/tools/perf/util/ctype.c
index 35073621e5de..aada3ac5e891 100644
--- a/tools/perf/util/ctype.c
+++ b/tools/perf/util/ctype.c
@@ -3,7 +3,7 @@
  *
  * No surprises, and works with signed and unsigned chars.
  */
-#include "cache.h"
+#include "util.h"
 
 enum {
 	S = GIT_SPACE,
-- 
1.7.9


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

* [PATCH 3/3] perf tools: Get rid of ctype.h in symbol.c
  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-10  1:10 ` 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
  2 siblings, 1 reply; 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 ctype.h in symbol.c was needed because of isupper(). However we now
have it in util.h, it can be changed to use our implementation.

Signed-off-by: Namhyung Kim <namhyung.kim@lge.com>
---
 tools/perf/util/symbol.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index fc6e12fe4b44..5dd83c3e2c0c 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -1,4 +1,3 @@
-#include <ctype.h>
 #include <dirent.h>
 #include <errno.h>
 #include <libgen.h>
@@ -12,6 +11,7 @@
 #include <unistd.h>
 #include <inttypes.h>
 #include "build-id.h"
+#include "util.h"
 #include "debug.h"
 #include "symbol.h"
 #include "strlist.h"
-- 
1.7.9


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

* [tip:perf/core] perf tools: Implement islower/ isupper macro into util.h
  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-10  1:10 ` [PATCH 3/3] perf tools: Get rid of ctype.h in symbol.c Namhyung Kim
@ 2012-02-17  9:48 ` tip-bot for Namhyung Kim
  2 siblings, 0 replies; 6+ messages in thread
From: tip-bot for Namhyung Kim @ 2012-02-17  9:48 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: acme, linux-kernel, paulus, hpa, mingo, a.p.zijlstra,
	namhyung.kim, namhyung, tglx, mingo

Commit-ID:  2cd13b0f7dd3a5df68ff4cd82af2e1f7bc2a43ab
Gitweb:     http://git.kernel.org/tip/2cd13b0f7dd3a5df68ff4cd82af2e1f7bc2a43ab
Author:     Namhyung Kim <namhyung.kim@lge.com>
AuthorDate: Fri, 10 Feb 2012 10:10:15 +0900
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 13 Feb 2012 23:15:43 -0200

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>
---
 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 7917b09..0f99f39 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)
 

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

* [tip:perf/core] perf tools: ctype.c only wants util.h
  2012-02-10  1:10 ` [PATCH 2/3] perf tools: ctype.c only wants util.h Namhyung Kim
@ 2012-02-17  9:49   ` tip-bot for Namhyung Kim
  0 siblings, 0 replies; 6+ messages in thread
From: tip-bot for Namhyung Kim @ 2012-02-17  9:49 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: acme, linux-kernel, paulus, hpa, mingo, a.p.zijlstra,
	namhyung.kim, namhyung, tglx, mingo

Commit-ID:  3bd2b8d1095d41254d3bdc3d62622c7fd5e143b8
Gitweb:     http://git.kernel.org/tip/3bd2b8d1095d41254d3bdc3d62622c7fd5e143b8
Author:     Namhyung Kim <namhyung.kim@lge.com>
AuthorDate: Fri, 10 Feb 2012 10:10:16 +0900
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 13 Feb 2012 23:17:40 -0200

perf tools: ctype.c only wants util.h

The implementation of sane ctype macros only depends on symbols in
util.h not cache.h.

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-2-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>
---
 tools/perf/util/ctype.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/perf/util/ctype.c b/tools/perf/util/ctype.c
index 3507362..aada3ac 100644
--- a/tools/perf/util/ctype.c
+++ b/tools/perf/util/ctype.c
@@ -3,7 +3,7 @@
  *
  * No surprises, and works with signed and unsigned chars.
  */
-#include "cache.h"
+#include "util.h"
 
 enum {
 	S = GIT_SPACE,

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

* [tip:perf/core] perf tools: Get rid of ctype.h in symbol.c
  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-bot for Namhyung Kim
  0 siblings, 0 replies; 6+ messages in thread
From: tip-bot for Namhyung Kim @ 2012-02-17  9:50 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: acme, linux-kernel, paulus, hpa, mingo, a.p.zijlstra,
	namhyung.kim, namhyung, tglx, mingo

Commit-ID:  e334c726ca774d346cb7c4db487e80953a202b58
Gitweb:     http://git.kernel.org/tip/e334c726ca774d346cb7c4db487e80953a202b58
Author:     Namhyung Kim <namhyung.kim@lge.com>
AuthorDate: Fri, 10 Feb 2012 10:10:17 +0900
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 13 Feb 2012 23:22:50 -0200

perf tools: Get rid of ctype.h in symbol.c

The ctype.h in symbol.c was needed because of isupper(). However we now
have it in util.h, it can be changed to use our implementation.

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-3-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>
---
 tools/perf/util/symbol.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index fc6e12f..5dd83c3 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -1,4 +1,3 @@
-#include <ctype.h>
 #include <dirent.h>
 #include <errno.h>
 #include <libgen.h>
@@ -12,6 +11,7 @@
 #include <unistd.h>
 #include <inttypes.h>
 #include "build-id.h"
+#include "util.h"
 #include "debug.h"
 #include "symbol.h"
 #include "strlist.h"

^ 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