diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-07-01 06:37:06 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-07-01 06:49:48 -0400 |
commit | f37a291c527c954df4da568de718ebb36b8261c0 (patch) | |
tree | bb4863fbd185fbfef5f7d28cb4001d59d4123a2d /tools/perf/util/strbuf.h | |
parent | 88a69dfbc6ab1e3b51bba8c9103055e21089ebb9 (diff) |
perf_counter tools: Add more warnings and fix/annotate them
Enable -Wextra. This found a few real bugs plus a number
of signed/unsigned type mismatches/uncleanlinesses. It
also required a few annotations
All things considered it was still worth it so lets try with
this enabled for now.
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/util/strbuf.h')
-rw-r--r-- | tools/perf/util/strbuf.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/perf/util/strbuf.h b/tools/perf/util/strbuf.h index 9ee908a3ec5d..d2aa86c014c1 100644 --- a/tools/perf/util/strbuf.h +++ b/tools/perf/util/strbuf.h | |||
@@ -50,7 +50,7 @@ struct strbuf { | |||
50 | #define STRBUF_INIT { 0, 0, strbuf_slopbuf } | 50 | #define STRBUF_INIT { 0, 0, strbuf_slopbuf } |
51 | 51 | ||
52 | /*----- strbuf life cycle -----*/ | 52 | /*----- strbuf life cycle -----*/ |
53 | extern void strbuf_init(struct strbuf *, size_t); | 53 | extern void strbuf_init(struct strbuf *buf, ssize_t hint); |
54 | extern void strbuf_release(struct strbuf *); | 54 | extern void strbuf_release(struct strbuf *); |
55 | extern char *strbuf_detach(struct strbuf *, size_t *); | 55 | extern char *strbuf_detach(struct strbuf *, size_t *); |
56 | extern void strbuf_attach(struct strbuf *, void *, size_t, size_t); | 56 | extern void strbuf_attach(struct strbuf *, void *, size_t, size_t); |
@@ -61,7 +61,7 @@ static inline void strbuf_swap(struct strbuf *a, struct strbuf *b) { | |||
61 | } | 61 | } |
62 | 62 | ||
63 | /*----- strbuf size related -----*/ | 63 | /*----- strbuf size related -----*/ |
64 | static inline size_t strbuf_avail(const struct strbuf *sb) { | 64 | static inline ssize_t strbuf_avail(const struct strbuf *sb) { |
65 | return sb->alloc ? sb->alloc - sb->len - 1 : 0; | 65 | return sb->alloc ? sb->alloc - sb->len - 1 : 0; |
66 | } | 66 | } |
67 | 67 | ||
@@ -122,9 +122,9 @@ extern void strbuf_addf(struct strbuf *sb, const char *fmt, ...); | |||
122 | 122 | ||
123 | extern size_t strbuf_fread(struct strbuf *, size_t, FILE *); | 123 | extern size_t strbuf_fread(struct strbuf *, size_t, FILE *); |
124 | /* XXX: if read fails, any partial read is undone */ | 124 | /* XXX: if read fails, any partial read is undone */ |
125 | extern ssize_t strbuf_read(struct strbuf *, int fd, size_t hint); | 125 | extern ssize_t strbuf_read(struct strbuf *, int fd, ssize_t hint); |
126 | extern int strbuf_read_file(struct strbuf *sb, const char *path, size_t hint); | 126 | extern int strbuf_read_file(struct strbuf *sb, const char *path, ssize_t hint); |
127 | extern int strbuf_readlink(struct strbuf *sb, const char *path, size_t hint); | 127 | extern int strbuf_readlink(struct strbuf *sb, const char *path, ssize_t hint); |
128 | 128 | ||
129 | extern int strbuf_getline(struct strbuf *, FILE *, int); | 129 | extern int strbuf_getline(struct strbuf *, FILE *, int); |
130 | 130 | ||