浏览代码

perf quote: Disentangle headers

No need to include stdio.h from quote.h, also forward declare strbuf.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-k3kbcxhctpxvz6ckve3kv6c1@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Arnaldo Carvalho de Melo 9 年之前
父节点
当前提交
380a71a22b
共有 2 个文件被更改,包括 5 次插入2 次删除
  1. 3 1
      tools/perf/util/quote.c
  2. 2 1
      tools/perf/util/quote.h

+ 3 - 1
tools/perf/util/quote.c

@@ -1,5 +1,7 @@
-#include "cache.h"
+#include <stdlib.h>
+#include "strbuf.h"
 #include "quote.h"
 #include "quote.h"
+#include "util.h"
 
 
 /* Help to copy the thing properly quoted for the shell safety.
 /* Help to copy the thing properly quoted for the shell safety.
  * any single quote is replaced with '\'', any exclamation point
  * any single quote is replaced with '\'', any exclamation point

+ 2 - 1
tools/perf/util/quote.h

@@ -2,7 +2,6 @@
 #define __PERF_QUOTE_H
 #define __PERF_QUOTE_H
 
 
 #include <stddef.h>
 #include <stddef.h>
-#include <stdio.h>
 
 
 /* Help to copy the thing properly quoted for the shell safety.
 /* Help to copy the thing properly quoted for the shell safety.
  * any single quote is replaced with '\'', any exclamation point
  * any single quote is replaced with '\'', any exclamation point
@@ -24,6 +23,8 @@
  * sq_quote() in a real application.
  * sq_quote() in a real application.
  */
  */
 
 
+struct strbuf;
+
 int sq_quote_argv(struct strbuf *, const char **argv, size_t maxlen);
 int sq_quote_argv(struct strbuf *, const char **argv, size_t maxlen);
 
 
 #endif /* __PERF_QUOTE_H */
 #endif /* __PERF_QUOTE_H */