diff options
author | Denton Liu <liu.denton@gmail.com> | 2019-04-29 04:28:14 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-05-05 15:20:06 +0900 |
commit | 554544276a604c144df45efcb060c80aa322088c (patch) | |
tree | ce55b3dc9ca47c326991ecfc06a2b1103f60be3a /trace.h | |
parent | ffac537e6cbbf934b08745a378932722df287a53 (diff) | |
download | git-554544276a604c144df45efcb060c80aa322088c.tar.gz |
*.[ch]: remove extern from function declarations using spatch
There has been a push to remove extern from function declarations.
Remove some instances of "extern" for function declarations which are
caught by Coccinelle. Note that Coccinelle has some difficulty with
processing functions with `__attribute__` or varargs so some `extern`
declarations are left behind to be dealt with in a future patch.
This was the Coccinelle patch used:
@@
type T;
identifier f;
@@
- extern
T f(...);
and it was run with:
$ git ls-files \*.{c,h} |
grep -v ^compat/ |
xargs spatch --sp-file contrib/coccinelle/noextern.cocci --in-place
Files under `compat/` are intentionally excluded as some are directly
copied from external sources and we should avoid churning them as much
as possible.
Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'trace.h')
-rw-r--r-- | trace.h | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -17,12 +17,12 @@ extern struct trace_key trace_default_key; extern struct trace_key trace_perf_key; extern struct trace_key trace_setup_key; -extern void trace_repo_setup(const char *prefix); -extern int trace_want(struct trace_key *key); -extern void trace_disable(struct trace_key *key); -extern uint64_t getnanotime(void); -extern void trace_command_performance(const char **argv); -extern void trace_verbatim(struct trace_key *key, const void *buf, unsigned len); +void trace_repo_setup(const char *prefix); +int trace_want(struct trace_key *key); +void trace_disable(struct trace_key *key); +uint64_t getnanotime(void); +void trace_command_performance(const char **argv); +void trace_verbatim(struct trace_key *key, const void *buf, unsigned len); uint64_t trace_performance_enter(void); #ifndef HAVE_VARIADIC_MACROS @@ -36,7 +36,7 @@ extern void trace_printf_key(struct trace_key *key, const char *format, ...); __attribute__((format (printf, 2, 3))) extern void trace_argv_printf(const char **argv, const char *format, ...); -extern void trace_strbuf(struct trace_key *key, const struct strbuf *data); +void trace_strbuf(struct trace_key *key, const struct strbuf *data); /* Prints elapsed time (in nanoseconds) if GIT_TRACE_PERFORMANCE is enabled. */ __attribute__((format (printf, 2, 3))) @@ -137,7 +137,7 @@ extern void trace_printf_key_fl(const char *file, int line, struct trace_key *ke __attribute__((format (printf, 4, 5))) extern void trace_argv_printf_fl(const char *file, int line, const char **argv, const char *format, ...); -extern void trace_strbuf_fl(const char *file, int line, struct trace_key *key, +void trace_strbuf_fl(const char *file, int line, struct trace_key *key, const struct strbuf *data); __attribute__((format (printf, 4, 5))) extern void trace_performance_fl(const char *file, int line, |