aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/util/parse-options.h
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo2010-05-17 15:51:10 -0300
committerArnaldo Carvalho de Melo2010-05-17 16:22:37 -0300
commit8035458fbb567ae138c77a5f710050107c6a7066 (patch)
tree0bd6e3730d96aa5d574e73d500f1820d2b195d8c /tools/perf/util/parse-options.h
parent1967936d688c475b85d34d84e09858cf514c893c (diff)
perf options: Type check OPT_BOOLEAN and fix the offenders
Cc: Frédéric Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Stephane Eranian <eranian@google.com> Cc: Tom Zanussi <tzanussi@gmail.com> LKML-Reference: <new-submission> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/parse-options.h')
-rw-r--r--tools/perf/util/parse-options.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/perf/util/parse-options.h b/tools/perf/util/parse-options.h
index 9ca348e1063b..5838e2d8bbc1 100644
--- a/tools/perf/util/parse-options.h
+++ b/tools/perf/util/parse-options.h
@@ -2,6 +2,7 @@
#define __PERF_PARSE_OPTIONS_H
#include <linux/kernel.h>
+#include <stdbool.h>
enum parse_opt_type {
/* special types */
@@ -101,7 +102,7 @@ struct option {
#define OPT_ARGUMENT(l, h) { .type = OPTION_ARGUMENT, .long_name = (l), .help = (h) }
#define OPT_GROUP(h) { .type = OPTION_GROUP, .help = (h) }
#define OPT_BIT(s, l, v, h, b) { .type = OPTION_BIT, .short_name = (s), .long_name = (l), .value = (v), .help = (h), .defval = (b) }
-#define OPT_BOOLEAN(s, l, v, h) { .type = OPTION_BOOLEAN, .short_name = (s), .long_name = (l), .value = (v), .help = (h) }
+#define OPT_BOOLEAN(s, l, v, h) { .type = OPTION_BOOLEAN, .short_name = (s), .long_name = (l), .value = check_vtype(v, bool *), .help = (h) }
#define OPT_INCR(s, l, v, h) { .type = OPTION_INCR, .short_name = (s), .long_name = (l), .value = (v), .help = (h) }
#define OPT_SET_INT(s, l, v, h, i) { .type = OPTION_SET_INT, .short_name = (s), .long_name = (l), .value = (v), .help = (h), .defval = (i) }
#define OPT_SET_PTR(s, l, v, h, p) { .type = OPTION_SET_PTR, .short_name = (s), .long_name = (l), .value = (v), .help = (h), .defval = (p) }