diff options
author | Denton Liu <liu.denton@gmail.com> | 2019-04-29 04:28:20 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-05-05 15:20:08 +0900 |
commit | b199d7147a218c3b10b077f9caad0f207bc34d7a (patch) | |
tree | 56c58e8053c5f5c8d177d84f1f29ca7449c17d42 /cache.h | |
parent | *.[ch]: remove extern from function declarations using spatch (diff) | |
download | tgif-b199d7147a218c3b10b077f9caad0f207bc34d7a.tar.xz |
*.[ch]: remove extern from function declarations using sed
There has been a push to remove extern from function declarations.
Finish the job by removing all instances of "extern" for function
declarations in headers using sed.
This was done by running the following on my system with sed 4.2.2:
$ git ls-files \*.{c,h} |
grep -v ^compat/ |
xargs sed -i'' -e 's/^\(\s*\)extern \([^(]*([^*]\)/\1\2/'
Files under `compat/` are intentionally excluded as some are directly
copied from external sources and we should avoid churning them as much
as possible.
Then, leftover instances of extern were found by running
$ git grep -w -C3 extern \*.{c,h}
and manually checking the output. No other instances were found.
Note that the regex used specifically excludes function variables which
_should_ be left as extern.
Not the most elegant way to do it but it gets the job done.
Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'cache.h')
-rw-r--r-- | cache.h | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1690,7 +1690,7 @@ extern const char *git_mailmap_blob; /* IO helper functions */ void maybe_flush_or_die(FILE *, const char *); __attribute__((format (printf, 2, 3))) -extern void fprintf_or_die(FILE *, const char *fmt, ...); +void fprintf_or_die(FILE *, const char *fmt, ...); #define COPY_READ_ERROR (-2) #define COPY_WRITE_ERROR (-3) @@ -1724,7 +1724,7 @@ void write_file_buf(const char *path, const char *buf, size_t len); * write_file(path, "counter: %d", ctr); */ __attribute__((format (printf, 2, 3))) -extern void write_file(const char *path, const char *fmt, ...); +void write_file(const char *path, const char *fmt, ...); /* pager.c */ void setup_pager(void); |